Skip to content

Latest commit

 

History

History
120 lines (88 loc) · 2.5 KB

Toolbar-Documentation.pod

File metadata and controls

120 lines (88 loc) · 2.5 KB

Class Toolbar Documentation

Description

Class Toolbar - XML Generator for DHTMLX

construct

$toolbar = new Toolbar( set encoding, default utf-8 )

$toolbar = new Toolbar;

or

$toolbar = new Toolbar('iso-8859-1');

item

$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"
        )
    )
);

header

$toolbar->header()

$toolbar->header();

return

header("Content-type: application/xml; charset=utf-8");

result

$toolbar->result()

echo $toolbar->result();

Print XML

Examples

Example 1

<?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>

Author

Lucas Tiago de Moraes

Support

Group DHTMLX Facebook