Last update: 31.03.2008 | © 2023 Julian von Mendel | Datenschutz
<?php
/* xml_extension class
* (C) 2006 Julian von Mendel (http://derjulian.net)
* License: LGPL
*/
class xml_option implements xml_widget
{
public $node;
public $xml ;
function __construct($node, $xml)
{
$this->node = $node;
$this->xml = $xml ;
}
public static function dtd()
{
return <<<DTD
DTD;
}
public function output($returntype = "xhtml")
{
if (!method_exists($this, $returntype))
{
return False;
}
$parse = $this->xml->attributes($this->node, array("type", "name", "html", "urlencode"));
$attributes = $parse["attributes_array"];
$data = $this->xml->getDataItem("option");
if (!isset($data[$attributes["type"]][$attributes["name"]]))
{
return False;
}
$data = $data[$attributes["type"]][$attributes["name"]];
return call_user_func(array($this, $returntype), $data, $attributes["html"], $attributes["urlencode"]);
}
private function xhtml($data, $html, $urlencode)
{
if ($urlencode == "urlencode")
{
$data = urlencode($data);
}
if ($html != "html")
{
$data = xml::mask_xml($data);
}
return $data;
}
}
?>
© 2009 Julian von Mendel (http://derjulian.net) | Datum: 24.03.2023