Changeset 3838
- Timestamp:
- Sep 9, 2009, 9:28:56 AM (15 years ago)
- Location:
- extensions/akBookStyle/trunk
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/css/ak_style.css
r3831 r3838 57 57 } 58 58 59 a.hide { 60 visibility: hidden; 61 } 62 59 63 /******************/ 60 64 #theHeader, #menubar, .navigationBar, .titrePage { -
extensions/akBookStyle/trunk/include/akContent.class.php
r3830 r3838 32 32 $this->plugin_config = $config; 33 33 $this->current_picture = 0; 34 $this->next_picture = null; 35 $this->previous_picture = null; 34 36 } 35 37 … … 50 52 $template->assign('AK_DIR_THUMBNAIL', isset($GLOBALS['conf']['dir_thumbnail'])?$GLOBALS['conf']['dir_thumbnail']:'thumbnail'); 51 53 $template->assign('AK_PREFIX_THUMBNAIL', $GLOBALS['conf']['prefix_thumbnail']); 52 $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));53 54 $template->assign('AK_BY_LINE', $this->plugin_config->ak_by_line); 54 55 $template->assign('AK_MOUSE_EVENT', $this->plugin_config->ak_mouse_event); … … 58 59 $template->assign('AK_HORIZONTAL_TPL', AK_PLUGIN_TEMPLATE. '/ak_horizontal.tpl'); 59 60 $template->assign('AK_THUMBNAILS_LOC', $this->plugin_config->ak_thumbnails_loc); 60 /* Thumbnail Nav */ 61 if (!empty($page['navigation_bar'])) { 62 $nav = explode('|', $page['navigation_bar']); 63 if (substr($nav[1],1,2)=='<a') { 64 $this->navbar['URL_PREV'] = substr($nav[1],10,stripos($nav[1],'" rel="')); 65 } 66 if (substr($nav[3],1,2)=='<a') { 67 $this->navbar['URL_NEXT'] = substr($nav[3],10,stripos($nav[3],'" rel="')); 68 } 69 $template->assign('navbar', $this->navbar); 70 } 71 } 61 $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture])); 62 63 $template->assign('AK_NEXT', $this->getNextPicture($this->current_picture, $images)); 64 $template->assign('AK_PREVIOUS', $this->getPreviousPicture($this->current_picture, $images)); 65 } 72 66 73 67 public function loc_end_index_thumbnails($tpl_vars, $images) { … … 121 115 } 122 116 } 117 118 private function getPreviousPicture($current, $images) { 119 $previous = $current--; 120 if ($previous>0) { 121 return $this->makeAkUrl(array('ID' => $images[$previous]['id'])); 122 } else { 123 return null; 124 } 125 } 126 127 private function getNextPicture($current, $images) { 128 $index_current = null; 129 foreach ($images as $index => $image) { 130 if ($image['id']==$current) { 131 $index_current = $index; 132 break; 133 } 134 } 135 136 $next = $index_current+1; 137 if ($next<count($images)) { 138 return $this->makeAkUrl(array('ID' => $images[$next]['id'])); 139 } else { 140 return null; 141 } 142 } 123 143 } 124 144 ?> -
extensions/akBookStyle/trunk/js/ak_jquery-load.js
r3813 r3838 2 2 $("a.load") 3 3 .bind(ak_mouse_event, function() { 4 $('#akPicture').attr('src', $(this).children('img').attr('src').replace(dir_thumbnail+'\/'+prefix_thumbnail, '')); 4 $a = $(this); 5 $thumbnails = $('.thumbnails a[class="load"]'); 6 $nbThumbnails = $thumbnails.length; 7 8 $previous_link = $current_link = $next_link = null; 9 10 $('.thumbnails a[class="load"]') 11 .each( function(i) { 12 if ($(this).attr('href')==$a.attr('href')) { 13 $current_link = $(this); 14 if (i>0) { 15 $previous_link = $thumbnails[i-1]; 16 } 17 if (i<$nbThumbnails) { 18 $next_link = $thumbnails[i+1]; 19 } 20 } 21 }); 22 23 $current_link = $('.thumbnails a[href='+$(this).attr('href')+']'); 24 $src = $current_link.children('img').attr('src'); 25 $src = $src.replace(dir_thumbnail+'\/'+prefix_thumbnail, ''); 26 27 $('#akPicture').attr('src', $src); 28 if ($previous_link) { 29 if ($('#akPreviousPicture').hasClass('hide')) { 30 $('#akPreviousPicture').removeClass('hide'); 31 } 32 $('#akPreviousPicture').attr('href', $($previous_link).attr('href')); 33 } else { 34 $('#akPreviousPicture').addClass('hide'); 35 } 36 if ($next_link) { 37 if ($('#akNextPicture').hasClass('hide')) { 38 $('#akNextPicture').removeClass('hide'); 39 } 40 $('#akNextPicture').attr('href', $($next_link).attr('href')); 41 } else { 42 $('#akNextPicture').addClass('hide'); 43 } 5 44 return false; 6 45 }); -
extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl
r3791 r3838 3 3 <table class="picture"> 4 4 <tr class="nline"> 5 <td class="ncol"> 6 {if isset($AK_PREVIOUS) } 7 8 <a class="{$AK_PREVIOUS.load} navButton" href="{$AK_PREVIOUS.U_PIC}" 5 <td class="ncol"> 6 <a id="akPreviousPicture" class="{if empty($AK_PREVIOUS)}hide {/if}load navButton" href="{$AK_PREVIOUS}" 9 7 title="{'previous_page'|@translate} : {$AK_PREVIOUS.TITLE}" 10 8 rel="prev"> … … 12 10 class="button" alt="{'previous_page'|@translate}"> 13 11 </a> 14 {/if}15 12 </td> 16 13 </tr> … … 24 21 <tr class="nline"> 25 22 <td class="ncol"> 26 {if !empty($AK_NEXT) } 27 <a class="{$AK_NEXT.load} navButton" href="{$AK_NEXT.U_PIC}" 23 <a id="akNextPicture" class="{if empty($AK_NEXT)}hide {/if}load navButton" href="{$AK_NEXT}" 28 24 title="{'next_page'|@translate} : {$AK_NEXT.TITLE}" 29 25 rel="next"> … … 31 27 class="button" alt="{'next_page'|@translate}"> 32 28 </a> 33 {/if}34 29 </td> 35 30 </tr>
Note: See TracChangeset
for help on using the changeset viewer.