checkProfil(PROFIL_ADMIN);
if(isset($_POST['submit']) AND in_array($_POST['selection'], array('delete', 'activate', 'deactivate'))) {
$plxAdmin->plxPlugins->saveConfig($_POST);
header('Location: parametres_plugins.php');
exit;
}
elseif(isset($_POST['update'])) {
$plxAdmin->plxPlugins->saveConfig($_POST);
header('Location: parametres_plugins.php');
exit;
}
function pluginsList($plugins, $defaultLang, $type) {
# plugins array() contient la liste des plugins à afficher
# defaultLang string langue utilisée dans l'admin
# type true|false true=liste des plugins actifs, false=liste des plugins inactifs
$output='';
if(sizeof($plugins)>0) {
$num=0;
foreach($plugins as $plugName => $plugInstance) {
$ordre = ++$num;
# détermination de l'icone à afficher
if(is_file(PLX_PLUGINS.$plugName.'/icon.png'))
$icon=PLX_PLUGINS.$plugName.'/icon.png';
elseif(is_file(PLX_PLUGINS.$plugName.'/icon.jpg'))
$icon=PLX_PLUGINS.$plugName.'/icon.jpg';
elseif(is_file(PLX_PLUGINS.$plugName.'/icon.gif'))
$icon=PLX_PLUGINS.$plugName.'/icon.gif';
else
$icon=PLX_CORE.'admin/theme/images/icon_plugin.png';
$output .= '
';
# checkbox
$output .= '';
$output .= '';
$output .= '';
$output .= ' | ';
# icon
$output .= ' | ';
# plugin infos
$output .= '';
# title + version
$output .= ''.plxUtils::strCheck($plugInstance->getInfo('title')).' - '.L_PLUGINS_VERSION.' '.plxUtils::strCheck($plugInstance->getInfo('version')).'';
# date
if($plugInstance->getInfo('date')!='') $output .= ' ('.plxUtils::strCheck($plugInstance->getInfo('date')).')';
# description
$output .= ' '.plxUtils::strCheck($plugInstance->getInfo('description')).' ';
# author
$output .= L_PLUGINS_AUTHOR.' : '.plxUtils::strCheck($plugInstance->getInfo('author'));
# site
if($plugInstance->getInfo('site')!='') $output .= ' - '.plxUtils::strCheck($plugInstance->getInfo('site')).'';
# message d'alerte si plugin non configuré
if($type AND file_exists(PLX_PLUGINS.$plugName.'/config.php') AND !file_exists(PLX_ROOT.PLX_CONFIG_PATH.'plugins/'.$plugName.'.xml')) $output .= ' '.L_PLUGIN_NO_CONFIG.'';
$output .= ' | ';
# colonne pour trier les plugins
if($type) {
$output .= '';
$output .= '';
$output .= ' | ';
}
# affichage des liens du plugin
$output .= '';
# lien configuration
if(is_file(PLX_PLUGINS.$plugName.'/config.php')) {
$output .= ''.L_PLUGINS_CONFIG.' ';
}
# lien pour code css
$output .= ''.L_PLUGINS_CSS.' ';
# lien aide
if(is_file(PLX_PLUGINS.$plugName.'/lang/'.$defaultLang.'-help.php'))
$output .= ''.L_PLUGINS_HELP.'';
$output .= ' | ';
$output .= '
';
}
}
else
$output .= ''.L_NO_PLUGIN.' |
';
return $output;
}
# récuperation de la liste des plugins inactifs
$aInactivePlugins = $plxAdmin->plxPlugins->getInactivePlugins();
# nombre de plugins actifs
$nbActivePlugins = sizeof($plxAdmin->plxPlugins->aPlugins);
# nombre de plugins inactifs
$nbInactivePlugins = sizeof($aInactivePlugins);
# récuperation du type de plugins à afficher
$_GET['sel'] = isset($_GET['sel']) ? intval(plxUtils::nullbyteRemove($_GET['sel'])) : '';
$session = isset($_SESSION['selPlugins']) ? $_SESSION['selPlugins'] : '1';
$sel = (in_array($_GET['sel'], array('0', '1')) ? $_GET['sel'] : $session);
$_SESSION['selPlugins'] = $sel;
if($sel=='1') {
$aSelList = array('' => L_FOR_SELECTION, 'deactivate'=> L_PLUGINS_DEACTIVATE, '-' => '-----', 'delete' => L_PLUGINS_DELETE);
$plugins = pluginsList($plxAdmin->plxPlugins->aPlugins, $plxAdmin->aConf['default_lang'], true);
} else {
$aSelList = array('' => L_FOR_SELECTION, 'activate' => L_PLUGINS_ACTIVATE, '-' => '-----', 'delete' => L_PLUGINS_DELETE);
$plugins = pluginsList($aInactivePlugins, $plxAdmin->aConf['default_lang'], false);
}
# fil d'ariane
$breadcrumbs = array();
$breadcrumbs[] = ''.L_PLUGINS_ACTIVE_LIST.' ('.$nbActivePlugins.')';
$breadcrumbs[] = ''.L_PLUGINS_INACTIVE_LIST.' ('.$nbInactivePlugins.')';
# On inclut le header
include(dirname(__FILE__).'/top.php');
?>
plxPlugins->callHook('AdminSettingsPluginsTop')) # Hook Plugins ?>
plxPlugins->callHook('AdminSettingsPluginsFoot'));
# On inclut le footer
include(dirname(__FILE__).'/foot.php');
?>