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


PHP QueryPage::execute方法代码示例

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


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

示例1: execute

 public function execute($parameters)
 {
     global $wgOut, $wgRequest, $wgDisableTextSearch, $wgScript;
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $wgOut->addWikiText(wfMsgForContentNoTrans('proofreadpage_specialpage_text'));
     $this->searchList = null;
     $this->searchTerm = $wgRequest->getText('key');
     $this->suppressSqlOffset = false;
     if (!$wgDisableTextSearch) {
         $self = $this->getTitle();
         $wgOut->addHTML(Xml::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::input('limit', false, $limit, array('type' => 'hidden')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('proofreadpage_specialpage_legend')) . Xml::input('key', 20, $this->searchTerm) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
         if ($this->searchTerm) {
             $index_namespace = $this->index_namespace;
             $index_ns_index = MWNamespace::getCanonicalIndex(strtolower(str_replace(' ', '_', $index_namespace)));
             $searchEngine = SearchEngine::create();
             $searchEngine->setLimitOffset($limit, $offset);
             $searchEngine->setNamespaces(array($index_ns_index));
             $searchEngine->showRedirects = false;
             $textMatches = $searchEngine->searchText($this->searchTerm);
             $escIndex = preg_quote($index_namespace, '/');
             $this->searchList = array();
             while ($result = $textMatches->next()) {
                 $title = $result->getTitle();
                 if ($title->getNamespace() == $index_ns_index) {
                     array_push($this->searchList, $title->getDBkey());
                 }
             }
             $this->suppressSqlOffset = true;
         }
     }
     parent::execute($parameters);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:33,代码来源:SpecialProofreadPages.php

示例2: execute

 function execute($par)
 {
     $mime = $par ? $par : $this->getRequest()->getText('mime');
     $this->setHeaders();
     $this->outputHeader();
     $this->getOutput()->addHTML(Xml::openElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor('MIMEsearch')->getLocalUrl())) . Xml::openElement('fieldset') . Html::hidden('title', SpecialPage::getTitleFor('MIMEsearch')->getPrefixedText()) . Xml::element('legend', null, wfMsg('mimesearch')) . Xml::inputLabel(wfMsg('mimetype'), 'mime', 'mime', 20, $mime) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
     list($this->major, $this->minor) = File::splitMime($mime);
     if ($this->major == '' || $this->minor == '' || $this->minor == 'unknown' || !self::isValidType($this->major)) {
         return;
     }
     parent::execute($par);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:SpecialMIMEsearch.php

示例3: execute

 function execute($par)
 {
     global $wgUrlProtocols, $wgMiserMode, $wgScript;
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->allowClickjacking();
     $request = $this->getRequest();
     $target = $request->getVal('target', $par);
     $namespace = $request->getIntorNull('namespace', null);
     $protocols_list = array();
     foreach ($wgUrlProtocols as $prot) {
         if ($prot !== '//') {
             $protocols_list[] = $prot;
         }
     }
     $target2 = $target;
     // Get protocol, default is http://
     $protocol = 'http://';
     $bits = wfParseUrl($target);
     if (isset($bits['scheme']) && isset($bits['delimiter'])) {
         $protocol = $bits['scheme'] . $bits['delimiter'];
         // Make sure wfParseUrl() didn't make some well-intended correction in the
         // protocol
         if (strcasecmp($protocol, substr($target, 0, strlen($protocol))) === 0) {
             $target2 = substr($target, strlen($protocol));
         } else {
             // If it did, let LinkFilter::makeLikeArray() handle this
             $protocol = '';
         }
     }
     $out->addWikiMsg('linksearch-text', '<nowiki>' . $this->getLanguage()->commaList($protocols_list) . '</nowiki>', count($protocols_list));
     $s = Html::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript)) . "\n" . Html::hidden('title', $this->getPageTitle()->getPrefixedDBkey()) . "\n" . Html::openElement('fieldset') . "\n" . Html::element('legend', array(), $this->msg('linksearch')->text()) . "\n" . Xml::inputLabel($this->msg('linksearch-pat')->text(), 'target', 'target', 50, $target) . "\n";
     if (!$wgMiserMode) {
         $s .= Html::namespaceSelector(array('selected' => $namespace, 'all' => '', 'label' => $this->msg('linksearch-ns')->text()), array('name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector'));
     }
     $s .= Xml::submitButton($this->msg('linksearch-ok')->text()) . "\n" . Html::closeElement('fieldset') . "\n" . Html::closeElement('form') . "\n";
     $out->addHTML($s);
     if ($target != '') {
         $this->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
         parent::execute($par);
         if ($this->mMungedQuery === false) {
             $out->addWikiMsg('linksearch-error');
         }
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:46,代码来源:SpecialLinkSearch.php

示例4: onSubmit

 public function onSubmit($data, $form)
 {
     $this->propName = $data['propname'];
     parent::execute($data['propname']);
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:5,代码来源:SpecialPagesWithProp.php

示例5: execute

 public function execute($par)
 {
     $this->mime = $par ? $par : $this->getRequest()->getText('mime');
     $this->mime = trim($this->mime);
     list($this->major, $this->minor) = File::splitMime($this->mime);
     if ($this->major == '' || $this->minor == '' || $this->minor == 'unknown' || !self::isValidType($this->major)) {
         $this->setHeaders();
         $this->outputHeader();
         $this->getPageHeader();
         return;
     }
     parent::execute($par);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:13,代码来源:SpecialMIMEsearch.php

示例6: getList

 function getList()
 {
     list($limit, $offset) = wfCheckLimits();
     $this->limit = $limit;
     $this->offset = $offset;
     parent::execute('');
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:NewHowtoArticles.body.php

示例7: execute

 function execute($par)
 {
     global $wgUrlProtocols, $wgMiserMode;
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->allowClickjacking();
     $request = $this->getRequest();
     $target = $request->getVal('target', $par);
     $namespace = $request->getIntorNull('namespace', null);
     $protocols_list = array();
     foreach ($wgUrlProtocols as $prot) {
         if ($prot !== '//') {
             $protocols_list[] = $prot;
         }
     }
     $target2 = $target;
     $protocol = '';
     $pr_sl = strpos($target2, '//');
     $pr_cl = strpos($target2, ':');
     if ($pr_sl) {
         // For protocols with '//'
         $protocol = substr($target2, 0, $pr_sl + 2);
         $target2 = substr($target2, $pr_sl + 2);
     } elseif (!$pr_sl && $pr_cl) {
         // For protocols without '//' like 'mailto:'
         $protocol = substr($target2, 0, $pr_cl + 1);
         $target2 = substr($target2, $pr_cl + 1);
     } elseif ($protocol == '' && $target2 != '') {
         // default
         $protocol = 'http://';
     }
     if ($protocol != '' && !in_array($protocol, $protocols_list)) {
         // unsupported protocol, show original search request
         $target2 = $target;
         $protocol = '';
     }
     $out->addWikiMsg('linksearch-text', '<nowiki>' . $this->getLanguage()->commaList($protocols_list) . '</nowiki>');
     $s = Xml::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'])) . Html::hidden('title', $this->getTitle()->getPrefixedDbKey()) . '<fieldset>' . Xml::element('legend', array(), $this->msg('linksearch')->text()) . Xml::inputLabel($this->msg('linksearch-pat')->text(), 'target', 'target', 50, $target) . ' ';
     if (!$wgMiserMode) {
         $s .= Html::namespaceSelector(array('selected' => $namespace, 'all' => '', 'label' => $this->msg('linksearch-ns')->text()), array('name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector'));
     }
     $s .= Xml::submitButton($this->msg('linksearch-ok')->text()) . '</fieldset>' . Xml::closeElement('form');
     $out->addHTML($s);
     if ($target != '') {
         $this->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
         parent::execute($par);
         if ($this->mMungedQuery === false) {
             $out->addWikiMsg('linksearch-error');
         }
     }
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:52,代码来源:SpecialLinkSearch.php

示例8: execute

 function execute($par)
 {
     $this->initServices();
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->allowClickjacking();
     $request = $this->getRequest();
     $target = $request->getVal('target', $par);
     $namespace = $request->getIntOrNull('namespace', null);
     $protocols_list = array();
     foreach ($this->getConfig()->get('UrlProtocols') as $prot) {
         if ($prot !== '//') {
             $protocols_list[] = $prot;
         }
     }
     $target2 = $target;
     // Get protocol, default is http://
     $protocol = 'http://';
     $bits = wfParseUrl($target);
     if (isset($bits['scheme']) && isset($bits['delimiter'])) {
         $protocol = $bits['scheme'] . $bits['delimiter'];
         // Make sure wfParseUrl() didn't make some well-intended correction in the
         // protocol
         if (strcasecmp($protocol, substr($target, 0, strlen($protocol))) === 0) {
             $target2 = substr($target, strlen($protocol));
         } else {
             // If it did, let LinkFilter::makeLikeArray() handle this
             $protocol = '';
         }
     }
     $out->addWikiMsg('linksearch-text', '<nowiki>' . $this->getLanguage()->commaList($protocols_list) . '</nowiki>', count($protocols_list));
     $fields = array('target' => array('type' => 'text', 'name' => 'target', 'id' => 'target', 'size' => 50, 'label-message' => 'linksearch-pat', 'default' => $target, 'dir' => 'ltr'));
     if (!$this->getConfig()->get('MiserMode')) {
         $fields += array('namespace' => array('type' => 'namespaceselect', 'name' => 'namespace', 'label-message' => 'linksearch-ns', 'default' => $namespace, 'id' => 'namespace', 'all' => '', 'cssclass' => 'namespaceselector'));
     }
     $hiddenFields = array('title' => $this->getPageTitle()->getPrefixedDBkey());
     $htmlForm = HTMLForm::factory('ooui', $fields, $this->getContext());
     $htmlForm->addHiddenFields($hiddenFields);
     $htmlForm->setSubmitTextMsg('linksearch-ok');
     $htmlForm->setWrapperLegendMsg('linksearch');
     $htmlForm->setAction(wfScript());
     $htmlForm->setMethod('get');
     $htmlForm->prepareForm()->displayForm(false);
     $this->addHelpLink('Help:Linksearch');
     if ($target != '') {
         $this->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
         parent::execute($par);
         if ($this->mungedQuery === false) {
             $out->addWikiMsg('linksearch-error');
         }
     }
 }
开发者ID:nanasess,项目名称:mediawiki,代码行数:53,代码来源:SpecialLinkSearch.php

示例9: execute

 /**
  * Add the JS
  * @param string|null $par
  */
 public function execute($par)
 {
     parent::execute($par);
     $this->getOutput()->addModules('mediawiki.special.unwatchedPages');
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:9,代码来源:SpecialUnwatchedpages.php

示例10: execute

 function execute($unused)
 {
     if (!$this->getUser()->isAllowed('moderation')) {
         $this->displayRestrictionError();
         return;
     }
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->preventClickjacking();
     $action = $this->getRequest()->getVal('modaction');
     $id = $this->getRequest()->getVal('modid');
     $token = $this->getRequest()->getVal('token');
     if (!$action) {
         $out->addModules('ext.moderation');
         $out->addWikiMsg('moderation-text');
         return parent::execute('');
         # '' suppresses warning in QueryPage.php
     }
     # Some action was requested
     $class = null;
     switch ($action) {
         case 'showimg':
             $class = 'ModerationActionShowImage';
             break;
         case 'show':
             $class = 'ModerationActionShow';
             break;
         case 'preview':
             $class = 'ModerationActionPreview';
             break;
         case 'approve':
         case 'approveall':
             $class = 'ModerationActionApprove';
             break;
         case 'reject':
         case 'rejectall':
             $class = 'ModerationActionReject';
             break;
         case 'merge':
             $class = 'ModerationActionMerge';
             break;
         case 'block':
         case 'unblock':
             $class = 'ModerationActionBlock';
     }
     if (!$class) {
         throw new ModerationError('moderation-unknown-modaction');
     }
     $A = new $class($this);
     $A->run();
 }
开发者ID:ATCARES,项目名称:mediawiki-moderation,代码行数:52,代码来源:SpecialModeration.php


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