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


PHP SpecialPage::AddPage方法代码示例

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


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

示例1: wfCheckmylinks

function wfCheckmylinks()
{
    global $wgMessageCache;
    SpecialPage::AddPage(new UnlistedSpecialPage('Checkmylinks'));
    SpecialPage::AddPage(new UnlistedSpecialPage('PreviewPage'));
    $wgMessageCache->addMessages(array('checkmylinks' => 'Check My Links', 'checkmylinks_summary' => 'This is a simple page that will tell you whether or not your "[[Create Custom Navigation Links on Your Sidebar on wikiHow|My links]]" are too long. Please log out and log back in again after making any changes to see your most recent links.', 'checkmylinks_notloggedin' => 'You have to be logged in to use this feature.', 'checkmylinks_error' => 'Your account does not have any links asscociated with it. Please see [[Create Custom Navigation Links on Your Sidebar on wikiHow]].', 'checkmylinks_size_bad' => 'Your links are $1 bytes long. These are too long, please shorten them to allow them to less than 3,000 to allow them to  work. ', 'checkmylinks_size_good' => 'Your links are $1 bytes long. These are OK!'));
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:Checkmylinks.php

示例2: setupOpenID

 function setupOpenID()
 {
     global $wgMessageCache, $wgOut, $wgRequest;
     $wgMessageCache->addMessages(array('openidlogin' => 'Login with OpenID', 'openidfinish' => 'Finish OpenID login', 'openidserver' => 'OpenID server', 'openidconvert' => 'OpenID converter', 'openidlogininstructions' => 'Enter your OpenID identifier to log in:', 'openiderror' => 'Verification error', 'openiderrortext' => 'An error occured during verification of the OpenID URL.', 'openidconfigerror' => 'OpenID Configuration Error', 'openidconfigerrortext' => 'The OpenID storage configuration for this wiki is invalid.  Please consult this site\'s administrator.', 'openidpermission' => 'OpenID permissions error', 'openidpermissiontext' => 'The OpenID you provided is not allowed to login to this server.', 'openidcancel' => 'Verification cancelled', 'openidcanceltext' => 'Verification of the OpenID URL was cancelled.', 'openidfailure' => 'Verification failed', 'openidfailuretext' => 'Verification of the OpenID URL failed.', 'openidsuccess' => 'Verification succeeded', 'openidsuccesstext' => 'Verification of the OpenID URL succeeded.', 'openidusernameprefix' => 'OpenIDUser', 'openidserverlogininstructions' => 'Enter your password below to log in to $3 as user $2 (user page $1).', 'openidtrustinstructions' => 'Check if you want to share data with $1.', 'openidallowtrust' => 'Allow $1 to trust this user account.', 'openidnopolicy' => 'Site has not specified a privacy policy.', 'openidpolicy' => 'Check the <a target="_new" href="$1">privacy policy</a> for more information.', 'openidoptional' => 'Optional', 'openidrequired' => 'Required', 'openidnickname' => 'Nickname', 'openidfullname' => 'Fullname', 'openidemail' => 'Email address', 'openidlanguage' => 'Language', 'openidnotavailable' => 'Your preferred nickname ($1) is already in use by another user.', 'openidnotprovided' => 'Your OpenID server did not provide a nickname (either because it can\'t, or because you told it not to).', 'openidchooseinstructions' => 'All users need a nickname; you can choose one from the options below.', 'openidchoosefull' => 'Your full name ($1)', 'openidchooseurl' => 'A name picked from your OpenID ($1)', 'openidchooseauto' => 'An auto-generated name ($1)', 'openidchoosemanual' => 'A name of your choice: ', 'openidconvertinstructions' => 'This form lets you change your user account to use an OpenID URL.', 'openidconvertsuccess' => 'Successfully converted to OpenID', 'openidconvertsuccesstext' => 'You have successfully converted your OpenID to $1.', 'openidconvertyourstext' => 'That is already your OpenID.', 'openidconvertothertext' => 'That is someone else\'s OpenID.'));
     SpecialPage::AddPage(new UnlistedSpecialPage('OpenIDLogin'));
     SpecialPage::AddPage(new UnlistedSpecialPage('OpenIDFinish'));
     SpecialPage::AddPage(new UnlistedSpecialPage('OpenIDServer'));
     SpecialPage::AddPage(new UnlistedSpecialPage('OpenIDConvert'));
     SpecialPage::AddPage(new UnlistedSpecialPage('OpenIDXRDS'));
     $action = $wgRequest->getText('action', 'view');
     if ($action == 'view') {
         $title = $wgRequest->getText('title');
         if (!isset($title) || strlen($title) == 0) {
             # If there's no title, and Cache404 is in use, check using its stuff
             if (defined('CACHE404_VERSION')) {
                 if ($_SERVER['REDIRECT_STATUS'] == 404) {
                     $url = getRedirectUrl($_SERVER);
                     if (isset($url)) {
                         $title = cacheUrlToTitle($url);
                     }
                 }
             } else {
                 $title = wfMsg('mainpage');
             }
         }
         $nt = Title::newFromText($title);
         // If the page being viewed is a user page,
         // generate the openid.server META tag and output
         // the X-XRDS-Location.  See the OpenIDXRDS
         // special page for the XRDS output / generation
         // logic.
         if ($nt && $nt->getNamespace() == NS_USER && strpos($nt->getText(), '/') === false) {
             $user = User::newFromName($nt->getText());
             if ($user && $user->getID() != 0) {
                 $openid = OpenIdGetUserUrl($user);
                 if (isset($openid) && strlen($openid) != 0) {
                     $url = OpenIDToUrl($openid);
                     $disp = htmlspecialchars($openid);
                     $wgOut->setSubtitle("<span class='subpages'>" . "<img src='http://openid.net/login-bg.gif' alt='OpenID' />" . "<a href='{$url}'>{$disp}</a>" . "</span>");
                 } else {
                     $wgOut->addLink(array('rel' => 'openid.server', 'href' => OpenIDServerUrl()));
                     $rt = Title::makeTitle(NS_SPECIAL, 'OpenIDXRDS/' . $user->getName());
                     $wgOut->addMeta('http:X-XRDS-Location', $rt->getFullURL());
                     header('X-XRDS-Location', $rt->getFullURL());
                 }
             }
         }
     }
     // Verify the config file settings.  FIXME: How to
     // report error?
     global $wgOpenIDServerStorePath, $wgOpenIDServerStoreType, $wgOpenIDConsumerStorePath, $wgOpenIDConsumerStoreType;
     if ($wgOpenIDConsumerStoreType == 'file') {
         assert($wgOpenIDConsumerStorePath != false);
     }
     if ($wgOpenIDServerStoreType == 'file') {
         assert($wgOpenIDServerStorePath != false);
     }
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:58,代码来源:OpenID.php

示例3: setupMwRdf

 function setupMwRdf()
 {
     global $wgParser, $wgMessageCache, $wgRequest, $wgOut, $wgHooks;
     $wgMessageCache->addMessages(array('rdf' => 'Rdf', 'rdf-inpage' => "Embedded In-page Turtle", 'rdf-dcmes' => "Dublin Core Metadata Element Set", 'rdf-cc' => "Creative Commons", 'rdf-image' => "Embedded images", 'rdf-linksto' => "Links to the page", 'rdf-linksfrom' => "Links from the page", 'rdf-links' => "All links", 'rdf-history' => "Historical versions", 'rdf-interwiki' => "Interwiki links", 'rdf-categories' => "Categories", 'rdf-target' => "Target page", 'rdf-modelnames' => "Model(s)", 'rdf-format' => "Output format", 'rdf-output-xml' => "XML", 'rdf-output-turtle' => "Turtle", 'rdf-output-ntriples' => "NTriples", 'rdf-instructions' => "Select the target page and RDF models you're interested in."));
     $wgParser->setHook('rdf', 'renderMwRdf');
     SpecialPage::AddPage(new SpecialPage('Rdf', '', true, 'wfSpecialRdf', 'extensions/MwRdf.php'));
     # Add an RDF metadata link if requested
     $action = $wgRequest->getText('action', 'view');
     # Note: $wgTitle not yet set; have to get it from the request
     $title = $wgRequest->getText('title');
     # If there's no requested title...
     if (!isset($title) || strlen($title) == 0) {
         # If there's no title, and Cache404 is in use, check using its stuff
         if (defined('CACHE404_VERSION')) {
             if ($_SERVER['REDIRECT_STATUS'] == 404) {
                 $url = getRedirectUrl($_SERVER);
                 if (isset($url)) {
                     $title = cacheUrlToTitle($url);
                 }
             }
         }
     }
     if (isset($title) && strlen($title) > 0) {
         $nt = Title::newFromText($title);
         if (isset($nt) && $nt->getNamespace() != NS_SPECIAL) {
             if ($action == 'view') {
                 $rdft = Title::makeTitle(NS_SPECIAL, "Rdf");
                 $target = $nt->getPrefixedDBkey();
                 $linkdata = array('title' => 'RDF Metadata', 'type' => 'application/rdf+xml', 'href' => $rdft->getLocalURL("target={$target}"));
                 $wgOut->addMetadataLink($linkdata);
             } else {
                 if ($action == 'purge') {
                     # clear cache on purge
                     MwRdfClearCacheAll($nt);
                 }
             }
         }
     }
     # We set some hooks for invalidating the cache
     $wgHooks['ArticleSave'][] = 'MwRdfOnArticleSave';
     $wgHooks['ArticleSaveComplete'][] = 'MwRdfOnArticleSaveComplete';
     $wgHooks['TitleMoveComplete'][] = 'MwRdfOnTitleMoveComplete';
     $wgHooks['ArticleDeleteComplete'][] = 'MwRdfOnArticleDeleteComplete';
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:44,代码来源:Rdf.php

示例4: wfRevisionReel

function wfRevisionReel()
{
    global $wgMessageCache;
    SpecialPage::AddPage(new UnlistedSpecialPage('RevisionReel'));
    $wgMessageCache->addMessages(array('revisionreel' => 'Revision Reel', 'revisionreel_loggedin' => 'You must be logged in to view this page. '));
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:6,代码来源:RevisionReel.php

示例5: wfImagecounter

function wfImagecounter()
{
    SpecialPage::AddPage(new SpecialPage('Imagecounter'));
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:4,代码来源:Imagecounter.php

示例6: wfTranslationHelper

function wfTranslationHelper()
{
    global $wgMessageCache, $wgLogTypes, $wgLogNames, $wgHooks;
    SpecialPage::AddPage(new SpecialPage('TranslationHelper'));
    $wgMessageCache->addMessages(array('translationhelper' => 'Translation Helper', 'translationhelper_view' => 'view', 'translationhelper_extensionmessages' => 'Extension messages', 'translationhelper_mediawikimessages' => 'Missing/Out of date Mediawiki messages'), 'en');
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:6,代码来源:TranslationHelper.php

示例7: wfCheckquality

function wfCheckquality()
{
    SpecialPage::AddPage(new UnlistedSpecialPage('Checkquality'));
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('checkquality' => 'Check Article Quality'));
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:6,代码来源:Checkquality.php


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