32 if (!$res && !empty(
$_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) $res = @include
$_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
34 $tmp = empty(
$_SERVER[
'SCRIPT_FILENAME']) ?
'' :
$_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
35 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
36 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
37 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
39 if (!$res && file_exists(
"../../main.inc.php")) $res = @include
"../../main.inc.php";
40 if (!$res && file_exists(
"../../../main.inc.php")) $res = @include
"../../../main.inc.php";
41 if (!$res) die(
"Include of main fails");
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
44 require_once
'../lib/mymodule.lib.php';
47 $langs->loadLangs(array(
'mymodule@mymodule',
'admin'));
50 $form =
new Form($db);
53 $tmptype2label = ExtraFields::$type2label;
54 $type2label = array(
'');
55 foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
57 $action =
GETPOST(
'action',
'aZ09');
58 $attrname =
GETPOST(
'attrname',
'alpha');
59 $elementtype =
'mymodule_myobject';
68 require DOL_DOCUMENT_ROOT.
'/core/actions_extrafields.inc.php';
77 llxHeader(
'', $langs->trans(
"MyModuleSetup"), $help_url);
80 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
88 require DOL_DOCUMENT_ROOT.
'/core/tpl/admin_extrafields_view.tpl.php';
94 if ($action !=
'create' && $action !=
'edit')
96 print '<div class="tabsAction">';
97 print "<a class=\"butAction\" href=\"".$_SERVER[
"PHP_SELF"].
"?action=create#newattrib\">".$langs->trans(
"NewAttribute").
"</a>";
105 if ($action ==
'create')
107 print '<br><div id="newattrib"></div>';
110 require DOL_DOCUMENT_ROOT.
'/core/tpl/admin_extrafields_add.tpl.php';
116 if ($action ==
'edit' && !empty($attrname))
121 require DOL_DOCUMENT_ROOT.
'/core/tpl/admin_extrafields_edit.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
mymoduleAdminPrepareHead()
Prepare admin pages header.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.