function generateInputRadioButton()
{
    return new clsInputWithLabel('Radio: ', 'left', array('attributes' => array('type' => 'radio', 'name' => 'InputRadio', 'id' => 'InputRadio')));
}
function generateInputTextArea()
{
    return new clsTextarea(array('attributes' => array('name' => 'InputTextarea', 'id' => 'InputTextarea', 'rows' => '20', 'cols' => '20')));
}
function generateInputButton()
{
    return new clsInput(array('attributes' => array('type' => 'button', 'name' => 'InputButton', 'id' => 'InputButton')));
}
function generateInputHidden()
{
    return new clsInputWithLabel('Hidden: ', 'left', array('attributes' => array('type' => 'hidden', 'name' => 'InputHidden', 'id' => 'InputHidden')));
}
function generateContent()
{
    $nbsp = new clsLiteral(' ');
    return new clsDiv(array('children' => array(new clsLiteral('literal text'), new clsBr(), new clsHr(), new clsSub(array('child' => new clsLiteral('sub'))), $nbsp, new clsSup(array('child' => new clsLiteral('sup'))), $nbsp, new clsEm(array('child' => new clsLiteral('em'))), $nbsp, new clsStrong(array('child' => new clsLiteral('strong'))), $nbsp, new clsCite(array('child' => new clsLiteral('cite'))), $nbsp, new clsDfn(array('child' => new clsLiteral('dfn'))), $nbsp, new clsCode(array('child' => new clsLiteral('code'))), $nbsp, new clsSamp(array('child' => new clsLiteral('samp'))), $nbsp, new clsKbd(array('child' => new clsLiteral('kbd'))), $nbsp, new clsVar(array('child' => new clsLiteral('var'))), $nbsp, new clsAbbr(array('child' => new clsLiteral('abbr'))), $nbsp, new clsAcronym(array('child' => new clsLiteral('acronym'))), $nbsp, new clsTt(array('child' => new clsLiteral('tt'))), $nbsp, new clsItalic(array('child' => new clsLiteral('italic'))), $nbsp, new clsBold(array('child' => new clsLiteral('bold'))), $nbsp, new clsBig(array('child' => new clsLiteral('big'))), $nbsp, new clsSmall(array('child' => new clsLiteral('small'))), $nbsp, new clsIns(array('child' => new clsLiteral('ins'))), $nbsp, new clsDel(array('child' => new clsLiteral('del'))), new clsHeadline('1', array('child' => new clsLiteral('h1'))), new clsHeadline('2', array('child' => new clsLiteral('h2'))), new clsHeadline('3', array('child' => new clsLiteral('h3'))), new clsHeadline('4', array('child' => new clsLiteral('h4'))), new clsHeadline('5', array('child' => new clsLiteral('h5'))), new clsHeadline('6', array('child' => new clsLiteral('h6'))), new clsAddress(array('child' => new clsLiteral('address'))), new clsParagraph(array('child' => new clsLiteral('paragraph'))), new clsBlockquote(array('child' => new clsLiteral('blockquote'))), new clsPre(array('child' => new clsLiteral('pre'))))));
}
function generateValidation()
{
    return new clsDiv(array('child' => new clsParagraph(array('child' => new clsAnchor(array('attributes' => array('href' => 'http://validator.w3.org/check?uri=referer', 'target' => '_new'), 'child' => new clsImg(array('attributes' => array('src' => 'http://www.w3.org/Icons/valid-html401-blue', 'alt' => 'Valid HTML 4.01 Transitional', 'height' => 31, 'width' => 88)))))))));
}
function generateIframe()
{
    return new clsIframe(array('attributes' => array('src' => 'frameset.php')));
}
$objDocument->printHTML();
示例#2
0
}
$brk = new clsBr();
$clear = new clsBr(array("attributes" => array("style" => "clear:both;")));
$space = new clsLiteral(' ');
$objTitle = new clsTitle(array('children' => array(new clsLiteral('xajax Test Suite'))));
ob_start();
?>

