if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); /** * @file * @brief Automatic installation of plugins and activation */ global $cn; global $http; $dossier_id=Dossier::id(); /****************************************************************************** * Scan the plugin folder and file in each subfolder a property file and * store them into an array a_plugin ****************************************************************************** */ $dirscan=scandir(NOALYSS_PLUGIN); $nb_dirscan=count($dirscan); $a_plugin=array(); for ($e=0;$e<$nb_dirscan;$e++) { if ($dirscan[$e] != '.' && $dirscan[$e]!='..' && is_dir(NOALYSS_PLUGIN.'/'.$dirscan[$e])) { $dir_plugin=$dirscan[$e]; if (file_exists(NOALYSS_PLUGIN.'/'.$dir_plugin.'/plugin.xml')) { $extension=Extension::read_definition(NOALYSS_PLUGIN.'/'.$dir_plugin.'/plugin.xml'); for ($i=0;$isave_plugin(); } catch (\Exception $e) { echo_warning($e->getMessage()); } } } } } $nb_plugin=count($a_plugin); /** * available profiles */ $a_profile=$cn->get_array('select p_id,p_name from profile where p_id > 0 order by p_name'); $nb_profile=count($a_profile); /****************************************************************************** * Display the Plugin and for each profile were it is installed or not ******************************************************************************/ ?>
get_array("select distinct p_id,p_name, (select count(*) from profile_menu as a where a.p_id=b.p_id and me_code=$1 )+ (select count(*) from menu_ref as c join profile_menu as d on (d.me_code=c.me_code) where d.p_id=b.p_id and me_file=$2 ) as cnt from profile as b where p_id > 0 order by p_name",array($a_plugin[$e]->me_code,$a_plugin[$e]->me_file)); $class=($e%2==0)?'odd':'even'; ?>
me_code); ?> me_menu); ?> me_description);?> AD: %s "),$a_plugin[$e]->depend); ?> me_file); ?> me_code.']['.$a_profile[$w]['p_id'].']'); $name=uniqid($a_plugin[$e]->me_code); $ckpl=new ICheckBox($name); $ckpl->set_attribute("gDossier", $dossier_id); $ckpl->set_attribute("me_code", $a_plugin[$e]->me_code); $ckpl->set_attribute("pr_id", $a_profile[$w]['p_id']); $ckpl->set_attribute("dep", $a_plugin[$e]->depend); $ckpl->set_attribute("order", $a_plugin[$e]->order); $ckpl->javascript=' onchange="activate_plugin(this)"'; if ($a_profile[$w]['cnt']>0) $ckpl->selected=true; echo $ckpl->input(); echo $a_profile[$w]['p_name']; ?>