Location: PHPKode > projects > Site-Assistant > sas/sas/plugs/cls.php
<?php
class cls extends plug {
	// Bezeichnung des Plugs
	var $label = "Ausgabeklasse";
	var $min_width = WIDE_LIST;

	var $form = array (
		"main" => array (
			"property" => array("class")
		)
	);

  // Parameter die in Datenbank gespeichert werden
	var $property =	array (
 		"id" => array("type" => "INT NOT NULL AUTO_INCREMENT PRIMARY KEY", "save_as" => "none", "label" => ""),
 		"class" => array("type" => "TEXT", "save_as" => "string", "label" => "Klassenname", "editable" => TRUE)
	);

function show_form_element($property_name, &$value, $form_id = 0) {
	global $paths,$core,$cls,$database;

	$str = "Bitte wählen Sie eine der verfügbaren Ausgabeklassen aus:<br />";
	$str .= "<select id='class' name='class'>";
		$result = $core->query("select * from ".$database['prefix']."_classes where aktiv=1");
		while($row = mysql_fetch_array($result)){
			$cl = $row["desc"];
			if ($value == $row["id"]) $selected = " selected";
			else $selected = "";
			$str .= "<option value='".$row["id"]."'$selected>$cl</<option>";
		}
		$str .= "</select>";
		return $str;


}
function output($content_id, $content_list) {
	global $cls,$core,$database;
	extract($this->get_content_editable($content_id));
	$klasse = $core->sv_query("select name from ".$database['prefix']."_classes where id=$class");

	return $cls[$klasse]->output();
}

function output_javascript() {
	return;
}


}
?>
Return current item: Site-Assistant