Changeset 2488 for trunk/plugins
- Timestamp:
- Aug 28, 2008, 2:32:39 AM (16 years ago)
- Location:
- trunk/plugins
- Files:
-
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/AMenuManager/admin/amm_linksconfig.tpl
r2468 r2488 67 67 <table class="formtable"> 68 68 <tr> 69 <td>{'g002_setting_block_active'|@translate}</td>70 <td>71 <select name="famm_links_active" id="iamm_links_active">72 {html_options values=$datas.yesno_values output=$datas.yesno_labels selected=$datas.active_selected}73 </select>74 </td>75 </tr>76 77 <tr>78 69 <td>{'g002_setting_block_title'|@translate}</td> 79 70 <td> -
trunk/plugins/AMenuManager/admin/amm_randompicconfig.tpl
r2468 r2488 67 67 <table class="formtable"> 68 68 <tr> 69 <td>{'g002_setting_block_active'|@translate}</td>70 <td>71 <select name="famm_randompicture_active" id="iamm_randompicture_active">72 {html_options values=$datas.yesno_values output=$datas.yesno_labels selected=$datas.active_selected}73 </select>74 </td>75 </tr>76 77 <tr>78 69 <td>{'g002_setting_block_title'|@translate}</td> 79 70 <td> -
trunk/plugins/AMenuManager/amm_aim.class.inc.php
r2466 r2488 31 31 function init_events() 32 32 { 33 parent::init_events(); 33 34 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') ); 34 35 } -
trunk/plugins/AMenuManager/amm_aip.class.inc.php
r2468 r2488 190 190 public function init_events() 191 191 { 192 add_event_handler('menubar_file', array(&$this, 'plugin_public_menu') );193 192 add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS')); 194 193 } … … 238 237 239 238 case 'setmenu_modspecial_sections_list': 240 $result=$this->ajax_amm_setmenu_mod_section_list('amm_sections_modspecial ');239 $result=$this->ajax_amm_setmenu_mod_section_list('amm_sections_modspecials'); 241 240 break; 242 241 case 'setmenu_modspecial_sections_showhide': 243 $result=$this->ajax_amm_setmenu_mod_section_showhide('amm_sections_modspecial ', $_REQUEST['fItem']);242 $result=$this->ajax_amm_setmenu_mod_section_showhide('amm_sections_modspecials', $_REQUEST['fItem']); 244 243 break; 245 244 … … 326 325 'AMM_AJAX_URL_LIST' => $this->page_link."&ajaxfct=", 327 326 'show_icons_selected' => $this->my_config['amm_links_show_icons'], 328 'active_selected' => $this->my_config['amm_links_active'],329 327 'lang_selected' => $user['language'], 330 328 'fromlang' => substr($user['language'],0,2) … … 460 458 { 461 459 $this->my_config['amm_links_show_icons']=$_POST['famm_links_show_icons']; 462 $this->my_config['amm_links_active']=$_POST['famm_links_active'];463 460 $languages=get_languages(); 464 461 foreach($languages as $key => $val) … … 474 471 protected function action_randompic_modify_config() 475 472 { 476 $this->my_config['amm_randompicture_active']=$_POST['famm_randompicture_active'];477 473 $this->my_config['amm_randompicture_showname']=$_POST['famm_randompicture_showname']; 478 474 $this->my_config['amm_randompicture_showcomment']=$_POST['famm_randompicture_showcomment']; … … 542 538 $template_datas=array( 543 539 'lnk_list' => $this->page_link.'&fAMM_tabsheet=links', 544 'active_selected' => $this->my_config['amm_randompicture_active'],545 540 'showname_selected' => $this->my_config['amm_randompicture_showname'], 546 541 'showcomment_selected' => $this->my_config['amm_randompicture_showcomment'], … … 703 698 protected function action_create_modify_personalised() 704 699 { 705 global $ menu, $user;700 global $user; 706 701 707 702 if($_POST['famm_modeedit']=='create') … … 734 729 } 735 730 } 736 737 if($_POST['famm_modeedit']=='create')738 {739 $menu->register('mbAMM_personalised'.$id, ($_POST['famm_personalised_nfo']=='')?$_POST['famm_personalised_title_'.$user['language']]:$_POST['famm_personalised_nfo'], 0, 'AMM');740 }741 742 743 744 731 } 745 732 … … 813 800 { 814 801 $numurl=$this->get_count_url(); 815 $sql="INSERT INTO ".$this->tables['urls']." ( id,label, url, mode, icon, position, visible)816 VALUES (' ', '".$datas['label']."', '".$datas['url']."', '".$datas['mode']."',802 $sql="INSERT INTO ".$this->tables['urls']." (label, url, mode, icon, position, visible) 803 VALUES ('".$datas['label']."', '".$datas['url']."', '".$datas['mode']."', 817 804 '".$datas['icon']."', '".$numurl."', '".$datas['visible']."')"; 818 805 return(pwg_query($sql)); … … 1054 1041 private function ajax_amm_personalised_delete($sectionid) 1055 1042 { 1056 global $menu;1057 1058 1043 if(!$this->adviser_abort()) 1059 1044 { 1060 1045 $this->delete_personalised($sectionid); 1061 $menu->unregister('mbAMM_personalised'.$sectionid);1062 1046 } 1063 1047 return($this->ajax_amm_personalised_list()); -
trunk/plugins/AMenuManager/amm_install.class.inc.php
r2468 r2488 48 48 PRIMARY KEY (`id`), 49 49 KEY `order_key` (`position`) 50 ) ENGINE=MyISAM DEFAULT CHARSET=latin1",50 )", 51 51 52 52 "CREATE TABLE `".$this->tables['personalised']."` ( … … 58 58 `nfo` varchar(25) NOT NULL default '', 59 59 PRIMARY KEY (`id`,`lang`) 60 ) ENGINE=MyISAM DEFAULT CHARSET=latin1"60 )" 61 61 ); 62 62 //$table_def array 63 63 $tables_def = create_table_add_character_set($tables_def); 64 64 $result=$this->tablef->create_tables($tables_def); 65 65 return($result); -
trunk/plugins/AMenuManager/amm_pip.class.inc.php
r2468 r2488 39 39 public function init_events() 40 40 { 41 add_event_handler('loc_begin_menubar', array(&$this, 'modify_menu') ); 41 //TODELETE: add_event_handler('loc_begin_menubar', array(&$this, 'modify_menu') ); 42 parent::init_events(); 43 add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); 42 44 } 43 45 44 /* --------------------------------------------------------------------------- 45 protected classe functions 46 --------------------------------------------------------------------------- */ 47 public function modify_menu() 46 public function blockmanager_apply( $menu_ref_arr ) 48 47 { 49 global $menu, $user; 50 51 52 /* 53 Add a new section (links) 54 */ 55 $urls=$this->get_urls(true); 56 if(($this->my_config['amm_links_active']=='y')and(count($urls)>0)) 57 { 58 if($this->my_config['amm_links_show_icons']=='y') 59 { 60 for($i=0;$i<count($urls);$i++) 61 { 62 $urls[$i]['icon']=AMM_PATH."links_pictures/".$urls[$i]['icon']; 63 } 64 } 65 66 $section = new Section('mbAMM_links', base64_decode($this->my_config['amm_links_title'][$user['language']]), dirname(__FILE__).'/menu_templates/menubar_links.tpl'); 67 $section->set_items(array( 68 'LINKS' => $urls, 69 'icons' => $this->my_config['amm_links_show_icons'] 70 )); 71 $menu->add($section->get()); 72 } 73 48 $menu = & $menu_ref_arr[0]; 74 49 75 50 /* 76 51 Add a new random picture section 77 52 */ 78 if ($this->my_config['amm_randompicture_active']=='y')53 if ( ($block = $menu->get_block( 'mbAMM_randompict' ) ) != null ) 79 54 { 80 55 $sql="SELECT i.id as image_id, i.file as image_file, i.comment, i.path, i.tn_ext, c.id as catid, c.name, c.permalink, RAND() as rndvalue, i.name as imgname … … 96 71 'permalink' => $nfo['permalink'] 97 72 ); 98 99 $section = new Section('mbAMM_randompict', base64_decode($this->my_config['amm_randompicture_title'][$user['language']]), dirname(__FILE__).'/menu_templates/menubar_randompic.tpl'); 100 $section->set_items(array( 73 global $user; 74 $block->set_title( base64_decode($this->my_config['amm_randompicture_title'][$user['language']]) ); 75 $block->template = dirname(__FILE__).'/menu_templates/menubar_randompic.tpl'; 76 $block->data = array( 101 77 'LINK' => make_picture_url($nfo), 102 78 'IMG' => get_thumbnail_url($nfo), … … 105 81 'SHOWNAME' => $this->my_config['amm_randompicture_showname'], 106 82 'SHOWCOMMENT' => $this->my_config['amm_randompicture_showcomment'] 107 )); 108 $menu->add($section->get()); 83 ); 84 } 85 } 86 87 /* 88 Add a new section (links) 89 */ 90 if ( ($block = $menu->get_block( 'mbAMM_links' ) ) != null ) 91 { 92 $urls=$this->get_urls(true); 93 if ( count($urls)>0 ) 94 { 95 if($this->my_config['amm_links_show_icons']=='y') 96 { 97 for($i=0;$i<count($urls);$i++) 98 { 99 $urls[$i]['icon']=get_root_url().'plugins/'.AMM_DIR."/links_pictures/".$urls[$i]['icon']; 100 } 101 } 102 103 $block->set_title( base64_decode($this->my_config['amm_links_title'][$user['language']]) ); 104 $block->template = dirname(__FILE__).'/menu_templates/menubar_links.tpl'; 105 106 $block->data = array( 107 'LINKS' => $urls, 108 'icons' => $this->my_config['amm_links_show_icons'] 109 ); 109 110 } 110 111 } … … 122 123 if(!isset($id_done[$val['id']])) 123 124 { 124 $section = new Section('mbAMM_personalised'.$val['id'], $val['title'], dirname(__FILE__).'/menu_templates/menubar_personalised.tpl'); 125 $section->set_items(array( 126 'CONTENT' => stripslashes($val['content']))); 127 $menu->add($section->get()); 128 125 if ( ($block = $menu->get_block( 'mbAMM_personalised'.$val['id'] ) ) != null ) 126 { 127 $block->set_title( $val['title'] ); 128 $block->template = dirname(__FILE__).'/menu_templates/menubar_personalised.tpl'; 129 $block->data = stripslashes($val['content']); 130 } 129 131 $id_done[$val['id']]=""; 130 132 } 131 }132 }133 134 135 /*136 Hide sections137 */138 foreach($this->my_config['amm_sections_visible'] as $key => $val)139 {140 if($val=='n')141 {142 $menu->remove($key);143 133 } 144 134 } … … 147 137 hide items from special & menu sections 148 138 */ 149 foreach(array('mbMenu' => 'amm_sections_modmenu', 'mbSpecial ' =>'amm_sections_modspecial') as $key0 => $val0)139 foreach(array('mbMenu' => 'amm_sections_modmenu', 'mbSpecials' =>'amm_sections_modspecials') as $key0 => $val0) 150 140 { 151 $section_menu=$menu->section($key0); 152 foreach($this->my_config[$val0] as $key => $val) 141 if ( ($block = $menu->get_block( $key0 ) ) != null ) 153 142 { 154 if($val=='n')143 foreach($this->my_config[$val0] as $key => $val) 155 144 { 156 unset($section_menu['ITEMS'][$key]); 145 if($val=='n') 146 { 147 unset( $block->data[$key] ); 148 } 157 149 } 158 150 } 159 $menu->replace($section_menu);160 151 } 161 162 } 163 152 } 164 153 165 154 } // AMM_PIP class -
trunk/plugins/AMenuManager/amm_root.class.inc.php
r2468 r2488 38 38 public function init_config() 39 39 { 40 global $menu;41 42 40 $this->my_config=array( 43 41 'amm_links_show_icons' => 'y', 44 'amm_links_active' => 'y',45 42 'amm_links_title' => array(), 46 'amm_sections_visible' => array(),47 'amm_randompicture_active' => 'n',48 43 'amm_randompicture_showname' => 'n', //n:no, o:over, u:under 49 44 'amm_randompicture_showcomment' => 'n', //n:no, o:over, u:under 50 45 'amm_randompicture_title' => array(), 51 'amm_sections_modspecial ' => array(52 'favorite _cat' => 'y',53 'most_visited _cat' => 'y',54 'best_rated _cat' => 'y',55 'random _cat' => 'y',56 'recent_pics _cat' => 'y',57 'recent_cats _cat' => 'y',46 'amm_sections_modspecials' => array( 47 'favorites' => 'y', 48 'most_visited' => 'y', 49 'best_rated' => 'y', 50 'random' => 'y', 51 'recent_pics' => 'y', 52 'recent_cats' => 'y', 58 53 'calendar' => 'y' 59 54 ), 60 55 'amm_sections_modmenu' => array( 61 56 'qsearch' => 'y', 62 ' Tags' => 'y',63 ' Search' => 'y',57 'tags' => 'y', 58 'search' => 'y', 64 59 'comments' => 'y', 65 ' About' => 'y',66 ' Notification' => 'y'60 'about' => 'y', 61 'notification' => 'y' 67 62 ) 68 63 ); … … 83 78 } 84 79 85 $sections=$menu->registered();86 foreach($sections as $key => $val)87 {88 $this->my_config['amm_sections_visible'][$key]='y';89 }90 80 } 91 81 92 82 public function load_config() 93 83 { 94 global $menu; 84 parent::load_config(); 85 } 95 86 96 parent::load_config(); 87 public function init_events() 88 { 89 add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') ); 90 } 97 91 98 $sections=$menu->registered(); 99 foreach($sections as $key => $val) 92 public function register_blocks( $menu_ref_arr ) 93 { 94 $menu = & $menu_ref_arr[0]; 95 if ($menu->get_id() != 'menubar') 96 return; 97 $menu->register_block( new RegisteredBlock( 'mbAMM_randompict', 'Random pictures', 'AMM')); 98 $menu->register_block( new RegisteredBlock( 'mbAMM_links', 'Links', 'AMM')); 99 100 $sections=$this->get_sections(true); 101 if(count($sections)) 100 102 { 101 if(!isset($this->my_config['amm_sections_visible'][$key])) 103 $id_done=array(); 104 foreach($sections as $key => $val) 102 105 { 103 $this->my_config['amm_sections_visible'][$key]='y'; 106 if(!isset($id_done[$val['id']])) 107 { 108 $menu->register_block( new RegisteredBlock( 'mbAMM_personalised'.$val['id'], $val['title'], 'AMM')); 109 $id_done[$val['id']]=""; 110 } 104 111 } 105 112 } 106 107 113 } 108 114 -
trunk/plugins/AMenuManager/main.inc.php
r2466 r2488 44 44 define('AMM_VERSION' , '1.0.0'); // => ne pas oublier la version dans l'entête !! 45 45 46 global $prefixeTable , $menu;46 global $prefixeTable; 47 47 48 if( basename($_SERVER["PHP_SELF"])=='admin.php')48 if(defined('IN_ADMIN')) 49 49 { 50 50 //AMM admin part loaded and active only if in admin page -
trunk/plugins/AMenuManager/maintain.inc.php
r2466 r2488 6 6 ini_set('display_errors', true); 7 7 8 define ('AMM_DIR' , basename(dirname(__FILE__)));9 define ('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/');8 defined('AMM_DIR') || define('AMM_DIR' , basename(dirname(__FILE__))); 9 defined('AMM_PATH') || define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/'); 10 10 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 11 11 … … 24 24 function plugin_install($plugin_id, $plugin_version, &$errors) 25 25 { 26 global $prefixeTable, $gpc_installed , $menu;26 global $prefixeTable, $gpc_installed; 27 27 if($gpc_installed) 28 28 { 29 $menu->register('mbAMM_links', 'Links', 0, 'AMM');30 $menu->register('mbAMM_randompict', 'Random pictures', 0, 'AMM');29 //$menu->register('mbAMM_links', 'Links', 0, 'AMM'); 30 //$menu->register('mbAMM_randompict', 'Random pictures', 0, 'AMM'); 31 31 $amm=new AMM_install($prefixeTable, __FILE__); 32 32 $result=$amm->install(); … … 48 48 function plugin_uninstall($plugin_id) 49 49 { 50 global $prefixeTable, $gpc_installed, $menu; 51 if($gpc_installed) 52 { 53 $menu->unregister('mbAMM_links'); 54 $menu->unregister('mbAMM_randompict'); 55 $amm=new AMM_install($prefixeTable, __FILE__); 56 $result=$amm->uninstall(); 57 } 58 else 59 { 60 array_push($errors, l10n('Grum Plugin Classes is not installed')); 61 } 50 global $prefixeTable; 51 $amm=new AMM_install($prefixeTable, __FILE__); 52 $result=$amm->uninstall(); 62 53 } 63 54 -
trunk/plugins/AMenuManager/menu_templates/menubar_links.tpl
r2469 r2488 1 1 2 2 <!-- links menu bar --> 3 {if $ section.NAME!=""}4 <dt>{$ section.NAME|@translate}</dt>3 {if $block->get_title() !="" } 4 <dt>{$block->get_title()}</dt> 5 5 {/if} 6 6 <dd> 7 <ul {if $ section.ITEMS.icons=='y'}style="padding-left:4px;list-style:none;"{/if}>8 {foreach from=$ section.ITEMS.LINKS item=link}7 <ul {if $block->data.icons=='y'}style="padding-left:4px;list-style:none;"{/if}> 8 {foreach from=$block->data.LINKS item=link} 9 9 <li> 10 {if $ section.ITEMS.icons=='y'}<img src='{$link.icon}' style="position:relative;top:3px;"/>{/if}10 {if $block->data.icons=='y'}<img src='{$link.icon}' style="position:relative;top:3px;"/>{/if} 11 11 <a href="{$link.url}" 12 12 {if $link.mode == 0} target = '_blank' {/if}>{$link.label}</a> -
trunk/plugins/AMenuManager/menu_templates/menubar_personalised.tpl
r2468 r2488 1 1 2 2 <!-- personalised menu bar --> 3 {if $ section.NAME!=""}4 <dt>{$ section.NAME|@translate}</dt>3 {if $block->get_title() !="" } 4 <dt>{$block->get_title()}</dt> 5 5 {/if} 6 6 <dd> 7 { if $section.ITEMS.CONTENT!=""}{$section.ITEMS.CONTENT}{/if}7 {$block->data} 8 8 </dd> -
trunk/plugins/AMenuManager/menu_templates/menubar_randompic.tpl
r2468 r2488 1 1 2 2 <!-- random picture menu bar --> 3 {if $section.NAME!=""} 4 <dt>{$section.NAME|@translate}</dt> 5 {/if} 3 <dt>{$block->get_title()}</dt> 6 4 <dd> 7 5 <div class="illustration" style="text-align:center;padding:5px;font-size:85%;"> 8 {if $ section.ITEMS.IMGNAME!="" and $section.ITEMS.SHOWNAME=="o"}{$section.ITEMS.IMGNAME}<br/>{/if}9 {if $ section.ITEMS.IMGCOMMENT!="" and $section.ITEMS.SHOWCOMMENT=="o"}{$section.ITEMS.IMGCOMMENT}<br/>{/if}10 <a href="{$ section.ITEMS.LINK}"><img src="{$section.ITEMS.IMG}"/></a>11 {if $ section.ITEMS.IMGNAME!="" and $section.ITEMS.SHOWNAME=="u"}<br/>{$section.ITEMS.IMGNAME}{/if}12 {if $ section.ITEMS.IMGCOMMENT!="" and $section.ITEMS.SHOWCOMMENT=="u"}<br/>{$section.ITEMS.IMGCOMMENT}{/if}6 {if $block->data.IMGNAME!="" and $block->data.SHOWNAME=="o"}{$block->data.IMGNAME}<br/>{/if} 7 {if $block->data.IMGCOMMENT!="" and $block->data.SHOWCOMMENT=="o"}{$block->data.IMGCOMMENT}<br/>{/if} 8 <a href="{$block->data.LINK}"><img src="{$block->data.IMG}"/></a> 9 {if $block->data.IMGNAME!="" and $block->data.SHOWNAME=="u"}<br/>{$block->data.IMGNAME}{/if} 10 {if $block->data.IMGCOMMENT!="" and $block->data.SHOWCOMMENT=="u"}<br/>{$block->data.IMGCOMMENT}{/if} 13 11 </div> 14 12 </dd>
Note: See TracChangeset
for help on using the changeset viewer.