getPlugins(false); $themes_list = $themes->getPluginsList(); $is_writable = is_writable($themes_root); $dc_ini_file = dirname(__FILE__).'/../../../conf/dotclear.ini'; $is_ini_writable = is_writable($dc_ini_file); # Installation d'un thème if ($is_writable && !empty($_GET['tool_url'])) { $tool_url = $_GET['tool_url']; $parsed_url = parse_url($tool_url); if (empty($parsed_url['scheme']) || !preg_match('/^http|ftp$/',$parsed_url['scheme']) || empty($parsed_url['host']) || empty($parsed_url['path'])) { $err = __('URL is not valid.'); } else { if (($err = $themes->install($tool_url)) === true) { header('Location: tools.php?p=thememng'); exit; } } } # Utilisation d'un thème $use = (!empty($_GET['use'])) ? $_GET['use'] : ''; if ($is_ini_writable && in_array($use,array_keys($themes_list))) { $objIni = new iniFile($dc_ini_file); $objIni->editVar('dc_theme',$use); if ($objIni->saveFile() !== false) { header('Location: tools.php?p=thememng'); exit; } else { $err = __('An error occured while writing configuration file.'); } exit; } # Suppression d'un thème $delete = (!empty($_GET['delete'])) ? $_GET['delete'] : ''; if ($is_writable && $delete != '' && in_array($delete,array_keys($themes_list)) && $delete != 'default') { files::deltree($themes_root.'/'.$delete); header('Location: tools.php?p=thememng'); exit; } if($err != '') { buffer::str( '
'.__('Error(s)').' :
'.$err.''.sprintf(__('The folder %s is not writable, please check its permissions.'), 'themes/').'
' ); } else { buffer::str( '' ); } buffer::str( '' ); buffer::str( '