Changeset 5548 for extensions/lmt
- Timestamp:
- Apr 1, 2010, 9:05:29 PM (14 years ago)
- Location:
- extensions/lmt
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/lmt/admin/plugin_admin.php
r3396 r5548 22 22 $main_plugin_object = get_plugin_data($plugin_id); 23 23 24 $plugin_aip = new LMT_AIP($prefixeTable, $main_plugin_object->get _filelocation());24 $plugin_aip = new LMT_AIP($prefixeTable, $main_plugin_object->getFileLocation()); 25 25 $plugin_aip->manage(); 26 26 ?> -
extensions/lmt/admin/plugin_admin_list.tpl
r4396 r5548 3 3 function loadpage(pagenum) 4 4 { 5 http_request=create_httpobject('get', '', '{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}'+pagenum+"&filter="+$("#filter").val(), false); 6 http_request.send(null); 7 8 tmp=http_request.responseText; 5 tmp=$.ajax({ 6 type: "POST", 7 url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}"+pagenum+"&filter="+$("#filter").val(), 8 async: false, 9 }).responseText; 9 10 10 11 $("#nbphotos").attr("innerHTML", tmp.substr(0,tmp.indexOf("#"))); -
extensions/lmt/admin/plugin_admin_manage.tpl
r3396 r5548 10 10 function loadpage(pagenum) 11 11 { 12 http_request=create_httpobject('get', '', '{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}'+pagenum, false); 13 http_request.send(null); 12 tmp=$.ajax({ 13 type: "POST", 14 url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}"+pagenum, 15 async: false, 16 }).responseText; 14 17 15 tmp=http_request.responseText;16 17 18 $("#nbphotos").attr("innerHTML", tmp.substr(0,tmp.indexOf("#"))); 18 19 $("#list").attr("innerHTML", tmp.substr(tmp.indexOf("#")+1)); … … 32 33 $("#img"+id).attr("className", "is_on"); 33 34 $(document).data("nbsel", $(document).data("nbsel")+1); 34 } 35 } 35 36 $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0); 36 37 } … … 43 44 case '-': 44 45 break; 45 case 'all': 46 case 'all': 46 47 $(document).data("nbsel", {/literal}{$nbphotos}{literal}); 47 48 $("input").filter(".none").each( 48 function(i) 49 { 50 this.value="1"; 49 function(i) 50 { 51 this.value="1"; 51 52 $("#img"+this.id).attr("className", "is_on"); 52 } 53 ); 53 } 54 ); 54 55 break; 55 56 case 'none': 56 57 $(document).data("nbsel", 0); 57 58 $("input").filter(".none").each( 58 function(i) 59 { 60 this.value="0"; 59 function(i) 60 { 61 this.value="0"; 61 62 $("#img"+this.id).attr("className", "is_off"); 62 } 63 ); 63 } 64 ); 64 65 break; 65 66 case 'invert': 66 67 $("input").filter(".none").each( 67 function(i) 68 { 68 function(i) 69 { 69 70 if(this.value=="1") 70 71 { … … 79 80 $(document).data("nbsel", $(document).data("nbsel")+1); 80 81 } 81 } 82 ); 82 } 83 ); 83 84 break; 84 85 default: 85 86 $(document).data("nbsel", 0); 86 87 $("input").filter(".none").each( 87 function(i) 88 { 88 function(i) 89 { 89 90 if(this.alt==act) 90 91 { … … 93 94 $(document).data("nbsel", $(document).data("nbsel")+1); 94 95 } 95 } 96 ); 96 } 97 ); 97 98 break; 98 } 99 } 99 100 $("#selectlist").get(0).options[0].selected=true; 100 101 $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0); -
extensions/lmt/language/fr_FR/plugin.lang.php
r4396 r5548 180 180 //1.1.0 181 181 $lang["lmt_help_config"][10] = "Si activé, l'ouverture de la page vers laquelle pointe l'hyperlien sera effectuée dans une nouvelle fenêtre."; 182 $lang["lmt_cfg_warning_target"] = "Forcer l'ouverture dans une nouvelle fenêtre" 182 $lang["lmt_cfg_warning_target"] = "Forcer l'ouverture dans une nouvelle fenêtre"; 183 183 184 // 1.2.0 185 $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'; 184 186 185 187 -
extensions/lmt/lmt_aim.class.inc.php
r3396 r5548 19 19 20 20 class LMT_AIM extends LMT_root 21 { 22 public function LMT_AIM($prefixeTable, $filelocation)21 { 22 public function __construct($prefixeTable, $filelocation) 23 23 { 24 24 parent::__construct($prefixeTable, $filelocation); … … 28 28 initialize events call for the plugin 29 29 */ 30 public function init _events()30 public function initEvents() 31 31 { 32 parent::init _events();33 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin _admin_menu') );32 parent::initEvents(); 33 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); 34 34 } 35 35 -
extensions/lmt/lmt_aip.class.inc.php
r5431 r5548 15 15 16 16 include_once('lmt_root.class.inc.php'); 17 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/translate.class.inc.php');18 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/tables.class.inc.php');19 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/genericjs.class.inc.php');20 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/pages_navigation.class.inc.php');17 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTranslate.class.inc.php'); 18 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/genericjs.class.inc.php'); 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPagesNavigation.class.inc.php'); 21 21 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 22 22 … … 26 26 protected $tabsheet; 27 27 28 public function LMT_AIP($prefixeTable, $filelocation)28 public function __construct($prefixeTable, $filelocation) 29 29 { 30 30 parent::__construct($prefixeTable, $filelocation); 31 $this->load _config();32 $this->init _events();31 $this->loadConfig(); 32 $this->initEvents(); 33 33 34 34 $this->tabsheet = new tabsheet(); 35 35 $this->tabsheet->add('list', 36 36 l10n('lmt_list'), 37 $this-> page_link."&f_tabsheet=list");37 $this->getAdminLink()."&f_tabsheet=list"); 38 38 $this->tabsheet->add('manage', 39 39 l10n('lmt_manage'), 40 $this-> page_link."&f_tabsheet=manage");40 $this->getAdminLink()."&f_tabsheet=manage"); 41 41 $this->tabsheet->add('manageaut', 42 42 l10n('lmt_manageaut'), 43 $this-> page_link."&f_tabsheet=manageaut");43 $this->getAdminLink()."&f_tabsheet=manageaut"); 44 44 $this->tabsheet->add('config', 45 45 l10n('lmt_config'), 46 $this-> page_link."&f_tabsheet=config");46 $this->getAdminLink()."&f_tabsheet=config"); 47 47 $this->tabsheet->add('help', 48 48 l10n('lmt_help'), 49 $this->page_link."&f_tabsheet=help"); 50 51 // don't create this object inside root classe otherwise header is modified 52 // everywhere in admin pages 53 $this->ajax = new Ajax(); 49 $this->getAdminLink()."&f_tabsheet=help"); 50 54 51 55 52 // don't create the google_translate object everytime, otherwise google's js … … 59 56 /*if((isset($_POST['fmypolls_gomodify_translation'])||isset($_POST['fmypolls_goadd_translation']))) 60 57 { 61 $this->google_translate = new translate();58 $this->google_translate = new GPCTranslate(); 62 59 } 63 60 */ 61 } 62 63 public function __destruct() 64 { 65 unset($this->google_translate); 66 unset($this->tabsheet); 67 parent::__destruct(); 64 68 } 65 69 … … 67 71 initialize events call for the plugin 68 72 */ 69 public function init _events()70 { 71 parent::init _events();72 add_event_handler('loc_end_page_header', array(&$this->css, 'apply _CSS'));73 add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply _CSS'));73 public function initEvents() 74 { 75 parent::initEvents(); 76 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 77 add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS')); 74 78 } 75 79 … … 117 121 $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]"); 118 122 119 $template_plugin["LMT_VERSION"] = "<i>".$this-> plugin_name."</i> ".l10n('lmt_release').LMT_VERSION;123 $template_plugin["LMT_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('lmt_release').LMT_VERSION; 120 124 $template_plugin["LMT_PAGE"] = $_REQUEST['f_tabsheet']; 121 125 $template_plugin["LMT_TITLE"] = ""; … … 146 150 break; 147 151 } 148 //$template-> 149 $this->ajax->return_result($result); 152 GPCAjax::returnResult($result); 150 153 } 151 154 } … … 163 166 if(isset($_POST['submit_save_config'])) 164 167 { 165 foreach($this-> my_config as $key => $val)168 foreach($this->config as $key => $val) 166 169 { 167 170 if(is_array($val)) … … 171 174 if(isset($_REQUEST[str2url('f_'.$key.'_'.$key2)])) 172 175 { 173 $this-> my_config[$key][$key2] = htmlspecialchars(stripslashes($_REQUEST[str2url('f_'.$key.'_'.$key2)]), ENT_QUOTES);176 $this->config[$key][$key2] = htmlspecialchars(stripslashes($_REQUEST[str2url('f_'.$key.'_'.$key2)]), ENT_QUOTES); 174 177 } 175 178 } … … 179 182 if(isset($_REQUEST['f_'.$key])) 180 183 { 181 $this-> my_config[$key] = $_REQUEST['f_'.$key];184 $this->config[$key] = $_REQUEST['f_'.$key]; 182 185 } 183 186 } 184 187 185 188 } 186 $this->display _result(l10n('lmt_save_config'), $this->save_config());189 $this->displayResult(l10n('lmt_save_config'), $this->saveConfig()); 187 190 } 188 191 } … … 199 202 200 203 $template->set_filename('body_page', 201 dirname($this-> filelocation).'/admin/plugin_admin_help.tpl');204 dirname($this->getFileLocation()).'/admin/plugin_admin_help.tpl'); 202 205 203 206 $template->assign('imgdir', LMT_PATH."img/"); … … 213 216 214 217 $template->set_filename('body_page', 215 dirname($this-> filelocation).'/admin/plugin_admin_list.tpl');218 dirname($this->getFileLocation()).'/admin/plugin_admin_list.tpl'); 216 219 217 220 if(!isset($_REQUEST['filter']) || … … 230 233 231 234 $datas=array( 232 "LMT_AJAX_URL_LIST" => $this-> page_link.'&ajaxfct=img_list&numpage='235 "LMT_AJAX_URL_LIST" => $this->getAdminLink().'&ajaxfct=img_list&numpage=' 233 236 ); 234 237 … … 247 250 $filter_list_values = array_merge(array(''), $filter_list_values); 248 251 $filter_list_labels = array_merge(array(l10n('lmt_nofilter')), $filter_list_labels); 249 $default_licence = l10n("lmt_lbl_cc-".strtolower($this-> my_config['lmt_licence_default']));250 $default_licence_img =LMT_PATH."img/".strtolower($this-> my_config['lmt_licence_default'])."_80x15.png";252 $default_licence = l10n("lmt_lbl_cc-".strtolower($this->config['lmt_licence_default'])); 253 $default_licence_img =LMT_PATH."img/".strtolower($this->config['lmt_licence_default'])."_80x15.png"; 251 254 252 255 $results=true; … … 272 275 if((!$results)||(!$result)) 273 276 { 274 $this->display _result(l10n("lmt_caddie_not_updated"), false);277 $this->displayResult(l10n("lmt_caddie_not_updated"), false); 275 278 } 276 279 else 277 280 { 278 $this->display _result(l10n("lmt_caddie_updated"), true);281 $this->displayResult(l10n("lmt_caddie_updated"), true); 279 282 } 280 283 } … … 347 350 if($results[0]!="") 348 351 { 349 $this->display _result($results[0], true);352 $this->displayResult($results[0], true); 350 353 } 351 354 352 355 if($results[1]!="") 353 356 { 354 $this->display _result($results[1], false);357 $this->displayResult($results[1], false); 355 358 } 356 359 } 357 360 else 358 361 { 359 $this->display _result(l10n("lmt_no_element_selected"), false);362 $this->displayResult(l10n("lmt_no_element_selected"), false); 360 363 } 361 364 } … … 363 366 364 367 $template->set_filename('body_page', 365 dirname($this-> filelocation).'/admin/plugin_admin_manage.tpl');368 dirname($this->getFileLocation()).'/admin/plugin_admin_manage.tpl'); 366 369 367 370 $datas=array( 368 "LMT_AJAX_URL_LIST" => $this-> page_link.'&ajaxfct=manage_list&numpage='371 "LMT_AJAX_URL_LIST" => $this->getAdminLink().'&ajaxfct=manage_list&numpage=' 369 372 ); 370 373 … … 435 438 436 439 $template->set_filename('body_page', 437 dirname($this-> filelocation).'/admin/plugin_admin_config.tpl');440 dirname($this->getFileLocation()).'/admin/plugin_admin_config.tpl'); 438 441 439 442 … … 441 444 "img_directory" => LMT_PATH."img/" 442 445 ); 443 foreach($this-> my_config as $key => $val)446 foreach($this->config as $key => $val) 444 447 { 445 448 if(!is_array($val)) … … 489 492 $datas['lmt_warning_texts'][]=array( 490 493 'lang' => str2url($key), 491 'text' => $this-> my_config['lmt_warning_texts'][$key]494 'text' => $this->config['lmt_warning_texts'][$key] 492 495 ); 493 496 … … 495 498 { 496 499 $datas['lmt_redirect_urls'][str2url('lmt_redirect_url-'.strToLower($val2))]['langs'][str2url($key)]= 497 $this-> my_config['lmt_redirect_url-'.strToLower($val2)][$key];500 $this->config['lmt_redirect_url-'.strToLower($val2)][$key]; 498 501 } 499 502 } … … 565 568 if($result) 566 569 { 567 $this->display _result(l10n("lmt_author_added"), true);570 $this->displayResult(l10n("lmt_author_added"), true); 568 571 $_REQUEST['action']="list"; 569 572 } 570 573 else 571 574 { 572 $this->display _result(l10n("lmt_cannot_add_author"), false);575 $this->displayResult(l10n("lmt_cannot_add_author"), false); 573 576 } 574 577 } 575 578 else 576 579 { 577 $this->display _result(l10n("lmt_no_text"), false);580 $this->displayResult(l10n("lmt_no_text"), false); 578 581 } 579 582 } … … 593 596 if($result) 594 597 { 595 $this->display _result(l10n("lmt_author_modified"), true);598 $this->displayResult(l10n("lmt_author_modified"), true); 596 599 $_REQUEST['action']="list"; 597 600 } 598 601 else 599 602 { 600 $this->display _result(l10n("lmt_cannot_modify_author"), false);603 $this->displayResult(l10n("lmt_cannot_modify_author"), false); 601 604 } 602 605 } 603 606 else 604 607 { 605 $this->display _result(l10n("lmt_no_text"), false);608 $this->displayResult(l10n("lmt_no_text"), false); 606 609 } 607 610 } … … 618 621 if(pwg_db_changes()==1) 619 622 { 620 $this->display _result(l10n("lmt_author_deleted"), true);623 $this->displayResult(l10n("lmt_author_deleted"), true); 621 624 622 625 $sql="UPDATE ".$this->tables["images"]." SET author_id = NULL … … 628 631 if($nbimages>0) 629 632 { 630 $this->display _result($nbimages." ".l10n("lmt_author_nb_images_updated"), true);633 $this->displayResult($nbimages." ".l10n("lmt_author_nb_images_updated"), true); 631 634 } 632 635 } 633 636 else 634 637 { 635 $this->display _result(l10n("lmt_cannot_delete_author"), false);638 $this->displayResult(l10n("lmt_cannot_delete_author"), false); 636 639 } 637 640 } 638 641 else 639 642 { 640 $this->display _result(l10n("lmt_cannot_delete_author"), false);643 $this->displayResult(l10n("lmt_cannot_delete_author"), false); 641 644 } 642 645 } 643 646 else 644 647 { 645 $this->display _result(l10n("lmt_cannot_delete_author"), false);648 $this->displayResult(l10n("lmt_cannot_delete_author"), false); 646 649 } 647 650 $this->display_manageaut_page_list(); … … 667 670 668 671 $template->set_filename('body_page', 669 dirname($this-> filelocation).'/admin/plugin_admin_manageaut.tpl');672 dirname($this->getFileLocation()).'/admin/plugin_admin_manageaut.tpl'); 670 673 671 674 $datas=array( 672 675 "author_list" => array(), 673 676 "img_directory" => LMT_PATH."img/", 674 "default_licencepublished" => l10n("lmt_lbl_under-".strToLower($this-> my_config['lmt_licence_default'])),675 "default_licenceL" => strToLower($this-> my_config['lmt_licence_default']),676 "default_licenceU" => l10n("lmt_lbl_cc_s-".strToLower($this-> my_config['lmt_licence_default'])),677 "lmt_licence_logo" => $this-> my_config['lmt_licence_logo'],677 "default_licencepublished" => l10n("lmt_lbl_under-".strToLower($this->config['lmt_licence_default'])), 678 "default_licenceL" => strToLower($this->config['lmt_licence_default']), 679 "default_licenceU" => l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default'])), 680 "lmt_licence_logo" => $this->config['lmt_licence_logo'], 678 681 "nbauthor" => 0, 679 "add_link" => $this-> page_link.'&f_tabsheet=manageaut&action=add'682 "add_link" => $this->getAdminLink().'&f_tabsheet=manageaut&action=add' 680 683 ); 681 684 … … 690 693 "text1" => $row['text1'], 691 694 "text2" => $row['text2'], 692 "lnk_delete" => $this-> page_link.'&f_tabsheet=manageaut&action=delete&id='.$row['id'],693 "lnk_edit" => $this-> page_link.'&f_tabsheet=manageaut&action=edit&id='.$row['id']695 "lnk_delete" => $this->getAdminLink().'&f_tabsheet=manageaut&action=delete&id='.$row['id'], 696 "lnk_edit" => $this->getAdminLink().'&f_tabsheet=manageaut&action=edit&id='.$row['id'] 694 697 ); 695 698 } … … 707 710 708 711 $template->set_filename('body_page', 709 dirname($this-> filelocation).'/admin/plugin_admin_manageaut_edit.tpl');712 dirname($this->getFileLocation()).'/admin/plugin_admin_manageaut_edit.tpl'); 710 713 711 714 if($_REQUEST["action"]=="edit") … … 745 748 } 746 749 747 $datas["urllist"] = $this-> page_link.'&f_tabsheet=manageaut';750 $datas["urllist"] = $this->getAdminLink().'&f_tabsheet=manageaut'; 748 751 749 752 $template->assign('datas', $datas); … … 761 764 if(is_adviser()) 762 765 { 763 $this->display _result(l10n("lmt_adviser_not_allowed"), false);766 $this->displayResult(l10n("lmt_adviser_not_allowed"), false); 764 767 return(true); 765 768 } … … 775 778 $local_tpl = new Template(LMT_PATH."admin/", ""); 776 779 $local_tpl->set_filename('body_page', 777 dirname($this-> filelocation).'/admin/lmt_js.tpl');780 dirname($this->getFileLocation()).'/admin/lmt_js.tpl'); 778 781 779 782 $lmt_licence_default_values=array_slice($this->licences,0,count($this->licences)-1); … … 833 836 $local_tpl = new Template(LMT_PATH."admin/", ""); 834 837 $local_tpl->set_filename('body_page', 835 dirname($this-> filelocation).'/admin/plugin_admin_listitems.tpl');838 dirname($this->getFileLocation()).'/admin/plugin_admin_listitems.tpl'); 836 839 837 840 if(!isset($_REQUEST['filter']) || … … 870 873 $sql.=" GROUP BY lmti.image_id ORDER BY cat.id, img.id "; 871 874 872 if($this-> my_config['lmt_list_maxitems']>0)873 { 874 $refdbt = ($pagenum-1)*$this-> my_config['lmt_list_maxitems'];875 $sql.=" LIMIT ".$refdbt.", ".$this-> my_config['lmt_list_maxitems'];875 if($this->config['lmt_list_maxitems']>0) 876 { 877 $refdbt = ($pagenum-1)*$this->config['lmt_list_maxitems']; 878 $sql.=" LIMIT ".$refdbt.", ".$this->config['lmt_list_maxitems']; 876 879 } 877 880 … … 921 924 $nb=pwg_db_fetch_row($result); 922 925 923 $ pages_navigation = new pages_navigation();924 $ pages_navigation->set_nb_items($nb[0]);925 $ pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);926 $ pages_navigation->set_current_page($pagenum);927 $ pages_navigation->set_options(array(926 $GPCPagesNavigation = new GPCPagesNavigation(); 927 $GPCPagesNavigation->setNbItems($nb[0]); 928 $GPCPagesNavigation->setNbItemsPerPage($this->config['lmt_list_maxitems']); 929 $GPCPagesNavigation->setCurrentPage($pagenum); 930 $GPCPagesNavigation->setOptions(array( 928 931 "text_prev" => l10n("lmt_nav_prev"), 929 932 "text_next" => l10n("lmt_nav_next"), … … 931 934 "text_last" => l10n("lmt_nav_last") 932 935 )); 933 $navbar=$ pages_navigation->make_navigation("loadpage");936 $navbar=$GPCPagesNavigation->makeNavigation("loadpage"); 934 937 if($navbar!="") 935 938 { … … 947 950 $local_tpl = new Template(LMT_PATH."admin/", ""); 948 951 $local_tpl->set_filename('body_page', 949 dirname($this-> filelocation).'/admin/plugin_admin_manageitems.tpl');952 dirname($this->getFileLocation()).'/admin/plugin_admin_manageitems.tpl'); 950 953 951 954 if(!isset($_REQUEST['select'])) … … 972 975 ORDER BY cat.id, img.id "; 973 976 974 if($this-> my_config['lmt_list_maxitems']>0)975 { 976 $refdbt = ($pagenum-1)*$this-> my_config['lmt_list_maxitems'];977 $sql.=" LIMIT ".$refdbt.", ".$this-> my_config['lmt_list_maxitems'];977 if($this->config['lmt_list_maxitems']>0) 978 { 979 $refdbt = ($pagenum-1)*$this->config['lmt_list_maxitems']; 980 $sql.=" LIMIT ".$refdbt.", ".$this->config['lmt_list_maxitems']; 978 981 } 979 982 … … 1023 1026 $nb=pwg_db_fetch_row($result); 1024 1027 1025 $ pages_navigation = new pages_navigation();1026 $ pages_navigation->set_nb_items($nb[0]);1027 $ pages_navigation->set_nb_items_per_page($this->my_config['lmt_list_maxitems']);1028 $ pages_navigation->set_current_page($pagenum);1029 $ pages_navigation->set_options(array(1028 $GPCPagesNavigation = new GPCPagesNavigation(); 1029 $GPCPagesNavigation->setNbItems($nb[0]); 1030 $GPCPagesNavigation->setNbItemsPerPage($this->config['lmt_list_maxitems']); 1031 $GPCPagesNavigation->setCurrentPage($pagenum); 1032 $GPCPagesNavigation->setOptions(array( 1030 1033 "text_prev" => l10n("lmt_nav_prev"), 1031 1034 "text_next" => l10n("lmt_nav_next"), … … 1033 1036 "text_last" => l10n("lmt_nav_last") 1034 1037 )); 1035 $navbar=$ pages_navigation->make_navigation("loadpage");1038 $navbar=$GPCPagesNavigation->makeNavigation("loadpage"); 1036 1039 if($navbar!="") 1037 1040 { … … 1045 1048 } //class 1046 1049 1050 1047 1051 ?> -
extensions/lmt/lmt_install.class.inc.php
r3396 r5548 13 13 14 14 --------------------------------------------------------------------------- */ 15 16 include_once('lmt_version.inc.php'); // => Don't forget to update this file !! 15 17 @include_once('lmt_root.class.inc.php'); 16 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 17 18 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 18 19 19 20 /* lmt class for install process */ … … 23 24 private $exportfile; 24 25 25 public function LMT_Install($prefixeTable, $filelocation)26 public function __construct($prefixeTable, $filelocation) 26 27 { 27 28 parent::__construct($prefixeTable, $filelocation); 28 $this->tablef= new manage_tables($this->tables);29 $this->exportfile=dirname($this-> filelocation).'/'.$this->plugin_name_files.'.sql';29 $this->tablef= new GPCTables($this->tables); 30 $this->exportfile=dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().'.sql'; 30 31 } 31 32 32 /* 33 function for installation process 34 return true if install process is ok, otherwise false 35 */ 33 public function __destruct() 34 { 35 unset($this->tablef); 36 unset($this->exportfile); 37 parent::__destruct(); 38 } 39 40 /* 41 function for installation process 42 return true if install process is ok, otherwise false 43 */ 36 44 public function install() 37 45 { 46 $this->initConfig(); 47 $this->loadConfig(); 48 $this->config['installed']=LMT_VERSION2; 49 $this->saveConfig(); 50 38 51 $tables_def=array( 39 52 "CREATE TABLE `".$this->tables['images']."` ( … … 44 57 KEY `by_licence` (`licence_type`), 45 58 KEY `by_author_id` (`author_id`) 46 ) 47 ENGINE=MyISAM 59 ) 60 ENGINE=MyISAM 48 61 CHARACTER SET utf8 COLLATE utf8_general_ci", 49 62 … … 59 72 60 73 //if present, try to import backup 61 //if backup file 74 //if backup file 62 75 $import=$this->tablef->import($this->exportfile); 63 76 if($import['errors']<0) 64 77 { 65 $result=$this->tablef->create _tables($tables_def);78 $result=$this->tablef->create($tables_def); 66 79 return($result); 67 80 } … … 79 92 { 80 93 $this->tablef->export($this->exportfile); 81 $this->delete _config();82 $this->tablef->drop _tables();94 $this->deleteConfig(); 95 $this->tablef->drop(); 83 96 return(''); 84 97 } … … 88 101 global $template; 89 102 90 $this->init_config(); 91 $this->load_config(); 92 $this->save_config(); 103 $this->initConfig(); 104 $this->loadConfig(); 105 $this->config['installed']=LMT_VERSION2; 106 $this->saveConfig(); 93 107 return(''); 94 108 } -
extensions/lmt/lmt_pip.class.inc.php
r4396 r5548 15 15 16 16 include_once('lmt_root.class.inc.php'); 17 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/public_integration.class.inc.php');17 //include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php'); 18 18 19 19 class LMT_PIP extends LMT_root … … 21 21 protected $section_page; 22 22 23 public function LMT_PIP($prefixeTable, $filelocation)23 public function __construct($prefixeTable, $filelocation) 24 24 { 25 25 parent::__construct($prefixeTable, $filelocation); 26 $this->load _config();26 $this->loadConfig(); 27 27 28 // don't create this object inside root classe otherwise header is modified29 // everywhere in admin pages30 $this->ajax = new Ajax();28 $this->initEvents(); 29 $this->load_lang(); 30 } 31 31 32 $this->init_events(); 33 $this->load_lang(); 32 public function __destruct() 33 { 34 unset($section_page); 35 parent::__destruct(); 34 36 } 35 37 … … 51 53 initialize events call for the plugin 52 54 */ 53 public function init _events()55 public function initEvents() 54 56 { 55 parent::init _events();57 parent::initEvents(); 56 58 /* 57 59 add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); 58 60 add_event_handler('loading_lang', array(&$this, 'load_lang')); 59 61 */ 60 if($this-> my_config['lmt_licence_activated']=='y')62 if($this->config['lmt_licence_activated']=='y') 61 63 { 62 add_event_handler('loc_end_page_header', array(&$this->css_icn, 'apply _CSS'));64 add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS')); 63 65 add_event_handler('loc_end_picture', array(&$this, 'manage_licence_element')); 64 66 65 if($this-> my_config['lmt_warning_visible']=='y')67 if($this->config['lmt_warning_visible']=='y') 66 68 { 67 69 add_event_handler('loc_end_page_tail', array(&$this, 'manage_warning_text')); … … 85 87 } 86 88 87 if($this-> my_config['lmt_redirect_activated']=='y')89 if($this->config['lmt_redirect_activated']=='y') 88 90 { 89 $url=$this-> my_config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']];91 $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']]; 90 92 if($url=='') 91 93 { 92 $url=$this-> my_config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK'];94 $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK']; 93 95 } 94 96 } … … 100 102 $style=""; 101 103 $text=""; 102 $target=($this-> my_config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":"";103 switch($this-> my_config['lmt_licence_logo'])104 $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":""; 105 switch($this->config['lmt_licence_logo']) 104 106 { 105 107 case '80x15': … … 144 146 145 147 146 if(isset($this-> my_config['lmt_warning_texts'][$user['language']]))148 if(isset($this->config['lmt_warning_texts'][$user['language']])) 147 149 { 148 $text=$this-> my_config['lmt_warning_texts'][$user['language']];150 $text=$this->config['lmt_warning_texts'][$user['language']]; 149 151 } 150 152 else 151 153 { 152 $text=$this-> my_config['lmt_warning_texts']['en_UK'];154 $text=$this->config['lmt_warning_texts']['en_UK']; 153 155 } 154 156 155 157 $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i'); 156 158 $replacements = array( 157 "<img class='logo80x15' src='". LMT_PATH."img/".strToLower($this-> my_config['lmt_licence_default'])."_80x15.png'>",158 "<img class='logo88x31' src='". LMT_PATH."img/".strToLower($this-> my_config['lmt_licence_default'])."_88x31.png'>",159 l10n("lmt_lbl_cc_s-".strToLower($this-> my_config['lmt_licence_default']))159 "<img class='logo80x15' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_80x15.png'>", 160 "<img class='logo88x31' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_88x31.png'>", 161 l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default'])) 160 162 ); 161 163 162 if($this-> my_config['lmt_redirect_activated']=='y')164 if($this->config['lmt_redirect_activated']=='y') 163 165 { 164 $url=$this-> my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])][$user['language']];166 $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])][$user['language']]; 165 167 if($url=='') 166 168 { 167 $url=$this-> my_config['lmt_redirect_url-'.strToLower($this->my_config['lmt_licence_default'])]['en_UK'];169 $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])]['en_UK']; 168 170 } 169 171 if($url!="") 170 172 { 171 $target=($this-> my_config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":"";173 $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":""; 172 174 $replacements[0]="<a href='".$url."'".$target.">".$replacements[0]."</a>"; 173 175 $replacements[1]="<a href='".$url."'".$target.">".$replacements[1]."</a>"; -
extensions/lmt/lmt_root.class.inc.php
r5431 r5548 13 13 14 14 --------------------------------------------------------------------------- */ 15 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'); 16 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php'); 17 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php'); 18 global $ajax; 19 20 class LMT_root extends common_plugin 15 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 16 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); 17 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 18 19 class LMT_root extends CommonPlugin 21 20 { 22 21 protected $css; //the css object … … 25 24 protected $licences=array('BY', 'BY-ND', 'BY-NC', 'BY-NC-ND', 'BY-NC-SA', 'BY-SA', 'CRIGHT', 'CLEFT', 'DEFAULT'); 26 25 27 public function LMT_root($prefixeTable, $filelocation) 28 { 29 $this->plugin_name='LMT'; 30 $this->plugin_name_files="lmt"; 31 parent::common_plugin($prefixeTable, $filelocation); 32 $this->section_name=$this->plugin_name_files; 33 34 $this->set_tables_list(array('images', 'licence_author', 'licence_doc')); 35 36 37 $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css"); 38 $this->css_icn = new css(dirname($this->filelocation).'/'.$this->plugin_name_files."_icn.css"); 39 } 40 41 public function init_events() 26 public function __construct($prefixeTable, $filelocation) 27 { 28 $this->setPluginName('LMT'); 29 $this->setPluginNameFiles("lmt"); 30 parent::__construct($prefixeTable, $filelocation); 31 $this->section_name=$this->getPluginNameFiles(); 32 33 $this->setTablesList(array('images', 'licence_author')); 34 35 36 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); 37 $this->css_icn = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."_icn.css"); 38 } 39 40 public function __destruct() 41 { 42 unset($this->css); 43 unset($this->css_icn); 44 unset($this->licences); 45 parent::__destruct(); 46 } 47 48 public function initEvents() 42 49 { 43 50 add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') ); … … 54 61 55 62 /* 56 surchage of common_plugin->save_config function57 */ 58 public function save _config()59 { 60 if(parent::save _config())61 { 62 $this->css->make _CSS($this->generate_CSS());63 $this->css_icn->make _CSS($this->generate_CSS2());63 surchage of CommonPlugin->saveConfig function 64 */ 65 public function saveConfig() 66 { 67 if(parent::saveConfig()) 68 { 69 $this->css->makeCSS($this->generate_CSS()); 70 $this->css_icn->makeCSS($this->generate_CSS2()); 64 71 return(true); 65 72 } … … 68 75 69 76 /* 70 surchage of common_plugin->save_config function71 */ 72 public function load _config()73 { 74 parent::load _config();75 if(!$this->css-> css_file_exists())76 { 77 $this->css->make _CSS($this->generate_CSS());78 } 79 if(!$this->css_icn-> css_file_exists())80 { 81 $this->css_icn->make _CSS($this->generate_CSS2());77 surchage of CommonPlugin->saveConfig function 78 */ 79 public function loadConfig() 80 { 81 parent::loadConfig(); 82 if(!$this->css->fileExists()) 83 { 84 $this->css->makeCSS($this->generate_CSS()); 85 } 86 if(!$this->css_icn->fileExists()) 87 { 88 $this->css_icn->makeCSS($this->generate_CSS2()); 82 89 } 83 90 } … … 86 93 intialize default values 87 94 */ 88 public function init _config()95 public function initConfig() 89 96 { 90 97 //global $user; 91 $this-> my_config=array(98 $this->config=array( 92 99 'lmt_mouseovercolor' => '303030', /**/ 93 100 'lmt_list_maxheight' => '650', … … 117 124 $lang=substr($key,0,2)."/"; 118 125 if($lang=="en/") { $lang=""; } 119 $this-> my_config['lmt_warning_texts'][$key]='';120 $this-> my_config['lmt_redirect_url-by'][$key]='http://creativecommons.org/licenses/by/2.0/'.$lang;121 $this-> my_config['lmt_redirect_url-by-nd'][$key]='http://creativecommons.org/licenses/by-nd/2.0/'.$lang;122 $this-> my_config['lmt_redirect_url-by-nc'][$key]='http://creativecommons.org/licenses/by-nc/2.0/'.$lang;123 $this-> my_config['lmt_redirect_url-by-nc-nd'][$key]='http://creativecommons.org/licenses/by-nc-nd/2.0/'.$lang;124 $this-> my_config['lmt_redirect_url-by-nc-sa'][$key]='http://creativecommons.org/licenses/by-nc-sa/2.0/'.$lang;125 $this-> my_config['lmt_redirect_url-by-sa'][$key]='http://creativecommons.org/licenses/by-sa/2.0/'.$lang;126 $this-> my_config['lmt_redirect_url-cright'][$key]='';127 $this-> my_config['lmt_redirect_url-cleft'][$key]='';126 $this->config['lmt_warning_texts'][$key]=''; 127 $this->config['lmt_redirect_url-by'][$key]='http://creativecommons.org/licenses/by/2.0/'.$lang; 128 $this->config['lmt_redirect_url-by-nd'][$key]='http://creativecommons.org/licenses/by-nd/2.0/'.$lang; 129 $this->config['lmt_redirect_url-by-nc'][$key]='http://creativecommons.org/licenses/by-nc/2.0/'.$lang; 130 $this->config['lmt_redirect_url-by-nc-nd'][$key]='http://creativecommons.org/licenses/by-nc-nd/2.0/'.$lang; 131 $this->config['lmt_redirect_url-by-nc-sa'][$key]='http://creativecommons.org/licenses/by-nc-sa/2.0/'.$lang; 132 $this->config['lmt_redirect_url-by-sa'][$key]='http://creativecommons.org/licenses/by-sa/2.0/'.$lang; 133 $this->config['lmt_redirect_url-cright'][$key]=''; 134 $this->config['lmt_redirect_url-cleft'][$key]=''; 128 135 } 129 136 … … 138 145 .TableRow:hover 139 146 { 140 background-color:#".$this-> my_config['lmt_mouseovercolor'].";147 background-color:#".$this->config['lmt_mouseovercolor']."; 141 148 } 142 149 … … 307 314 } 308 315 309 if(($return["licence"]=="")&&($this-> my_config["lmt_licence_visible"]=="y"))316 if(($return["licence"]=="")&&($this->config["lmt_licence_visible"]=="y")) 310 317 { 311 318 $return=array( 312 319 "defaut" => "y", 313 "licence" => $this-> my_config["lmt_licence_default"],320 "licence" => $this->config["lmt_licence_default"], 314 321 "aut_text1" => "", 315 322 "aut_text2" => "" … … 317 324 318 325 $sql="SELECT * FROM ".$this->tables['licence_author']." 319 WHERE id = '".$this-> my_config["lmt_licence_default_author"]."'";326 WHERE id = '".$this->config["lmt_licence_default_author"]."'"; 320 327 $result=pwg_query($sql); 321 328 if($result) … … 354 361 } 355 362 356 protected function display _result($action_msg, $result)363 protected function displayResult($action_msg, $result) 357 364 { 358 365 global $page; -
extensions/lmt/main.inc.php
r5431 r5548 76 76 define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/'); 77 77 78 define('LMT_VERSION' , '1.2.0'); // => ne pas oublier la version dans l'entête !!78 include_once('lmt_version.inc.php'); // => Don't forget to update this file !! 79 79 80 80 global $prefixeTable; 81 82 81 83 82 if(defined('IN_ADMIN')) … … 86 85 include_once("lmt_aim.class.inc.php"); 87 86 $obj=new LMT_AIM($prefixeTable, __FILE__); 88 $obj->init _events();87 $obj->initEvents(); 89 88 } 90 89 else -
extensions/lmt/maintain.inc.php
r5431 r5548 20 20 //ini_set('display_errors', true); 21 21 22 global $gpc_installed, $ lang; //needed for plugin manager compatibility22 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 23 23 24 24 /* ----------------------------------------------------------------------------- … … 26 26 ----------------------------------------------------------------------------- */ 27 27 $gpc_installed=false; 28 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 28 $gpcNeeded="3.0.0"; 29 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 29 30 { 30 @include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/main.inc.php');31 // need GPC release greater or equal than 2.0.532 if( checkGPCRelease(2,0,5))31 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 32 // need GPC release greater or equal than 3.0.0 33 if(CommonPlugin::checkGPCRelease(3,0,0)) 33 34 { 34 35 @include_once('lmt_install.class.inc.php'); … … 39 40 function gpcMsgError(&$errors) 40 41 { 41 array_push($errors, sprintf(l10n('lmt_gpc2_not_installed'), "2.0.5")); 42 global $gpcNeeded; 43 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 44 if(is_array($errors)) 45 { 46 array_push($errors, $msg); 47 } 48 else 49 { 50 $errors=Array($msg); 51 } 42 52 } 43 53 // ----------------------------------------------------------------------------- … … 51 61 function plugin_install($plugin_id, $plugin_version, &$errors) 52 62 { 53 global $prefixeTable, $gpc_installed ;63 global $prefixeTable, $gpc_installed, $gpcNeeded; 54 64 55 65 if($gpc_installed) … … 61 71 array_push($errors, "error"); 62 72 } 73 GPCCore::register($obj->getPluginName(), LMT_VERSION, $gpcNeeded); 63 74 } 64 75 else … … 109 120 $obj = new LMT_Install($prefixeTable, __FILE__); 110 121 $obj->uninstall(); 122 GPCCore::unregister($obj->getPluginName()); 111 123 } 112 124 else
Note: See TracChangeset
for help on using the changeset viewer.