[9412] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // | EDIT_CL | |
---|
| 5 | // +-----------------------------------------------------------------------+ |
---|
| 6 | // | Copyright(C) 2010 cljosse | |
---|
| 7 | // +-----------------------------------------------------------------------+ |
---|
| 8 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 9 | // | it under the terms of the GNU General Public License as published by | |
---|
| 10 | // | the Free Software Foundation | |
---|
| 11 | // | | |
---|
| 12 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 13 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 14 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 15 | // | General Public License for more details. | |
---|
| 16 | // | | |
---|
| 17 | // | You should have received a copy of the GNU General Public License | |
---|
| 18 | // | along with this program; if not, write to the Free Software | |
---|
| 19 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 20 | // | USA. | |
---|
| 21 | // +-----------------------------------------------------------------------+ |
---|
| 22 | if (!defined('EDIT_CL_PATH')) |
---|
| 23 | define( |
---|
| 24 | 'EDIT_CL_PATH', |
---|
| 25 | PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' |
---|
| 26 | ); |
---|
| 27 | if (!defined('ROOT_URL')) |
---|
| 28 | define( 'ROOT_URL', get_root_url().'/' ); |
---|
| 29 | |
---|
| 30 | $EDIT_CL_PATH_ABS=str_replace('\\','/',dirname(__FILE__) ); |
---|
| 31 | if (!defined('EDIT_CL_PATH_ABS')) |
---|
| 32 | define( |
---|
| 33 | 'EDIT_CL_PATH_ABS', $EDIT_CL_PATH_ABS."/" |
---|
| 34 | ); |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | class cl_edit_controler { |
---|
| 40 | |
---|
| 41 | static public function cl_edit_admin_menu($menu) |
---|
| 42 | { |
---|
| 43 | include_once( dirname(__FILE__) .'/include/functions.php'); |
---|
| 44 | add_event_handler('invalidate_user_cache', 'cl_meta_invalidate_cache' ); |
---|
| 45 | array_push($menu, |
---|
| 46 | array( |
---|
| 47 | 'NAME' => 'EDIT Maps & Earth', |
---|
| 48 | 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/admin.php') ) |
---|
| 49 | ); |
---|
| 50 | return $menu; |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | /* |
---|
| 59 | * |
---|
| 60 | */ |
---|
| 61 | function cl_edit_Get_Options() |
---|
| 62 | { |
---|
| 63 | global $conf,$EDIT_CL_parametres; |
---|
| 64 | $EDIT_CL_parametres = unserialize($conf['cl_edit']); |
---|
| 65 | $EDIT_CL_parametres = cl_edit_Set_Options(); |
---|
| 66 | return $EDIT_CL_parametres; |
---|
| 67 | } |
---|
| 68 | /* |
---|
| 69 | * |
---|
| 70 | */ |
---|
| 71 | function cl_edit_Set_Options() |
---|
| 72 | { |
---|
| 73 | |
---|
| 74 | global $EDIT_CL_parametres; |
---|
| 75 | //============================================================================= |
---|
| 76 | $my_para=$EDIT_CL_parametres; |
---|
| 77 | $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type: 'Ty') ; |
---|
| 78 | |
---|
| 79 | //=============================================================================== |
---|
| 80 | |
---|
| 81 | if ( isset($_POST['submit'] ) && $_POST['submit'] == l10n('cl_edit_save') ) { |
---|
| 82 | $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ; |
---|
| 83 | |
---|
| 84 | }else{ |
---|
| 85 | $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v : 'off') ; |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | return $my_para; |
---|
| 91 | } |
---|
| 92 | /* |
---|
| 93 | * |
---|
| 94 | */ |
---|
| 95 | function cl_edit_sauve_options_inf() |
---|
| 96 | { |
---|
| 97 | global $options,$infos_message,$conf,$EDIT_CL_parametres ; |
---|
| 98 | $infos_message .=l10n("cl_edit_save_config")."<br>"; |
---|
| 99 | $EDIT_CL_parametres=cl_edit_Set_Options(); |
---|
| 100 | |
---|
| 101 | if ( isset($EDIT_CL_parametres) ) |
---|
| 102 | { |
---|
| 103 | |
---|
| 104 | $query = ' |
---|
| 105 | UPDATE '.CONFIG_TABLE.' |
---|
| 106 | SET value="'.addslashes(serialize($EDIT_CL_parametres)).'" |
---|
| 107 | WHERE param = "cl_EDIT_CL" |
---|
| 108 | LIMIT 1'; |
---|
| 109 | pwg_query($query); |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | function Memo_vars($variables) |
---|
| 115 | { |
---|
| 116 | ob_start(); |
---|
| 117 | echo '<pre>'; |
---|
| 118 | print_r($variables); |
---|
| 119 | echo '</pre>'; |
---|
| 120 | $m= ob_get_contents(); |
---|
| 121 | |
---|
| 122 | ob_end_clean(); |
---|
| 123 | return $m; |
---|
| 124 | |
---|
| 125 | } |
---|
| 126 | } // class |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | ?> |
---|