Changeset 3838 for extensions/akBookStyle/trunk/include/akContent.class.php
- Timestamp:
- Sep 9, 2009, 9:28:56 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note: See TracChangeset
for help on using the changeset viewer.