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


PHP Xml::buildTable方法代码示例

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


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

示例1: execute

 function execute()
 {
     $this->out->setPageTitle($this->app->runFunction('wfMsg', 'spellchecker-info'));
     // get information about enchant
     $dict = new SpellCheckerDictionary();
     // show list of all supported lanuages
     $languages = $dict->getLanguages();
     $rows = array();
     foreach ($languages as $lang) {
         $rows[] = array($lang);
     }
     $this->out->addHtml(Xml::buildTable($rows, array('class' => 'wikitable'), array($this->app->runFunction('wfMsg', 'spellchecker-info-languages', count($languages)))));
     // list providers
     $providers = $dict->getProviders();
     $rows = array();
     foreach ($providers as $provider => $dictionaries) {
         sort($dictionaries);
         $count = count($dictionaries);
         $rows[] = array($provider, implode(', ', $dictionaries) . " ({$count})");
     }
     $this->out->addHtml(Xml::buildTable($rows, array('class' => 'wikitable'), array($this->app->runFunction('wfMsg', 'spellchecker-info-provider'), $this->app->runFunction('wfMsg', 'spellchecker-info-dictionaries'))));
     // spell checking demo
     $this->out->addHtml(Xml::element('hr'));
     $this->spellCheckingForm($languages);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:SpellCheckerInfoSpecial.class.php

示例2: displayStats

 private function displayStats()
 {
     global $wgOut;
     if (empty($this->mGroup)) {
         $wgOut->addHTML(wfMsg('transstats-select-group'));
         return true;
     }
     if (empty($this->mLanglist)) {
         $data['total'] = MessageGroupStatistics::forGroup($this->mGroup);
     } else {
         foreach ($this->mLanglist as $lang) {
             $data['total'][$lang] = MessageGroupStatistics::forItem($this->mGroup, $lang);
         }
     }
     if (empty($data)) {
         $wgOut->addHTML(wfMsg('transstats-error'));
         return true;
     }
     $displayData = array();
     foreach ($data['total'] as $type => $row) {
         $processed = $this->processRow($row, $type);
         if ($processed) {
             $displayData[$type] = $processed;
         }
     }
     $headers = array(wfMsg('transstats-language'), wfMsg('transstats-translated'), wfMsg('transstats-percentage'));
     $attribs = array('class' => 'wikitable');
     $table = Xml::buildTable($displayData, $attribs, $headers);
     $this->renderHeader();
     $wgOut->addHTML($table);
     $this->renderFooter();
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:33,代码来源:SpecialGroupStats.body.php

示例3: efImageReviewDisplayStatus

function efImageReviewDisplayStatus($imagePage, &$html)
{
    global $wgCityId, $wgExternalDatawareDB, $wgUser;
    if (!$wgUser->isAllowed('imagereviewstats')) {
        return true;
    }
    $html .= Xml::element('h2', array(), wfMsg('imagereview-imagepage-header'));
    $reviews = array();
    $headers = array('Reviewer', 'State', 'Time');
    $where = array('wiki_id' => $wgCityId, 'page_id' => $imagePage->getId());
    $dbr = wfGetDB(DB_SLAVE, array(), $wgExternalDatawareDB);
    $res = $dbr->select('image_review_stats', '*', $where);
    if ($dbr->numRows($res) == 0) {
        //check if image is in the queue at all!
        $imgCurState = $dbr->selectField('image_review', 'state', $where);
        if (false === $imgCurState) {
            // oh oh, image is not in queue at all
            $html .= wfMsg('imagereview-imagepage-not-in-queue');
        } else {
            // image is in the queue but not reviewed yet
            $html .= wfMsg('imagereview-state-0');
        }
    } else {
        // go through the list and display review states
        while ($row = $dbr->fetchObject($res)) {
            $data = array();
            $data[] = User::newFromId($row->reviewer_id)->getName();
            $data[] = wfMsg('imagereview-state-' . $row->review_state);
            $data[] = $row->review_end . ' (UTC)';
            $reviews[] = $data;
        }
        $html .= Xml::buildTable($reviews, array('class' => 'wikitable filehistory sortable', 'style' => 'width: 60%'), $headers);
    }
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:35,代码来源:ImageReviewImageStatus.php

示例4: displayStats

 private function displayStats()
 {
     global $wgOut;
     if (empty($this->mGroup)) {
         $wgOut->addHTML(wfMsg('transstats-select-group'));
         return true;
     }
     $data['total'] = MessageGroupStatistics::forGroup($this->mGroup);
     // need to get child groups for this meta group
     if (!empty($this->mBreakdown)) {
         $data[] = MessageGroupStatistics::forGroup($this->mBreakdown);
     }
     if (empty($data)) {
         $wgOut->addHTML(wfMsg('transstats-error'));
         return true;
     }
     foreach ($data['total'] as $type => &$row) {
         $this->processRow($row, $type);
     }
     $headers = array(wfMsg('transstats-language'), wfMsg('transstats-translated'), wfMsg('transstats-untranslated'));
     $attribs = array('class' => 'wikitable');
     $table = Xml::buildTable($data['total'], $attribs, $headers);
     $this->renderHeader();
     $wgOut->addHTML($table);
     $this->renderFooter();
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:SpecialTranslationCount.body.php

示例5: efImageReviewDisplayStatus

function efImageReviewDisplayStatus(ImagePage $imagePage, &$html)
{
    global $wgCityId, $wgExternalDatawareDB, $wgUser;
    if (!$wgUser->isAllowed('imagereviewstats')) {
        return true;
    }
    if (!$imagePage->getTitle()->exists()) {
        return true;
    }
    $html .= Xml::element('h2', array(), wfMsg('imagereview-imagepage-header'));
    $reviews = array();
    $headers = array(wfMessage('imagereview-imagepage-table-header-reviewer')->text(), wfMessage('imagereview-imagepage-table-header-state')->text(), wfMessage('imagereview-imagepage-table-header-time')->text());
    $where = array('wiki_id' => $wgCityId, 'page_id' => $imagePage->getId());
    $dbr = wfGetDB(DB_SLAVE, array(), $wgExternalDatawareDB);
    $res = $dbr->select('image_review_stats', '*', $where);
    if ($dbr->numRows($res) == 0) {
        //check if image is in the queue at all!
        $imgCurState = $dbr->selectField('image_review', 'state', $where);
        if (false === $imgCurState) {
            /**
             * If the file is a local one and is older than 1 hour - send it to ImageReview
             * since it's probably been restored, and is not just a fresh file.
             */
            $lastTouched = new DateTime($imagePage->getRevisionFetched()->getTimestamp());
            $now = new DateTime();
            $file = $imagePage->getDisplayedFile();
            if ($file instanceof WikiaLocalFile && $lastTouched < $now->modify('-1 hour')) {
                $scribeEventProducer = new ScribeEventProducer('edit');
                $user = User::newFromName($file->getUser());
                if ($scribeEventProducer->buildEditPackage($imagePage, $user, null, null, $file)) {
                    $logParams = ['cityId' => $wgCityId, 'pageId' => $imagePage->getID(), 'pageTitle' => $imagePage->getTitle()->getText(), 'uploadUser' => $user->getName()];
                    \Wikia\Logger\WikiaLogger::instance()->info('ImageReviewLog', ['message' => 'Image moved back to queue', 'params' => $logParams]);
                    $scribeEventProducer->sendLog();
                }
            }
            // oh oh, image is not in queue at all
            $html .= wfMsg('imagereview-imagepage-not-in-queue');
        } else {
            // image is in the queue but not reviewed yet
            $html .= wfMsg('imagereview-state-0');
        }
    } else {
        // go through the list and display review states
        while ($row = $dbr->fetchObject($res)) {
            $data = array();
            $data[] = User::newFromId($row->reviewer_id)->getName();
            $data[] = wfMsg('imagereview-state-' . $row->review_state);
            $data[] = $row->review_end . ' (UTC)';
            $reviews[] = $data;
        }
        $html .= Xml::buildTable($reviews, array('class' => 'wikitable filehistory sortable', 'style' => 'width: 60%'), $headers);
    }
    return true;
}
开发者ID:yusufchang,项目名称:app,代码行数:54,代码来源:ImageReviewImageStatus.php

示例6: getInterwikis

 /**
  * Get all Interwiki Links - the heart of the function
  * @param $prefix string Prefix to search for in list
  * @return string HTML
  */
 private function getInterwikis($prefix = null)
 {
     global $wgScript;
     $dbr = wfGetDB(DB_SLAVE);
     $conds = array();
     if (!is_null($prefix)) {
         $conds[] = "iw_prefix " . $dbr->buildLike($prefix, $dbr->anyString());
     }
     $results = $dbr->select('interwiki', array('iw_prefix', 'iw_url'), $conds);
     $form = Xml::openElement('form', array('action' => $wgScript, 'method' => 'get', 'id' => 'interwikilist-search')) . Html::Hidden('title', $this->mTitle->getPrefixedText()) . Xml::inputLabel(wfMsg('interwikilist-prefix'), 'iwsearch', 'interwikilist-prefix', false, $prefix) . Xml::submitButton(wfMsg('search')) . Xml::closeElement('form');
     $text = Xml::fieldSet(wfMsg('interwikilist-filter'), $form);
     $interwikiList = array();
     foreach ($results as $row) {
         $interwikiList["mw-iwlist-" . $row->iw_prefix] = array($row->iw_prefix, $row->iw_url);
     }
     $dbr->freeResult($results);
     $text .= Xml::buildTable($interwikiList, array('id' => 'sv-software'), array(wfMsg('interwikilist-linkname'), wfMsg('interwikilist-target')));
     return $text;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:InterwikiList_body.php

示例7: showHints

 function showHints()
 {
     global $wgOut;
     $wgOut->addHTML(Xml::element('p', null, wfMsg('masseditregex-hint-intro')));
     $wgOut->addHTML(Xml::buildTable(array(array('/$/', 'abc', wfMsg('masseditregex-hint-toappend')), array('/$/', '\\n[[Category:New]]', wfMsg('masseditregex-hint-toappend')), array('{{OldTemplate}}', '', wfMsg('masseditregex-hint-remove')), array('\\[\\[Category:[^]]+\\]\\]', '', wfMsg('masseditregex-hint-removecat'))), array('class' => 'wikitable'), array(wfMsg('masseditregex-hint-headmatch'), wfMsg('masseditregex-hint-headreplace'), wfMsg('masseditregex-hint-headeffect'))));
     // Xml::buildTable
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:7,代码来源:MassEditRegex.class.php

示例8: fnPayflowDisplayApprovedResults

 /**
  * Display response message to user with submitted user-supplied data
  *
  * @param $data Array: array of posted data from form
  * @param $responseMsg String: message supplied by fnPayflowDisplayResults function
  */
 function fnPayflowDisplayApprovedResults($data, $responseMsg)
 {
     global $wgOut;
     $thankyoupage = $this->adapter->getGlobal('ThankYouPage');
     if ($thankyoupage) {
         $wgOut->redirect($thankyoupage);
     } else {
         // display response message
         $wgOut->addHTML('<h3 class="response_message">' . $responseMsg . '</h3>');
         // translate country code into text
         $countries = GatewayForm::getCountries();
         $rows = array('title' => array(wfMsg('donate_interface-post-transaction')), 'amount' => array(wfMsg('donate_interface-donor-amount'), $data['amount']), 'email' => array(wfMsg('donate_interface-donor-email'), $data['email']), 'name' => array(wfMsg('donate_interface-donor-name'), $data['fname'], $data['mname'], $data['lname']), 'address' => array(wfMsg('donate_interface-donor-address'), $data['street'], $data['city'], $data['state'], $data['zip'], $countries[$data['country']]));
         // if we want to show the response
         $wgOut->addHTML(Xml::buildTable($rows, array('class' => 'submitted-response')));
     }
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:22,代码来源:payflowpro_gateway.body.php

示例9: blockWikia

 private function blockWikia($wikiId)
 {
     $oWiki = WikiFactory::getWikiById($wikiId);
     if (!is_object($oWiki)) {
         return false;
     }
     // process block data for display
     $data = array('wiki_id' => $oWiki->city_id, 'sitename' => WikiFactory::getVarValueByName("wgSitename", $oWiki->city_id), 'url' => WikiFactory::getVarValueByName("wgServer", $oWiki->city_id), 'last_timestamp' => $this->wg->Lang->timeanddate($oWiki->city_last_timestamp));
     // we have a valid id, change title to use it
     $this->wg->Out->setPageTitle(wfMsg('phalanx-stats-title') . ': ' . $data['url']);
     $headers = array(wfMsg('phalanx-stats-table-wiki-id'), wfMsg('phalanx-stats-table-wiki-name'), wfMsg('phalanx-stats-table-wiki-url'), wfMsg('phalanx-stats-table-wiki-last-edited'));
     $tableAttribs = array('border' => 1, 'class' => 'wikitable', 'style' => "font-family:monospace;");
     $table = Xml::buildTable(array($data), $tableAttribs, $headers);
     $this->setVal('table', $table);
     $pager = new PhalanxStatsWikiaPager($wikiId);
     $this->setVal('statsPager', $pager->getNavigationBar() . $pager->getBody() . $pager->getNavigationBar());
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:17,代码来源:PhalanxStatsSpecialController.class.php

示例10: block_wikia

 private function block_wikia($par)
 {
     global $wgOut, $wgLang, $wgUser, $wgRequest;
     $oWiki = WikiFactory::getWikiById($par);
     if (!is_object($oWiki)) {
         return false;
     }
     $url = WikiFactory::getVarValueByName("wgServer", $oWiki->city_id);
     $sitename = WikiFactory::getVarValueByName("wgSitename", $oWiki->city_id);
     #we have a valid id, change title to use it
     $wgOut->setPageTitle(wfMsg('phalanx-stats-title') . ': ' . $url);
     // process block data for display
     $data['wiki_id'] = $oWiki->city_id;
     $data['sitename'] = $sitename;
     $data['url'] = $url;
     $data['last_timestamp'] = $wgLang->timeanddate($oWiki->city_last_timestamp);
     $html = '';
     $headers = array(wfMsg('phalanx-stats-table-wiki-id'), wfMsg('phalanx-stats-table-wiki-name'), wfMsg('phalanx-stats-table-wiki-url'), wfMsg('phalanx-stats-table-wiki-last-edited'));
     $tableAttribs = array('border' => 1, 'class' => 'wikitable', 'style' => "font-family:monospace;");
     #use magic to build it
     $table = Xml::buildTable(array($data), $tableAttribs, $headers);
     $html .= $table . "<br />\n";
     $wgOut->addHTML($html);
     $pager = new PhalanxWikiStatsPager($par);
     $html = '';
     $html .= $pager->getNavigationBar();
     $html .= $pager->getBody();
     $html .= $pager->getNavigationBar();
     $wgOut->addHTML($html);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:30,代码来源:SpecialPhalanxStats.body.php

示例11: table

 function table($opts)
 {
     global $wgOut;
     $data = $this->getData($opts);
     $legend = array_shift($data);
     array_unshift($legend, 'Date');
     foreach ($data[0] as $date => &$row) {
         array_unshift($row, $date);
     }
     $wgOut->addHTML(Xml::buildTable($data[0], array('class' => 'wikitable'), $legend));
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:11,代码来源:SpecialTranslationStats.php

示例12: array

Year">
			<?php 
    for ($i = 2012; $i <= $currentYear; ++$i) {
        echo Xml::option($i, $i, $i == ${$prefix . "Year"});
    }
    ?>
		</select>
	</fieldset>
<?php 
}
?>

	<?php 
echo Xml::submitButton('Show stats');
?>
	<?php 
echo Xml::submitButton('Download as CSV', array('formaction' => 'csvstats', 'class' => 'secondary'));
?>
</form>

<h2>Summary</h2>

<?php 
echo Xml::buildTable(array($summary), array('class' => 'wikitable'), $summaryHeaders);
?>

<h2>Breakdown by user</h2>

<?php 
echo Xml::buildTable($data, array('class' => 'wikitable sortable'), $headers);
开发者ID:Tjorriemorrie,项目名称:app,代码行数:30,代码来源:ImageReviewSpecial_stats.php


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