Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/col_man/colModify.inc.php
<?php
// +----------------------------------------------------------------------+
// | colModify.inc.php                                                    |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The C*B Development Group                    |
// +----------------------------------------------------------------------+
// | This source file is subject to version 1.0 of the CB license,        |
// | that is bundled with this package in the file license.txt            |
// | If you did not receive a copy of the PHP license please send a       |
// | note to hide@address.com so we can mail you            |
// | a copy immediately.                                                  |
// +----------------------------------------------------------------------+
// | Authors: Jörg Stöber <hide@address.com>                |
// |          Michael Pfannkuchen <hide@address.com>                |
// | $Id: colModify.inc.php,v 1.4 2004/09/19 19:33:11 cb_fog Exp $                                                                |
// +----------------------------------------------------------------------+

if($columnPerms->hasAccess() && $columnPerms->hasEditPermission($fid)) {
	
	$tpl->assign("SUB", "colModify");

	$fresult = mysql_query("SELECT * FROM ".TABLE."_columns WHERE fid = '$fid'");
	$fQueryNumRows = mysql_num_rows($fresult);
	$fresult = mysql_fetch_assoc($fresult);

	/*
	* SprachVersion einstellen
	*/
	if($columnOption->getSingleOption("activateMultiLanguageColumns") && $fQueryNumRows == 1) {
		if(isset($columnAddLanguage) && preg_match("/^([0-9]*)$/", $columnAddLanguageID)) {
			$query = mysql_query("INSERT INTO ".TABLE."_language (type, typeID, languageID, text) VALUES ('column', '$fid', '$columnAddLanguageID', '$columnAddLanguageText')");
		}
		
		if(isset($columnLanguageDeleteVersion) && preg_match("/^([0-9]*)$/", $columnLanguageDeleteVersion)) {
			$query = mysql_query("DELETE FROM ".TABLE."_language WHERE type = 'column' AND typeID = '$fid' AND languageID = '$columnLanguageDeleteVersion'");
		}
		
		if(isset($columnEditSubmit) && preg_match("/^([0-9]*)$/", $columnEditLanguageID)) {
			$query = mysql_query("UPDATE ".TABLE."_language SET text = '$columnEditLanguageText' WHERE type = 'column' AND typeID = '$fid' AND languageID = '$columnEditLanguageID'");
		}
	}

	/* 
	* Skin Finder 
	*/
	$skinTplValueArray = $cbColumn->skinFinder();
	$skinTplSelected   = $cbColumn->getSelectedSkin($fresult['skin'], $skinTplValueArray);
	
	foreach($skinTplValueArray as $k => $v) {
		$tempName = explode(":", $v);
		if(count($tempName) > 1) {
			$skinTplNameArray[$k] = "--> ".$tempName[1];
		} else {
			$skinTplNameArray[$k] = $tempName[0];
		}
	}
	
	$tpl->assign("style_option", 
		array ( "TPLNAME"      => $skinTplNameArray,
				"TPLVALUE"     => $skinTplValueArray,
				"SELECTED"     => $skinTplSelected
		)
	);
	/* 
	* Skin Finder Ende
	*/


	$tpl->assign("column", 
		array(  "GDNAME"       => $fresult["fname"] )
	);

	$fstatus = array();
	// Row1
	$status_value[]    = "c";
	$status_text[]     = $rmText["statusClosed"];
	$status_sel[]	= '';
	// Row 2
	$status_value[]    = "o";
	$status_text[]     = $rmText["statusOpen"];
	$status_sel[] 	= '';

	if($fresult['writestatus'] == "c") {
	 	$status_sel['0'] = "selected";
	} else {
	 	$status_sel['1'] = "selected";
	}

	$tpl->assign("status_tpl_set", "1");
	$tpl->assign("status_select",
	 	array(  "VALUE"		=> $status_value,
				"SELECTED"	=> $status_sel,
				"TEXT"		=> $status_text
		)
	);
	
	/* 
	* Rubriken Tree für die Verschiebe Option 
	*/
	$columnTreeData = $nestedSet->getAllNodes();
	if($columnTreeData != false) {
		foreach($columnTreeData as $v) {
			$space = "";
			for($z = 1; $z <= $v[level]; $z++) {
				$space .= "&nbsp;&nbsp;";
			}
			$folderSpace[]   = $space;
			$folderName[]    = $v[fname];
			$folderID[]      = $v[fid];
			$folderLevel[]   = $v[level];
		}
	}
	
	$tpl->assign("folder_move_select",
		array ( "MFNAME"       => $folderName,
			 	"MID"          => $folderID,
			 	"MSPACE"       => $folderSpace,
			 	"MLEVEL"       => $folderLevel
		)
	);
	
	/*
	* Optionen der Rubrik auslesen und ans Template senden
	*/
	$options = $fresult['options'];
	$columnOptions['online']         = (COLUMN_OPTION_ONLINE      & $options)?'1':'0';
	$columnOptions['localPermsOnly'] = (COLUMN_OPTION_LOCAL_PERMS & $options)?'1':'0';
	
	$columnOptions['setPermOptionsAllowed'] = 0;
	if((ADMIN & $cbPerms) || (COL_MNG & $cbPerms)) {
		$columnOptions['setPermOptionsAllowed'] = 1;
	}
	
	$tpl->assign("columnOptions", $columnOptions);
	
	/*
	* Mehrsprachigkeit für Rubriken
	*/
	if($columnOption->getSingleOption("activateMultiLanguageColumns")) {
		if($modf == 1) {
			/* Sprachversionen auslesen */
			$columnLangID = array();
			$columnLangIDArr     = array_flip($supportedLangArr);
			$query  = mysql_query("SELECT languageID, text, entryID FROM ".TABLE."_language WHERE type = 'column' AND typeID = '$fid'");
			while($columnLangVersionRow   = mysql_fetch_object($query)) {
				$columnLangShort[]   = $columnLangIDArr[$columnLangVersionRow->languageID];
				$columnLangID[]      = $columnLangVersionRow->languageID;
				$columnLangEntryID[] = $columnLangVersionRow->entryID;
				$columnLangText[]    = $columnLangVersionRow->text;
				$columnLangVersionSet     = true;
			}
			
			/* Fehlende Sprach Versionen ermitteln */
			$columnLangNotSetArr = array_diff($supportedLangArr, $columnLangID);
			foreach($columnLangNotSetArr as $k => $v) {
				$columnLangNotSetShort[] = $k;
				$columnLangNotSetID[]    = $v;
			}
			
			/* Inforamationen ans Template senden */
			if($columnLangVersionSet) {
				$tpl->assign("columnEditLang_set", "1");
			}
					
			$tpl->assign("columnEditLangRow",
				array ( "LANGUAGE_SHORT"  => $columnLangShort,
						"LANGUAGE_ID"     => $columnLangID,
						"TEXT"            => $columnLangText,
						"ENTRY_ID"        => $columnLangEntryID
				)
			);
			
			$tpl->assign("columnAddLang",
				array ( "LANGUAGE_SHORT"  => $columnLangNotSetShort,
						"LANGUAGE_ID"     => $columnLangNotSetID
				)
			);
			$tpl->assign("columnMultiLanguage_set", "1");
		}
	}
	
	if(empty($modf)) {
		if (!empty($type)){
			switch($type) {
				case "sub":
					$tpl->assign("FOLDER_TITLE", $rmLink['subFolder']." (".$fresult['fname'].")");
					break;
				default:
					$tpl->assign("FOLDER_TITLE", $rmLink['mainFolder']." (/)");
			}
		}
		$tpl->assign("MOD_TYPE", "create");
	} else {
		$tpl->assign("modFolder_form", 
			array ( "COL_NAME"    => $fresult['fname'],
					"LOADURL"     => $fresult["loadurl"],
					"GDSTATUS"    => $fresult["writestatus"],
					"STATUS"      => $fresult["status"],
					"GFXSS"       => $fresult["mfolder"],
					"GDDESC"      => $fresult["describt"],
					
			)
		);
		$tpl->assign("FOLDER_TITLE", $rmText["modify"]);
		$tpl->assign("folder_move_set", "1");
		$tpl->assign("MOD_TYPE", "gdmodify");
	}
	$tpl->assign("modFolder_form_set", "1");
	
	/*
	* Template Output für das Rubriken Management speichern
	*/
	$mainPluginContent[]  = $tpl->fetch($config['templates']."colModify.template", null, "pluginColumn".$cbUserID);
	
	/*
	* Rubriken Rechte Management inkludieren
	*/
	if($modf == 1) {
		if(((ADMIN & $cbPerms) || (COL_MNG & $cbPerms)) && isset($fid)) {
			$editColRightSet = $fid;
			include($pluginLocation."/colRightAdmin.inc.php");
			$mainPluginContent[] = $rightAdminTPLOutput;
		}
	}
} else {
	$error[] = $rmError['permission'];
}
?>
Return current item: Content*Builder