check_module('CFGPRO')==0) die(); require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; $http=new HttpInput(); try { $type=$http->get('type'); $p_level=$http->get('p_level', "string",0); $dep=$http->get('dep', "string",0); } catch (Exception $exc) { echo $exc->getMessage(); error_log($exc->getTraceAsString()); return; } // if type == menu the if ($type=='me') { if ( isNumber($p_level)==0 ) throw new Exception('invalid call'); if ($p_level==0) { // There is no dependency // Menu which can be added $ame_code=$cn->make_array(" select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'') ||'('|| case when me_type='SP' then 'Special' when me_type='PL' then 'Plugin' when me_type='ME' and me_file is null and me_javascript is null and me_url is null then 'Module - Menu principal' when me_type='ME' then 'Menu' else me_type end||')' from menu_ref where me_type<>'PR' order by 1 "); } elseif ($p_level==1) { // dependency is in dep // Menu which can be added $ame_code=$cn->make_array(" select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'') ||'('|| case when me_type='SP' then 'Special' when me_type='PL' then 'Plugin' when me_type='ME' and me_file is null and me_javascript is null and me_url is null then 'Module - Menu principal' when me_type='ME' then 'Menu' else me_type end||')' from menu_ref where me_type<>'PR' order by 1 "); } elseif ($p_level==2) { // menu can *NOT* have submenu // Menu which can be added $ame_code=$cn->make_array(" select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'') ||'('|| case when me_type='SP' then 'Special' when me_type='PL' then 'Plugin' when me_type='ME' and me_file is null and me_javascript is null and me_url is null then 'Module - Menu principal' when me_type='ME' then 'Menu' else me_type end||')' from menu_ref where me_type<>'PR' and ( coalesce(me_file,'') <> '' or coalesce(me_url,'') <> '' or coalesce(me_javascript,'') <> '' ) order by 1 "); } else { throw new Exception('LEVEL ERROR'); } $p_order=new INum("p_order", "10"); $me_code=new ISelect('me_code'); $me_code->rowsize=15; $me_code->value=$ame_code; $pm_default=new ICheckBox('pm_default'); echo HtmlInput::title_box(_("Nouveau"), $ctl); ?>