Changeset 10326 for extensions/Icons_Set/admin.php
- Timestamp:
- Apr 12, 2011, 5:20:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Icons_Set/admin.php
r10299 r10326 12 12 { 13 13 check_pwg_token(); 14 $conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset)) 15 $conf_themes=$conf_iconset['themes']; 16 $conf_icons=$conf_iconset['icons']; 17 $conf_icons=$conf_iconset['icons']; 18 $error_update=''; 19 $update_ok=''; 20 foreach ($conf_themes as $theme_id => $iconset) // theme supprimé 21 { 22 if (isset($_POST[$theme_id]) and isset($conf_themes[$theme_id]) and $conf_themes[$theme_id]!=$_POST[$theme_id] and in_array($_POST[$theme_id], $conf_icons)) 23 { 24 $conf_themes[$theme_id]=$_POST[$theme_id]; 25 $update_ok.=$theme_id.' / '; 26 } 27 elseif (empty($_POST[$theme_id]) and $conf_themes[$theme_id]!=$_POST[$theme_id]) 28 { 29 $conf_themes[$theme_id]=''; 30 $update_ok.=$theme_id.' / '; 31 } 32 elseif (!isset($_POST[$theme_id]) or !isset($conf_themes[$theme_id]) or (!in_array($_POST[$theme_id], $conf_icons) and !empty($_POST[$theme_id])) ) 33 { 34 $error_update.=$theme_id.' / '; 35 } 36 } 37 $conf['iconset']=array( 38 'themes'=>$conf_themes, 39 'icons'=>$conf_icons 40 ); 41 $query = ' 42 UPDATE '.CONFIG_TABLE.' 43 SET value="'.pwg_db_real_escape_string(serialize($conf['iconset'])).'" 44 WHERE param="iconset" 45 LIMIT 1'; 46 pwg_query($query); 47 if (!empty($error_update)) { array_push($page['infos'], l10n('iconset_error_update').$error_update ); } 48 if (!empty($update_ok)) { array_push($page['infos'], l10n('iconset_update_ok').$update_ok ); } 49 load_conf_from_db(); 14 50 } 15 51 //////////////////////////////////////////////// … … 117 153 LIMIT 1'; 118 154 pwg_query($query); 155 load_conf_from_db(); 119 156 if (!empty($info_new_theme)) { array_push($page['infos'], l10n('iconset_info_new_theme').$info_new_theme ); } 120 157 if (!empty($info_new_icon)) { array_push($page['infos'], l10n('iconset_info_new_icon').$info_new_icon ); } … … 144 181 $values=array(); 145 182 $output=array(); 183 $template->func_combine_css(array( 184 'path' => 'themes/default/iconset.css', 185 ), 186 $smarty 187 ); 188 146 189 foreach ($conf_icons as $iconset) 147 190 { … … 153 196 'icon_file' => $iconsetconf['icon_file'], 154 197 'css_file' => $iconsetconf['css_file'], 198 'css_file_admin' => $iconsetconf['css_file_admin'], 155 199 ); 156 200 $values[]=$iconset; 157 201 $output[]=$iconsetconf['name']; 202 $template->func_combine_css(array( 203 'path' => $iconsetconf['css_file_admin'], 204 ), 205 $smarty 206 ); 158 207 } 159 208 $template->assign(array( … … 173 222 $smarty 174 223 ); 224 175 225 $template->set_filename('plugin_admin_content', dirname(__FILE__) .'/template/admin.tpl'); 176 226 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
Note: See TracChangeset
for help on using the changeset viewer.