$page->setJS("TREE"); $page->setJS("FCKLIB"); //initialize $variation = variation(); $action = value("action", "", ""); $clt = value("clt", "NUMERIC", ""); if ($action == "" && value("changevariation", "", "") != "") { $action = value("acstate"); $clt = initValueEx("clt", "clt", "", "NUMERIC"); } $go = value("go", "NOSPACES", ""); $pnode = initValueEx("pnode", "pnode", "0", "NUMERIC"); //// ACL Check //// $aclf = aclFactory($pnode, "folder"); $aclf->load(); if (! $aclf->hasAccess($auth->userId)) { $pnode = "0"; delVar($pnode); $aclf = aclFactory(0, "folder"); $aclf->load(); if (! $aclf->hasAccess($auth->userId)) header("Location: ". $c["docroot"]."modules/common/noaccess.php?sid=$sid&guid=$pnode"); } //// ACL Check //// $clnid = value("clnid");
if ($action == $lang->get('resetcli') && $aclf->checkAccessToFunction("B_RESET_CL_INST")) { $spid = value("spid"); $sql = "UPDATE sitepage SET CLNID=0 WHERE SPID = $spid"; $query = new query($db, $sql); $query->free(); $action = "editobject"; $go = "CREATE"; $processing = "no"; $page_state = "start"; } if ($action == "newpage" && $aclf->checkAccessToFunction("ADD_SITEPAGE")) { if ($go == "insert") $page_action = "INSERT"; $mid = initValueEx("mid", "mid", "0"); $form = new stdEDForm($lang->get("sp_newpage"), "i_edit.gif"); $cond = $form->setPK("sitemap", "MENU_ID"); $form->add(new IconSelectInput($lang->get("tmpl_name", "Select a template"), "sitemap", "SPM_ID", "sitepage_master", "NAME", "SPM_ID", "DESCRIPTION", $c["spmthumbdocroot"], "THUMBNAIL", "DELETED=0 AND VERSION=0", $cond, "type:dropdown", "MANDATORY")); $oname = new TextInput($lang->get("stname", "Select a name to identify this page in the sitemap"), "sitemap", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"); $oname->setFilter("PARENT_ID = $mid"); $form->add($oname); $form->add(new SitemapPosition($lang->get("pos_in_menu"), "sitemap", "POSITION", $cond, 0, $mid)); $form->add(new Label("lbl", $lang->get("cr_content", "Create Content for this page?"), "standard")); $form->add(new Checkbox("createpage", "1", "standard", true)); $form->add(new ActionField("newpage")); $form->add(new NonDisplayedValueOnInsert("sitemap", "PARENT_ID", $cond, $mid, "NUMBER")); $form->add(new NonDisplayedValueOnInsert("sitemap", "DELETED", $cond, 0, "NUMBER")); $form->add(new NonDisplayedValueOnInsert("sitemap", "IS_DISPLAYED", $cond, 1, "NUMBER")); $form->forbidDelete(true); $form->forbidUpdate(true);