/**
		  * standard constructor
		  * @param string Text that is to be shown as description or label with your object. (will not be displayed !!)
		  * @param string Table, you want to connect with the object.
		  * @param string column, you want to connect with the object.
		  * @param string $row_identifier Usually to be generated with form->setPK. Identifies the
		  * row in db, you want to affect with operation. Keep empty for insert. (Example: stdEDForm)
		  * @param string $params Allowed parameters are:
		  * type:RICH;
		  * size:XX Size of Input in chars.
		  * width:XX Size of Input in pixel.
		  * @param string $check Does checks on user input. Allowed are MANDATORY (=not null)|UNIQUE. Separate with &.
		  * @param string $db_datatype Datatype of the database, you want to use. Allowed are CHAR|NUMBER|PASSWORD
		  */
		function RicheditInput($label, $table, $column, $row_identifier = "1", $params = "type:rich,size:10,width:100", $check = "", $db_datatype = "TEXT") {
			DBO::DBO($label, $table, $column, $row_identifier, $params, $db_datatype, $check);

			global $page_state, $page_action, $forceLoadFromDB;

			if ($page_state == "processing" && value("changevariation") != "GO" && value("changetranslation") != "GO" && ! ($forceLoadFromDB=="yes")) {
                //$fieldname = $this->table."_".$this->column;
				$fieldname = $this->name;

				if (value($fieldname) != "0") {
					$this->value = value($fieldname);
                } else {
                    $this->value = $_POST[$fieldname];
                }
				/** added 21.1.2002 */
				global $c_magic_quotes_gpc;

				if ($c_magic_quotes_gpc == 1)
					$this->value = str_replace("\\", "", $this->value);
				$this->value = str_replace('&', '&', $this->value);
				/** got rid of magic quotes! */
				$this->oldvalue = getDBCell($table, $column, $row_identifier);
			} else {
				if (($page_action == "UPDATE" || $page_action == "DELETE") && $this->row_identifier != "1") {
                    $parser = new NX2HTML(variation());
					$this->value = $parser->parseText(getDBCell($table, $column, $row_identifier));

				}
			}
		
			switch ($this->type):
				case "RICH":
					$this->v_wuiobject = new Richedit($this->name, $this->value, $this->std_style, $this->size, $this->parameter, $this->width);
					break;
			endswitch;
		}
	 **********************************************************************/
	 require_once "../../config.inc.php";

	// include extra language file
	// include extra language file
	$auth = new auth("CL_BROWSER");
	if (value('resetfilter', 'NUMERIC', '0') == '1')
	  delVar('linkset');
	
	$page = new page("Cluster Browser");

	$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)) {
        $clustereditbar->addAction($lang->get("sp_rltree", "Refresh Tree"));
    }
    if ($aclf->checkAccessToFunction("B_EXPIRE_TREE")) {
        $clustereditbar->addAction($lang->get('exp_tree', 'Expire Tree'));
    }
    if ($aclf->checkAccessToFunction("B_DESTROY_TREE") && $isDeletable) {
        $clustereditbar->addAction('separator');
        $clustereditbar->addAction($lang->get('del_tree', 'Delete Tree'));
    }
}
if (!$c["disableTranslationHelp"] && $editState && countRows("variations", "VARIATION_ID", "1") > 1) {
    $toolbar = new Buttonbar("Toolbar");
    $toolbar->selectBoxDescr = true;
    $toolbar->setTranslationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "VARIATION_ID <>" . variation()), translation());
    if (!$isArticle) {
        $toolbar->setVariationSelector(populateVariations($clnid, variation()), variation());
    }
    $clusterPanel->add($toolbar);
}
// PANELS
// Edit-Content Panel.
// include needed sources
includePGNISources();
//Plugin Sources.
$clid = getClusterFromNode($clnid, $variation);
if ($view == $pos_clusterPanel) {
    syncCluster($clid);
}
$clusterPanel->add(new Hidden("view", $view));
$clusterPanel->add(new Hidden("oid", value("oid", "NUMERIC")));
if (!$clusterEditState || $isArticle) {
		/**
		   * Create the sql-code for a version of the selected object
		   * @param integer ID of new Version.
		   * @returns string SQL Code for new Version.
		   */
		function createVersion($newid) {
			// query for content
			global $db;

			$querySQL = "SELECT * FROM $this->management_table WHERE $this->pk_name = $this->fkid";
			$query = new query($db, $querySQL);
			$query->getrow();
			$content = $query->field("SNIPLET");
			$snt = $query->field("SNIPLETTYPE");
			$parser = new LaunchText(variation(), false);
			$content = addslashes($parser->parseText($content));			
			$query->free();

			$sql = "INSERT INTO $this->management_table ($this->pk_name, SNIPLET, SNIPLETTYPE ) VALUES ($newid, '$content', $snt)";
			return $sql;
		}
Beispiel #5
0
	/**
	 * Creates an instance of the Selected module and variation.
	 * returns the plugin-Class
	 * @param integer ID of the content
	 * @param integer Variation ID to select appropriate recordset for.
	 * @return Object	Object of type Plugin.
	 */
	function createPGNRef2($contentId, $variation=0) {
		global $c, $cds;
		if ($variation==0 && ! is_object($cds)) $variation = variation();
		$modId = getDBCell("content", "MODULE_ID", "CID=".$contentId);
		$check = getDBCell("content_variations", "VARIATION_ID", "VARIATION_ID = $variation AND CID = $contentId");
		if ($check =="") {
			$variation = getDBCell("content_variations", "VARIATION_ID", "CID = $contentId");
		}
		$fkid = getDBCell("content_variations", "FK_ID", "CID = $contentId AND VARIATION_ID = ".$variation);
		
        if ($modId != "") {
			includePGNSource($modId);
			return createPGNRef($modId, $fkid);
        }
	}
	 *	The initial has been setup as a small diploma thesis (Studienarbeit) at the FZI.
	 *	It was be coached by Prof. Werner Zorn and Dipl.-Inform Thomas Gauweiler.
	 *
	 *	N/X is free software; you can redistribute it and/or modify
	 *	it under the terms of the GNU General Public License as published by
	 *	the Free Software Foundation; either version 2 of the License, or
	 *	(at your option) any later version.
	 *
	 *	N/X is distributed in the hope that it will be useful,
	 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
	 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	 *	GNU General Public License for more details.
	 *
	 *	You should have received a copy of the GNU General Public License
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/

	require_once "../../config.inc.php";
	$auth = new auth("B_PREVIEW_PAGE");
	require_once $c["path"]."api/cds/lib.inc.php";
	includePGNISources();
	$cds = new CDSApi(true);
	$clnid = value("oid", "NUMERIC");
	$clt = getDBCell("cluster_node", "CLT_ID", "CLNID = $clnid");
	$template = html_entity_decode(getDBCell("cluster_templates", "TEMPLATE", "CLT_ID=$clt"));
	$me = new AbstractCDSApi(true, $clnid, variation());
	$cds->layout->htmlHeader();
	eval($template);
	$cds->layout->htmlFooter();
?>
 /**
  * query the rows from the database
  */
 function getRows()
 {
     global $db, $c, $sid, $lang, $auth;
     $result = array();
     $order = "ca.TITLE";
     if ($this->order == "NAME") {
         $order = "ca.TITLE";
     } else {
         if ($this->order == "CATEGORY") {
             $order = "ca.CH_CAT_ID";
         } else {
             if ($this->order == "EDITED") {
                 $order = "cv.LAST_CHANGED";
             } else {
                 if ($this->order == "CREATED") {
                     $order = "cv.CREATED_AT";
                 } else {
                     if ($this->order == "POSITION") {
                         $order = "ca.POSITION";
                     }
                 }
             }
         }
     }
     $order .= " " . $this->orderdir;
     // $sql_articles = "Select ca.*, cv.LAST_USER, cv.CREATED_AT, cv.LAST_CHANGED FROM channel_articles ca, cluster_variations cv ".$this->getFilterJoin()." WHERE ca.CHID = ".$this->channelId." AND ca.ARTICLE_ID = cv.CLNID AND cv.VARIATION_ID = ".variation()." AND ca.VERSION=0 " . $this->getFilterSQL() . " ORDER BY $order LIMIT ".(($this->page - 1) * $this->recordsPerPage).",".$this->recordsPerPage;
     $sql_articles = "SELECT DISTINCT ca.* FROM channel_articles ca, cluster_variations cv " . $this->getFilterJoin() . " WHERE ca.ARTICLE_ID = cv.CLNID AND ca.CHID = " . $this->channelId . " AND ca.VERSION = 0 " . $this->getFilterSQL() . " ORDER BY {$order} LIMIT " . ($this->page - 1) * $this->recordsPerPage . "," . $this->recordsPerPage;
     // echo $sql_articles;
     $query = new query($db, $sql_articles);
     while ($query->getrow()) {
         $tmp = array();
         $varexists = true;
         $article_id = $query->field("ARTICLE_ID");
         $cvdatasql = "SELECT * FROM cluster_variations WHERE CLNID = " . $article_id . " AND VARIATION_ID=" . variation();
         $cvdata = new query($db, $cvdatasql);
         $cvdata->getrow();
         if ($cvdata->count() < 1) {
             $varexists = false;
         }
         array_push($tmp, $query->field("ARTICLE_ID"));
         $clid = getDBCell("cluster_variations", "CLID", "CLNID = " . $query->field("ARTICLE_ID") . " AND VARIATION_ID = " . variation());
         $live = isClusterLive($clid);
         if ($varexists) {
             if ($live) {
                 array_push($tmp, drawImage("green.gif", $lang->get("article_is_live", "Article is live")));
             } else {
                 array_push($tmp, drawImage("red.gif", $lang->get("article_is_expired", "Article is expired")));
             }
         } else {
             array_push($tmp, drawImage("gray.gif", $lang->get("article_variation_missing", "Variation of this article does not exist yet")));
         }
         array_push($tmp, $query->field("POSITION"));
         array_push($tmp, '<b>' . $query->field("TITLE") . '</b>');
         array_push($tmp, $this->categories[$query->field("CH_CAT_ID")]);
         array_push($tmp, formatDBTimestamp($cvdata->field("LAST_CHANGED")));
         $buttons = "&nbsp;" . crLink(drawImage('up.gif'), $c["docroot"] . "modules/channels/overview.php?sid={$sid}&action=up&article=" . $query->field("ARTICLE_ID"), "navelement");
         $buttons .= "&nbsp;" . crLink(drawImage('down.gif'), $c["docroot"] . "modules/channels/overview.php?sid={$sid}&action=down&article=" . $query->field("ARTICLE_ID"), "navelement");
         $buttons .= "&nbsp;";
         if ($auth->checkAccessToFunction("CHANNEL_DELETE")) {
             $buttons .= "&nbsp;" . crLink($lang->get("delete"), "javascript:confirmAction('" . $lang->get("del_article") . "', '" . $c["docroot"] . "modules/channels/overview.php?sid={$sid}&action=deletearticle&article=" . $query->field("ARTICLE_ID") . "');", "navelement");
         }
         if ($auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
             $buttons .= "&nbsp;" . crLink($lang->get("launch", "Launch"), $c["docroot"] . "modules/channels/overview.php?sid={$sid}&action=launcharticle&article=" . $query->field("ARTICLE_ID"), "navelement");
             $buttons .= "&nbsp;" . crLink($lang->get("expire", "Expire"), $c["docroot"] . "modules/channels/overview.php?sid={$sid}&action=expirearticle&article=" . $query->field("ARTICLE_ID"), "navelement");
         }
         array_push($tmp, $buttons);
         array_push($result, $tmp);
     }
     return $result;
 }
/**
 * get the allowed variations of a channel
 * @param integer id of the channel
 */
function getChannelVariations($channelId)
{
    global $db, $c, $variation;
    $variation = variation();
    $isInVariations = false;
    $result = array();
    $sql = "SELECT v.NAME AS NAM, v.VARIATION_ID AS VAR FROM variations v, sitepage_variations s WHERE s.SPM_ID = {$channelId} AND s.VARIATION_ID = v.VARIATION_ID";
    $query = new query($db, $sql);
    while ($query->getrow()) {
        $ar[0] = $query->field("NAM");
        $ar[1] = $query->field("VAR");
        $result[] = $ar;
        if ($ar[1] == $variation) {
            $isInVariations = true;
        }
    }
    if (!$isInVariations) {
        pushVar("variation", $result[0][1]);
        $variation = $result[0][1];
        if ($variation == "") {
            $variation = $c["stdvariation"];
        }
    }
    return $result;
}
		/**
		   * Create the sql-code for a version of the selected object
		   * @param integer ID of new Version.
		   * @returns string SQL Code for new Version.
		   */
		function createVersion($newid) {
			// query for content
			global $db;

			$querySQL = "SELECT CONTENT FROM $this->management_table WHERE $this->pk_name = $this->fkid";
			$query = new query($db, $querySQL);
			$query->getrow();
			$content = $query->field("CONTENT");
			$parser = new LaunchText(variation(), false);			
			$content = addslashes($parser->parseText($content));			
			$query->free();
			$launchparser = new ObjectParser();
			$launchparser->launch($content, variation());
			$sql = "INSERT INTO $this->management_table ($this->pk_name, CONTENT) VALUES ($newid, '$content')";
			return $sql;
		}
$rowOrderFilter = "VERSION=0 AND CHID=" . $selch->selected;
if (value("action") == "up") {
    $article = value("article", "NUMERIC");
    moveRowUp("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
} else {
    if (value("action") == "down") {
        $article = value("article", "NUMERIC");
        moveRowDown("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
    }
}
$filtermenu = new StdMenu("");
require_once $c["path"] . "modules/channels/menu.inc.php";
$oid = value("oid", "NUMERIC");
if ($selch->selected != "0" && $selch->selected != "-1" && $selch->selected != 0) {
    sortTableRows("channel_articles", "ARTICLE_ID", "POSITION", $rowOrderFilter);
    $form = new ArticleSelectForm($selch->selected);
    $form->newAction = "modules/channels/edit.php?sid={$sid}&action=createarticle";
    $form->buttonbar->setVariationSelector(getChannelVariations($selch->selected), variation());
    $form->editAction = $c["docroot"] . "modules/channels/edit.php";
    $form->addFilterRule($lang->get("name"), "ca.TITLE");
    $form->addFilterRule($lang->get("category"), "cc.NAME", "LEFT JOIN channel_categories cc ON cc.CH_CAT_ID = ca.CH_CAT_ID");
    $form->addFilterRule($lang->get("Author"), "cv.LAST_USER");
    // preparation for adding a "grab from Multipage"-Button
    $grabAction = "modules/channels/wz_import.php?sid={$sid}";
    $form->buttonbar->add("new", $lang->get("channel_importarticles", "Import articles"), "button", "document.location.href='" . $c["docroot"] . $grabAction . "';", "navelement");
    $page->add($form);
}
// SELECT `channel_articles`.* FROM channel_categories, channel_articles WHERE ((`channel_categories`.`NAME` = 'Erfolge') AND (`channel_articles`.`CH_CAT_ID` = channel_categories.CH_CAT_ID))
$page->addMenu($selch);
$page->addMenu($filtermenu);
$page->draw();
	/**
	 * Draw the input boxes needed for editing the contents in the envelope.
	 * @param integer id of cluster_content.CLCID
	 */
	function getSingleEdit($id) {
		global $specialID, $lang, $c, $sid, $aclf, $db, $lang;
        global $forceLoadFromDB, $auth;

       $clt = getDBCell("cluster_template_items", "FKID", "CLTI_ID = ".$this->clti);

       if ($this->saction == "createCluster" && $id == value("id")) {
                $name = parseSQL(value("cluster_node_NAME".$id));
                if ($name=="0") $name = "Cluster";
                $name = makeCopyName("cluster_node", "NAME", $name, "1", "", false);
                $clnid = createClusterNode($name, $clt);
                $variations = createDBCArray("variations", "VARIATION_ID");
                for ($varX=0; $varX < count($variations); $varX++) {
                        $clid = createCluster($clnid, $variations[$varX], $auth->userName);
                }

                $sql = "UPDATE cluster_content SET FKID = $clnid WHERE CLCID = $id";
                $query = new query($db, $sql);
                $query->free();
                $forceLoadFromDB = "yes";
        }

        if ($this->editState && $this->editor) {
            $chclbox = new Container(4);
				$compoundEnvelope = new Container(3);
				$compoundContainer = new Container(3);

                $specialID = $id;
                $cpselector = new CPCLSelector($lang->get("select_cl"), "cluster_content", "FKID", "CLCID=$id", getModuleFromCLC($id), "", "");
                $cpselector->additionalAttribute = "onchange=\" if ( !confirm('".$lang->get("confirm_unsaved_changes_linkedcluster", "Note: When changing the linked cluster, any changes you apply on the currently linked cluster will be lost. If you want to save these canges, save your work first and change the linked cluster then. Proceed ?")."') ) { for(i=0; i<document.form1.cluster_content_FKID$specialID.length; i++)  if(document.form1.cluster_content_FKID$specialID.options[i].defaultSelected == true) document.form1.cluster_content_FKID$specialID.options[i].selected=true; }\"";
                $variation = variation();
                // force save in dbo.
                //$clnid = getDBCell("cluster_content", "FKID", "CLCID = ".$id);
                if (!isset($clnid)) {
                    $clnid = $cpselector->value;
                } else {
                    $cpselector->value = $clnid;
                }
                $clid = getClusterFromNode($clnid, $variation);
                $chclbox->add( $cpselector );
                $forceLoadFromDB = "no";


                if ($clnid != "" && $clnid != "0") {
				    $clid = getClusterFromNode($clnid, $variation);
                    $name = getDBCell("cluster_node", "NAME", "CLNID = $clnid");
                }
                
				$infoboxid = $id;
				$chclboxid = $id;

				$table = '<table width="100% border="0" cellpadding="0" cellspacing="0"><tr><td>';
				$table.= $lang->get("cllink", "This box is linked to ")."&nbsp; <b>".$name."</b>";
				$table.= '</td><td align="right">';
				// Add-Button
				$ShowInfoButton = new LinkButtonInline("toggle_info_".$infoboxid, "show info", "box", "button", "toggle('showinfo_".$infoboxid."')");
				$CHCLButton = new LinkButtonInline("toggle_chcl_".$chclboxid, "change cluster", "box", "button", "toggle('chcl_".$chclboxid."')");
				$table.= $ShowInfoButton->draw()."&nbsp;".$CHCLButton->draw();
				$table.= '</td></tr></table>';
				
				$this->add(new Label("lbl", $table, "headbox", 2));

				if (getDBCell("cluster_content", "FKID", "CLCID = ".$id) != $clnid)
					$forceLoadFromDB = "yes";
	

			    $chclbox->add(new Cell("spacer", "standardlight", 1));
			    $chclbox->add(new Label("lbl", "or create a new instance called", "standardlight"));
			    $chclbox->add(new Input("cluster_node_NAME$id", "", "standardlight", 32));
			    $chclbox->add(new SingleHidden("clt", ""));
			    $chclbox->add(new SingleHidden("id", ""));
			    $chclbox->add(new LinkButtonInCell("neueInstanz", "Create Instance", "standardlight navelement", "button", "javascript:if (confirm('".$lang->get("confirm_unsaved_changes")."')) { document.form1.saction.value='createCluster';document.form1.id.value='$id';document.form1.clt.value='$clt';document.form1.submit(); };", "form1", 1));

			    $sql = "SELECT * FROM variations WHERE 1";
			    $variations = new query($db, $sql);
			    while ($variations->getrow()) {
				    $chclbox->add(new Hidden("cluster_variations_VARIATION_ID_".$variations->field("VARIATION_ID"), "1"));
			    }

			    $specialID = "";
                $compoundContainer->add(new IDWrapper("chcl_".$chclboxid, $chclbox, "embedded", ' style="display:'.(($clid == 0) ? "" : "none" ).';" ', 3));

                if ($clid != "0" && $clid != "") {
        			// GET CONTENT OF THE CLUSTER
    				// set variables that will contain the content later to null.
    				$clusters = null;
    				$plugins = null;
    				$types = null;

    				// get the structure of the content.
    				$sql = "SELECT CLTI_ID, CLTITYPE_ID FROM cluster_template_items WHERE CLT_ID = $clt AND FKID!=0 ORDER BY POSITION";

    				$query = new query($db, $sql);

    				while ($query->getrow()) {
    					$cltitype = $query->field("CLTITYPE_ID");

    					$ni = count($plugins);
    					$plugins[$ni] = $query->field("CLTI_ID");
    					$types[$ni] = $cltitype;
    				}

    				$query->free();

    				// we don't want to draw an additional back link in clusters-editor
    				// if (! $sitepage && ! $isArticle) {
    				//	$compoundContainer->add(new LinkLabel("link1", $lang->get("back_to_cv", "Back to cluster overview"), "modules/cluster/clusterbrowser.php?sid=$sid&clt=$clt", "_self", "informationheader", 2));
    				// }

    				$infobox = new Container(3);

    				// draw some cluster-information.
    				$infobox->add(new Subtitle("", $lang->get("cluster_information", "Information about this record"), 3));
    				$infobox->add(new ClusterInformation($clid));

    				$compoundContainer->add(new IDWrapper("showinfo_".$infoboxid, $infobox, "embedded", ' style="display:none;" ', 3));
    				// draw plugin preview.

    				$len = count($plugins);
    				if ($clid) {
    					for ($i = 0; $i < $len; $i++) {

                            if ($types[$i] == 2)
    							$compoundContainer->add(new ContentEnvelope($plugins[$i], $clid, true));

    						if ($types[$i] == 4)
    							$compoundContainer->add(new ClusterEnvelope($plugins[$i], $clid, true));

    						if ($types[$i] == 5)
    							$compoundContainer->add(new LibraryEnvelope($plugins[$i], $clid, true));

    						if ($types[$i] == 6)
    							$compoundContainer->add(new CompoundClusterEnvelope($plugins[$i], $clid, true));

    				        if ($types[$i] == 8)
    				          $compoundContainer->add(new ChannelEnvelope($plugins[$i], $clid, true));
    					}
    					if ($isArticle || $action == $lang->get("edit_all") || ($action == $lang->get("save")) || $action == $lang->get("save_back")) {
    				       	$compoundContainer->add(new NonDisplayedValue("cluster_variations", "LAST_CHANGED", "CLID = ".$clid, "(NOW()+0)", "NUMBER"));
    						$compoundContainer->add(new NonDisplayedValue("cluster_variations", "LAST_USER", "CLID = ".$clid, $auth->userName, "TEXT"));
    					}
    				}
                }
                $compoundEnvelope->add(new IDWrapper("compoundEnvelope_$id", $compoundContainer, "embedded sub", '', 3));
                $this->add(new IDWrapper("compoundCluster_$id", $compoundEnvelope, "boxed", '', 3));

		} else {
			$name = "&lt;" . $lang->get("not_selected", "No item selected yet."). "&gt;";
			$myfk = getDBCell("cluster_content", "FKID", "CLCID = " . $id);
			if ($myfk != 0 && $myfk != "") {
				$clt = getDBCell("cluster_node", "CLT_ID", "CLNID = " . $myfk);
				$cltname = getDBCell("cluster_templates", "NAME", "CLT_ID = ".$clt);
				$cat = getDBCell("cluster_templates", "CATEGORY_ID", "CLT_ID = " . $clt);
				$name = "<br><b>" . $lang->get("cli"). "</b> " .$cltname."/".getDBCell("cluster_node", "NAME", "CLNID = " . $myfk);
				$buttons = "<br><a href=\"" . $c["docroot"] . "modules/cluster/clusterbrowser.php?sid=$sid&action=editobject&go=update&oid=$myfk&pnode=$cat&clt=$clt\" class=\"box\">".$lang->get("goto_cl", "Goto Cluster")."</a>";
				if ($aclf->checkAccessToFunction("B_PREVIEW_PAGE")) $buttons .= drawSpacer(10, 1). "<a href=\"#\" onClick=\"window.open('" . $c["docroot"] . "modules/cluster/previewcpcl.php?sid=$sid&oid=$myfk', 'cppreview', 'width=400,height=400,location=no,menubar=no,toolbar=no');return false;\"  class=\"box\">".$lang->get("preview")."</a>";
			}
			$this->add(new Label("lbl", $name, "", 1));
			$this->add(new AlignedLabel('lbl', $buttons, 'right', '', 1));
		}

	}
Beispiel #12
0
		/**
		 * Add the variation(language)-selector to the form
		 */
		function enableVariationSelector() {
			global $oid, $go, $page_action, $page_state;
			$this->buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "DELETED=0", "ORDER BY NAME ASC"), variation());
			$this->add(new Hidden("goon", $page_action));
			if (isset($oid)) {
			  $this->add(new Hidden("oid", $oid));
			}
			if (value("changevariation") != "0") $page_state="";
		}
<?php

if ($aclf->checkAccessToFunction("NEW_FOLDER")) {
    $form->buttonbar->add("action", $lang->get("new_folder", "Create Folder"), "submit", "document.form1.processing.value = '';");
}
if ($pnode != "0" && ($aclf->checkAccessToFunction("ED_FOLDER_PROPS") || $aclf->checkAccessToFunction("DELETE_FOLDER"))) {
    if ($aclf->checkAccessToFunction("ED_FOLDER_PROPS")) {
        $form->buttonbar->add("action", $lang->get("edit_folder", "Edit Folder"), "submit", "document.form1.processing.value= '';");
    }
    if ($aclf->checkAccessToFunction("DELETE_FOLDER")) {
        $form->buttonbar->add("action", $lang->get("del_folder", "Delete Folder"), "submit", "document.form1.processing.value= '';");
    }
    $form->buttonbar->add("separator", "", "", "", "");
}
if ($aclf->checkAccessToFunction("ED_FOLDER_ACL")) {
    $form->buttonbar->add("action", $lang->get("edit_access", "Set Access"), "submit", "document.form1.processing.value= '';");
}
$form->buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "1"), variation());