getPlugins(false); $plugins_list = $plugins->getPluginsList(); $is_writable = is_writable($plugins_root); # 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 = $plugins->install($tool_url)) === true) { header('Location: tools.php?p=toolsmng'); exit; } } } # Changement de status d'un plugin $switch = (!empty($_GET['switch'])) ? $_GET['switch'] : ''; if ($is_writable && $switch != '' && in_array($switch,array_keys($plugins_list)) && $switch != 'toolsmng') { $plugins->switchStatus($switch); header('Location: tools.php?p=toolsmng'); exit; } # Suppression d'un thème $delete = (!empty($_GET['delete'])) ? $_GET['delete'] : ''; if ($is_writable && $delete != '' && in_array($delete,array_keys($plugins_list)) && $delete != 'toolsmng') { files::deltree($plugins_root.'/'.$delete); header('Location: tools.php?p=toolsmng'); exit; } if($err != '') { buffer::str( '
'.__('Error(s)').' :
'.$err.''.sprintf(__('The folder %s is not writable, please check its permissions.'), DC_ECRIRE.'/tools/').'
' ); } else { buffer::str( '' ); } buffer::str( '' ); # Traduction des plugins foreach ($plugins_list as $k => $v) { $plugins->loadl10n($k); $plugins_list[$k]['label'] = __($v['label']); $plugins_list[$k]['desc'] = __($v['desc']); } # Tri des plugins par leur nom uasort($plugins_list,create_function('$a,$b','return strcmp($a["label"],$b["label"]);')); buffer::str( '