Class Accordion - XML Generator for DHTMLX
$accordion = new Accordion( set encoding, default utf-8 )
$accordion = new Accordion;
or
$accordion = new Accordion('iso-8859-1');
skin
$accordion->skin = 'dhx_skyblue'; // default skin dhx_skyblue
mode
$accordion->mode = 'single'; // default single
iconsPath
$accordion->iconsPath = '../common/'; // default path '../common/'
openEffect
$accordion->openEffect = 'false'; // default false
$accordion->cell( array( 'key attribute' => 'value attribute' ) )
$accordion->cell(
array(
"id" => "a1",
"height" => "120",
"text" => "Main Page"
)
);
$accordion->header()
$accordion->header();
return
header("Content-type: application/xml; charset=utf-8");
$accordion->result()
echo $accordion->result();
Print XML
<?php
include_once 'DHX.php';
$accordion = new Accordion;
$accordion->cell(
array(
"id" => "a1",
"height" => "120",
"text" => "Main Page"
),
array(
"id" => "a2",
"open" => "true",
"text" => "Site Navigation"
),
array(
"id" => "a3",
"icon" => "icon2.gif",
"text" => "Support & Feedback"
),
array(
"id" => "a4",
"icon" => "icon3.gif",
"text" => "Comments"
)
);
$accordion->header();
echo $accordion->result();
?>
Result
<?xml version="1.0" encoding="utf-8"?>
<accordion skin="dhx_skyblue" mode="single" iconsPath="../common/" openEffect="false">
<cell id="a1" height="120">Main Page</cell>
<cell id="a2" open="true">Site Navigation</cell>
<cell id="a3" icon="icon2.gif">Support & Feedback</cell>
<cell id="a4" icon="icon3.gif">Comments</cell>
</accordion>
Lucas Tiago de Moraes