24 define(
'NOSCANPOSTFORINJECTION', 1);
25 define(
'NOSTYLECHECK', 1);
28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
33 $langs->loadLangs(array(
"admin",
"other",
"website"));
39 $conf->dol_hide_leftmenu = 1;
42 $website =
GETPOST(
'website',
'alpha');
43 $page =
GETPOST(
'page',
'alpha');
45 $action =
GETPOST(
'action',
'aZ09');
57 $action =
'editmedia';
66 $action =
'setashome';
72 $action =
'editcontent';
95 if ($action ==
'add') {
98 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
99 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
100 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
101 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
103 if (empty($objectpage->title)) {
104 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
109 $res = $objectpage->create($user);
117 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
124 $id = $objectpage->id;
128 if ($action ==
'delete') {
131 $res =
$object->fetch(0, $website);
133 $res = $objectpage->fetch($pageid,
$object->fk_website);
136 $res = $objectpage->delete($user);
144 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
146 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
162 $form =
new Form($db);
166 llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0,
'',
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
168 print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
169 print
'<input type="hidden" name="token" value="'.newToken().
'">';
170 if ($action ==
'create') {
171 print
'<input type="hidden" name="action" value="add">';
177 if ($action !=
'preview' && $action !=
'editcontent') {
178 $style =
' margin-bottom: 5px;';
182 print
'<div class="centpercent websitebar">';
187 print
"</div>\n</form>\n";
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.