本文整理汇总了PHP中FormOptions::consumeValues方法的典型用法代码示例。如果您正苦于以下问题:PHP FormOptions::consumeValues方法的具体用法?PHP FormOptions::consumeValues怎么用?PHP FormOptions::consumeValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormOptions
的用法示例。
在下文中一共展示了FormOptions::consumeValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: whatlinkshereForm
function whatlinkshereForm()
{
// We get nicer value from the title object
$this->opts->consumeValue('target');
// Reset these for new requests
$this->opts->consumeValues(['back', 'from']);
$target = $this->target ? $this->target->getPrefixedText() : '';
$namespace = $this->opts->consumeValue('namespace');
$nsinvert = $this->opts->consumeValue('invert');
# Build up the form
$f = Xml::openElement('form', ['action' => wfScript()]);
# Values that should not be forgotten
$f .= Html::hidden('title', $this->getPageTitle()->getPrefixedText());
foreach ($this->opts->getUnconsumedValues() as $name => $value) {
$f .= Html::hidden($name, $value);
}
$f .= Xml::fieldset($this->msg('whatlinkshere')->text());
# Target input (.mw-searchInput enables suggestions)
$f .= Xml::inputLabel($this->msg('whatlinkshere-page')->text(), 'target', 'mw-whatlinkshere-target', 40, $target, ['class' => 'mw-searchInput']);
$f .= ' ';
# Namespace selector
$f .= Html::namespaceSelector(['selected' => $namespace, 'all' => '', 'label' => $this->msg('namespace')->text()], ['name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector']);
$f .= ' ' . Xml::checkLabel($this->msg('invert')->text(), 'invert', 'nsinvert', $nsinvert, ['title' => $this->msg('tooltip-whatlinkshere-invert')->text()]);
$f .= ' ';
# Submit
$f .= Xml::submitButton($this->msg('whatlinkshere-submit')->text());
# Close
$f .= Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n";
return $f;
}
示例2: whatlinkshereForm
function whatlinkshereForm()
{
global $wgScript;
// We get nicer value from the title object
$this->opts->consumeValue('target');
// Reset these for new requests
$this->opts->consumeValues(array('back', 'from'));
$target = $this->target ? $this->target->getPrefixedText() : '';
$namespace = $this->opts->consumeValue('namespace');
# Build up the form
$f = Xml::openElement('form', array('action' => $wgScript));
# Values that should not be forgotten
$f .= Html::hidden('title', $this->getTitle()->getPrefixedText());
foreach ($this->opts->getUnconsumedValues() as $name => $value) {
$f .= Html::hidden($name, $value);
}
$f .= Xml::fieldset(wfMsg('whatlinkshere'));
# Target input
$f .= Xml::inputLabel(wfMsg('whatlinkshere-page'), 'target', 'mw-whatlinkshere-target', 40, $target);
$f .= ' ';
# Namespace selector
$f .= Xml::label(wfMsg('namespace'), 'namespace') . ' ' . Xml::namespaceSelector($namespace, '');
$f .= ' ';
# Submit
$f .= Xml::submitButton(wfMsg('allpagessubmit'));
# Close
$f .= Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n";
return $f;
}
示例3: setup
public function setup()
{
global $wgRequest;
$opts = new FormOptions();
// Bind to the member variable
$this->opts = $opts;
$opts->add('mode', self::MODE_STATS);
$opts->add('image', APCImages::IMG_NONE);
$opts->add('clearcache', false);
$opts->add('limit', 20);
$opts->add('offset', 0);
$opts->add('display', '');
$opts->add('delete', '');
$opts->add('sort', 'hits');
$opts->add('sortdir', 0);
$opts->add('scope', 'active');
$opts->add('searchi', '');
// MediaWiki captures search, ARGH!
$opts->fetchValuesFromRequest($wgRequest);
$opts->validateIntBounds('limit', 0, 5000);
$opts->validateIntBounds('sortdir', 0, 1);
$this->opts->consumeValues(array('display', 'clearcache', 'image'));
}
示例4: getExtraOptions
/**
* Get options to be displayed in a form
*
* @param FormOptions $opts
* @return array
*/
function getExtraOptions($opts)
{
$opts->consumeValues(array('namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'));
$extraOpts = array();
$extraOpts['namespace'] = $this->namespaceFilterForm($opts);
if ($this->getConfig()->get('AllowCategorizedRecentChanges')) {
$extraOpts['category'] = $this->categoryFilterForm($opts);
}
$tagFilter = ChangeTags::buildTagFilterSelector($opts['tagfilter']);
if (count($tagFilter)) {
$extraOpts['tagfilter'] = $tagFilter;
}
// Don't fire the hook for subclasses. (Or should we?)
if ($this->getName() === 'Recentchanges') {
Hooks::run('SpecialRecentChangesPanel', array(&$extraOpts, $opts));
}
return $extraOpts;
}