Changeset 5545 for extensions/AMenuManager
- Timestamp:
- Apr 1, 2010, 9:03:36 PM (14 years ago)
- Location:
- extensions/AMenuManager
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/admin/amm_linkslist.tpl
r3681 r5545 31 31 if(action_todo!='') 32 32 { 33 http_request=create_httpobject('get', '', '{/literal}{$datas.AMM_AJAX_URL_LIST}{literal}'+action_todo, false); 34 http_request.send(null); 35 doc.innerHTML=http_request.responseText; 33 doc.innerHTML=$.ajax({ 34 type: "POST", 35 url: "{/literal}{$datas.AMM_AJAX_URL_LIST}{literal}"+action_todo, 36 async: false, 37 }).responseText; 36 38 } 37 39 } -
extensions/AMenuManager/admin/amm_personalisedlist.tpl
r3681 r5545 26 26 if(action_todo!='') 27 27 { 28 http_request=create_httpobject('get', '', '{/literal}{$datas.AMM_AJAX_URL_LIST}{literal}'+action_todo, false); 29 http_request.send(null); 30 doc.innerHTML=http_request.responseText; 28 doc.innerHTML=$.ajax({ 29 type: "POST", 30 url: "{/literal}{$datas.AMM_AJAX_URL_LIST}{literal}"+action_todo, 31 async: false, 32 }).responseText; 31 33 } 32 34 } -
extensions/AMenuManager/admin/amm_randompicconfig.tpl
r5429 r5545 7 7 width:350px; 8 8 height:10px; 9 border:1px solid; 9 border-width:1px; 10 border-style:solid; 10 11 margin-right:5px; 11 12 padding-right:14px; … … 16 17 position:relative; 17 18 top:-2px; 18 border:1px solid; 19 border-width:1px; 20 border-style:solid; 19 21 display:block; 20 22 } … … 50 52 slide: function(event, ui) { formatDelay(ui.value); } 51 53 }); 54 $("#iamm_rp_pc_slider a").addClass('gcBgInput'); 52 55 53 56 formatHeight({/literal}{$datas.height}{literal}); … … 60 63 slide: function(event, ui) { formatHeight(ui.value); } 61 64 }); 65 $("#iamm_rp_height_slider a").addClass('gcBgInput'); 62 66 } 63 67 … … 160 164 <td> 161 165 <input type="hidden" name="famm_randompicture_height" id="iamm_randompicture_height" value="{$datas.height}"> 162 <div id="iamm_rp_height_slider" ></div>166 <div id="iamm_rp_height_slider" class="gcBgInput gcBorderInput"></div> 163 167 </td> 164 168 <td width="90px"> … … 204 208 <td> 205 209 <input type="hidden" name="famm_randompicture_periodicchange" id="iamm_randompicture_periodicchange" value="{$datas.periodic_change}"> 206 <div id="iamm_rp_pc_slider" ></div>210 <div id="iamm_rp_pc_slider" class="gcBgInput gcBorderInput"></div> 207 211 </td> 208 212 <td width="70px"> -
extensions/AMenuManager/admin/plugin_admin.php
r3681 r5545 23 23 $main_plugin_object = get_plugin_data($plugin_id); 24 24 25 $plugin_ai = new AMM_AIP($prefixeTable, $main_plugin_object->get _filelocation());25 $plugin_ai = new AMM_AIP($prefixeTable, $main_plugin_object->getFileLocation()); 26 26 $plugin_ai->manage(); 27 27 -
extensions/AMenuManager/amm_aim.class.inc.php
r3681 r5545 20 20 21 21 class AMM_AIM extends AMM_root 22 { 22 { 23 23 function AMM_AIM($prefixeTable, $filelocation) 24 24 { … … 29 29 initialize events call for the plugin 30 30 */ 31 function init _events()31 function initEvents() 32 32 { 33 parent::init _events();34 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin _admin_menu') );33 parent::initEvents(); 34 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); 35 35 } 36 36 -
extensions/AMenuManager/amm_aip.class.inc.php
r5427 r5545 19 19 include_once(PHPWG_ROOT_PATH.'include/block.class.php'); 20 20 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 21 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/ajax.class.inc.php');22 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/genericjs.class.inc.php');23 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/translate.class.inc.php');21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 22 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/genericjs.class.inc.php'); 23 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTranslate.class.inc.php'); 24 24 25 25 class AMM_AIP extends AMM_root … … 27 27 protected $google_translate; 28 28 protected $tabsheet; 29 protected $ajax;30 29 protected $sectionsId=array('menu' => 'Menu', 'special' => 'Specials'); 31 30 … … 36 35 parent::__construct($prefixeTable, $filelocation); 37 36 38 $this->load _config();39 $this->init _events();37 $this->loadConfig(); 38 $this->initEvents(); 40 39 41 40 $this->tabsheet = new tabsheet(); 42 41 $this->tabsheet->add('setmenu', 43 42 l10n('g002_setmenu'), 44 $this-> page_link.'&fAMM_tabsheet=setmenu');43 $this->getAdminLink().'&fAMM_tabsheet=setmenu'); 45 44 $this->tabsheet->add('links', 46 45 l10n('g002_addlinks'), 47 $this-> page_link.'&fAMM_tabsheet=links');46 $this->getAdminLink().'&fAMM_tabsheet=links'); 48 47 $this->tabsheet->add('randompict', 49 48 l10n('g002_randompict'), 50 $this-> page_link.'&fAMM_tabsheet=randompict');49 $this->getAdminLink().'&fAMM_tabsheet=randompict'); 51 50 $this->tabsheet->add('personnalblock', 52 51 l10n('g002_personnalblock'), 53 $this->page_link.'&fAMM_tabsheet=personnalblock'); 54 $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css"); 55 $this->ajax = new Ajax(); 56 $this->google_translate = new translate(); 52 $this->getAdminLink().'&fAMM_tabsheet=personnalblock'); 53 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); 54 $this->google_translate = new GPCTranslate(); 57 55 } 58 56 … … 80 78 $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]"); 81 79 82 $template_plugin["AMM_VERSION"] = "<i>".$this-> plugin_name."</i> ".l10n('g002_version').AMM_VERSION;80 $template_plugin["AMM_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('g002_version').AMM_VERSION; 83 81 $template_plugin["AMM_PAGE"] = $_REQUEST['fAMM_tabsheet']; 84 82 $template_plugin["PATH"] = AMM_PATH; … … 189 187 initialize events call for the plugin 190 188 */ 191 public function init _events()192 { 193 add_event_handler('loc_end_page_header', array(&$this->css, 'apply _CSS'));189 public function initEvents() 190 { 191 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 194 192 } 195 193 … … 244 242 break; 245 243 } 246 //$template-> 247 $this->ajax->return_result($result);244 245 GPCAjax::returnResult($result); 248 246 } 249 247 } … … 282 280 global $template, $user; 283 281 $template->set_filename('body_page', 284 dirname($this-> filelocation).'/admin/amm_linkslist.tpl');282 dirname($this->getFileLocation()).'/admin/amm_linkslist.tpl'); 285 283 286 284 $tmp=$this->get_count_url(); … … 300 298 301 299 $template_datas=array( 302 'lnk_create' => $this-> page_link.'&fAMM_tabsheet=links&action=create',303 'lnk_config' => $this-> page_link.'&fAMM_tabsheet=links&action=config',304 'AMM_AJAX_URL_LIST' => $this-> page_link."&ajaxfct=",300 'lnk_create' => $this->getAdminLink().'&fAMM_tabsheet=links&action=create', 301 'lnk_config' => $this->getAdminLink().'&fAMM_tabsheet=links&action=config', 302 'AMM_AJAX_URL_LIST' => $this->getAdminLink()."&ajaxfct=", 305 303 'nburl' => $tmp 306 304 ); … … 317 315 global $template, $user; 318 316 $template->set_filename('body_page', 319 dirname($this-> filelocation).'/admin/amm_linksconfig.tpl');317 dirname($this->getFileLocation()).'/admin/amm_linksconfig.tpl'); 320 318 321 319 $template_datas=array( 322 'lnk_list' => $this-> page_link.'&fAMM_tabsheet=links',323 'AMM_AJAX_URL_LIST' => $this-> page_link."&ajaxfct=",324 'show_icons_selected' => $this-> my_config['amm_links_show_icons'],320 'lnk_list' => $this->getAdminLink().'&fAMM_tabsheet=links', 321 'AMM_AJAX_URL_LIST' => $this->getAdminLink()."&ajaxfct=", 322 'show_icons_selected' => $this->config['amm_links_show_icons'], 325 323 'lang_selected' => $user['language'], 326 324 'fromlang' => substr($user['language'],0,2) … … 328 326 329 327 $template_datas['language_list'] = array(); 330 foreach($this-> my_config['amm_links_title'] as $key => $val)328 foreach($this->config['amm_links_title'] as $key => $val) 331 329 { 332 330 $template_datas['language_list'][] = array( … … 362 360 global $template, $user; 363 361 $template->set_filename('body_page', 364 dirname($this-> filelocation).'/admin/amm_linkslist_edit.tpl');362 dirname($this->getFileLocation()).'/admin/amm_linkslist_edit.tpl'); 365 363 366 364 $extensions_list=array('jpg'=>0,'jpeg'=>0,'gif'=>0,'png'=>0); 367 365 $template_icons_list=array(); 368 $directory=dir(dirname($this-> filelocation).'/links_pictures/');366 $directory=dir(dirname($this->getFileLocation()).'/links_pictures/'); 369 367 while($file=$directory->read()) 370 368 { … … 403 401 } 404 402 405 $template_datas['lnk_list'] = $this-> page_link.'&fAMM_tabsheet=links';403 $template_datas['lnk_list'] = $this->getAdminLink().'&fAMM_tabsheet=links'; 406 404 $template_datas['icons_img'] = AMM_PATH."links_pictures/".$template_datas['icons_selected']; 407 405 $template_datas['icons_values'] = array(); … … 455 453 protected function action_links_modify_config() 456 454 { 457 $this-> my_config['amm_links_show_icons']=$_POST['famm_links_show_icons'];455 $this->config['amm_links_show_icons']=$_POST['famm_links_show_icons']; 458 456 $languages=get_languages(); 459 457 foreach($languages as $key => $val) 460 458 { 461 $this-> my_config['amm_links_title'][$key]=base64_encode($_POST['famm_links_title_'.$key]);462 } 463 $this->save _config();459 $this->config['amm_links_title'][$key]=base64_encode($_POST['famm_links_title_'.$key]); 460 } 461 $this->saveConfig(); 464 462 } 465 463 … … 469 467 protected function action_randompic_modify_config() 470 468 { 471 $this-> my_config['amm_randompicture_height']=$_POST['famm_randompicture_height'];472 $this-> my_config['amm_randompicture_periodicchange']=$_POST['famm_randompicture_periodicchange'];473 $this-> my_config['amm_randompicture_showname']=$_POST['famm_randompicture_showname'];474 $this-> my_config['amm_randompicture_showcomment']=$_POST['famm_randompicture_showcomment'];469 $this->config['amm_randompicture_height']=$_POST['famm_randompicture_height']; 470 $this->config['amm_randompicture_periodicchange']=$_POST['famm_randompicture_periodicchange']; 471 $this->config['amm_randompicture_showname']=$_POST['famm_randompicture_showname']; 472 $this->config['amm_randompicture_showcomment']=$_POST['famm_randompicture_showcomment']; 475 473 $languages=get_languages(); 476 474 foreach($languages as $key => $val) 477 475 { 478 $this-> my_config['amm_randompicture_title'][$key]=base64_encode(stripslashes($_POST['famm_randompicture_title_'.$key]));479 } 480 $this->save _config();476 $this->config['amm_randompicture_title'][$key]=base64_encode(stripslashes($_POST['famm_randompicture_title_'.$key])); 477 } 478 $this->saveConfig(); 481 479 } 482 480 … … 489 487 { 490 488 global $template, $user, $page; 491 $template->set_filename('body_page', dirname($this-> filelocation).'/admin/amm_sections.tpl');489 $template->set_filename('body_page', dirname($this->getFileLocation()).'/admin/amm_sections.tpl'); 492 490 493 491 if(isset($_POST['fList']) && !$this->adviser_abort()) … … 503 501 $properties=explode("#", $items[$i]); 504 502 $properties[0]=explode(",", $properties[0]); 505 $this-> my_config['amm_sections_items'][$properties[0][0]]['container']=$properties[0][1];506 $this-> my_config['amm_sections_items'][$properties[0][0]]['order']=$properties[0][2];507 $this-> my_config['amm_sections_items'][$properties[0][0]]['visibility']=$properties[1];503 $this->config['amm_sections_items'][$properties[0][0]]['container']=$properties[0][1]; 504 $this->config['amm_sections_items'][$properties[0][0]]['order']=$properties[0][2]; 505 $this->config['amm_sections_items'][$properties[0][0]]['visibility']=$properties[1]; 508 506 } 509 507 $this->sortSectionsItems(); 510 if($this->save _config())508 if($this->saveConfig()) 511 509 { 512 510 array_push($page['infos'], l10n('g002_config_saved')); … … 518 516 } 519 517 520 foreach($this-> my_config['amm_sections_items'] as $key=>$val)521 { 522 $this-> my_config['amm_sections_items'][$key]['visibilityForm'] = $this->makeVisibility($val['visibility'], $key);518 foreach($this->config['amm_sections_items'] as $key=>$val) 519 { 520 $this->config['amm_sections_items'][$key]['visibilityForm'] = $this->makeVisibility($val['visibility'], $key); 523 521 $this->defaultMenus[$key]['visibilityForm'] = $this->makeVisibility("guest,generic,normal,webmaster,admin/", $key); 524 522 } … … 526 524 $this->sortSectionsItems(); 527 525 528 $users=new users("");529 $groups=new groups("");526 $users=new GPCUsers(""); 527 $groups=new GPCGroups(""); 530 528 531 529 … … 533 531 $template->assign("sections", $this->sectionsId); 534 532 $template->assign("defaultValues", $this->defaultMenus); 535 $template->assign("items", $this-> my_config['amm_sections_items']);533 $template->assign("items", $this->config['amm_sections_items']); 536 534 $template->assign_var_from_handle('AMM_BODY_PAGE', 'body_page'); 537 535 } … … 545 543 global $template, $user; 546 544 $template->set_filename('body_page', 547 dirname($this-> filelocation).'/admin/amm_randompicconfig.tpl');545 dirname($this->getFileLocation()).'/admin/amm_randompicconfig.tpl'); 548 546 549 547 $template_datas=array( 550 'lnk_list' => $this-> page_link.'&fAMM_tabsheet=links',551 'showname_selected' => $this-> my_config['amm_randompicture_showname'],552 'showcomment_selected' => $this-> my_config['amm_randompicture_showcomment'],553 'periodic_change' => $this-> my_config['amm_randompicture_periodicchange'],554 'height' => $this-> my_config['amm_randompicture_height'],548 'lnk_list' => $this->getAdminLink().'&fAMM_tabsheet=links', 549 'showname_selected' => $this->config['amm_randompicture_showname'], 550 'showcomment_selected' => $this->config['amm_randompicture_showcomment'], 551 'periodic_change' => $this->config['amm_randompicture_periodicchange'], 552 'height' => $this->config['amm_randompicture_height'], 555 553 'lang_selected' => $user['language'], 556 554 'fromlang' => substr($user['language'],0,2) … … 558 556 559 557 $template_datas['language_list'] = array(); 560 foreach($this-> my_config['amm_randompicture_title'] as $key => $val)558 foreach($this->config['amm_randompicture_title'] as $key => $val) 561 559 { 562 560 $template_datas['language_list'][] = array( … … 603 601 global $template, $user; 604 602 $template->set_filename('body_page', 605 dirname($this-> filelocation).'/admin/amm_personalisedlist.tpl');603 dirname($this->getFileLocation()).'/admin/amm_personalisedlist.tpl'); 606 604 607 605 $sql="SELECT COUNT(DISTINCT ID) as countid FROM ".$this->tables['personalised']; … … 632 630 633 631 $template_datas=array( 634 'lnk_create' => $this-> page_link.'&fAMM_tabsheet=personnalblock&action=create',635 'AMM_AJAX_URL_LIST' => $this-> page_link."&ajaxfct=",632 'lnk_create' => $this->getAdminLink().'&fAMM_tabsheet=personnalblock&action=create', 633 'AMM_AJAX_URL_LIST' => $this->getAdminLink()."&ajaxfct=", 636 634 'nbsections' => $tmp 637 635 ); … … 650 648 global $template, $user; 651 649 $template->set_filename('body_page', 652 dirname($this-> filelocation).'/admin/amm_personalisedlist_edit.tpl');650 dirname($this->getFileLocation()).'/admin/amm_personalisedlist_edit.tpl'); 653 651 654 652 $template_datas=array(); … … 697 695 $template_datas['lang_selected'] = $user['language']; 698 696 699 $template_datas['personalised_list'] = $this-> page_link.'&fAMM_tabsheet=personnalblock';697 $template_datas['personalised_list'] = $this->getAdminLink().'&fAMM_tabsheet=personnalblock'; 700 698 $template_datas['yesno_values'] = array('y','n'); 701 699 $template_datas['yesno_labels'][] = l10n('g002_yesno_y'); … … 754 752 $local_tpl = new Template(AMM_PATH."admin/", ""); 755 753 $local_tpl->set_filename('body_page', 756 dirname($this-> filelocation).'/admin/amm_sections_visibility.tpl');754 dirname($this->getFileLocation()).'/admin/amm_sections_visibility.tpl'); 757 755 758 756 759 757 $parameters=explode("/", $visibility); 760 758 761 $users=new users(str_replace(",", "/", $parameters[0]));762 $users->set _allowed('admin', true);763 $groups=new groups(str_replace(",", "/", $parameters[1]));759 $users=new GPCUsers(str_replace(",", "/", $parameters[0])); 760 $users->setAllowed('admin', true); 761 $groups=new GPCGroups(str_replace(",", "/", $parameters[1])); 764 762 765 763 $local_tpl->assign('name', $id); … … 780 778 if(is_adviser()) 781 779 { 782 $this->display _result(l10n("g002_adviser_not_allowed"), false);780 $this->displayResult(l10n("g002_adviser_not_allowed"), false); 783 781 return(true); 784 782 } … … 940 938 $local_tpl = new Template(AMM_PATH."admin/", ""); 941 939 $local_tpl->set_filename('body_page', 942 dirname($this-> filelocation).'/admin/amm_linkslist_detail.tpl');940 dirname($this->getFileLocation()).'/admin/amm_linkslist_detail.tpl'); 943 941 944 942 $template_datas['urls']=array(); … … 953 951 'up' => ($i==0)?false:true, 954 952 'down' => ($i<(count($urls)-1))?true:false, 955 'edit' => $this-> page_link.'&fAMM_tabsheet=links&action=modify&fItem='.$urls[$i]['id'],953 'edit' => $this->getAdminLink().'&fAMM_tabsheet=links&action=modify&fItem='.$urls[$i]['id'], 956 954 'ID' => $urls[$i]['id'], 957 955 'IDPREV' => ($i==0)?0:$urls[$i-1]['id'], … … 999 997 $local_tpl = new Template(AMM_PATH."admin/", ""); 1000 998 $local_tpl->set_filename('body_page', 1001 dirname($this-> filelocation).'/admin/amm_personalisedlist_detail.tpl');999 dirname($this->getFileLocation()).'/admin/amm_personalisedlist_detail.tpl'); 1002 1000 1003 1001 $template_datas['sections']=array(); … … 1011 1009 $template_datas['sections'][]=array( 1012 1010 'title' => ($val['title']!='')?$val['title']:l10n('g002_notitle'), 1013 'edit' => $this-> page_link.'&fAMM_tabsheet=personnalblock&action=modify&fItem='.$val['id'],1011 'edit' => $this->getAdminLink().'&fAMM_tabsheet=personnalblock&action=modify&fItem='.$val['id'], 1014 1012 'ID' => $val['id'], 1015 1013 'visible' => l10n('g002_yesno_'.$val['visible']), -
extensions/AMenuManager/amm_install.class.inc.php
r5421 r5545 16 16 include_once('amm_version.inc.php'); 17 17 include_once('amm_root.class.inc.php'); 18 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/tables.class.inc.php');18 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 19 19 20 20 21 21 class AMM_install extends AMM_root 22 22 { 23 private $table f;23 private $tablesManager; 24 24 private $exportfile; 25 25 … … 27 27 { 28 28 parent::__construct($prefixeTable, $filelocation); 29 $this->table f= new manage_tables($this->tables);30 $this->exportfile=dirname($this-> filelocation).'/'.$this->plugin_name_files.'.sql';29 $this->tablesManager= new GPCTables($this->tables); 30 $this->exportfile=dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().'.sql'; 31 31 } 32 32 … … 37 37 public function install() 38 38 { 39 $this->init _config();40 $this->load _config();41 $this-> my_config['installed']=AMM_VERSION2;42 $this->save _config();39 $this->initConfig(); 40 $this->loadConfig(); 41 $this->config['installed']=AMM_VERSION2; 42 $this->saveConfig(); 43 43 44 44 $tables_def=array( … … 67 67 //$table_def array 68 68 $tables_def = create_table_add_character_set($tables_def); 69 $result=$this->table f->create_tables($tables_def);69 $result=$this->tablesManager->create($tables_def); 70 70 return($result); 71 71 } … … 77 77 public function uninstall() 78 78 { 79 $this->table f->export($this->exportfile);80 $this->delete _config();81 $this->table f->drop_tables();79 $this->tablesManager->export($this->exportfile); 80 $this->deleteConfig(); 81 $this->tablesManager->drop(); 82 82 } 83 83 … … 86 86 global $template; 87 87 88 $this->init _config();89 $this->load _config();88 $this->initConfig(); 89 $this->loadConfig(); 90 90 91 91 $this->udpateTablesDef(); 92 92 93 $this-> my_config['installed']=AMM_VERSION2; //update the installed release number94 $this->save _config();93 $this->config['installed']=AMM_VERSION2; //update the installed release number 94 $this->saveConfig(); 95 95 } 96 96 … … 113 113 * This function aim to import the old conf into the new conf property 114 114 */ 115 if(isset($this-> my_config['amm_sections_modspecials']))115 if(isset($this->config['amm_sections_modspecials'])) 116 116 { 117 foreach($this-> my_config['amm_sections_modspecials'] as $key=>$val)117 foreach($this->config['amm_sections_modspecials'] as $key=>$val) 118 118 { 119 $this-> my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/";119 $this->config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 120 120 } 121 unset($this-> my_config['amm_sections_modspecials']);121 unset($this->config['amm_sections_modspecials']); 122 122 } 123 123 124 if(isset($this-> my_config['amm_sections_modmenu']))124 if(isset($this->config['amm_sections_modmenu'])) 125 125 { 126 foreach($this-> my_config['amm_sections_modmenu'] as $key=>$val)126 foreach($this->config['amm_sections_modmenu'] as $key=>$val) 127 127 { 128 $this-> my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/";128 $this->config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 129 129 } 130 unset($this-> my_config['amm_sections_modmenu']);130 unset($this->config['amm_sections_modmenu']); 131 131 } 132 132 133 if(!array_key_exists('installed', $this-> my_config))133 if(!array_key_exists('installed', $this->config)) 134 134 { 135 135 /* … … 137 137 * 2.2.0 release 138 138 */ 139 $this-> my_config['installed']="02.01.06";139 $this->config['installed']="02.01.06"; 140 140 } 141 141 142 if($this-> my_config['installed']<="02.01.06")142 if($this->config['installed']<="02.01.06") 143 143 { 144 144 /* … … 153 153 pwg_query($sql); 154 154 155 foreach($this-> my_config['amm_sections_items'] as $key => $val)155 foreach($this->config['amm_sections_items'] as $key => $val) 156 156 { 157 $this-> my_config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation'];157 $this->config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation']; 158 158 } 159 159 } -
extensions/AMenuManager/amm_pip.class.inc.php
r5427 r5545 17 17 18 18 include_once(PHPWG_PLUGINS_PATH.'AMenuManager/amm_root.class.inc.php'); 19 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/ajax.class.inc.php');19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 20 20 21 21 class AMM_PIP extends AMM_root 22 22 { 23 protected $ajax;24 23 protected $displayRandomImageBlock=true; 25 24 … … 27 26 { 28 27 parent::__construct($prefixeTable, $filelocation); 29 $this->ajax = new Ajax(); 30 $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files."2.css"); 31 32 $this->load_config(); 33 $this->init_events(); 28 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."2.css"); 29 30 $this->loadConfig(); 31 $this->initEvents(); 34 32 } 35 33 … … 43 41 initialize events call for the plugin 44 42 */ 45 public function init _events()43 public function initEvents() 46 44 { 47 45 //TODELETE: add_event_handler('loc_begin_menubar', array(&$this, 'modify_menu') ); 48 parent::init _events();46 parent::initEvents(); 49 47 add_event_handler('loading_lang', array(&$this, 'load_lang')); 50 48 add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); 51 add_event_handler('loc_end_page_header', array(&$this->css, 'apply _CSS'));49 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 52 50 add_event_handler('loc_end_page_tail', array(&$this, 'applyJS')); 53 51 } … … 78 76 if ( ( ($block = $menu->get_block( 'mbAMM_randompict' ) ) != null ) && ($user['nb_total_images'] > 0) ) 79 77 { 80 $block->set_title( base64_decode($this-> my_config['amm_randompicture_title'][$user['language']]) );78 $block->set_title( base64_decode($this->config['amm_randompicture_title'][$user['language']]) ); 81 79 $block->data = array( 82 "delay" => $this-> my_config['amm_randompicture_periodicchange'],83 "blockHeight" => $this-> my_config['amm_randompicture_height'],80 "delay" => $this->config['amm_randompicture_periodicchange'], 81 "blockHeight" => $this->config['amm_randompicture_height'], 84 82 "firstPicture" => $this->ajax_amm_get_random_picture() 85 83 ); … … 99 97 if ( count($urls)>0 ) 100 98 { 101 if($this-> my_config['amm_links_show_icons']=='y')99 if($this->config['amm_links_show_icons']=='y') 102 100 { 103 101 for($i=0;$i<count($urls);$i++) … … 107 105 } 108 106 109 $block->set_title( base64_decode($this-> my_config['amm_links_title'][$user['language']]) );107 $block->set_title( base64_decode($this->config['amm_links_title'][$user['language']]) ); 110 108 $block->template = dirname(__FILE__).'/menu_templates/menubar_links.tpl'; 111 109 112 110 $block->data = array( 113 111 'LINKS' => $urls, 114 'icons' => $this-> my_config['amm_links_show_icons']112 'icons' => $this->config['amm_links_show_icons'] 115 113 ); 116 114 } … … 178 176 $blocks['special']->data=Array(); 179 177 180 $users=new users("");181 $groups=new groups("");178 $users=new GPCUsers(""); 179 $groups=new GPCGroups(""); 182 180 $user_groups=$this->get_user_groups($user['id']); 183 181 184 foreach($this-> my_config['amm_sections_items'] as $key => $val)182 foreach($this->config['amm_sections_items'] as $key => $val) 185 183 { 186 184 if(isset($menuItems[$key])) 187 185 { 188 186 $access=explode("/",$val['visibility']); 189 $users->set _alloweds(str_replace(",", "/", $access[0]));190 $groups->set _alloweds(str_replace(",", "/", $access[1]));187 $users->setAlloweds(str_replace(",", "/", $access[0])); 188 $groups->setAlloweds(str_replace(",", "/", $access[1])); 191 189 192 190 /* test if user status is allowed to access the menu item 193 191 * if access is managed by group, the user have to be associated with an allowed group to access the menu item 194 192 */ 195 if($users->is _allowed($user['status']) && (193 if($users->isAllowed($user['status']) && ( 196 194 ($access[1]=='') || 197 (($access[1]!='') && $groups->are _allowed($user_groups)))195 (($access[1]!='') && $groups->areAllowed($user_groups))) 198 196 ) 199 197 { … … 241 239 break; 242 240 } 243 $this->ajax->return_result($result);241 GPCAjax::returnResult($result); 244 242 } 245 243 } … … 254 252 $local_tpl = new Template(AMM_PATH."menu_templates/", ""); 255 253 $local_tpl->set_filename('body_page', 256 dirname($this-> filelocation).'/menu_templates/menubar_randompic_inner.tpl');254 dirname($this->getFileLocation()).'/menu_templates/menubar_randompic_inner.tpl'); 257 255 258 256 $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 … … 285 283 'IMGNAME' => $nfo['imgname'], 286 284 'IMGCOMMENT' => $nfo['comment'], 287 'SHOWNAME' => $this-> my_config['amm_randompicture_showname'],288 'SHOWCOMMENT' => $this-> my_config['amm_randompicture_showcomment']285 'SHOWNAME' => $this->config['amm_randompicture_showname'], 286 'SHOWCOMMENT' => $this->config['amm_randompicture_showcomment'] 289 287 ); 290 288 } … … 320 318 { 321 319 $local_tpl = new Template(AMM_PATH."admin/", ""); 322 $local_tpl->set_filename('body_page', dirname($this-> filelocation).'/menu_templates/menubar_randompic.js.tpl');320 $local_tpl->set_filename('body_page', dirname($this->getFileLocation()).'/menu_templates/menubar_randompic.js.tpl'); 323 321 324 322 $data = array( 325 "delay" => $this-> my_config['amm_randompicture_periodicchange'],326 "blockHeight" => $this-> my_config['amm_randompicture_height'],323 "delay" => $this->config['amm_randompicture_periodicchange'], 324 "blockHeight" => $this->config['amm_randompicture_height'], 327 325 "firstPicture" => $this->ajax_amm_get_random_picture() 328 326 ); -
extensions/AMenuManager/amm_root.class.inc.php
r5426 r5545 17 17 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 18 18 19 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/common_plugin.class.inc.php');20 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/users_groups.class.inc.php');21 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/css.class.inc.php');22 23 24 class AMM_root extends common_plugin19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCUsersGroups.class.inc.php'); 21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); 22 23 24 class AMM_root extends CommonPlugin 25 25 { 26 26 protected $css; //the css object … … 41 41 ); 42 42 43 function AMM_root($prefixeTable, $filelocation)44 { 45 $this-> plugin_name="Advanced Menu Manager";46 $this-> plugin_name_files="amm";43 public function __construct($prefixeTable, $filelocation) 44 { 45 $this->setPluginName("Advanced Menu Manager"); 46 $this->setPluginNameFiles("amm"); 47 47 parent::__construct($prefixeTable, $filelocation); 48 48 49 49 $list=array('urls', 'personalised'); 50 $this->set_tables_list($list); 50 $this->setTablesList($list); 51 } 52 53 public function __destruct() 54 { 55 unset($this->css); 56 unset($this->defaultMenus); 57 parent::__destruct(); 51 58 } 52 59 … … 56 63 57 64 /* this function initialize var $my_config with default values */ 58 public function init _config()59 { 60 $this-> my_config=array(65 public function initConfig() 66 { 67 $this->config=array( 61 68 'amm_links_show_icons' => 'y', 62 69 'amm_links_title' => array(), … … 74 81 if($key=='fr_FR') 75 82 { 76 $this-> my_config['amm_links_title'][$key]=base64_encode('Liens');77 $this-> my_config['amm_randompicture_title'][$key]=base64_encode('Une image au hasard');83 $this->config['amm_links_title'][$key]=base64_encode('Liens'); 84 $this->config['amm_randompicture_title'][$key]=base64_encode('Une image au hasard'); 78 85 } 79 86 else 80 87 { 81 $this-> my_config['amm_links_title'][$key]=base64_encode('Links');82 $this-> my_config['amm_randompicture_title'][$key]=base64_encode('A random picture');83 } 84 } 85 } 86 87 public function load _config()88 { 89 parent::load _config();90 } 91 92 public function init _events()88 $this->config['amm_links_title'][$key]=base64_encode('Links'); 89 $this->config['amm_randompicture_title'][$key]=base64_encode('A random picture'); 90 } 91 } 92 } 93 94 public function loadConfig() 95 { 96 parent::loadConfig(); 97 } 98 99 public function initEvents() 93 100 { 94 101 add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') ); … … 204 211 protected function sortSectionsItems() 205 212 { 206 uasort($this-> my_config['amm_sections_items'], array($this, "sortSectionsItemsCompare"));213 uasort($this->config['amm_sections_items'], array($this, "sortSectionsItemsCompare")); 207 214 } 208 215 -
extensions/AMenuManager/language/fr_FR/plugin.lang.php
r4389 r5545 1 1 <?php 2 2 3 $lang[' Grum Plugin Classes is not installed'] = 'Le plugin <b>Grum Plugin Classes</b> n\'est pas installé';3 $lang['To install this plugin, you need to install Grum Plugin Classes %s before'] = 'Pour installer ce plugin, vous devez au préalable, installer le plugin Grum Plugin Classes %s'; 4 4 5 5 $lang['g002_title_page'] = 'Gestion avancée du menu'; -
extensions/AMenuManager/main.inc.php
r5421 r5545 127 127 include_once("amm_aim.class.inc.php"); 128 128 $obj = new AMM_AIM($prefixeTable, __FILE__); 129 $obj->init _events();129 $obj->initEvents(); 130 130 set_plugin_data($plugin['id'], $obj); 131 131 } -
extensions/AMenuManager/maintain.inc.php
r5427 r5545 8 8 defined('AMM_DIR') || define('AMM_DIR' , basename(dirname(__FILE__))); 9 9 defined('AMM_PATH') || define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/'); 10 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 10 11 include_once('amm_version.inc.php'); // => Don't forget to update this file !! 12 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php'); 13 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 11 14 12 15 13 global $gpc_installed, $ lang; //needed for plugin manager compatibility16 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 14 17 15 18 /* ----------------------------------------------------------------------------- … … 17 20 ----------------------------------------------------------------------------- */ 18 21 $gpc_installed=false; 19 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 22 $gpcNeeded="3.0.0"; 23 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 20 24 { 21 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php'); 22 // need GPC release greater or equal than 2.0.5 23 24 if(checkGPCRelease(2,0,5)) 25 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 26 // need GPC release greater or equal than 3.0.0 27 if(CommonPlugin::checkGPCRelease(3,0,0)) 25 28 { 26 29 @include_once("amm_install.class.inc.php"); … … 31 34 function gpcMsgError(&$errors) 32 35 { 33 array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.5")); 36 global $gpcNeeded; 37 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 38 if(is_array($errors)) 39 { 40 array_push($errors, $msg); 41 } 42 else 43 { 44 $errors=Array($msg); 45 } 34 46 } 35 47 // ----------------------------------------------------------------------------- … … 41 53 function plugin_install($plugin_id, $plugin_version, &$errors) 42 54 { 43 global $prefixeTable, $gpc_installed ;55 global $prefixeTable, $gpc_installed, $gpcNeeded; 44 56 if($gpc_installed) 45 57 { … … 48 60 $amm=new AMM_install($prefixeTable, __FILE__); 49 61 $result=$amm->install(); 62 GPCCore::register($amm->getPluginName(), AMM_VERSION, $gpcNeeded); 50 63 } 51 64 else … … 69 82 function plugin_uninstall($plugin_id) 70 83 { 71 global $prefixeTable ;84 global $prefixeTable, $gpc_installed; 72 85 if($gpc_installed) 73 86 { 74 87 $amm=new AMM_install($prefixeTable, __FILE__); 75 88 $result=$amm->uninstall(); 89 GPCCore::unregister($amm->getPluginName()); 76 90 } 77 91 else -
extensions/AMenuManager/menu_templates/menubar_randompic.tpl
r4363 r5545 1 {known_script id="jquery" src=$ROOT_URL|cat:"t emplate-common/lib/jquery.packed.js"}1 {known_script id="jquery" src=$ROOT_URL|cat:"themes/default/js/jquery.packed.js"} 2 2 3 3 <!-- random picture menu bar -->
Note: See TracChangeset
for help on using the changeset viewer.