Changeset 4363
- Timestamp:
- Nov 24, 2009, 11:22:08 PM (14 years ago)
- Location:
- extensions/AMenuManager
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/amm_pip.class.inc.php
r3690 r4363 49 49 add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); 50 50 add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS')); 51 add_event_handler('loc_end_page_tail', array(&$this, 'applyJS')); 51 52 } 52 53 … … 230 231 } 231 232 233 234 public function applyJS() 235 { 236 global $user, $template; 237 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) ) 243 { 244 $local_tpl = new Template(AMM_PATH."admin/", ""); 245 $local_tpl->set_filename('body_page', dirname($this->filelocation).'/menu_templates/menubar_randompic.js.tpl'); 246 247 $data = array( 248 "delay" => $this->my_config['amm_randompicture_periodicchange'], 249 "blockHeight" => $this->my_config['amm_randompicture_height'], 250 "firstPicture" => $this->ajax_amm_get_random_picture() 251 ); 252 253 $local_tpl->assign('data', $data); 254 255 $template->append('footer_elements', $local_tpl->parse('body_page', true)); 256 } 257 258 } 259 232 260 } // AMM_PIP class 233 261 -
extensions/AMenuManager/main.inc.php
r4274 r4363 2 2 /* 3 3 Plugin Name: Advanced Menu Manager 4 Version: 2.1. 24 Version: 2.1.3 5 5 Description: Gestion avancée du menu / Advanced management of menu 6 6 Plugin URI: http://piwigo.org … … 44 44 | | | - es_ES 45 45 | | | - hu_HU (thx to sámli) 46 | | | 47 | | | 46 | 2.1.3 | 2009/11/24 | * move the js for "random image" in the the footer 47 | | | (having the js inside the <dl> tag was not w3c 48 | | | compliant) 48 49 | | | 49 50 … … 70 71 define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/'); 71 72 72 define('AMM_VERSION' , '2.1. 2'); // => ne pas oublier la version dans l'entête !!73 define('AMM_VERSION' , '2.1.3'); // => ne pas oublier la version dans l'entête !! 73 74 74 75 global $prefixeTable, $page; -
extensions/AMenuManager/menu_templates/menubar_randompic.tpl
r3690 r4363 4 4 <dt>{$block->get_title()}</dt> 5 5 6 {literal}7 <script type="text/javascript">8 var fixedHeight = {/literal}{$block->data.blockHeight}{literal};9 10 function init()11 {12 {/literal}13 {if $block->data.blockHeight>0}14 $("#irandompicinner").height(fixedHeight);15 {literal}$("#iammrpic").load( function () { computePositionTop(); } );{/literal}16 {else}17 {literal}18 $("#iammrpic").load( function () { $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal"); } );19 {/literal}20 {/if}21 {literal}22 }23 24 function computePositionTop()25 {26 $("#iamm_ill0").css({top:(fixedHeight-$("#iamm_ill0").innerHeight())/2});27 }28 29 function getRandomPicture()30 {31 $.get("./index.php", {ajaxfct:"randompic"},32 function (data)33 {34 $("#iamm_ill0").fadeTo('slow', 0, function ()35 {36 $("#iamm_ill0").html(data);37 38 {/literal}39 {if $block->data.blockHeight>0}40 {literal}41 $("#iammrpic").load( function () {42 computePositionTop();43 $("#iamm_ill0").fadeTo('slow', 1);44 } );45 {/literal}46 {else}47 {literal}48 $("#iammrpic").load( function () {49 $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal", function ()50 {51 $("#iamm_ill0").fadeTo('slow', 1, function ()52 {53 $("#irandompicinner").animate({height: this.clientHeight+"px"}, "normal");54 });55 });56 } );57 {/literal}58 {/if}59 {literal}60 61 } );62 }63 );64 }65 66 67 </script>68 {/literal}69 6 70 7 <dd id="irandompicdd" class="randompicdd"> … … 76 13 </dd> 77 14 78 <script type="text/javascript">79 init();80 {if $block->data.delay > 0 }81 var vIntervalID = window.setInterval(getRandomPicture, {$block->data.delay});82 {/if}83 </script>
Note: See TracChangeset
for help on using the changeset viewer.