1839c8d00dab8d08874cea6bc66d0ffec090d8a3
[atutor.git] / mods / photos / include / html / pa_index.tmpl.php
1 <div>
2         <!-- Photo album options and page numbers -->
3         <div class="album_panel">       
4                 <div class="topbar">
5                         <div class="search_bar">
6                                 <form action="<?php echo AT_PA_BASENAME.'search.php'; ?>" id="pa_search_form" name="pa_search_form" method="post">
7                                         <input type="text" class="s" name="pa_search" id="pa_search" title="<?php echo _AT('search');?>" />
8                                         <input type="image" class="s_img" src="<?php echo AT_PA_BASENAME; ?>images/search_icon.png" alt="<?php echo _AT('search');?>" />
9                                 </form>
10                         </div>
11                         <?php if($this->num_rows > AT_PA_ALBUMS_PER_PAGE): ?>
12                         <!-- page numbers -->
13                         <div class="paginator">
14                                 <?php print_paginator($this->page, $this->num_rows, 'type='.$this->type, AT_PA_ALBUMS_PER_PAGE, AT_PA_PAGE_WINDOW); ?>
15                         </div>
16                         <?php endif; ?>
17                 </div>
18         
19                 <!-- loop through this -->
20                 <?php if(!empty($this->albums)): ?>
21                 <?php foreach($this->albums as $index=>$row): 
22                         $pa = new PhotoAlbum($index);
23                 ?>
24                 <div class="album">
25                         <!-- TODO: If photo is not presense, print another image? -->
26                         <div class="image">
27                         <?php 
28                         $photo_info = $pa->getPhotoInfo($row['photo_id']); 
29                         if (!empty($photo_info)):
30                         ?>
31                         <a href="<?php echo AT_PA_BASENAME.'albums.php?id='.$row['id'];?>"><img src="<?php echo AT_PA_BASENAME.'get_photo.php?aid='.$row['id'].SEP.'pid='.$row['photo_id'].SEP.'ph='.getPhotoFilePath($photo_info['id'], '', $photo_info['created_date']);?>" title="<?php echo htmlentities_utf82($photo_info['description']); ?>" alt="<?php echo htmlentities_utf82($row['name']); ?>" /></a>
32                         <?php else: ?>
33                         <a href="<?php echo AT_PA_BASENAME.'albums.php?id='.$row['id'];?>"><img class="no-image" title="<?php echo _AT('pa_no_image'); ?>" alt="<?php echo _AT('pa_no_image'); ?>" /></a>
34                         <?php endif; //image ?>
35                         </div>
36                         <div class="info">
37                                 <h4><a href="<?php echo AT_PA_BASENAME.'albums.php?id='.$row['id'];?>"><?php echo htmlentities_utf82($row['name']); ?></a></h4>
38                                 <p><?php echo htmlentities_utf82($row['description']); ?></p>
39                                 <p><?php echo _AT('location').': '.htmlentities_utf82($row['location']); ?></p>
40                                 <span>
41                                 <!-- If this is shared album, display the author -->
42                                 <?php if (isset($this->isSharedAlbum)): ?>
43                                 <p><?php echo _AT('created_by').': '.AT_print(get_display_name($row['member_id']), 'members.full_name'); ?></p>
44                                 <?php endif; ?>
45                                 <p><?php echo _AT('last_updated', AT_date(_AT('forum_date_format'), $row['last_updated'], AT_DATE_MYSQL_DATETIME));?></p>
46                                 <p><?php echo _AT('created').': '.AT_date(_AT('forum_date_format'), $row['created_date'], AT_DATE_MYSQL_DATETIME); ?></p>
47                                 </span><br/>
48                                 <?php 
49                                         /* If the span has 3 rows, we need 2 <br> for the next span to sink to the bottom.  
50                                          * So if we have an extra "created_by" row, we need an extra <br> tag
51                                          */
52                                         if (isset($this->isSharedAlbum)){
53                                                 echo '<br/>';
54                                         }
55                                 ?>
56                                 <?php if($pa->checkAlbumPriv($_SESSION['member_id'])): ?>
57                                 <span><p><a href="<?php echo AT_PA_BASENAME;?>edit_album.php?id=<?php echo $row['id'];?>"><?php echo _AT('edit'); ?></a> | <a href="<?php echo AT_PA_BASENAME;?>delete_album.php?id=<?php echo $row['id'];?>"><?php echo _AT('delete');?></a></p></span>
58                                 <?php endif; ?>
59                         </div>
60                 </div>
61                 <?php endforeach; ?>
62                 <?php else: ?>
63                 <div class="album">
64                         <p><?php echo _AT('pa_no_album'); ?></p>
65                 </div>
66                 <?php endif; ?>
67                 <!-- end loop -->
68                 <!-- page numbers -->
69                 <?php if($this->num_rows > AT_PA_ALBUMS_PER_PAGE): ?>
70                 <div class="topbar">
71                         <div class="paginator">
72                                 <?php print_paginator($this->page, $this->num_rows, 'type='.$this->type, AT_PA_ALBUMS_PER_PAGE, AT_PA_PAGE_WINDOW);  ?>
73                         </div>
74                 </div>
75                 <?php endif; ?>
76         </div>  
77 </div>