Changeset 16012 for extensions/GrumPluginClasses/classes
- Timestamp:
- Jun 24, 2012, 9:18:26 PM (12 years ago)
- Location:
- extensions/GrumPluginClasses/classes
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/CommonPlugin.class.inc.php
r15340 r16012 2 2 /* ----------------------------------------------------------------------------- 3 3 class name: CommonPlugin 4 class version : 2. 2.05 plugin version : 3. 2.06 date : 201 0-07-284 class version : 2.3.0 5 plugin version : 3.5.2 6 date : 2012-06-24 7 7 8 8 ------------------------------------------------------------------------------ … … 51 51 | | | function 52 52 | | | 53 | 2.3.0 | 2012/06/24 | * Add loadCSS() function 54 | | | 53 55 | | | 54 56 | | | … … 64 66 private $page_link; //link to admin page 65 67 private $fileLocation; //files plugin location on server 68 private $pluginDirectory; //directory of plugin 66 69 private $displayResult_ok; 67 70 private $displayResult_ko; … … 122 125 } 123 126 124 /* constructor allows to initialize $prefixeTable value */ 127 /** 128 * constructor allows to initialize $prefixeTable value 129 * @param String $prefixeTable: prefix used for tables 130 * @param String $filelocation: file calling the constructor (__FILE__) 131 */ 125 132 public function __construct($prefixeTable, $filelocation) 126 133 { … … 129 136 $this->fileLocation=$filelocation; 130 137 $this->prefixeTable=$prefixeTable; 138 $this->pluginDirectory=basename(dirname($filelocation)); 131 139 $this->page_link=get_root_url().'admin.php?page=plugin-'.basename(dirname($this->getFileLocation())); 132 140 //$this->page_link="admin.php?page=plugin§ion=".basename(dirname($this->getFileLocation()))."/admin/".$this->plugin_admin_file.".php"; … … 150 158 } 151 159 160 /** 161 * return the file location 162 * @return String: file location 163 */ 152 164 public function getFileLocation() 153 165 { … … 155 167 } 156 168 169 /** 170 * return the plugin directory 171 * @return String: directory 172 */ 173 public function getDirectory() 174 { 175 return($this->pluginDirectory); 176 } 177 178 /** 179 * return the link of plugin in admin pages 180 * @return String: url 181 */ 157 182 public function getAdminLink() 158 183 { … … 160 185 } 161 186 187 /** 188 * set the link of plugin in admin pages 189 * @param String $link: url to set 190 * @return String: url 191 */ 162 192 public function setAdminLink($link) 163 193 { … … 166 196 } 167 197 198 /** 199 * set the plugin name 200 * @param String $name: plugin's name 201 * @return String: plugin's name 202 */ 168 203 public function setPluginName($name) 169 204 { … … 172 207 } 173 208 209 /** 210 * set the plugin name for file system useage 211 * @param String $name: plugin's name 212 * @return String: plugin's name 213 */ 174 214 public function setPluginNameFiles($name) 175 215 { … … 178 218 } 179 219 220 /** 221 * get the plugin name 222 * @return String: plugin's name 223 */ 180 224 public function getPluginName() 181 225 { … … 183 227 } 184 228 229 /** 230 * get the plugin name for file system useage 231 * @return String: plugin's name 232 */ 185 233 public function getPluginNameFiles() 186 234 { … … 192 240 --------------------------------------------------------------------------- */ 193 241 194 /* this function initialize var $config with default values */ 242 /** 243 * this function initialize var $this->config with default values 244 */ 195 245 public function initConfig() 196 246 { … … 198 248 } 199 249 200 /* load config from CONFIG_TABLE into var $my_config */ 250 /** 251 * load config from CONFIG_TABLE into var $this->config 252 * @return Boolean: true if config is loaded, otherwiser false 253 */ 201 254 public function loadConfig() 202 255 { … … 206 259 207 260 /** 208 * load config from a file into var $ my_config261 * load config from a file into var $this->config 209 262 * 210 263 * this function don't initialize the default value ! … … 212 265 * 213 266 * @param String $fileName : name of file to load 267 * @return Boolean: true if file is loaded, otherwise false 214 268 */ 215 269 public function loadConfigFromFile($fileName) … … 218 272 } 219 273 220 /* save var $my_config into CONFIG_TABLE */ 274 /** 275 * save var $this->config into CONFIG_TABLE 276 * @return Boolean: true if config is saved, otherwise false 277 */ 221 278 public function saveConfig() 222 279 { … … 224 281 } 225 282 226 /* delete config from CONFIG_TABLE */ 283 /** 284 * delete config from CONFIG_TABLE 285 * @return Boolean: true if config is deleted, otherwise false 286 */ 227 287 public function deleteConfig() 228 288 { … … 234 294 --------------------------------------------------------------------------- */ 235 295 236 /* 237 initialize tables list used by the plugin 238 $list = array('table1', 'table2') 239 $this->tables_list['table1'] = $prefixeTable.$plugin_name.'_table1' 240 */ 296 /** 297 * initialize tables list used by the plugin; tables name will be prefixed 298 * automatically 299 * $list = array('table1', 'table2') 300 * $this->tables_list['table1'] = $prefixeTable.$plugin_name.'_table1' 301 * @param Array $list: a list of table name 302 */ 241 303 protected function setTablesList($list) 242 304 { … … 251 313 --------------------------------------------------------------------------- */ 252 314 253 /* add plugin into administration menu */ 315 /** 316 * add plugin into administration menu; url is built automatically 317 * @param String $menu: 318 */ 254 319 public function pluginAdminMenu($menu) 255 320 { … … 261 326 ) 262 327 ); 263 /* 264 array_push($menu, 265 array( 266 'NAME' => $this->plugin_name, 267 'URL' => get_admin_plugin_menu_link(dirname($this->getFileLocation()). 268 '/admin/'.$this->plugin_admin_file.'.php') 269 ));*/ 270 return $menu; 271 } 272 273 /* 274 manage plugin integration into piwigo's admin interface 275 276 to be surcharged by child's classes 277 */ 328 return($menu); 329 } 330 331 /** 332 * manage plugin integration into piwigo's admin interface 333 * 334 * to be surcharged by child's classes 335 */ 278 336 public function manage() 279 337 { 280 338 } 281 339 282 /* 283 initialize plugin's events 284 to be surcharged by child's classes 285 */ 340 /** 341 * initialize plugin's events 342 * by default, call the loadCSS() function on the 'loc_begin_page_header' events 343 * 344 * to be surcharged by child's classes 345 */ 286 346 public function initEvents() 287 347 { 288 } 348 global $plugin_id; 349 350 if($plugin_id==$this->getDirectory() or !defined('IN_ADMIN')) 351 add_event_handler('loc_begin_page_header', array(&$this, 'loadCSS')); 352 } 353 354 /** 355 * called on the 'loc_begin_page_header' event 356 * 357 * to be surcharged by child's classes 358 */ 359 public function loadCSS() 360 { 361 } 362 289 363 290 364 protected function debug($text, $rewrite=false) … … 306 380 } 307 381 308 /*309 manage infos & errors display310 */311 382 protected function displayResult($action_msg, $result) 312 383 { -
extensions/GrumPluginClasses/classes/GPCAjax.class.inc.php
r5550 r16012 3 3 /* ----------------------------------------------------------------------------- 4 4 class name : GPCAjax 5 class version : 3. 0.06 plugin version : 3. 0.07 date : 201 0-03-305 class version : 3.1.0 6 plugin version : 3.5.2 7 date : 2012-06-19 8 8 ------------------------------------------------------------------------------ 9 9 author: grum at piwigo.org … … 15 15 | release | date | 16 16 | 3.0.0 | 2010/03/30 | * Update class & function names 17 | | | 18 | 3.1.0 | 2012/06/19 | * Check token request 19 | | | 17 20 | | | 18 21 | | | … … 27 30 ---------------------------------------------------------------------- */ 28 31 29 32 define('GPC_AJAX', 'ajaxfct'); 30 33 31 34 class GPCAjax … … 39 42 exit(strtr($str, $chars)); 40 43 } 44 45 /** 46 * check if there's a valid token in $_REQUEST 47 * if no, the GPC_AJAX call is set to empty value 48 * 49 * @param String $fct: the ajax function field (GPC_AJAX by default) 50 * @param String $token: the token field ('token' by default) to check 51 * @return Boolean: true if ok, otherwise false 52 */ 53 static public function checkToken($fct=GPC_AJAX, $token='token') 54 { 55 if(!isset($_REQUEST[$token])) $_REQUEST[$token]=''; 56 if($fct!='' && !isset($_REQUEST[$fct])) $_REQUEST[$fct]=''; 57 58 if($_REQUEST[$token]==get_pwg_token()) return(true); 59 60 if($fct!='') $_REQUEST[$fct]=''; 61 return(false); 62 } 41 63 } //class 42 64 -
extensions/GrumPluginClasses/classes/GPCCore.class.inc.php
r15373 r16012 67 67 | | | * Remove google translate connector (google has changed the useage 68 68 | | | and now an API key is needed) 69 | | | 70 | | | * Add js objects: inputDate, inputFilterBox, inputPages, inputSortBox, inputTag 71 | | | dynamicTable 72 | | | 73 | | | * AddHeaderCSS and AddJS are ignored if called in an ajax session (AJAX_CALL defined) 74 | | | 75 | | | 76 | | | 69 77 | | | 70 78 … … 81 89 - static function BBtoHTML 82 90 - static function VarToHTML 91 - static function TabsToHTML 83 92 - static function FormMailToHTML 84 93 - static function addHeaderCSS … … 90 99 - static function rmDir 91 100 - static function applyMarkups 101 - static function setTemplateToken 102 - static function addHeaderContent 92 103 ---------------------------------------------------------------------- */ 93 104 … … 129 140 return( 130 141 Array( 131 Array('name' => "CommonPlugin", 'version' => "2. 2.0"),132 Array('name' => "GPCAjax", 'version' => "3. 0.0"),142 Array('name' => "CommonPlugin", 'version' => "2.3.0"), 143 Array('name' => "GPCAjax", 'version' => "3.1.0"), 133 144 Array('name' => "GPCCategorySelector", 'version' => "1.0.1"), 134 145 Array('name' => "GPCCore", 'version' => "1.4.1"), 135 Array('name' => "GPCCss", 'version' => "3.1.0"),146 //Array('name' => "GPCCss", 'version' => "3.1.0"), removed with v1.4.1 136 147 Array('name' => "GPCPagesNavigation", 'version' => "2.0.0"), 137 148 Array('name' => "GPCPublicIntegration", 'version' => "2.0.0"), 138 Array('name' => "GPCRequestBuilder", 'version' => "1.1. 2"),149 Array('name' => "GPCRequestBuilder", 'version' => "1.1.7"), 139 150 Array('name' => "GPCTables", 'version' => "1.5.0"), 140 151 Array('name' => "GPCTabSheet", 'version' => "1.1.1"), … … 205 216 206 217 /** 218 * return the list of registered plugins 207 219 * @return Array : list of registered plugins 208 220 */ … … 503 515 } 504 516 517 /** 518 * analyze and replace markups by their value, according to $conf parameted 519 * @param String $text: text to analyze 520 * @return String: analyzed text 521 */ 505 522 static public function applyMarkups($text) 506 523 { … … 532 549 533 550 /** 534 * used to add a css filein the header551 * used to add a js or css directly in the header 535 552 * 536 553 * @param String $id : a unique id for the file 537 554 * @param String $file : the css file 555 * @param String $order: priority 556 */ 557 static public function addHeaderContent($type, $content) 558 { 559 global $template; 560 $null=null; 561 562 if(defined('AJAX_CALL')) return(false); // not needed for an ajax call 563 564 switch($type) 565 { 566 case 'css': 567 $template->block_html_style(null, $content, $null, $null); 568 break; 569 case 'js': 570 $template->block_html_head(null, '<script type="text/javascript">'.$content.'</script>', $null, $null); 571 break; 572 } 573 } 574 575 /** 576 * used to add a css file in the header 577 * 578 * @param String $id : a unique id for the file 579 * @param String $file : the css file 580 * @param String $order: priority 538 581 */ 539 582 static public function addHeaderCSS($id, $file, $order=0) … … 541 584 global $template; 542 585 543 if(!array_key_exists($file, self::$headerItems['css']) and file_exists($file)) 586 if(defined('AJAX_CALL')) return(false); // no CSS needed for an ajax call 587 if(!array_key_exists($id, self::$headerItems['css']) and file_exists($file)) 544 588 { 545 589 self::$headerItems['css'][$id]=$file; … … 547 591 } 548 592 } 593 594 /** 595 * used to add a js file in the header 596 * 597 * @param String $id : a unique id for the file 598 * @param String $file : the js file 599 * @param Array $require : list of required files 600 */ 549 601 static public function addHeaderJS($id, $file, $require=array()) 550 602 { 551 603 global $template; 552 604 553 if(!array_key_exists($file, self::$headerItems['js']) and file_exists($file)) 605 if(defined('AJAX_CALL')) return(false); // no JS needed for an ajax call 606 if(!array_key_exists($id, self::$headerItems['js']) and file_exists($file)) 554 607 { 555 608 self::$headerItems['js'][$id]=$file; … … 562 615 * 563 616 * @param Array $list : possibles values are 617 * - categorySelector 618 * - dynamicTable 564 619 * - inputCheckbox 565 620 * - inputColorPicker 566 621 * - inputColorsFB 567 622 * - inputConsole 623 * - inputDate 568 624 * - inputDotArea 625 * - inputFilterBox 569 626 * - inputList 570 627 * - inputNum 571 628 * - inputPosition 572 629 * - inputRadio 630 * - inputSortBox 573 631 * - inputStatusBar 632 * - inputTag 574 633 * - inputText 575 * - categorySelector576 634 */ 577 635 static public function addUI($list) … … 595 653 switch($ui) 596 654 { 655 case 'gpcCSS': 656 $fileName='./plugins/'.basename(dirname(dirname(__FILE__))).'/css/gpc'; 657 self::addHeaderCSS('gpc.css', $fileName.'.css', 10); 658 self::addHeaderCSS('gpc.cssT', $fileName.'_'.$template->get_themeconf('name').'.css', 15); 659 break; 597 660 case 'categorySelector': 598 661 self::addHeaderCSS('gpc.categorySelector', GPC_PATH.'css/categorySelector.css'); … … 646 709 self::addHeaderJS('gpc.inputConsole', GPC_PATH.'js/ui.inputConsole.js', array('jquery.ui.widget')); 647 710 break; 711 case 'inputDate': 712 self::addHeaderCSS('gpc.inputDate', GPC_PATH.'css/inputDate.css'); 713 self::addHeaderCSS('gpc.inputDateT', sprintf($themeFile, 'inputDate')); 714 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 715 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 716 self::addHeaderJS('jquery.ui.datepicker', 'themes/default/js/ui/jquery.ui.datepicker.js', array('jquery.ui.widget')); 717 self::addHeaderJS('gpc.inputDate', GPC_PATH.'js/ui.inputDate.js', array('jquery.ui.widget')); 718 break; 648 719 case 'inputDotArea': 649 720 self::addHeaderCSS('gpc.inputDotArea', GPC_PATH.'css/inputDotArea.css'); … … 653 724 self::addHeaderJS('gpc.inputDotArea', GPC_PATH.'js/ui.inputDotArea.js', array('jquery.ui.widget')); 654 725 break; 726 case 'inputFilterBox': 727 self::addHeaderCSS('gpc.inputNum', GPC_PATH.'css/inputNum.css'); 728 self::addHeaderCSS('gpc.inputNumT', sprintf($themeFile, 'inputNum')); 729 self::addHeaderCSS('gpc.inputDate', GPC_PATH.'css/inputDate.css'); 730 self::addHeaderCSS('gpc.inputDateT', sprintf($themeFile, 'inputDate')); 731 self::addHeaderCSS('gpc.inputText', GPC_PATH.'css/inputText.css'); 732 self::addHeaderCSS('gpc.inputTextT', sprintf($themeFile, 'inputText')); 733 self::addHeaderCSS('gpc.inputList', GPC_PATH.'css/inputList.css'); 734 self::addHeaderCSS('gpc.inputListT', sprintf($themeFile, 'inputList')); 735 self::addHeaderCSS('gpc.inputFilterBox', GPC_PATH.'css/inputFilterBox.css'); 736 self::addHeaderCSS('gpc.inputFilterBoxT', sprintf($themeFile, 'inputFilterBox')); 737 738 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 739 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 740 741 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 742 self::addHeaderJS('jquery.ui.mouse', 'themes/default/js/ui/jquery.ui.mouse.js', array('jquery.ui.widget')); 743 self::addHeaderJS('jquery.ui.position', 'themes/default/js/ui/jquery.ui.position.js', array('jquery.ui.mouse')); 744 self::addHeaderJS('jquery.ui.resizable', 'themes/default/js/ui/jquery.ui.resizable.js', array('jquery.ui.position')); 745 self::addHeaderJS('jquery.ui.draggable', 'themes/default/js/ui/jquery.ui.draggable.js', array('jquery.ui.resizable')); 746 self::addHeaderJS('jquery.ui.sortable', 'themes/default/js/ui/jquery.ui.sortable.js', array('jquery.ui.draggable')); 747 self::addHeaderJS('jquery.ui.dialog', 'themes/default/js/ui/jquery.ui.dialog.js', array('jquery.ui.sortable')); 748 749 self::addHeaderJS('gpc.inputNum', GPC_PATH.'js/ui.inputNum.js', array('jquery.ui.dialog')); 750 self::addHeaderJS('gpc.inputList', GPC_PATH.'js/ui.inputList.js', array('jquery.ui.dialog')); 751 self::addHeaderJS('gpc.inputText', GPC_PATH.'js/ui.inputText.js', array('jquery.ui.dialog')); 752 self::addHeaderJS('gpc.inputDate', GPC_PATH.'js/ui.inputDate.js', array('jquery.ui.dialog')); 753 self::addHeaderJS('gpc.inputFilterBox', GPC_PATH.'js/ui.inputFilterBox.js', array('jquery.ui.dialog')); 754 break; 655 755 case 'inputList': 656 756 self::addHeaderCSS('gpc.inputList', GPC_PATH.'css/inputList.css'); … … 669 769 self::addHeaderJS('gpc.inputNum', GPC_PATH.'js/ui.inputNum.js', array('jquery','jquery.ui.slider')); 670 770 break; 771 case 'inputPages': 772 self::addHeaderCSS('gpc.inputPages', GPC_PATH.'css/inputPages.css'); 773 self::addHeaderCSS('gpc.inputPagesT', sprintf($themeFile, 'inputPages')); 774 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 775 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 776 self::addHeaderJS('gpc.inputPages', GPC_PATH.'js/ui.inputPages.js', array('jquery','jquery.ui.widget')); 777 break; 671 778 case 'inputPosition': 672 779 self::addHeaderCSS('gpc.inputPosition', GPC_PATH.'css/inputPosition.css'); … … 681 788 self::addHeaderJS('gpc.inputRadio', GPC_PATH.'js/ui.inputRadio.js', array('jquery.ui.widget')); 682 789 break; 790 case 'inputSortBox': 791 self::addHeaderCSS('gpc.inputSortBox', GPC_PATH.'css/inputSortBox.css'); 792 self::addHeaderCSS('gpc.inputSortBoxT', sprintf($themeFile, 'inputSortBox')); 793 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 794 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 795 self::addHeaderJS('jquery.ui.mouse', 'themes/default/js/ui/jquery.ui.mouse.js', array('jquery.ui.widget')); 796 self::addHeaderJS('jquery.ui.position', 'themes/default/js/ui/jquery.ui.position.js', array('jquery.ui.mouse')); 797 self::addHeaderJS('jquery.ui.draggable', 'themes/default/js/ui/jquery.ui.draggable.js', array('jquery.ui.position')); 798 self::addHeaderJS('jquery.ui.sortable', 'themes/default/js/ui/jquery.ui.sortable.js', array('jquery.ui.draggable')); 799 self::addHeaderJS('jquery.ui.dialog', 'themes/default/js/ui/jquery.ui.dialog.js', array('jquery.ui.sortable')); 800 self::addHeaderJS('gpc.inputSortBox', GPC_PATH.'js/ui.inputSortBox.js', array('jquery.ui.dialog')); 801 break; 683 802 case 'inputStatusBar': 684 803 self::addHeaderCSS('gpc.inputStatusBar', GPC_PATH.'css/inputStatusBar.css'); … … 695 814 self::addHeaderJS('gpc.inputSwitchButton', GPC_PATH.'js/ui.inputSwitchButton.js', array('jquery.ui.widget')); 696 815 break; 816 case 'inputTag': 817 self::addHeaderCSS('gpc.inputTag', GPC_PATH.'css/inputTag.css'); 818 self::addHeaderCSS('gpc.inputTagT', sprintf($themeFile, 'inputTag')); 819 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 820 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 821 self::addHeaderJS('gpc.inputTag', GPC_PATH.'js/ui.inputTag.js', array('jquery.ui.widget')); 822 break; 697 823 case 'inputText': 698 824 self::addHeaderCSS('gpc.inputText', GPC_PATH.'css/inputText.css'); … … 708 834 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 709 835 self::addHeaderJS('gpc.simpleTip', GPC_PATH.'js/simpleTip.js', array('jquery.ui.widget')); 836 break; 837 case 'dynamicTable': 838 self::addHeaderCSS('gpc.inputNum', GPC_PATH.'css/inputNum.css'); 839 self::addHeaderCSS('gpc.inputNumT', sprintf($themeFile, 'inputNum')); 840 self::addHeaderCSS('gpc.inputDate', GPC_PATH.'css/inputDate.css'); 841 self::addHeaderCSS('gpc.inputDateT', sprintf($themeFile, 'inputDate')); 842 self::addHeaderCSS('gpc.inputText', GPC_PATH.'css/inputText.css'); 843 self::addHeaderCSS('gpc.inputTextT', sprintf($themeFile, 'inputText')); 844 self::addHeaderCSS('gpc.inputList', GPC_PATH.'css/inputList.css'); 845 self::addHeaderCSS('gpc.inputListT', sprintf($themeFile, 'inputList')); 846 self::addHeaderCSS('gpc.inputSortBox', GPC_PATH.'css/inputSortBox.css'); 847 self::addHeaderCSS('gpc.inputSortBoxT', sprintf($themeFile, 'inputSortBox')); 848 self::addHeaderCSS('gpc.inputFilterBox', GPC_PATH.'css/inputFilterBox.css'); 849 self::addHeaderCSS('gpc.inputFilterBoxT', sprintf($themeFile, 'inputFilterBox')); 850 self::addHeaderCSS('gpc.inputPages', GPC_PATH.'css/inputPages.css'); 851 self::addHeaderCSS('gpc.inputPagesT', sprintf($themeFile, 'inputPages')); 852 self::addHeaderCSS('gpc.inputDynamicTable', GPC_PATH.'css/inputDynamicTable.css'); 853 self::addHeaderCSS('gpc.inputDynamicTableT', sprintf($themeFile, 'inputDynamicTable')); 854 855 self::addHeaderJS('jquery.ui', 'themes/default/js/ui/jquery.ui.core.js', array('jquery')); 856 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 857 858 self::addHeaderJS('jquery.ui.widget', 'themes/default/js/ui/jquery.ui.widget.js', array('jquery.ui')); 859 self::addHeaderJS('jquery.ui.mouse', 'themes/default/js/ui/jquery.ui.mouse.js', array('jquery.ui.widget')); 860 self::addHeaderJS('jquery.ui.position', 'themes/default/js/ui/jquery.ui.position.js', array('jquery.ui.mouse')); 861 self::addHeaderJS('jquery.ui.resizable', 'themes/default/js/ui/jquery.ui.resizable.js', array('jquery.ui.position')); 862 self::addHeaderJS('jquery.ui.draggable', 'themes/default/js/ui/jquery.ui.draggable.js', array('jquery.ui.resizable')); 863 self::addHeaderJS('jquery.ui.sortable', 'themes/default/js/ui/jquery.ui.sortable.js', array('jquery.ui.draggable')); 864 self::addHeaderJS('jquery.ui.dialog', 'themes/default/js/ui/jquery.ui.dialog.js', array('jquery.ui.sortable')); 865 866 self::addHeaderJS('gpc.inputNum', GPC_PATH.'js/ui.inputNum.js', array('jquery.ui.dialog')); 867 self::addHeaderJS('gpc.inputList', GPC_PATH.'js/ui.inputList.js', array('jquery.ui.dialog')); 868 self::addHeaderJS('gpc.inputText', GPC_PATH.'js/ui.inputText.js', array('jquery.ui.dialog')); 869 self::addHeaderJS('gpc.inputDate', GPC_PATH.'js/ui.inputDate.js', array('jquery.ui.dialog')); 870 self::addHeaderJS('gpc.inputFilterBox', GPC_PATH.'js/ui.inputFilterBox.js', array('jquery.ui.dialog')); 871 self::addHeaderJS('gpc.inputSortBox', GPC_PATH.'js/ui.inputSortBox.js', array('jquery.ui.dialog')); 872 self::addHeaderJS('gpc.inputPages', GPC_PATH.'js/ui.inputPages.js', array('jquery.ui.dialog')); 873 self::addHeaderJS('gpc.dynamicTable', GPC_PATH.'js/ui.dynamicTable.js', array('jquery.ui.dialog')); 710 874 break; 711 875 } … … 852 1016 853 1017 1018 /** 1019 * affect a valid token in a template var {$token} 1020 */ 1021 static public function setTemplateToken() 1022 { 1023 global $template; 1024 1025 $template->assign('token', get_pwg_token()); 1026 } 1027 1028 854 1029 } //class 855 1030 856 //add_event_handler('loc_begin_page_header', array('GPCCore', 'applyHeaderItems'), 10);857 858 1031 GPCCore::init(); 859 1032 -
extensions/GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php
r7449 r16012 41 41 class GPCPublicIntegration 42 42 { 43 var$section; //section applied to the page viewed44 var$callback_page_function; //called function to display page43 private $section; //section applied to the page viewed 44 private $callback_page_function; //called function to display page 45 45 46 46 public function __construct($section) -
extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php
r15352 r16012 2 2 /* ----------------------------------------------------------------------------- 3 3 class name: GCPRequestBuilder 4 class version : 1.1. 65 plugin version : 3.5. 16 date : 201 1-05-154 class version : 1.1.7 5 plugin version : 3.5.2 6 date : 2012-06-24 7 7 8 8 ------------------------------------------------------------------------------ … … 89 89 | | | . Request builder user interface don't work 90 90 | | | 91 | 1.1.7 | 2012/06/24 | * use some GPCCore function instead of code 91 92 | | | 92 93 | | | … … 539 540 540 541 //$template->append('head_elements', '<link href="plugins/'.$baseName.'rbuilder.css" type="text/css" rel="stylesheet"/>'); 541 if(defined('IN_ADMIN')) GPCCore::addHeaderCSS('gpc.rbuilder ', 'plugins/'.$baseName.'rbuilder_'.$template->get_themeconf('name').'.css', 26);542 if(defined('IN_ADMIN')) GPCCore::addHeaderCSS('gpc.rbuilderT', 'plugins/'.$baseName.'rbuilder_'.$template->get_themeconf('name').'.css', 26); 542 543 //$template->append('head_elements', '<link href="plugins/'.$baseName.'rbuilder_'.$template->get_themeconf('name').'.css" type="text/css" rel="stylesheet"/>'); 543 544 … … 556 557 GPCCore::addHeaderJS('gpc.rbCriteriaBuilder', 'plugins/'.$baseName.'rbCriteriaBuilder.js', array('gpc.external.inestedsortable')); 557 558 558 $template->append('head_elements', 559 "<script type=\"text/javascript\"> 560 requestBuilderOptions = { 561 textAND:\"".l10n('gpc_rb_textAND')."\", 562 textOR:\"".l10n('gpc_rb_textOR')."\", 563 textNoCriteria:\"".l10n('There is no criteria ! At least, one criteria is required to do search...')."\", 564 textSomethingWrong:\"".l10n('gpc_something_is_wrong_on_the_server_side')."\", 565 textCaddieUpdated:\"".l10n('gpc_the_caddie_is_updated')."\", 566 helpEdit:\"".l10n('gpc_help_edit_criteria')."\", 567 helpDelete:\"".l10n('gpc_help_delete_criteria')."\", 568 helpMove:\"".l10n('gpc_help_move_criteria')."\", 569 helpSwitchCondition:\"".l10n('gpc_help_switch_condition')."\", 570 ajaxUrl:'plugins/GrumPluginClasses/gpc_ajax.php', 571 } 572 </script>"); 559 GPCCore::addHeaderContent('js', 560 " 561 var requestBuilderOptions = { 562 textAND:\"".l10n('gpc_rb_textAND')."\", 563 textOR:\"".l10n('gpc_rb_textOR')."\", 564 textNoCriteria:\"".l10n('There is no criteria ! At least, one criteria is required to do search...')."\", 565 textSomethingWrong:\"".l10n('gpc_something_is_wrong_on_the_server_side')."\", 566 textCaddieUpdated:\"".l10n('gpc_the_caddie_is_updated')."\", 567 helpEdit:\"".l10n('gpc_help_edit_criteria')."\", 568 helpDelete:\"".l10n('gpc_help_delete_criteria')."\", 569 helpMove:\"".l10n('gpc_help_move_criteria')."\", 570 helpSwitchCondition:\"".l10n('gpc_help_switch_condition')."\", 571 ajaxUrl:'plugins/GrumPluginClasses/gpc_ajax.php', 572 token:'".get_pwg_token()."' 573 }; 574 " 575 ); 573 576 } 574 577 -
extensions/GrumPluginClasses/classes/GPCUserAgent.class.inc.php
r15340 r16012 1 1 <?php 2 /* -----------------------------------------------------------------------------3 class name: GPCUserAgent4 class version : 1.0.05 plugin version : 3.5.26 date : 2012-05-257 ------------------------------------------------------------------------------8 author: grum at piwog.org9 << May the Little SpaceFrog be with you >>10 ------------------------------------------------------------------------------11 12 this classes provides base functions to parse User Agent string and retrieve13 properties: Browser, OS, Engine14 15 16 (static public) function parse($userAgent)17 18 | release | date |19 | 1.0.0 | 2012-05-25 | * implementation of the class20 | | |21 | | |22 | | |23 | | |24 | | |25 | | |26 27 ----------------------------------------------------------------------------- */28 2 29 3 require_once('GPCUserAgent.const.inc.php'); 30 31 4 32 5 class GPCUserAgent 33 6 { 34 /**35 * returned result is ana array with the following properties:36 * 'os' => Operating System id on which the browser run; integer => UA_OS_*37 * 'os_version' => Version of the OS; string38 *39 * 'browser' => browser id; integer => UA_BROWSER_*40 * 'brower_name' => browser name; string41 * 'browser_type' => browser type id (crawler, computer, mobile, ...); integer => UA_PROP_TYPE_*42 * 'browser_version' => browser version; string43 *44 * 'engine' => engine used by the browser (gecko, khtml, ...); integer => UA_ENGINE_*45 *46 * @param String $userAgent: a user agent string47 * @return Array: array of properties48 */49 7 static public function parse($userAgent) 50 8 { … … 258 216 if(is_array($result) and count($result)>2) 259 217 { 218 if($browser==UA_BROWSER_SAFARI and preg_match('/iphone|ipad|ipod/i', $userAgent)) 219 $browser=UA_BROWSER_SAFARI_MOBILE; 220 260 221 $returned=array( 261 222 'browser' => $browser, -
extensions/GrumPluginClasses/classes/GPCUserAgent.const.inc.php
r15340 r16012 117 117 define('UA_BROWSER_FIREFOX', 0x1034); 118 118 define('UA_BROWSER_OPERA_WII', 0x1035); 119 define('UA_BROWSER_SAFARI_MOBILE', 0x1036); 119 120 120 121 … … 242 243 UA_BROWSER_LINKS => array(UA_PROP_NAME => 'Links', UA_PROP_TYPE=>UA_PROP_TYPE_BROWSER_COMPUTER, UA_PROP_URL => ''), 243 244 UA_BROWSER_LYNX => array(UA_PROP_NAME => 'Lynx', UA_PROP_TYPE=>UA_PROP_TYPE_BROWSER_COMPUTER, UA_PROP_URL => ''), 244 UA_BROWSER_SAFARI => array(UA_PROP_NAME => 'Safari', UA_PROP_TYPE=>UA_PROP_TYPE_BROWSER_COMPUTER, UA_PROP_URL => '') 245 UA_BROWSER_SAFARI => array(UA_PROP_NAME => 'Safari', UA_PROP_TYPE=>UA_PROP_TYPE_BROWSER_COMPUTER, UA_PROP_URL => ''), 246 UA_BROWSER_SAFARI_MOBILE => array(UA_PROP_NAME => 'Safari', UA_PROP_TYPE=>UA_PROP_TYPE_BROWSER_MOBILE, UA_PROP_URL => '') 245 247 ), 246 248
Note: See TracChangeset
for help on using the changeset viewer.