当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_Page2::disableXmlProlog方法代码示例

本文整理汇总了PHP中HTML_Page2::disableXmlProlog方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Page2::disableXmlProlog方法的具体用法?PHP HTML_Page2::disableXmlProlog怎么用?PHP HTML_Page2::disableXmlProlog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML_Page2的用法示例。


在下文中一共展示了HTML_Page2::disableXmlProlog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 /**
  * Outputs the form.
  *
  * @param  object HTML_QuickForm_Page  the page being processed
  * @access public
  * @since  2.0.0RC1
  */
 function _renderForm(&$page)
 {
     $tab = '  ';
     $p = new HTML_Page2(array('lineend' => PHP_EOL, 'tab' => $tab, 'doctype' => 'XHTML 1.0 Strict', 'language' => 'en', 'cache' => 'false'));
     $p->disableXmlProlog();
     $p->setTitle('PEAR::HTML_Progress2 - Generator');
     $p->setMetaData('author', 'Laurent Laville');
     $formTemplate = "\n<form{attributes}>" . "\n<table class=\"maintable\">" . "\n<caption>HTML_Progress2 Generator</caption>" . "\n{content}" . "\n</table>" . "\n</form>";
     $headerTemplate = "\n<tr>" . "\n\t<th colspan=\"2\">" . "\n\t\t{header}" . "\n\t</th>" . "\n</tr>";
     $elementTemplate = "\n<tr valign=\"top\">" . "\n\t<td class=\"qfLabel\">&nbsp;" . "<!-- BEGIN required --><span class=\"required\">*</span><!-- END required -->" . "{label}</td>" . "\n\t<td class=\"qfElement\">" . "\n{element}" . "<!-- BEGIN label_2 -->&nbsp;" . "<span class=\"qfLabel2\">{label_2}</span>" . "<!-- END label_2 -->" . "\n\t</td>" . "\n</tr>";
     $groupTemplate = "\n\t\t<table class=\"group\">" . "\n\t\t<tr>" . "\n\t\t\t{content}" . "\n\t\t</tr>" . "\n\t\t</table>";
     $groupElementTemplate = "<td>{element}" . "<!-- BEGIN label --><br/>" . "<span class=\"qfLabel\">{label}</span>" . "<!-- END label -->" . "</td>";
     $renderer =& $page->defaultRenderer();
     $renderer->setFormTemplate($formTemplate);
     $renderer->setHeaderTemplate($headerTemplate);
     $renderer->setElementTemplate($elementTemplate);
     $renderer->setGroupTemplate($groupTemplate, 'name');
     $renderer->setGroupElementTemplate($groupElementTemplate, 'name');
     $styles = $this->getStyleSheet();
     $js = '';
     // on preview tab, add progress bar javascript and stylesheet
     if ($page->getAttribute('id') == 'Preview') {
         $pb = $page->controller->createProgressBar();
         $pb->setTab($tab);
         $styles .= $pb->getStyle();
         $js = $pb->getScript();
         $p->addStyleDeclaration($styles);
         $p->addScriptDeclaration($js);
         $pbElement =& $page->getElement('progressBar');
         $pbElement->setText($pb->toHtml() . '<br /><br />');
     } else {
         $p->addStyleDeclaration($styles);
     }
     $page->accept($renderer);
     $p->addBodyContent($renderer->toHtml());
     $p->display();
 }
开发者ID:alexzita,项目名称:alex_blog,代码行数:44,代码来源:HTMLPage2.php

示例2:

    function _renderForm(&$page)
    {
        $pageName = $page->getAttribute('name');
        $tabPreview = array_slice($page->controller->_tabs, -2, 1);
        $tab = '  ';
        $p = new HTML_Page2(array('lineend' => PHP_EOL, 'tab' => $tab, 'doctype' => 'XHTML 1.0 Strict', 'language' => 'en', 'cache' => 'false'));
        $p->disableXmlProlog();
        $p->setTitle('PEAR::HTML_Progress2 - Generator');
        $p->setMetaData('author', 'Laurent Laville');
        $styles = '
body {
  background-color: #7B7B88;
  font-family: Verdana, Arial, helvetica;
  font-size: 10pt;
}

h1 {
  color: #FFC;
  text-align: center;
}

.maintable {
  width: 100%;
  border-width: 0;
  border-style: thin dashed;
  border-color: #D0D0D0;
  background-color: #EEE;
  cellspacing: 2;
  cellspadding: 3;
}

th {
  text-align: center;
  color: #FFC;
  background-color: #AAA;
  white-space: nowrap;
}

input {
  font-family: Verdana, Arial, helvetica;
}

input.flat {
  border-style: solid;
  border-width: 2px 2px 0 2px;
  border-color: #996;
}
';
        // on preview tab, add progress bar javascript and stylesheet
        if ($pageName == $tabPreview[0][0]) {
            $pb = $page->controller->createProgressBar();
            $pb->setTab($tab);
            $p->addStyleDeclaration($styles . $pb->getStyle());
            $p->addScriptDeclaration($pb->getScript());
            $pbElement =& $page->getElement('progressBar');
            $pbElement->setText($pb->toHtml() . '<br /><br />');
        } else {
            $p->addStyleDeclaration($styles);
        }
        $formTemplate = "\n<form{attributes}>" . "\n<table style=\"font-size: 8pt;\" class=\"maintable\">" . "\n{content}" . "\n</table>" . "\n</form>";
        $headerTemplate = "\n<tr>" . "\n\t<th colspan=\"2\">" . "\n\t\t{header}" . "\n\t</th>" . "\n</tr>";
        $elementTemplate = "\n\t<tr>" . "\n\t\t<td align=\"right\" valign=\"top\" width=\"30%\">" . "<!-- BEGIN required --><span style=\"color: #ff0000\">*</span><!-- END required -->" . "<b>{label}</b></td>" . "\n\t\t<td valign=\"top\" align=\"left\">" . "<!-- BEGIN error --><span style=\"color: #ff0000\">{error}</span><br /><!-- END error -->" . "\t{element}</td>" . "\n\t</tr>";
        $groupTemplate = "<table><tr>{content}</tr></table>";
        $groupElementTemplate = "<td>{element}<br />" . "<span style=\"font-size:10px;\">" . "<span class=\"label\">{label}</span>" . "</span></td>";
        $renderer =& $page->defaultRenderer();
        $renderer->setFormTemplate($formTemplate);
        $renderer->setHeaderTemplate($headerTemplate);
        $renderer->setElementTemplate($elementTemplate);
        $renderer->setGroupTemplate($groupTemplate, 'name');
        $renderer->setGroupElementTemplate($groupElementTemplate, 'name');
        $page->accept($renderer);
        $p->addBodyContent($renderer->toHtml());
        $p->display();
    }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:74,代码来源:HTMLPage2.php


注:本文中的HTML_Page2::disableXmlProlog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。