Ejemplo n.º 1
0
			$form = new YesNoForm($lang->get("cr_vr", "Create variation"), $lang->get("crlib_mes", "The content element does not exists in the selected variation. Do you want to create it?"));
			$form->add(new Hidden("action", "cr_content"));
			$form->add(new Hidden("oid", $oid));
			$form->add(new Hidden("crvar", $variation));
			$handled = true;
		}
        }
        
        if (! $handled) {
        	$form = new PanelForm($lang->get("edit_content", "Edit Content"). ": " . $name, '', 'con');
        
        	if ($aclf->checkAccessToFunction("EDIT_OBJECT")) {
        		$editpanel = new Panel($lang->get("edit_content"));
        		$buttonbar = new ButtonBar("variations");
        		$buttonbar->selectBoxDescr = true;
        		$buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "1"), $variation);        		
        		$editpanel->add($buttonbar);
        		$editpanel->add(new Subtitle("st", $lang->get("title")));
        		$oname = new TextInput($lang->get("o_name"), "content", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE");
        		$oname->setFilter("CATEGORY_ID = $category_id");
        		$editpanel->add($oname);
        		$editpanel->add(new TextInput($lang->get('access_key', 'Access Key', 'Key-Value with which you can access this content from the editor by typing [key].'), 'content', 'ACCESSKEY', $cond, "type:text,width:100,size:16",'UNIQUE'));        		
        		$editpanel->backto = $c["docroot"] . "modules/content/objectbrowser.php?sid=$sid&resetfilter=1&pnode=$category_id";
        
        		// Edit
        		$editpanel->add(new Subtitle("st", $lang->get("edit_content")));
        		includePGNSource ($content_MODULE_ID);
        		$ref = createPGNRef($content_MODULE_ID, $fkid);
        
        		if ($ref != "") {
        			$ref->edit($editpanel);
        // add compound preview...
        if (getDBCell("cluster_templates", "CLT_TYPE_ID", "CLT_ID=" . $clt) == 1) {
            if ($aclf->checkAccessToFunction("B_PREVIEW_PAGE")) {
                $clustereditbar->addAction($lang->get("preview", "Preview"), "window.open('" . $c["docroot"] . "modules/common/previewcpcl.php?sid={$sid}&oid={$clnid}', 'Preview','Width=400px,Height=400px,help=no,status=yes,scrollbars=yes,resizable=yes');");
            }
        }
    }
    if ($sitepage) {
        // draw customized job buttons...
        $path = getDBCell("sitepage_master", "TEMPLATE_PATH", "SPM_ID = {$spm}");
        if ($aclf->checkAccessToFunction("B_LIVE_AUTHORING")) {
            $clustereditbar->addAction($lang->get("wysiwyg", 'WYSIWYG Editor'), "window.open('" . $c["docroot"] . "modules/sma/sma.php?page={$spid}&v={$variation}&sid={$sid}', 'Preview','Width=800px,Height=700px,help=no,status=yes,scrollbars=yes,resizable=yes');");
        }
    }
    if (!$isArticle) {
        $clustereditbar->setVariationSelector($variations, $variation);
    }
}
if ($isArticle) {
    $clustereditbar->setVariationSelector(getChannelVariations($chid), $variation);
}
if ($sitepage && !($action == $lang->get("edit_all") || $action == $lang->get("save") || $action == $lang->get("save_back") || $action == "editsingle" || $action == "delete" || $action == "addci") && $aclf->checkAccessToFunction("B_PREVIEW_PAGE")) {
    $clustereditbar->add("preview", $lang->get("sp_preview"), "BUTTON", "window.open('" . $c["devdocroot"] . $path . "?page={$spid}&v={$variation}', 'Preview','Width=800px,Height=600px,help=no,status=yes,scrollbars=yes,resizable=yes');");
}
if (isset($clustereditbar) && (!$clusterEditState || $isArticle)) {
    $clusterPanel->add($clustereditbar);
}
$clustereditbar->addAction('separator');
if ($sitepage && ($aclf->checkAccessToFunction("B_EXPIRE_LAUNCH") || $aclf->checkAccessToFunction("B_LAUNCH_TREE") || $aclf->checkAccessToFunction("B_RELAUNCH_TREE") || $aclf->checkAccessToFunction("B_EXPIRE_TREE") || $aclf->checkAccessToFunction("B_DESTROY_TREE")) && !($action == $lang->get("edit_all") || $action == $lang->get("save") || $action == $lang->get("save_back") || $action == "editsingle")) {
    if ($aclf->checkAccessToFunction("B_EXPIRE_LAUNCH")) {
        if ($spid != "") {
Ejemplo n.º 3
0
<?

	if ((value("changevariation") != "0" && value("changevariation") != "") || (value("changetranslation") != "0" && value("changetranslation") != ""))
		$page_state = "";

	$switchbar = new ButtonBar("swbar");

	if ($mpProp) {
		$allowedVariations = createDBCArray("sitepage_variations", "VARIATION_ID", "SPM_ID = $spm");

		$commatext = implode(", ", $allowedVariations);
		$variations = createNameValueArray("variations", "NAME", "VARIATION_ID", "DELETED=0 AND VARIATION_ID IN ($commatext)");
	}

	$switchbar->setVariationSelector($variations, $variation);

	if ($mpProp) {
		$backup = $spid;

		$spid = $menuID;
	}

	// synchronize.... because new feature
	if (countRows("sitepage_names", "SPID", "SPID = $spid AND VARIATION_ID = $variation") < 1) {
		$sql = "INSERT INTO sitepage_names (SPID, VARIATION_ID) VALUES ($spid, $variation)";

		$query = new query($db, $sql);
		$query->free();
	}

	$menuPanel->add($switchbar);