示例#1
0
		/**
		   * 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;
		}