コード例 #1
0
ファイル: SpecialProperties.php プロジェクト: whysasse/kmwiki
 /**
  * FIXME MW 1.24 wfCheckLimits was deprecated in MediaWiki 1.24
  */
 private function getLimitOffset()
 {
     if (method_exists($this->getRequest(), 'getLimitOffset')) {
         return $this->getRequest()->getLimitOffset();
     }
     return wfCheckLimits();
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: SF_Templates.php プロジェクト: Rikuforever/wiki
 function execute($query)
 {
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $rep = new TemplatesPage();
     $rep->execute($query);
 }
コード例 #4
0
 function __construct($name = 'Newcontributors')
 {
     parent::__construct($name);
     list($limit, $offset) = wfCheckLimits();
     $this->limit = $limit;
     $this->offset = $offset;
 }
コード例 #5
0
ファイル: SF_Forms.php プロジェクト: whysasse/kmwiki
 function execute($query)
 {
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $rep = new FormsPage();
     return $rep->execute($query);
 }
コード例 #6
0
/**
 * constructor
 */
function wfSpecialNewpages($par, $specialPage)
{
    global $wgRequest;
    list($limit, $offset) = wfCheckLimits();
    if ($par) {
        $bits = preg_split('/\\s*,\\s*/', trim($par));
        foreach ($bits as $bit) {
            if ('shownav' == $bit) {
                $shownavigation = 1;
            }
            if (is_numeric($bit)) {
                $limit = $bit;
            }
            if (preg_match('/^limit=(\\d+)$/', $bit, $m)) {
                $limit = intval($m[1]);
            }
            if (preg_match('/^offset=(\\d+)$/', $bit, $m)) {
                $offset = intval($m[1]);
            }
        }
    }
    if (!isset($shownavigation)) {
        $shownavigation = !$specialPage->including();
    }
    $npp = new NewPagesPage();
    if (!$npp->doFeed($wgRequest->getVal('feed'))) {
        $npp->doQuery($offset, $limit, $shownavigation);
    }
}
コード例 #7
0
ファイル: SpecialNamesLog.php プロジェクト: k-hasan-19/wiki
/**
 * constructor
 */
function wfSpecialNamesLog($par, $specialPage)
{
    list($limit, $offset) = wfCheckLimits();
    if ($par) {
        $bits = preg_split('/\\s*,\\s*/', trim($par));
        foreach ($bits as $bit) {
            if ('shownav' == $bit) {
                $shownavigation = true;
            }
            if (is_numeric($bit)) {
                $limit = $bit;
            }
            if (preg_match('/^limit=(\\d+)$/', $bit, $m)) {
                $limit = intval($m[1]);
            }
            if (preg_match('/^offset=(\\d+)$/', $bit, $m)) {
                $offset = intval($m[1]);
            }
        }
    }
    if (!isset($shownavigation)) {
        $shownavigation = !$specialPage->including();
    }
    $rg = new NamesLog();
    $rg->doQuery($offset, $limit, $shownavigation);
}
コード例 #8
0
ファイル: RateArticle.body.php プロジェクト: ErdemA/wikihow
 function execute($par)
 {
     global $wgOut;
     $wgOut->setHTMLTitle(wfMsg('accuracypatrol'));
     list($limit, $offset) = wfCheckLimits();
     $llr = new ListAccuracyPatrol();
     return $llr->doQuery($offset, $limit);
 }
コード例 #9
0
function wfSpecialWithoutinterwiki()
{
    global $wgRequest;
    list($limit, $offset) = wfCheckLimits();
    $prefix = $wgRequest->getVal('prefix');
    $wip = new WithoutInterwikiPage();
    $wip->setPrefix($prefix);
    $wip->doQuery($offset, $limit);
}
コード例 #10
0
function smwfDoSpecialProperties()
{
    wfProfileIn('smwfDoSpecialProperties (SMW)');
    list($limit, $offset) = wfCheckLimits();
    $rep = new SMWPropertiesPage();
    $result = $rep->doQuery($offset, $limit);
    wfProfileOut('smwfDoSpecialProperties (SMW)');
    return $result;
}
コード例 #11
0
/**
 * constructor
 */
function wfSpecialUnwatchedpages()
{
    global $wgUser, $wgOut;
    if (!$wgUser->isAllowed('unwatchedpages')) {
        return $wgOut->permissionRequired('unwatchedpages');
    }
    list($limit, $offset) = wfCheckLimits();
    $wpp = new UnwatchedpagesPage();
    $wpp->doQuery($offset, $limit);
}
コード例 #12
0
function wfSpecialWithoutinterwiki()
{
    global $wgRequest, $wgContLang;
    list($limit, $offset) = wfCheckLimits();
    // Only searching the mainspace anyway
    $prefix = Title::capitalize($wgRequest->getVal('prefix'), NS_MAIN);
    $wip = new WithoutInterwikiPage();
    $wip->setPrefix($prefix);
    $wip->doQuery($offset, $limit);
}
コード例 #13
0
/**
 * Constructor
 */
function wfSpecialPopularpages()
{
    global $wgOut;
    list($limit, $offset) = wfCheckLimits();
    $wgOut->setRobotPolicy("index,follow");
    $ppp = new PopularPagesPage();
    if ($limit != 50 || $offset != 0) {
        $wgOut->setPageTitle(wfMsg('popularpages_range', $offset + 1, $offset + $limit));
    }
    return $ppp->doQuery($offset, $limit);
}
コード例 #14
0
	function execute( $par ) {
		$this->setHeaders();
		list( $limit, $offset ) = wfCheckLimits();
		$rep = new FiltersPage();
		// Handling changed in MW version 1.18.
		if ( method_exists( $rep, 'execute' ) ) {
			return $rep->execute( $par );
		} else {
			return $rep->doQuery( $offset, $limit );
		}
	}
コード例 #15
0
	function execute( $query ) {
		$this->setHeaders();
		list( $limit, $offset ) = wfCheckLimits();
		$rep = new TemplatesPage();
		// execute() method added in MW 1.18
		if ( method_exists( $rep, 'execute' ) ) {
			$rep->execute( $query );
		} else {
			return $rep->doQuery( $offset, $limit );
		}
	}
コード例 #16
0
 public function execute($param)
 {
     wfProfileIn('smwfDoSpecialUnusedProperties (SMW)');
     global $wgOut;
     $wgOut->setPageTitle(wfMsg('unusedproperties'));
     $rep = new SMWUnusedPropertiesPage();
     list($limit, $offset) = wfCheckLimits();
     $rep->doQuery($offset, $limit);
     // Ensure locally collected output data is pushed to the output!
     SMWOutputs::commitToOutputPage($wgOut);
     wfProfileOut('smwfDoSpecialUnusedProperties (SMW)');
 }
コード例 #17
0
function wfSpecialWithoutinterwiki()
{
    global $wgRequest, $wgContLang, $wgCapitalLinks;
    list($limit, $offset) = wfCheckLimits();
    if ($wgCapitalLinks) {
        $prefix = $wgContLang->ucfirst($wgRequest->getVal('prefix'));
    } else {
        $prefix = $wgRequest->getVal('prefix');
    }
    $wip = new WithoutInterwikiPage();
    $wip->setPrefix($prefix);
    $wip->doQuery($offset, $limit);
}
コード例 #18
0
function doSpecialListStreams($par = null)
{
    global $wgRequest, $wgOut;
    $sitting_id = $wgRequest->getVal('sitting_id');
    $existing = $wgRequest->getVal('existing');
    if ($sitting_id != "") {
        list($limit, $offset) = wfCheckLimits();
        $rep = new MV_SpecialListStreams($sitting_id, $existing);
        $rep->doQuery($offset, $limit);
    } else {
        $wgOut->addHTML(wfMsg('edit_sitting_missing'));
    }
}
コード例 #19
0
/**
 * constructor
 */
function wfSpecialMIMEsearch($par = null)
{
    global $wgRequest, $wgTitle, $wgOut;
    $mime = isset($par) ? $par : $wgRequest->getText('mime');
    $wgOut->addHTML(wfElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->escapeLocalUrl()), null) . wfOpenElement('label') . wfMsgHtml('mimetype') . wfElement('input', array('type' => 'text', 'size' => 20, 'name' => 'mime', 'value' => $mime), '') . ' ' . wfElement('input', array('type' => 'submit', 'value' => wfMsg('ilsubmit')), '') . wfCloseElement('label') . wfCloseElement('form'));
    list($major, $minor) = wfSpecialMIMEsearchParse($mime);
    if ($major == '' or $minor == '' or !wfSpecialMIMEsearchValidType($major)) {
        return;
    }
    $wpp = new MIMEsearchPage($major, $minor);
    list($limit, $offset) = wfCheckLimits();
    $wpp->doQuery($offset, $limit);
}
コード例 #20
0
/**
 * Output the HTML search form, and constructs the MIMEsearchPage object.
 */