<?php 
$objStyle = new clsStyle(array('attributes' => array('type' => 'text/css'), 'child' => new clsLiteral(ob_get_clean())));
$objHead = new clsHead(array('xajax' => $xajax, 'children' => array($objTitle, $objStyle, new clsMeta(array('attributes' => array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'))), new clsLink(array('attributes' => array('rel' => 'stylesheet', 'href' => 'xajax.css', 'type' => 'text/css'))))));
$objForm = new clsForm(array('attributes' => array('id' => 'settings'), 'child' => new clsDiv(array('children' => array(new clsSpan(array('attributes' => array('id' => 'testSelection'))), new clsInput(array('attributes' => array('type' => 'checkbox', 'name' => 'control_panel_visible', 'id' => 'control_panel_visible', 'style' => 'visibility: hidden; position: absolute;', 'value' => 1, 'checked' => 'checked'))), new clsAnchor(array('child' => new clsLiteral('Next Test'), 'event' => array('onclick', $aRequests['nexttest'], array(array(0, XAJAX_FORM_VALUES, 'settings'))))), $space, new clsAnchor(array('child' => new clsLiteral('Show/Hide Control Panel'), 'event' => array('onclick', $aRequests['togglecontrolpanel'], array(array(0, XAJAX_CHECKED_VALUE, 'control_panel_visible'))))), $space, new clsAnchor(array('child' => new clsLiteral('Compress Javascript Files'), 'event' => array('onclick', $aRequests['recompressjavascript']))), $space, new clsAnchor(array('child' => new clsLiteral('Compile Core Files'), 'event' => array('onclick', $aRequests['recompilecore']))), $space, new clsAnchor(array('child' => new clsLiteral('Refresh Test Page'), 'event' => array('onclick', $aRequests['gototest']))), new clsDiv(array('attributes' => array('id' => 'control_panel'), 'children' => array(new clsDiv(array("attributes" => array("id" => "options"), "children" => array(new clsInputWithLabel('Enable Debugging', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'debug', 'id' => 'debug', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Enable Verbose Debugging', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'verbose', 'id' => 'verbose', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Enable Status Messages', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'status', 'id' => 'status', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Set default mode to Synchronous', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'synchronous', 'id' => 'synchronous', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Inline javascript', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'inlineJS', 'id' => 'inlineJS', 'value' => '1', 'checked' => 'checked'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Use compiled core', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'AIO', 'id' => 'AIO', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk))), new clsDiv(array('attributes' => array('id' => 'encoding'), 'children' => array(new clsInputWithLabel('Encoding: ', 'left', array('attributes' => array('type' => 'text', 'name' => 'useEncoding', 'id' => 'useEncoding', 'value' => 'UTF-8'))), $brk, new clsLiteral('Output HTML Entities? '), new clsInputWithLabel('Yes', 'right', array('attributes' => array('type' => 'radio', 'name' => 'htmlEntities', 'id' => 'htmlEntitiesYes', 'value' => 1))), new clsInputWithLabel('No', 'right', array('attributes' => array('type' => 'radio', 'name' => 'htmlEntities', 'id' => 'htmlEntitiesNo', 'value' => 0, 'checked' => 'checked'))), $brk, new clsLiteral('Decode UTF-8 Input? '), new clsInputWithLabel('Yes', 'right', array('attributes' => array('type' => 'radio', 'name' => 'decodeUTF8Input', 'id' => 'decodeUTF8InputYes', 'value' => 1))), new clsInputWithLabel('No', 'right', array('attributes' => array('type' => 'radio', 'name' => 'decodeUTF8Input', 'id' => 'decodeUTF8InputNo', 'value' => 0, 'checked' => 'checked'))), $brk, new clsInput(array('attributes' => array('type' => 'submit', 'name' => 'set_options', 'value' => 'Set Options'), 'event' => array('onclick', $aRequests['gototest'])))))), new clsDiv(array('attributes' => array('id' => 'languages'), 'children' => array(new clsInputWithLabel('Load language module (en)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_en', 'value' => 'en', 'checked' => 'checked'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (de)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_de', 'value' => 'de'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (es)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_es', 'value' => 'es'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (fr)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_fr', 'value' => 'fr'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (nl)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_nl', 'value' => 'nl'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (tr)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_tr', 'value' => 'tr'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (bg)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_bg', 'value' => 'bg'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk))), $clear, new clsDiv(array('attributes' => array('id' => 'statusMessage')))))))))));
$objIframe = new clsIframe(array('attributes' => array('id' => 'testFrame', 'src' => './none.php')));
$objBody = new clsBody(array('children' => array($objForm, $objIframe), 'event' => array('onload', $aRequests['loadtests'])));
$document = new clsDocument(array('children' => array(new clsDoctype(), new clsHtml(array('children' => array($objHead, $objBody))))));
$document->printHTML();
class clsRequests
{
    var $tests = array();
    function clsRequests()
    {
        $this->tests['./none.php'] = '--- Select Test ---';
        $this->tests['./alert_confirm.php'] = 'Alert and Confirm Commands';
        $this->tests['./assign_append.php'] = 'Assign and Append';
        $this->tests['./tables.php'] = 'Tables';
        $this->tests['./transport.php'] = 'Transport';
        $this->tests['./delayEvents.php'] = 'Callbacks';
        $this->tests['./events.php'] = 'Client-side Events';
        $this->tests['./iframe.php'] = 'iFrame';
        $this->tests['./css.php'] = 'CSS';
        $this->tests['./functions.php'] = 'Functions';