Changeset 4382 for extensions/AMenuManager/amm_pip.class.inc.php
- Timestamp:
- Nov 28, 2009, 7:20:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/amm_pip.class.inc.php
r4363 r4382 22 22 { 23 23 protected $ajax; 24 protected $displayRandomImageBlock=true; 24 25 25 26 function AMM_PIP($prefixeTable, $filelocation) … … 68 69 public function blockmanager_apply( $menu_ref_arr ) 69 70 { 70 global $user ;71 global $user, $page; 71 72 $menu = & $menu_ref_arr[0]; 72 73 73 global $page;74 74 75 75 /* … … 85 85 ); 86 86 $block->template = dirname(__FILE__).'/menu_templates/menubar_randompic.tpl'; 87 } 88 else 89 { 90 $this->displayRandomImageBlock=false; 87 91 } 88 92 … … 136 140 } 137 141 142 138 143 /* 139 144 hide items from special & menu sections 140 145 */ 141 foreach(array('mbMenu' => 'amm_sections_modmenu', 'mbSpecials' =>'amm_sections_modspecials') as $key0 => $val0) 142 { 143 if ( ($block = $menu->get_block( $key0 ) ) != null ) 144 { 145 foreach($this->my_config[$val0] as $key => $val) 146 { 147 if($val=='n') 148 { 149 unset( $block->data[$key] ); 150 } 151 } 152 } 153 } 154 } 146 $blocks=Array(); 147 $blocks['menu']=$menu->get_block('mbMenu'); 148 $blocks['special']=$menu->get_block('mbSpecials'); 149 150 $menuItems=array_merge($blocks['menu']->data, $blocks['special']->data); 151 $this->sortSectionsItems(); 152 153 $blocks['menu']->data=Array(); 154 $blocks['special']->data=Array(); 155 156 foreach($this->my_config['amm_sections_items'] as $key => $val) 157 { 158 if(isset($menuItems[$key])) 159 { 160 $blocks[$val['container']]->data[$key]=$menuItems[$key]; 161 } 162 } 163 if(count($blocks['menu']->data)==0) $menu->hide_block('mbMenu'); 164 if(count($blocks['special']->data)==0) $menu->hide_block('mbSpecials'); 165 } 155 166 156 167 /* … … 236 247 global $user, $template; 237 248 238 $menu = new BlockManager("menubar"); 239 $menu->load_registered_blocks(); 240 $menu->prepare_display(); 241 242 if ( ( ($block = $menu->get_block( 'mbAMM_randompict' ) ) != null ) && ($user['nb_total_images'] > 0) ) 249 if($this->displayRandomImageBlock) 243 250 { 244 251 $local_tpl = new Template(AMM_PATH."admin/", "");
Note: See TracChangeset
for help on using the changeset viewer.