26define(
'NOSCANPOSTFORINJECTION', 1);
27define(
'NOSTYLECHECK', 1);
30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
35$langs->loadLangs(array(
"admin",
"other",
"website"));
41'@phan-var-force WebsitePage $objectpage';
43$conf->dol_hide_leftmenu = 1;
46$website =
GETPOST(
'website',
'alpha');
47$page =
GETPOST(
'page',
'alpha');
49$action =
GETPOST(
'action',
'aZ09');
61 $action =
'editmedia';
70 $action =
'setashome';
76 $action =
'editcontent';
83$permissiontoadd = $user->hasRight(
'collab',
'read');
84$permissiontodelete = $user->hasRight(
'collab',
'delete');
100if ($action ==
'add' && $permissiontoadd) {
103 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
104 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
105 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
106 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
108 if (empty($objectpage->title)) {
109 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
114 $res = $objectpage->create($user);
122 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
129 $id = $objectpage->id;
133if ($action ==
'delete' && $permissiontodelete) {
136 $res =
$object->fetch(0, $website);
138 $res = $objectpage->fetch($pageid,
$object->fk_website);
141 $res = $objectpage->delete($user);
149 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
151 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
167$form =
new Form($db);
171llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
173print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
174print
'<input type="hidden" name="token" value="'.newToken().
'">';
175if ($action ==
'create') {
176 print
'<input type="hidden" name="action" value="add">';
182if ($action !=
'preview' && $action !=
'editcontent') {
183 $style =
' margin-bottom: 5px;';
187print
'<div class="centpercent websitebar">';
192print
"</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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session 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.
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.