check_module('CFGPRO')==0) die(); $type=HtmlInput::default_value_get('type', 'XX'); $p_level=HtmlInput::default_value_get('p_level', 0); $dep=HtmlInput::default_value_get('dep', 0); if ($type=='XX') { throw new Exception('invalid call'); 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->value=$ame_code; $pm_default=new ICheckBox('pm_default'); echo HtmlInput::title_box(_("Nouveau"), $ctl); ?>