Source code for file /pattemplate/patTemplate/Dump/XUL.php
Documentation is available at XUL.php
* $Id: XUL.php 361 2005-02-18 19:06:41Z schst $
require_once 'XML/XUL.php';
* Dumps templates as XUL, using PEAR::XML_XUL
* @todo move this into patTemplate_Dump_Dhtml and keep it free from javascript
$this->_doc =
&XML_XUL::createDocument( );
$this->_doc->addStylesheet('chrome://global/skin/');
$win =
&$this->_doc->createElement('Window', array('title'=>
'patTemplate Dump'));
$this->_doc->addRoot($win);
$this->_root =
&$this->_doc->createElement( 'Tabbox', array('flex' =>
1) );
$win->appendChild($this->_root);
* dump the global variables
* @param array array containing all global variables
$gbox =
&$this->_doc->createElement('Groupbox', array('orient'=>
'vertical', 'flex' =>
1));
$gbox->setCaption('Global variables');
$grid =
&$this->_doc->createElement('Grid');
$grid->setColumns(2, array( 'flex' =>
1 ), array( 'flex' =>
1 ));
$gbox->appendChild($grid);
$this->_doc->createElement( 'Description', array( 'style' =>
'font-weight:bold;' ), 'Variable' ),
$this->_doc->createElement( 'Description', array( 'style' =>
'font-weight:bold;' ), 'Value' ),
foreach ($globals as $var =>
$value) {
$row =
array($var, $value);
$this->_root->addTab('Global Variables', $gbox);
$container =
&$this->_doc->createElement('VBox', array('flex' =>
1));
$gbox =
&$this->_doc->createElement('Groupbox', array('orient'=>
'vertical', 'flex' =>
'2'));
$gbox->setCaption('Templates');
$container->appendChild($gbox);
$tree =
&$this->_doc->createElement( 'Tree', array( 'flex' =>
1, 'enableColumnDrag' =>
'true', 'height' =>
'500' ) );
foreach( $templates as $name =>
$tmpl )
$gbox->appendChild($tree);
$splitter =
&$this->_doc->createElement('Splitter');
$container->appendChild($splitter);
$gbox2 =
&$this->_doc->createElement('Groupbox', array('orient'=>
'vertical', 'flex' =>
'2'));
$gbox2->setCaption('Details');
$container->appendChild($gbox2);
$deck =
&$this->_doc->createElement('Deck');
$gbox2->appendChild($deck);
$this->_root->addTab('Templates', $container);
$tmpl['attributes']['type'],
$tmpl['attributes']['visibility'],
$tmpl['loaded'] ?
'yes' :
'no',
$current =
&$tree->addItem($item);
if (!empty($tmpl['dependencies'])) {
$deps =
&$current->addItem(array( 'Dependencies' ));
foreach ($tmpl['dependencies'] as $dependency) {
if (!isset
($this->_vars[$name])) {
$this->_vars[$name] =
array();
$vars =
$this->_flattenVars( $this->_vars[$name] );
$varItem =
&$current->addItem(array( 'Variables' ));
foreach ($vars as $key =>
$value) {
$varItem->addItem(array($key, $value));
if ($_GET['mode'] ==
'debug') {
require_once 'XML/Beautifier.php';
$fmt =
&new XML_Beautifier( array( 'indent' =>
' ' ) );
} elseif ($_GET['mode'] ==
'source') {
} elseif ($_GET['mode'] ==
'debug2') {
} elseif ($_GET['mode'] ==
'source') { } else {