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_jstextarea 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")
{
$parse = $this->xml->parseNode($this->node, True, True, True, array("id", "lang"));
if (!method_exists($this, $returntype))
{
return False;
}
return call_user_func(array($this, $returntype), $parse["attributes_array"], $parse["attributes_string"], $parse["content_string"]);
}
private function xhtml($arr, $str, $content)
{
$lang = ($arr["lang"] != "") ? $arr["lang"] : "en";
$id = ($arr["id"] != "") ? $arr["id"] : "autoid".$this->xml->getFreeID();
return array("reparse" => True, "output" => <<<XML
<script type="text/javascript" src="editarea://edit_area.js"></script>
<script type="text/javascript">
// <![CDATA[
editArea.initArea({
id : "{$id}",
line_selection : false ,
do_highlight : false ,
toolbar : "new_document |, search, go_to_line, |, undo, redo, |, select_font, change_line_selection, highlight, reset_highlight",
allow_resize : "y" ,
language : "{$lang}",
code_lang : "php"
});
// ]]>
</script>
<textarea{$str} id="{$id}">{$content}</textarea>
XML
);
}
}
?>
© 2009 Julian von Mendel (http://derjulian.net) | Datum: 07.12.2023