24 define(
'NOSCANPOSTFORINJECTION', 1);
25 define(
'NOSTYLECHECK', 1);
27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32 $langs->loadLangs(array(
"admin",
"other",
"website"));
36 $conf->dol_hide_leftmenu = 1;
39 $website =
GETPOST(
'website',
'alpha');
40 $page =
GETPOST(
'page',
'alpha');
41 $pageid =
GETPOST(
'pageid',
'int');
42 $action =
GETPOST(
'action',
'aZ09');
44 if (
GETPOST(
'delete')) { $action =
'delete'; }
45 if (
GETPOST(
'preview')) $action =
'preview';
46 if (
GETPOST(
'create')) { $action =
'create'; }
47 if (
GETPOST(
'editmedia')) { $action =
'editmedia'; }
48 if (
GETPOST(
'editcss')) { $action =
'editcss'; }
49 if (
GETPOST(
'editmenu')) { $action =
'editmenu'; }
50 if (
GETPOST(
'setashome')) { $action =
'setashome'; }
51 if (
GETPOST(
'editmeta')) { $action =
'editmeta'; }
52 if (
GETPOST(
'editcontent')) { $action =
'editcontent'; }
54 if (empty($action)) $action =
'preview';
63 if (
GETPOST(
'refreshsite')) $pageid = 0;
64 if (
GETPOST(
'refreshpage')) $action =
'preview';
72 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
73 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
74 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
75 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
77 if (empty($objectpage->title))
79 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")), null,
'errors');
85 $res = $objectpage->create($user);
95 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl), null,
'mesgs');
102 $id = $objectpage->id;
106 if ($action ==
'delete')
110 $res = $object->fetch(0, $website);
112 $res = $objectpage->fetch($pageid, $object->fk_website);
116 $res = $objectpage->delete($user);
126 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website), null,
'mesgs');
128 header(
"Location: ".
$_SERVER[
"PHP_SELF"].
'?website='.$website);
144 $form =
new Form($db);
148 llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0,
'',
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
150 print "\n".
'<form action="'.
$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
151 print '<input type="hidden" name="token" value="'.newToken().
'">';
152 if ($action ==
'create')
154 print '<input type="hidden" name="action" value="add">';
160 if ($action !=
'preview' && $action !=
'editcontent') $style =
' margin-bottom: 5px;';
163 print '<div class="centpercent websitebar">';
168 print "</div>\n</form>\n";
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
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 ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...