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


PHP FormOptions::getChangedValues方法代码示例

本文整理汇总了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);
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:28,代码来源:SpecialNewpages.php

示例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);
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:30,代码来源:SpecialNewpages.php

示例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;
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:14,代码来源:SpecialSearchTranslations.php

示例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));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:SpecialWhatlinkshere.php

示例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);
 }
开发者ID:admonkey,项目名称:mediawiki,代码行数:34,代码来源:SpecialWatchlist.php

示例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);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:6,代码来源:SpecialAPC.php


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