Go to the documentation of this file.
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"));
38 $conf->dol_hide_leftmenu = 1;
41 $website =
GETPOST(
'website',
'alpha');
42 $page =
GETPOST(
'page',
'alpha');
43 $pageid =
GETPOST(
'pageid',
'int');
44 $action =
GETPOST(
'action',
'aZ09');
56 $action =
'editmedia';
65 $action =
'setashome';
71 $action =
'editcontent';
94 if ($action ==
'add') {
97 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
98 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
99 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
100 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
102 if (empty($objectpage->title)) {
103 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
108 $res = $objectpage->create($user);
116 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
123 $id = $objectpage->id;
127 if ($action ==
'delete') {
130 $res = $object->fetch(0, $website);
132 $res = $objectpage->fetch($pageid, $object->fk_website);
135 $res = $objectpage->delete($user);
143 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
145 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
165 llxHeader(
'', $langs->trans(
"WebsiteSetup"),
$help_url,
'', 0,
'',
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
167 print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
168 print
'<input type="hidden" name="token" value="'.newToken().
'">';
169 if ($action ==
'create') {
170 print
'<input type="hidden" name="action" value="add">';
176 if ($action !=
'preview' && $action !=
'editcontent') {
177 $style =
' margin-bottom: 5px;';
181 print
'<div class="centpercent websitebar">';
186 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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
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 ...