24define(
'NOSCANPOSTFORINJECTION', 1);
25define(
'NOSTYLECHECK', 1);
28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_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';
79$permissiontoadd = $user->hasRight(
'collab',
'read');
80$permissiontodelete = $user->hasRight(
'collab',
'delete');
96if ($action ==
'add' && $permissiontoadd) {
99 $objectpage->title =
GETPOST(
'WEBSITE_TITLE');
100 $objectpage->pageurl =
GETPOST(
'WEBSITE_PAGENAME');
101 $objectpage->description =
GETPOST(
'WEBSITE_DESCRIPTION');
102 $objectpage->keywords =
GETPOST(
'WEBSITE_KEYWORD');
104 if (empty($objectpage->title)) {
105 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_PAGENAME")),
null,
'errors');
110 $res = $objectpage->create($user);
118 setEventMessages($langs->trans(
"PageAdded", $objectpage->pageurl),
null,
'mesgs');
125 $id = $objectpage->id;
129if ($action ==
'delete' && $permissiontodelete) {
132 $res =
$object->fetch(0, $website);
134 $res = $objectpage->fetch($pageid,
$object->fk_website);
137 $res = $objectpage->delete($user);
145 setEventMessages($langs->trans(
"PageDeleted", $objectpage->pageurl, $website),
null,
'mesgs');
147 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?website='.$website);
163$form =
new Form($db);
167llxHeader(
'', $langs->trans(
"WebsiteSetup"), $help_url,
'', 0,
'',
'',
'',
'',
'',
'<!-- Begin div class="fiche" -->'.
"\n".
'<div class="fichebutwithotherclass">');
169print
"\n".
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST"><div>';
170print
'<input type="hidden" name="token" value="'.newToken().
'">';
171if ($action ==
'create') {
172 print
'<input type="hidden" name="action" value="add">';
178if ($action !=
'preview' && $action !=
'editcontent') {
179 $style =
' margin-bottom: 5px;';
183print
'<div class="centpercent websitebar">';
188print
"</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()
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.