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


PHP Xml::buildTableRow方法代码示例

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


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

示例1: execute

 function execute($par)
 {
     global $wgOut, $wgUser;
     // Check permissions
     if (!$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         return;
     }
     $this->setHeaders();
     $this->setDefaults();
     $wgOut->addScript('<script type="text/javascript">' . "var wgClickTrackUserDefs = " . json_encode($this->user_defs) . '</script>');
     $wgOut->setPageTitle(wfMsg('ct-title'));
     $outputTable = "";
     // grab top N
     $events = $this->getTopEvents();
     // open table
     $outputTable .= Xml::openElement("table", array("class" => "sortable click-data", "id" => "clicktrack_data_table"));
     // create a row for every event
     $i = 0;
     $db_result;
     // build row headers
     $header_row = array();
     $header_row["event_header"] = wfMsg('ct-event-name');
     $header_row["expert_header"] = wfMsg('ct-expert-header');
     $header_row["intermediate_header"] = wfMsg('ct-intermediate-header');
     $header_row["basic_header"] = wfMsg('ct-beginner-header');
     $header_row["total_header"] = wfMsg('ct-total-header');
     $outputTable .= Xml::buildTableRow(array("class" => "table_headers"), $header_row);
     // foreach event, build a row
     while (($db_result = $events->fetchRow()) != null) {
         ++$i;
         $outputTable .= $this->buildRow($db_result, $i, $this->user_defs);
     }
     // close table
     $outputTable .= Xml::closeElement("table");
     $wgOut->addHTML($outputTable);
     $wgOut->addHTML($this->buildDateRange());
     // build chart
     $wgOut->addHTML($this->buildChart("advanced.hide", 10, "20090815", "20090902", 1));
     // $wgOut->addHTML($this->buildControlBox());
     $wgOut->addHTML($this->buildChartDialog());
     $wgOut->addHTML($this->buildUserDefBlankDialog());
 }
开发者ID:BackupTheBerlios,项目名称:swahili-dict,代码行数:43,代码来源:SpecialClickTracking.php

示例2: buildTable

 /**
  * Build a table of data
  * @param array $rows An array of arrays of strings, each to be a row in a table
  * @param array $attribs An array of attributes to apply to the table tag [optional]
  * @param array $headers An array of strings to use as table headers [optional]
  * @return string
  */
 public static function buildTable($rows, $attribs = array(), $headers = null)
 {
     $s = Xml::openElement('table', $attribs);
     if (is_array($headers)) {
         $s .= Xml::openElement('thead', $attribs);
         foreach ($headers as $id => $header) {
             $attribs = array();
             if (is_string($id)) {
                 $attribs['id'] = $id;
             }
             $s .= Xml::element('th', $attribs, $header);
         }
         $s .= Xml::closeElement('thead');
     }
     foreach ($rows as $id => $row) {
         $attribs = array();
         if (is_string($id)) {
             $attribs['id'] = $id;
         }
         $s .= Xml::buildTableRow($attribs, $row);
     }
     $s .= Xml::closeElement('table');
     return $s;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:31,代码来源:Xml.php


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