Class Toolbar - XML Generator for DHTMLX
$toolbar = new Toolbar( set encoding, default utf-8 )
$toolbar = new Toolbar;
or
$toolbar = new Toolbar('iso-8859-1');
$toolbar->item( array( 'key attribute' => 'value attribute' ) )
$toolbar->item(
array(
"id" => "new",
"type" => "button",
"img" => "new.gif",
"imgdis" => "new_dis.gif",
"userdata" => array(
"name" => "some1",
"value" => "Value 1"
),
"item" => array(
"type" => "button",
"id" => "8_1",
"text" => "Today"
)
)
);
$toolbar->header()
$toolbar->header();
return
header("Content-type: application/xml; charset=utf-8");
$toolbar->result()
echo $toolbar->result();
Print XML
<?php
include_once 'DHX.php';
$toolbar = new Toolbar;
$toolbar->item(
array(
"id" => "new",
"type" => "button",
"img" => "new.gif",
"imgdis" => "new_dis.gif",
"userdata" => array(
"name" => "some1",
"value" => "Value 1"
),
"item" => array(
array(
"type" => "button",
"id" => "8_1",
"text" => "Today"
),
array(
"type" => "button",
"id" => "8_2",
"text" => "Yesturday"
),
array(
"type" => "button",
"id" => "8_3",
"text" => "Last Week"
)
)
)
);
$toolbar->header();
echo $toolbar->result();
?>
Result
<?xml version="1.0" encoding="utf-8"?>
<toolbar>
<item id="new" type="button" img="new.gif" imgdis="new_dis.gif">
<userdata>Value 1</userdata>
<item type="button" id="8_1" text="Today"/>
<item type="button" id="8_2" text="Yesturday"/>
<item type="button" id="8_3" text="Last Week"/>
</item>
</toolbar>
Lucas Tiago de Moraes