25define(
'NOSCANPOSTFORINJECTION', 1);
26define(
'NOSTYLECHECK', 1);
29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
34$langs->loadLangs(array(
"admin",
"other",
"website"));
40$conf->dol_hide_leftmenu = 1;
43$website =
GETPOST(
'website',
'alpha');
44$page =
GETPOST(
'page',
'alpha');
46$action =
GETPOST(
'action',
'aZ09');
58 $action =
'editmedia';
67 $action =
'setashome';
73 $action =
'editcontent';
80$permissiontoadd = $user->hasRight(
'collab',
'read');
81$permissiontodelete = $user->hasRight(
'collab',
'delete');
97if ($action ==
'add' && $permissiontoadd) {
100 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
101 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
102 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
103 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
105 if (empty($objectpage->title)) {
106 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
111 $res = $objectpage->create($user);
119 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
126 $id = $objectpage->id;
130if ($action ==
'delete' && $permissiontodelete) {
133 $res =
$object->fetch(0, $website);
135 $res = $objectpage->fetch($pageid,
$object->fk_website);
138 $res = $objectpage->delete($user);
146 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
148 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
164$form =
new Form($db);
168llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
170print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
171print
'<input type="hidden" name="token" value="'.newToken().
'">';
172if ($action ==
'create') {
173 print
'<input type="hidden" name="action" value="add">';
179if ($action !=
'preview' && $action !=
'editcontent') {
180 $style =
' margin-bottom: 5px;';
184print
'<div class="centpercent websitebar">';
189print
"</div>\n</form>\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.