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.'
' ); } buffer::str( '

'.__('Themes manager').'

'. '

'.__('Install a theme').'

' ); if (!$is_writable) { buffer::str( '

'.sprintf(__('The folder %s is not writable, please check its permissions.'), 'themes/').'

' ); } else { buffer::str( '
'. '

'. form::field('tool_url',50,'',$tool_url).'

'. '

'. '

'. '
' ); } buffer::str( '

'.__('Install new themes').'

' ); buffer::str( '

'.__('List of installed themes').'

'. '
' ); foreach ($themes_list as $k => $v) { $themes->loadl10n($k); buffer::str( '
'. ($k == dc_theme ? ''.__('Current theme').' - ' : ''). __($v['label']).' - '.$k.'
'. '
'.__($v['desc']).'
'. 'par '.$v['author'].' - '.__('version').' '.$v['version'].'
' ); if ($k != dc_theme) { if ($is_ini_writable) { buffer::str( ''. __('use this theme').' - ' ); } if ($is_writable) { buffer::str( ''. __('delete').'' ); } } buffer::str('
'); } buffer::str('
'); ?>