function wfSpecialMIMEsearch($par = null)
{
    global $wgRequest, $wgTitle, $wgOut;
    $mime = isset($par) ? $par : $wgRequest->getText('mime');
    $wgOut->addHTML(Xml::openElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->getLocalUrl())) . Xml::inputLabel(wfMsg('mimetype'), 'mime', 'mime', 20, $mime) . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('form'));
    list($major, $minor) = wfSpecialMIMEsearchParse($mime);
    if ($major == '' or $minor == '' or !wfSpecialMIMEsearchValidType($major)) {
        return;
    }
    $wpp = new MIMEsearchPage($major, $minor);
    list($limit, $offset) = wfCheckLimits();
    $wpp->doQuery($offset, $limit);
}
コード例 #21
0
 function execute($query)
 {
     global $wgRequest;
     ApprovedRevs::addCSS();
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $mode = $wgRequest->getVal('show');
     $rep = new SpecialApprovedRevsPage($mode);
     if (method_exists($rep, 'execute')) {
         return $rep->execute($query);
     } else {
         return $rep->doQuery($offset, $limit);
     }
 }
コード例 #22
0
/**
 * constructor
 */
function wfSpecialWantedpages($par = null, $specialPage)
{
    $inc = $specialPage->including();
    if ($inc) {
        @(list($limit, $nlinks) = explode('/', $par, 2));
        $limit = (int) $limit;
        $nlinks = $nlinks === 'nlinks';
        $offset = 0;
    } else {
        list($limit, $offset) = wfCheckLimits();
        $nlinks = true;
    }
    $wpp = new WantedPagesPage($inc, $nlinks);
    $wpp->doQuery($offset, $limit, !$inc);
}
コード例 #23
0
/**
 * Special:LinkSearch to search the external-links table.
 */
