Example #1
0
/**
 * Creates an Article out of a page
 * @param integer $spid ID of the sitepage
 * @param integer $channel ID of the channel
 * @param $category ID of the Channelcategory
 */
function importClusterToArticle($spid, $channel, $category)
{
    $clnid = getDBCell("sitepage", "CLNID", "SPID=" . $spid);
    $menues = createNameValueArrayEx("sitepage_names", "NAME", "VARIATION_ID", "SPID=" . $spid, "ORDER BY VARIATION_ID ASC");
    $clt = getDBCell("cluster_node", "CLT_ID", "CLNID=" . $clnid);
    $cs = new CreateSet("channel_articles");
    $cs->add("ARTICLE_ID", $clnid, "NUMBER");
    $cs->add("CHID", $channel, "NUMBER");
    $cs->add("CH_CAT_ID", $category, "NUMBER");
    $cs->add("VERSION", "0", "NUMBER");
    $cs->add("CLT_ID", $clt, "NUMBER");
    $cs->add("TITLE", $menues[0][0], "TEXT");
    $cs->add("POSITION", 999, "NUMBER");
    $cs->execute();
    processSaveSets();
}
			$clid = getDBCell("cluster_variations", "CLID", "CLNID = $clnid AND VARIATION_ID = $variation");
			$name = getDBCell("cluster_node", "NAME", "CLNID = $clnid");
			$form = new PanelForm($name, "i_editc.gif", 'cl');

			// Order of Panels
			$pos_clusterPanel = 1;
			$pos_metaPanel = 2;
			$pos_objectProp = 3;

			if (! $aclf->checkAccessToFunction("ED_CL_META_DATA")) 
			  $pos_objectProp = 2;
			  
			// Process actions:
			if ($action == $lang->get("save") && $errors == "" && $search == "") {
				processSaveSets();

				if ($errors != "") {
					$form->addToTopText($lang->get("saveerror"));
				} else {
					$form->addToTopText($lang->get("savesuccess"));
				}
			}
			$clusterPanel = new Panel($lang->get("ed_content"));
			$clusterPanel->backto = $c["docroot"]."modules/cluster/clusterbrowser.php?sid=$sid&oid=$clnid&view=1";
			$propPanel = new Panel($lang->get("cl_properties"));
			$metaPanel = new Panel($lang->get("ed_meta"));			
			if ($view == $pos_clusterPanel && count($variations) > 0 && ($aclf->checkAccessToFunction("EDIT_CL_CONTENT"))) {
				require_once $c["path"] . "modules/common/panel_cluster.inc.php";
			} else if ($view == $pos_objectProp && $aclf->checkAccessToFunction("CL_PROPS")) {
				$mynode = getVar("cluster");
Example #3
0
	/** For Down-Grade-Compatibility only **/
	function proccessSaveSets() { processSaveSets(); }
Example #4
0
		/**
		 * Process the form. Autochecking and saving is to be done here.
		 * process will be automatically called by the page->draw() method!
		 */
		function process() {
			global $errors, $page_state, $lang, $page_action, $oids, $oid, $filter_column, $filter_rule, $filter_page, $db, $sid;

			$this->check();
			if ($errors == "" && $page_state == "processing" && $page_action != "DELETE" && (value("changevariation") == "0" || value("changevariation") == "" )) {
			  			  
				for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->process();
				}
				if ((!$this->forbidUpdate && $page_action == "UPDATE") || $page_action == "INSERT")
					processSaveSets();

				for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->afterProcess();			
				}
			  if ((!$this->forbidUpdate && $page_action == "UPDATE") || $page_action == "INSERT")
			    processSaveSets();
			
				
				if ($errors != "") {
					$this->addToTopText($lang->get("saveerror"));
					$this->topstyle = 'headererror';
					
				} else {				
					if ($page_action == "INSERT") {						
						$page_action = "UPDATE";
						$oid = $oids[0];												
						$this->processHandlers("INSERT");						
					} else {
						$this->processHandlers("UPDATE");						
					}

					if ($errors == "") {
						$this->addToTopText($lang->get("savesuccess"));
						$this->topstyle = 'headersuccess';
						
					}
				}
			}

			if ($page_action == "DELETE" && !$this->forbidDelete) {
				$prompt = value("commit");

				if ($prompt == $lang->get("No")) {					

					$db->close();
					header ("Location: " . $this->action . "?sid=" . $sid . "&oid=" . $oid . "&go=update");
					exit;
				} else if ($prompt == $lang->get("Yes")) {
					$this->processHandlers("DELETE");

					$this->addToTopText($lang->get("deletesuccess"));
					$this->topstyle = 'headersucess';					
					$oid = "";
				} else {
					global $lang;

					$this->addTopYNPrompt($lang->get("promptdelete"));
				}
			}
			
			global $errors;
			if ($errors == "" && (value("action") == $lang->get("back") || value("action") == $lang->get("save_back"))  && $this->backto != "") {
				$db->close();

				header ("Location: " . $this->backto);
				exit;
			}
			
			if ($errors != "")
			  $this->topstyle = 'headererror';
		}
Example #5
0
		function commit() { processSaveSets(); }
 /**
  * Store the configuration of editConfig
  */
 function processConfig()
 {
     global $db;
     if ($this->isSingleConfig) {
         $check = getDBCell("pgn_config_store", "CLTI_ID", "CLTI_ID = " . $this->cltiid);
         if ($check == "") {
             $sql = "INSERT INTO pgn_config_store (CLTI_ID) VALUES (" . $this->cltiid . ")";
             $query = new query($db, $sql);
         }
         for ($i = 0; $i < count($this->configWidgets); $i++) {
             $this->configWidgets[$i]->process();
         }
         processSaveSets();
     }
 }
Example #7
0
		/**
		* Process the form. Autochecking and saving is to be done here.
		*/
		function process() {
			global $errors, $lang, $page_state, $page_action, $updatesets, $db;

			$this->check();
			if ($errors == "" && $page_state == "processing" && $page_action != "DELETE" && value("action") != $lang->get("back") && (value("changevariation") == "0" || value("changevariation") == "" ) && (value("changetranslation") == "0" || value("changetranslation") == "" )) {
			
			
				for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->process();
				}
				processSaveSets();
			
				$this->processHandlers($page_action);
			
			// after process
			  for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->afterProcess();			
				}
			  processSaveSets();
						

				if ($errors == "") {
					$this->addToTopText($lang->get("savesuccess"));								
				} else {
					$this->addToTopText($lang->get("saveerror"));					
				}
			}

			if ($errors == "" && (! $this->quickpanel) && (htmlentities(value("action")) == $lang->get("back") || htmlentities(value("action")) == $lang->get("save_back"))) {
				$db->close();
				header ("Location: " . $this->backto);
				exit;
			}
		}
		/**
		 * Form-wide Handler for going to the selected page and processing it.
		 */
		function process() {
			$this->check();

			// processing here
			global $savemeta, $errors, $lang, $page_action, $updatevariation;

			if ($errors == "" && (isset($savemeta) || isset($updatevariation))) {
								
				
				for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->process();
				}
				processSaveSets();

			  // after process
				for ($i = 0; $i < count($this->container); $i++) {
					$this->container[$i]->afterProcess();
				}
				processSaveSets();


				if ($errors != "") {
					$this->addToTopText($lang->get("saveerror"));
				} else {
					$this->addToTopText($lang->get("savesuccess"));
				}
			}
		}