29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
33$action =
GETPOST(
'action',
'aZ09');
34$cancel =
GETPOST(
'cancel',
'alpha');
45$langs->loadLangs(array(
"companies",
"products",
"admin",
"users",
"other"));
52$dirstandard = array();
53$dirsmartphone = array();
54$dirmenus = array_merge(array(
"/core/menus/"), (array)
$conf->modules_parts[
'menus']);
55foreach ($dirmenus as $dirmenu) {
56 $dirstandard[] = $dirmenu.
'standard';
57 $dirsmartphone[] = $dirmenu.
'smartphone';
64$err = error_reporting();
75if ($action ==
'update' && !$cancel) {
76 $_SESSION[
"mainmenu"] =
"home";
85 $listofmenuhandler = array();
86 $listofmenuhandler[preg_replace(
'/(_backoffice|_frontoffice|_menu)?\.php/i',
'',
GETPOST(
'MAIN_MENU_STANDARD',
'alpha'))] = 1;
87 $listofmenuhandler[preg_replace(
'/(_backoffice|_frontoffice|_menu)?\.php/i',
'',
GETPOST(
'MAIN_MENUFRONT_STANDARD',
'alpha'))] = 1;
88 if (
GETPOST(
'MAIN_MENU_SMARTPHONE',
'alpha')) {
89 $listofmenuhandler[preg_replace(
'/(_backoffice|_frontoffice|_menu)?\.php/i',
'',
GETPOST(
'MAIN_MENU_SMARTPHONE',
'alpha'))] = 1;
91 if (
GETPOST(
'MAIN_MENUFRONT_SMARTPHONE',
'alpha')) {
92 $listofmenuhandler[preg_replace(
'/(_backoffice|_frontoffice|_menu)?\.php/i',
'',
GETPOST(
'MAIN_MENUFRONT_SMARTPHONE',
'alpha'))] = 1;
96 foreach ($listofmenuhandler as $key => $val) {
98 $dirmenus = array_merge(array(
"/core/menus/"), (array)
$conf->modules_parts[
'menus']);
99 foreach ($dirmenus as $dirmenu) {
100 $file =
'init_menu_'.$key.
'.sql';
104 if (file_exists($fullpath)) {
107 $result =
run_sql($fullpath, 1, 0, 1, $key,
'none');
112 setEventMessages($langs->trans(
"FailedToInitializeMenu").
' '.$key,
null,
'errors');
123 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
133$form =
new Form($db);
136$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
137llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-menus');
145$head[$h][0] = DOL_URL_ROOT.
"/admin/menus.php";
146$head[$h][1] = $langs->trans(
"MenuHandlers");
147$head[$h][2] =
'handler';
150$head[$h][0] = DOL_URL_ROOT.
"/admin/menus/index.php";
151$head[$h][1] = $langs->trans(
"MenuAdmin");
152$head[$h][2] =
'editor';
155print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
156print
'<input type="hidden" name="token" value="'.newToken().
'">';
157print
'<input type="hidden" name="action" value="update">';
161print
'<div class="opacitymedium justify hideonsmartphone">'.$langs->trans(
"MenusDesc").
"</div>\n";
162print
'<br class="hideonsmartphone">';
171print
'<div class="div-table-responsive-no-min">';
173print
'<table class="noborder centpercent">';
174print
'<tr class="liste_titre"><td>'.$langs->trans(
"Menu").
'</td>';
176print $form->textwithpicto($langs->trans(
"InternalUsers"), $langs->trans(
"InternalExternalDesc"));
179print $form->textwithpicto($langs->trans(
"ExternalUsers"), $langs->trans(
"InternalExternalDesc"));
184print
'<tr class="oddeven"><td>'.$langs->trans(
"DefaultMenuManager").
'</td>';
194print
'<tr class="oddeven"><td>'.$langs->trans(
"DefaultMenuSmartphoneManager").
'</td>';
198if (
getDolGlobalString(
'MAIN_MENU_SMARTPHONE_FORCED') && preg_match(
'/smartphone/',
$conf->global->MAIN_MENU_SMARTPHONE_FORCED)
200 print
' '.img_warning($langs->transnoentitiesnoconv(
"ThisForceAlsoTheme"));
205$formadmin->select_menu(
getDolGlobalString(
'MAIN_MENUFRONT_SMARTPHONE_FORCED',
getDolGlobalString(
'MAIN_MENUFRONT_SMARTPHONE')),
'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), !
getDolGlobalString(
'MAIN_MENUFRONT_SMARTPHONE_FORCED') ?
'' :
' disabled');
207if (
getDolGlobalString(
'MAIN_MENU_SMARTPHONE_FORCED') && preg_match(
'/smartphone/',
$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
209 print
' '.img_warning($langs->transnoentitiesnoconv(
"ThisForceAlsoTheme"));
220print
'<div class="center">';
221print
'<input class="button button-save" type="submit" name="save" value="'.$langs->trans(
"Save").
'">';
run_sql($sqlfile, $silent=1, $entity=0, $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0, $colspan=0, $onlysqltoimportwebsite=0, $database='')
Launch a sql file.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.