function wfSpecialLinkSearch($par)
{
    list($limit, $offset) = wfCheckLimits();
    global $wgOut, $wgUrlProtocols, $wgMiserMode, $wgLang;
    $target = $GLOBALS['wgRequest']->getVal('target', $par);
    $namespace = $GLOBALS['wgRequest']->getIntorNull('namespace', null);
    $protocols_list[] = '';
    foreach ($wgUrlProtocols as $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 (!in_array($protocol, $protocols_list)) {
        // unsupported protocol, show original search request
        $target2 = $target;
        $protocol = '';
    }
    $self = Title::makeTitle(NS_SPECIAL, 'Linksearch');
    $wgOut->allowClickjacking();
    $wgOut->addWikiMsg('linksearch-text', '<nowiki>' . $wgLang->commaList($wgUrlProtocols) . '</nowiki>');
    $s = Xml::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'])) . Html::hidden('title', $self->getPrefixedDbKey()) . '<fieldset>' . Xml::element('legend', array(), wfMsg('linksearch')) . Xml::inputLabel(wfMsg('linksearch-pat'), 'target', 'target', 50, $target) . ' ';
    if (!$wgMiserMode) {
        $s .= Xml::label(wfMsg('linksearch-ns'), 'namespace') . ' ' . Xml::namespaceSelector($namespace, '');
    }
    $s .= Xml::submitButton(wfMsg('linksearch-ok')) . '</fieldset>' . Xml::closeElement('form');
    $wgOut->addHTML($s);
    if ($target != '') {
        $searcher = new LinkSearchPage();
        $searcher->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
        $searcher->doQuery($offset, $limit);
    }
}
コード例 #24
0
 public function execute()
 {
     global $wgRequest, $wgOut, $wgUser;
     if (!$this->userAllowed()) {
         $wgOut->setRobotpolicy('noindex,nofollow');
         $wgOut->errorpage('nosuchspecialpage', 'nospecialpagetext');
         return;
     }
     $wgOut->setHTMLTitle('Admin - Rating Reasons - wikiHow');
     $wgOut->setPageTitle('List Of Rating Reasons');
     $ArrLink = SpecialPage::getTitleFor('AdminRatingReasons');
     $filterThis = $wgUser->getSkin()->makeLinkObj($ArrLink, 'Show All Rating Reasons');
     // TODO what does this checklimits line do..
     list($limit, $offset) = wfCheckLimits();
     $item = $wgRequest->getVal('item');
     $pqp = new RatingReasonsQueryPage($item);
     $pqp->doQuery($offset, $limit);
     $wgOut->addHTML("<hr><br><p>{$filterThis}</p>");
 }
コード例 #25
0
 function execute($article_id = null, $limit = "", $offset = "", $show = true)
 {
     global $wgRequest, $wgOut, $wgTitle, $wgUser;
     if (!$wgUser->isAllowed('imageservingtest')) {
         throw new PermissionsError('imageservingtest');
     }
     $this->size = 200;
     $this->prop = array("w" => 2, "h" => 1);
     switch ($wgRequest->getVal("option", 1)) {
         case "2":
             $this->size = 270;
             $this->prop = array("w" => 3, "h" => 1);
             break;
         case "3":
             $this->size = 100;
             $this->prop = array("w" => 1, "h" => 1);
             break;
     }
     if ($wgRequest->getVal("article", "") != "") {
         $title = Title::newFromText($wgRequest->getVal("article"), NS_MAIN);
         $test = new ImageServing(array($title->getArticleId()), $this->size, $this->prop);
         foreach ($test->getImages(20) as $value) {
             $wgOut->addHTML("<b>" . $title->getText() . "</b><br><br>");
             foreach ($value as $value2) {
                 $wgOut->addHTML("<img src='{$value2['url']}' /> <br>");
                 $wgOut->addHTML($value2['name'] . "<br>");
             }
         }
         return;
     }
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=1")), wfMsg('imageserving-option1')) . "<br>");
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=2")), wfMsg('imageserving-option2')) . "<br>");
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=3")), wfMsg('imageserving-option3')) . "<br>");
     if (empty($limit) && empty($offset)) {
         list($limit, $offset) = wfCheckLimits();
     }
     /** removed reference to deprecated mechanism of Mostvisitedpages
      *  right now operation of ImageServing Test is not very clear
      *  TODO: provide clearer way of using ImageServingTest (BugId:97236)
      */
 }
コード例 #26
0
 function execute($article_id = null, $limit = "", $offset = "", $show = true)
 {
     global $wgRequest, $wgOut, $wgTitle, $wgUser;
     if (!$wgUser->isAllowed('imageservingtest')) {
         throw new PermissionsError('imageservingtest');
     }
     $this->size = 200;
     $this->prop = array("w" => 2, "h" => 1);
     switch ($wgRequest->getVal("option", 1)) {
         case "2":
             $this->size = 270;
             $this->prop = array("w" => 3, "h" => 1);
             break;
         case "3":
             $this->size = 100;
             $this->prop = array("w" => 1, "h" => 1);
             break;
     }
     if ($wgRequest->getVal("article", "") != "") {
         $title = Title::newFromText($wgRequest->getVal("article"), NS_MAIN);
         $test = new ImageServing(array($title->getArticleId()), $this->size, $this->prop);
         foreach ($test->getImages(20) as $key => $value) {
             $wgOut->addHTML("<b>" . $title->getText() . "</b><br><br>");
             foreach ($value as $value2) {
                 $wgOut->addHTML("<img src='{$value2['url']}' /> <br>");
                 $wgOut->addHTML($value2['name'] . "<br>");
             }
         }
         return;
     }
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=1")), wfMsg('imageserving-option1')) . "<br>");
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=2")), wfMsg('imageserving-option2')) . "<br>");
     $wgOut->addHTML(Xml::element("a", array("href" => $wgTitle->getLocalURL("option=3")), wfMsg('imageserving-option3')) . "<br>");
     if (empty($limit) && empty($offset)) {
         list($limit, $offset) = wfCheckLimits();
     }
     $this->mpp = new MostvisitedpagesPageIS($article_id, $show, $this->size, $this->prop);
     $this->mpp->doQuery($wgRequest->getVal("offset", 0), 20, $show);
 }
コード例 #27
0
 function execute($page = null, $limit = "", $offset = "", $show = true)
 {
     global $wgRequest, $wgUser, $wgOut;
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (!$wgUser->isAllowed('multiwikifinder')) {
         $this->displayRestrictionError();
         return;
     }
     $page = $wgRequest->getVal('target', $page);
     if (empty($limit) && empty($offset)) {
         list($limit, $offset) = wfCheckLimits();
     }
     $this->mfp = new MultiwikifinderPage($this->mName, $page, $limit, $offset);
     if (!empty($show)) {
         $this->setHeaders();
     } else {
         // return data as array - not like <LI> list
         $this->mfp->setShow(false);
     }
     $this->mfp->showForm();
 }
コード例 #28
0
 public function execute($par)
 {
     global $wgOut, $wgRequest;
     global $wgUser;
     if (!$wgUser->isAllowed('delete')) {
         $wgOut->permissionRequired('delete');
         return;
     }
     $skin = $wgUser->getSkin();
     $this->setHeaders();
     $this->db = wfGetDB(DB_SLAVE);
     if (($result = $this->checkTables($this->db)) !== true) {
         $wgOut->addHTML($result);
         return;
     }
     # normal processing
     list($limit, $offset) = wfCheckLimits();
     $cmd = $wgRequest->getVal('action');
     $order = $wgRequest->getVal('order');
     # null means default order (by page name)
     if (!in_array($order, array(null, 'user', 'time'))) {
         $order = null;
     }
     if ($cmd == null) {
         $cel = new ec_CurrentEditsList($order);
         $cel->doQuery($offset, $limit);
     } elseif ($cmd == 'delete') {
         if (($edit_id = $wgRequest->getVal('id')) !== null) {
             $this->deleteSession($edit_id);
             if ($order == null) {
                 $wgOut->redirect($this->getTitle()->getFullURL());
             } else {
                 $wgOut->redirect($this->getTitle()->getFullURL('order=' . $order));
             }
         }
     }
 }
コード例 #29
0
function wfSpecialAncientpages()
{
    list($limit, $offset) = wfCheckLimits();
    $app = new AncientPagesPage();
    $app->doQuery($offset, $limit);
}
コード例 #30
0
/**
 * constructor
 */
function wfSpecialMostlinked()
{
    list($limit, $offset) = wfCheckLimits();
    $wpp = new MostlinkedPage();
    $wpp->doQuery($offset, $limit);
}