本文整理汇总了PHP中FormOptions::getChangedValues方法的典型用法代码示例。如果您正苦于以下问题:PHP FormOptions::getChangedValues方法的具体用法?PHP FormOptions::getChangedValues怎么用?PHP FormOptions::getChangedValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormOptions
的用法示例。
在下文中一共展示了FormOptions::getChangedValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterLinks
protected function filterLinks()
{
// show/hide links
$showhide = array($this->msg('show')->escaped(), $this->msg('hide')->escaped());
// Option value -> message mapping
$filters = array('hideliu' => 'rcshowhideliu', 'hidepatrolled' => 'rcshowhidepatr', 'hidebots' => 'rcshowhidebots', 'hideredirs' => 'whatlinkshere-hideredirs');
foreach ($this->customFilters as $key => $params) {
$filters[$key] = $params['msg'];
}
// Disable some if needed
if (!User::groupHasPermission('*', 'createpage')) {
unset($filters['hideliu']);
}
if (!$this->getUser()->useNPPatrol()) {
unset($filters['hidepatrolled']);
}
$links = array();
$changed = $this->opts->getChangedValues();
unset($changed['offset']);
// Reset offset if query type changes
$self = $this->getTitle();
foreach ($filters as $key => $msg) {
$onoff = 1 - $this->opts->getValue($key);
$link = Linker::link($self, $showhide[$onoff], array(), array($key => $onoff) + $changed);
$links[$key] = $this->msg($msg)->rawParams($link)->escaped();
}
return $this->getLanguage()->pipeList($links);
}
示例2: filterLinks
protected function filterLinks()
{
global $wgGroupPermissions;
// show/hide links
$showhide = array(wfMsgHtml('show'), wfMsgHtml('hide'));
// Option value -> message mapping
$filters = array('hideliu' => 'rcshowhideliu', 'hidepatrolled' => 'rcshowhidepatr', 'hidebots' => 'rcshowhidebots', 'hideredirs' => 'whatlinkshere-hideredirs');
foreach ($this->customFilters as $key => $params) {
$filters[$key] = $params['msg'];
}
// Disable some if needed
# @todo FIXME: Throws E_NOTICEs if not set; and doesn't obey hooks etc.
if ($wgGroupPermissions['*']['createpage'] !== true) {
unset($filters['hideliu']);
}
if (!$this->getUser()->useNPPatrol()) {
unset($filters['hidepatrolled']);
}
$links = array();
$changed = $this->opts->getChangedValues();
unset($changed['offset']);
// Reset offset if query type changes
$self = $this->getTitle();
foreach ($filters as $key => $msg) {
$onoff = 1 - $this->opts->getValue($key);
$link = Linker::link($self, $showhide[$onoff], array(), array($key => $onoff) + $changed);
$links[$key] = wfMsgHtml($msg, $link);
}
return $this->getLanguage()->pipeList($links);
}
示例3: getSearchInput
protected function getSearchInput($query)
{
$attribs = array('placeholder' => $this->msg('tux-sst-search-ph'), 'class' => 'searchinputbox', 'dir' => $this->getLanguage()->getDir());
$title = Html::hidden('title', $this->getPageTitle()->getPrefixedText());
$input = Xml::input('query', false, $query, $attribs);
$submit = Xml::submitButton($this->msg('tux-sst-search'), array('class' => 'button'));
$nondefaults = $this->opts->getChangedValues();
$checkLabel = Xml::checkLabel($this->msg('tux-sst-case-sensitive')->text(), 'case', 'tux-case-sensitive', isset($nondefaults['case']));
$checkLabel = Html::openElement('div', array('class' => 'tux-search-operators')) . $checkLabel . Html::closeElement('div');
$lang = $this->getRequest()->getVal('language');
$language = is_null($lang) ? '' : Html::hidden('language', $lang);
$form = Html::rawElement('form', array('action' => wfScript(), 'name' => 'searchform'), $title . $input . $submit . $checkLabel . $language);
return $form;
}
示例4: getFilterPanel
/**
* Create filter panel
*
* @return string HTML fieldset and filter panel with the show/hide links
*/
function getFilterPanel()
{
$show = wfMsgHtml('show');
$hide = wfMsgHtml('hide');
$changed = $this->opts->getChangedValues();
unset($changed['target']);
// Already in the request title
$links = array();
$types = array('hidetrans', 'hidelinks', 'hideredirs');
if ($this->target->getNamespace() == NS_FILE) {
$types[] = 'hideimages';
}
// Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans', 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
// To be sure they will be find by grep
foreach ($types as $type) {
$chosen = $this->opts->getValue($type);
$msg = $chosen ? $show : $hide;
$overrides = array($type => !$chosen);
$links[] = wfMsgHtml("whatlinkshere-{$type}", $this->makeSelfLink($msg, array_merge($changed, $overrides)));
}
return Xml::fieldset(wfMsg('whatlinkshere-filters'), $this->getLanguage()->pipeList($links));
}
示例5: setTopText
function setTopText(FormOptions $opts)
{
$nondefaults = $opts->getChangedValues();
$form = "";
$user = $this->getUser();
$dbr = $this->getDB();
$numItems = $this->countItems($dbr);
$showUpdatedMarker = $this->getConfig()->get('ShowUpdatedMarker');
// Show watchlist header
$form .= "<p>";
if ($numItems == 0) {
$form .= $this->msg('nowatchlist')->parse() . "\n";
} else {
$form .= $this->msg('watchlist-details')->numParams($numItems)->parse() . "\n";
if ($this->getConfig()->get('EnotifWatchlist') && $user->getOption('enotifwatchlistpages')) {
$form .= $this->msg('wlheader-enotif')->parse() . "\n";
}
if ($showUpdatedMarker) {
$form .= $this->msg('wlheader-showupdated')->parse() . "\n";
}
}
$form .= "</p>";
if ($numItems > 0 && $showUpdatedMarker) {
$form .= Xml::openElement('form', array('method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'id' => 'mw-watchlist-resetbutton')) . "\n" . Xml::submitButton($this->msg('enotif_reset')->text(), array('name' => 'dummy')) . "\n" . Html::hidden('reset', 'all') . "\n";
foreach ($nondefaults as $key => $value) {
$form .= Html::hidden($key, $value) . "\n";
}
$form .= Xml::closeElement('form') . "\n";
}
$form .= Xml::openElement('form', array('method' => 'get', 'action' => $this->getPageTitle()->getLocalURL(), 'id' => 'mw-watchlist-form'));
$form .= Xml::fieldset($this->msg('watchlist-options')->text(), false, array('id' => 'mw-watchlist-options'));
$form .= $this->makeLegend();
$this->getOutput()->addHTML($form);
}
示例6: selfLink2
protected function selfLink2($title, $overrides)
{
$changed = $this->opts->getChangedValues();
$target = $this->title->getLocalURL(wfArrayToCGI($overrides, $changed));
return Xml::tags('a', array('href' => $target), $title);
}