本文整理汇总了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());
}
示例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;
}