From fbf7b9b6ce63bdedd4d15adb615af0291c684bbf Mon Sep 17 00:00:00 2001 From: grum Date: Wed, 22 Oct 2008 21:08:44 +0000 Subject: "remove grum_plugins_classes-2 and AMM plugin asked in topic #p98003" git-svn-id: http://piwigo.org/svn/branches/2.0@2791 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/grum_plugins_classes-2/ajax.class.inc.php | 56 --- plugins/grum_plugins_classes-2/ajax.js | 104 ----- .../common_plugin.class.inc.php | 209 ---------- plugins/grum_plugins_classes-2/css.class.inc.php | 76 ---- .../grum_plugins_classes-2/genericjs.class.inc.php | 41 -- plugins/grum_plugins_classes-2/genericjs.js | 49 --- plugins/grum_plugins_classes-2/google_translate.js | 101 ----- plugins/grum_plugins_classes-2/index.php | 33 -- plugins/grum_plugins_classes-2/main.inc.php | 52 --- plugins/grum_plugins_classes-2/maintain.inc.php | 26 -- .../pages_navigation.class.inc.php | 294 -------------- .../public_integration.class.inc.php | 202 ---------- .../grum_plugins_classes-2/tables.class.inc.php | 447 --------------------- .../grum_plugins_classes-2/translate.class.inc.php | 192 --------- .../users_groups.class.inc.php | 290 ------------- 15 files changed, 2172 deletions(-) delete mode 100755 plugins/grum_plugins_classes-2/ajax.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/ajax.js delete mode 100755 plugins/grum_plugins_classes-2/common_plugin.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/css.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/genericjs.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/genericjs.js delete mode 100755 plugins/grum_plugins_classes-2/google_translate.js delete mode 100755 plugins/grum_plugins_classes-2/index.php delete mode 100755 plugins/grum_plugins_classes-2/main.inc.php delete mode 100755 plugins/grum_plugins_classes-2/maintain.inc.php delete mode 100755 plugins/grum_plugins_classes-2/pages_navigation.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/public_integration.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/tables.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/translate.class.inc.php delete mode 100755 plugins/grum_plugins_classes-2/users_groups.class.inc.php (limited to 'plugins') diff --git a/plugins/grum_plugins_classes-2/ajax.class.inc.php b/plugins/grum_plugins_classes-2/ajax.class.inc.php deleted file mode 100755 index c1b8ccfa3..000000000 --- a/plugins/grum_plugins_classes-2/ajax.class.inc.php +++ /dev/null @@ -1,56 +0,0 @@ -> - ------------------------------------------------------------------------------ - - this classes provides base functions to add ajax.js file into html page ; - just instanciate an ajax object, and call return_result - $ajax_content_to_be_returned = "..............."; - $ajax = new ajax(); - $ajax->return_result($ajax_content_to_be_returned); - - - constructor ajax() - - function return_result($str) - ---------------------------------------------------------------------- */ - - - -class ajax -{ - function ajax() - { - add_event_handler('loc_end_page_header', array(&$this, 'load_JS')); - } - - function load_JS() - { - global $template; - - $name='plugins/'.basename(dirname(__FILE__)).'/ajax.js'; - - $template->append('head_elements', ''); - } - - function return_result($str) - { - //$chars=get_html_translation_table(HTML_ENTITIES, ENT_NOQUOTES); - $chars['<']='<'; - $chars['>']='>'; - $chars['&']='&'; - exit(strtr($str, $chars)); - } -} //class - -/* - it's better to make $ajax instance into the plugin object, otherwise an object - made here cannot be acceeded.. -*/ -//$ajax=new ajax(); - -?> \ No newline at end of file diff --git a/plugins/grum_plugins_classes-2/ajax.js b/plugins/grum_plugins_classes-2/ajax.js deleted file mode 100755 index 1b8008191..000000000 --- a/plugins/grum_plugins_classes-2/ajax.js +++ /dev/null @@ -1,104 +0,0 @@ -/* ----------------------------------------------------------------------------- - file: ajax.js - file version: 1.1.0 - date: 2008-05-25 - ------------------------------------------------------------------------------ - author: grum at grum.dnsalias.com - << May the Little SpaceFrog be with you >> - ------------------------------------------------------------------------------ - - this classes provides base functions to add ajax into html page - - + create_httpobject provide a simple function to create an HTML request to a - server ; return an XMLHttpRequest object (or compatible object for IE) - - + tHttpObject is a class providing : - - an XMLHttpRequest object - - - - ------------------------------------------------------------------------------ - HISTORY VERSION - v1.0.1 + [create_httpobject] overrideMimeType unknown by IE 7.0 ; - v1.1.0 + add create_httpobject2 with mimetype parameter - - -------------------------------------------------------------------------- */ - - - function create_httpobject(requesttype, charset, ajaxurl, async) - { - return(create_httpobject2(requesttype, charset, ajaxurl, async, '')); - } - - function create_httpobject2(requesttype, charset, ajaxurl, async, mimetype) - { - if (window.XMLHttpRequest) - { - // IE7 & FF method - http_request = new XMLHttpRequest(); - } - else - { - //Other IE method..... - if (window.ActiveXObject) - { - try - { - http_request = new ActiveXObject("Msxml2.XMLHTTP"); - } - catch (e) - { - try - { - http_request = new ActiveXObject("Microsoft.XMLHTTP"); - } - catch (e) - { - window.alert("Your browser is unable to use XMLHTTPRequest"); - } // try-catch - } // try-catch - } - } // if-else - - if(charset=='') { charset='utf-8'; } - - http_request.onreadystatechange = function() { }; - http_request.open(requesttype.toUpperCase(), ajaxurl, async); - - if(mimetype=='') - { - mimetype='text/html'; - } - - try - { - http_request.overrideMimeType(mimetype+'; charset='+charset); - } - catch(e) - { - } - - if(requesttype.toUpperCase()=='POST') - { - http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - } - - //method to restitute an XML object ; needed for compatibility between FF&IE - http_request.XML = httpobject_responseXML; - - return(http_request); - } - - - function httpobject_responseXML() - { - if (document.implementation && document.implementation.createDocument) - { - //ff method - return(this.responseXML); - } - else - { - //ie method - return(xmlCreateFromString(this.responseText)); - } - } \ No newline at end of file diff --git a/plugins/grum_plugins_classes-2/common_plugin.class.inc.php b/plugins/grum_plugins_classes-2/common_plugin.class.inc.php deleted file mode 100755 index c87581c12..000000000 --- a/plugins/grum_plugins_classes-2/common_plugin.class.inc.php +++ /dev/null @@ -1,209 +0,0 @@ -> - ------------------------------------------------------------------------------ - - this class provides base functions to manage a plugin - public - ADMINISTRATION RELATED - - manage() - - plugin_admin_menu($menu) - INITIALIZATION RELATED - - init_events() - CONFIG RELATED - - get_filelocation() - - get_admin_link() - - init_config() - - load_config() - - save_config() - - delete_config() - - protected - INITIALIZATION RELATED - - set_tables_list($list) - ------------------------------------------------------------------------------ - :: HISTORY - - 2.0.0 - 2008-07-13 - migrate to piwigo 2.0 ; use of PHP5 classes possibilities - - --------------------------------------------------------------------------- */ - -class common_plugin -{ - protected $prefixeTable; // prefixe for tables names - protected $page_link; //link to admin page - protected $filelocation; //files plugin location on server - protected $display_result_ok; - protected $display_result_ko; - protected $plugin_name; // used for interface display - protected $plugin_name_files; // used for files - protected $plugin_admin_file = "plugin_admin"; - protected $tables; // list of all tables names used by plugin - public $my_config; // array of config parameters - - /* constructor allows to initialize $prefixeTable value */ - public function common_plugin($prefixeTable, $filelocation) - { - $this->filelocation=$filelocation; - $this->prefixeTable=$prefixeTable; - $this->page_link="admin.php?page=plugin§ion=". basename(dirname($this->filelocation))."/admin/".$this->plugin_admin_file.".php"; - //$this->page_link=get_admin_plugin_menu_link($filelocation); - $this->init_config(); - $this->display_result_ok="OK"; - $this->display_result_ko="KO"; - } - - public function get_filelocation() - { - return($this->filelocation); - } - - public function get_admin_link() - { - return($this->page_link); - } - - - /* --------------------------------------------------------------------------- - CONFIGURATION RELATED FUNCTIONS - --------------------------------------------------------------------------- */ - - /* this function initialize var $my_config with default values */ - public function init_config() - { - $this->my_config=array(); - } - - /* load config from CONFIG_TABLE into var $my_config */ - public function load_config() - { - $this->init_config(); - $sql="SELECT value FROM ".CONFIG_TABLE." - WHERE param = '".$this->plugin_name_files."_config'"; - $result=pwg_query($sql); - if($result) - { - $row=mysql_fetch_row($result); - if(is_string($row[0])) - { - $config = unserialize($row[0]); - reset($config); - while (list($key, $val) = each($config)) - { $this->my_config[$key] =$val; } - } - } - } - - /* save var $my_config into CONFIG_TABLE */ - public function save_config() - { - $sql="REPLACE INTO ".CONFIG_TABLE." - VALUES('".$this->plugin_name_files."_config', '" - .serialize($this->my_config)."', '')"; - $result=pwg_query($sql); - if($result) - { return true; } - else - { return false; } - } - - /* delete config from CONFIG_TABLE */ - public function delete_config() - { - $sql="DELETE FROM ".CONFIG_TABLE." - WHERE param='".$this->plugin_name_files."_config'"; - $result=pwg_query($sql); - if($result) - { return true; } - else - { return false; } - } - - /* --------------------------------------------------------------------------- - PLUGIN INITIALIZATION RELATED FUNCTIONS - --------------------------------------------------------------------------- */ - - /* - initialize tables list used by the plugin - $list = array('table1', 'table2') - $this->tables_list['table1'] = $prefixeTable.$plugin_name.'_table1' - */ - protected function set_tables_list($list) - { - for($i=0;$itables[$list[$i]]=$this->prefixeTable.$this->plugin_name_files.'_'.$list[$i]; - } - } - - /* --------------------------------------------------------------------------- - ADMINISTRATOR CONSOLE RELATED FUNCTIONS - --------------------------------------------------------------------------- */ - - /* add plugin into administration menu */ - public function plugin_admin_menu($menu) - { - array_push($menu, - array( - 'NAME' => $this->plugin_name, - 'URL' => get_admin_plugin_menu_link(dirname($this->filelocation). - '/admin/'.$this->plugin_admin_file.'.php') - )); - return $menu; - } - - /* - manage plugin integration into piwigo's admin interface - - to be surcharged by child's classes - */ - public function manage() - { - } - - /* - intialize plugin's events - to be surcharged by child's classes - */ - public function init_events() - { - } - - protected function debug($text) - { - global $page; - array_push($page['infos'], "DEBUG MODE: ".$text); - } - - /* - manage infos & errors display - */ - protected function display_result($action_msg, $result) - { - global $page; - - if($result) - { - array_push($page['infos'], $action_msg); - array_push($page['infos'], $this->display_result_ok); - } - else - { - array_push($page['errors'], $action_msg); - array_push($page['errors'], $this->display_result_ko); - } - } -} //class common_plugin - -?> diff --git a/plugins/grum_plugins_classes-2/css.class.inc.php b/plugins/grum_plugins_classes-2/css.class.inc.php deleted file mode 100755 index cbd6bb1da..000000000 --- a/plugins/grum_plugins_classes-2/css.class.inc.php +++ /dev/null @@ -1,76 +0,0 @@ -> - ------------------------------------------------------------------------------ - - this classes provides base functions to manage css - classe consider that $filename is under plugins/ directory - - - - constructor css($filename) - - (public) function css_file_exists() - - (public) function make_CSS($css) - - (public) function apply_CSS() - ---------------------------------------------------------------------- */ -class css -{ - private $filename; - - public function css($filename) - { - $this->filename=$filename; - } - - /* - make the css file - */ - public function make_CSS($css) - { - if($css!="") - { - $handle=fopen($this->filename, "w"); - if($handle) - { - fwrite($handle, $css); - fclose($handle); - } - } - } - - /* - return true if css file exists - */ - public function css_file_exists() - { - return(file_exists($this->filename)); - } - - /* - put a link in the template to load the css file - this function have to be called in a 'loc_end_page_header' trigger - - if $text="", insert link to css file, otherwise insert directly a