本文整理汇总了PHP中Xml::fieldSet方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::fieldSet方法的具体用法?PHP Xml::fieldSet怎么用?PHP Xml::fieldSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::fieldSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
/**
* Shows the search form
*/
private function showForm()
{
global $wgScript, $wgOut, $wgRequest;
/* Build form */
$html = Xml::openElement('form', array('action' => $wgScript)) . "\n";
// Name of SpecialPage
$html .= Html::hidden('title', $this->getTitle()->getPrefixedText()) . "\n";
// Limit
$html .= Html::hidden('limit', $wgRequest->getInt('limit', 50));
// Input box with target prefilled if available
$formContent = "\t" . Xml::input('target', 40, is_null($this->target) ? '' : $this->target->getText()) . "\n\t" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('globalusage-ok'))) . "\n\t<p>" . Xml::checkLabel(wfMsg('globalusage-filterlocal'), 'filterlocal', 'mw-filterlocal', $this->filterLocal) . '</p>';
if (!is_null($this->target) && wfFindFile($this->target)) {
// Show the image if it exists
$html .= Linker::makeThumbLinkObj($this->target, wfFindFile($this->target), $this->target->getPrefixedText(), '', wfUILang()->alignEnd(), array(), false, false);
}
// Wrap the entire form in a nice fieldset
$html .= Xml::fieldSet(wfMsg('globalusage-text'), $formContent) . "\n</form>";
$wgOut->addHtml($html);
}
示例2: 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;
}