Last update: 31.03.2008 | © 2024 Julian von Mendel | Datenschutz
<?php
/* xml_extension class
* (C) 2006 Julian von Mendel (http://derjulian.net)
* License: LGPL
*/
class xml_wysiwyg 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="tinymce://tiny_mce.js"></script>
<script type="text/javascript" xml:space="preserve">
// <![CDATA[
tinyMCE.init({
theme : "advanced" ,
mode : "exact" ,
theme_advanced_toolbar_location : "top" ,
theme_advanced_toolbar_align: "left" ,
theme_advanced_statusbar_location : "bottom" ,
apply_source_formatting : true ,
language : "{$lang}" ,
elements : "{$id}" ,
plugins : "table, inlinepopups, style",
theme_advanced_buttons1 : "cut, copy, paste, separator, undo, redo, separator, bold, italic, styleprops, formatselect, separator, bullist, numlist, outdent, indent, link, anchor, unlink, separator, image, hr, charmap, separator, removeformat, separator, help",
theme_advanced_buttons2 : "tablecontrols" ,
theme_advanced_buttons3 : "" ,
table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
table_cell_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Cell=tableCel1",
table_row_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
table_cell_limit : 100,
table_row_limit : 5,
table_col_limit : 5
});
// ]]>
</script>
<textarea{$str} id="{$id}">{$content}</textarea>
XML
);
}
}
?>
© 2009 Julian von Mendel (http://derjulian.net) | Datum: 09.09.2024