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';
43$langs->loadLangs(array(
"admin",
"other",
"website"));
49'@phan-var-force WebsitePage $objectpage';
51$conf->dol_hide_leftmenu = 1;
54$website =
GETPOST(
'website',
'alpha');
55$page =
GETPOST(
'page',
'alpha');
57$action =
GETPOST(
'action',
'aZ09');
69 $action =
'editmedia';
78 $action =
'setashome';
84 $action =
'editcontent';
91$permissiontoadd = $user->hasRight(
'collab',
'read');
92$permissiontodelete = $user->hasRight(
'collab',
'delete');
108if ($action ==
'add' && $permissiontoadd) {
111 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
112 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
113 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
114 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
116 if (empty($objectpage->title)) {
117 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
122 $res = $objectpage->create($user);
130 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
137 $id = $objectpage->id;
141if ($action ==
'delete' && $permissiontodelete) {
144 $res =
$object->fetch(0, $website);
146 $res = $objectpage->fetch($pageid,
$object->fk_website);
149 $res = $objectpage->delete($user);
157 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
159 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
175$form =
new Form($db);
179llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
181print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
182print
'<input type="hidden" name="token" value="'.newToken().
'">';
183if ($action ==
'create') {
184 print
'<input type="hidden" name="action" value="add">';
190if ($action !=
'preview' && $action !=
'editcontent') {
191 $style =
' margin-bottom: 5px;';
195print
'<div class="centpercent websitebar">';
200print
"</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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.