Changeset 3843
- Timestamp:
- Sep 13, 2009, 8:00:47 PM (15 years ago)
- Location:
- extensions/akBookStyle/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/admin.php
r3842 r3843 37 37 if (!empty($_POST['ak_categories']) && $_POST['ak_categories']!=$me->ak_categories) { 38 38 $me->ak_categories = $_POST['ak_categories']; 39 if ( $_POST['ak_categories'] == '') $me->ak_categories = '<!--Book-->'; 39 40 array_push($GLOBALS['page']['infos'], $lang['ak_categories_changed']); 40 41 $save_config = true; -
extensions/akBookStyle/trunk/default_values.inc.php
r3842 r3843 24 24 die('Hacking attempt!'); 25 25 } 26 $default_values['ak_categories'] = ' <!--Book-->';26 $default_values['ak_categories'] = '<!--Book-->'; 27 27 $default_values['ak_by_page'] = 10; 28 28 $default_values['ak_by_line'] = 2; -
extensions/akBookStyle/trunk/include/akContent.class.php
r3842 r3843 34 34 $this->next_picture = null; 35 35 $this->previous_picture = null; 36 $this->applicable = false; 36 37 } 37 38 38 public function user_force() { 39 $GLOBALS['user']['nb_image_page'] = $this->plugin_config->ak_by_page; 39 public function page_force() { 40 global $page; 41 if ( isset($page['category']) ) { 42 $cat_filter = $this->plugin_config->ak_categories; 43 $this->applicable = (stripos($page['category']['name'], $cat_filter) > 0) ? true:false; 44 if ( $this->applicable ) { 45 $page['nb_image_page'] = $this->plugin_config->ak_by_page; 46 } 47 } 40 48 } 41 49 42 50 public function loc_begin_index_thumbnails($images) { 43 51 global $template; 52 if ($this->applicable === false) return; 44 53 $this->category_url = make_index_url(array('section' => 'category', 45 54 'category' => $GLOBALS['page']['category'], … … 69 78 70 79 public function loc_end_index_thumbnails($tpl_vars, $images) { 80 if ($this->applicable === false) return $tpl_vars; 71 81 foreach ($tpl_vars as &$tpl_var) { 72 82 $tpl_var['AK_URL'] = $this->makeAkUrl($tpl_var); -
extensions/akBookStyle/trunk/public.php
r3842 r3843 28 28 29 29 $public_content = new akContent($plugin_config); 30 30 /* Only on category request */ 31 31 add_event_handler('loc_begin_index_thumbnails', 32 33 32 array($public_content, 'loc_begin_index_thumbnails') 33 ); 34 34 add_event_handler('loc_end_index_thumbnails', 35 36 37 38 39 add_event_handler(' init',40 array($public_content, 'user_force')41 35 array($public_content, 'loc_end_index_thumbnails'), 36 EVENT_HANDLER_PRIORITY_NEUTRAL, 37 2 38 ); 39 add_event_handler('loc_begin_index', 40 array($public_content, 'page_force') 41 ); 42 42 ?>
Note: See TracChangeset
for help on using the changeset viewer.