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


PHP SpecialPage::addPage方法代码示例

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


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

示例1: 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-linksfrom' => "Links from the page", 'rdf-links' => "All links", 'rdf-linksto' => "Links to the page", '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-rdfxml' => "RDFXML", '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, 'wfRdfSpecialPage', 'extensions/Rdf/Rdf.php'));
    SpecialPage::addPage(new SpecialPage('RdfQuery', '', true, 'wfSpecialRdfQuery', 'extensions/Rdf/Rdf.php'));
    # next we set some hooks for saving and clearing RDF data.  Each
    # hook is called on the same ModelingAgent object as it preserves
    # the list of pages we link to in its state
    $wgHooks['ArticleSave'][] = array('wfRdfOnArticleSave');
    $wgHooks['ArticleSaveComplete'][] = array('wfRdfOnArticleSaveComplete');
    $wgHooks['TitleMoveComplete'][] = array('wfRdfOnTitleMoveComplete');
    $wgHooks['ArticleDeleteComplete'][] = array('wfRdfOnArticleDeleteComplete');
    # 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 (!isset($title) || strlen($title) == 0) {
        return true;
    }
    $nt = Title::newFromText($title);
    if (!isset($nt) || $nt->getNamespace() == NS_SPECIAL) {
        return true;
    }
    # finally *if* this is a page view we need to add the link
    if (!$action == 'view') {
        return true;
    }
    $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);
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:35,代码来源:SetupRdf.php

示例2: efEventsExtn

 function efEventsExtn()
 {
     global $wgMessageCache;
     SpecialPage::addPage(new EventsExtn());
     $wgMessageCache->addMessage('events', 'Events');
     $wgMessageCache->addMessage('events-header', '');
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:7,代码来源:SpecialEvents.php

示例3: wfExtensionAWCMultiFileUploader

function wfExtensionAWCMultiFileUploader()
{
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('awcmultifileuploader' => 'Multi-File Uploader'));
    //will expand
    SpecialPage::addPage(new SpecialPage('AWCMultiFileUploader', 'MultiFileUploader', true));
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:main.php

示例4: wfCreatePageSetup

function wfCreatePageSetup()
{
    global $IP, $wgMessageCache, $wgOut;
    require_once $IP . '/includes/SpecialPage.php';
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('createpage' => 'Create a new article', 'createpage_button' => 'Create a new article', 'createpage_help' => '', 'createpage_caption' => 'title', 'createpage_button_caption' => 'Create!', 'createpage_title' => 'Create a new article', 'createpage_categories' => 'Categories:', 'createpage_title_caption' => 'Title:', 'createpage_loading_mesg' => 'Loading... please wait...', 'createpage_enter_text' => 'Text:', 'createpage_here' => 'here', 'createpage_show_cloud' => '[show category cloud]', 'createpage_hide_cloud' => '[hide category cloud]', 'createpage_alternate_creation' => 'or click $1 to use original editor', 'createpage_categories_help' => 'Categories help organize information in this wiki. Please choose from the list below or type a new one.'));
    SpecialPage::addPage(new SpecialPage('Createpage', '', true, 'wfCreatePageSpecial', false));
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:8,代码来源:SpecialCreatePage.php

示例5: wfExtensionSpecialGoogleSitemap

function wfExtensionSpecialGoogleSitemap()
{
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('googlesitemap' => 'Google Sitemap'));
    $wgAvailableRights[] = 'googlesitemap';
    $wgGroupPermissions['bureaucrat']['googlesitemap'] = true;
    SpecialPage::addPage(new SpecialPage('GoogleSitemap', 'userrights'));
}
开发者ID:hoonio,项目名称:mediawiki,代码行数:8,代码来源:GoogleSitemap.php

示例6: wfSpamRegexSetup

function wfSpamRegexSetup()
{
    global $IP, $wgMessageCache;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    wfLoadExtensionMessages('Spamregex');
    SpecialPage::addPage(new SpecialPage('Spamregex', 'spamregex', true, 'wfSpamRegexSpecial', false));
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:10,代码来源:SpecialSpamRegex.php

示例7: wfRegexBlockSetup

function wfRegexBlockSetup()
{
    global $IP;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    SpecialPage::addPage(new SpecialPage('Regexblock', 'regexblock', true, 'wfRegexBlockSpecial', false));
    wfLoadExtensionMessages('RegexBlock');
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:10,代码来源:SpecialRegexBlock.php

示例8: wfRebuildMessagesSetup

function wfRebuildMessagesSetup()
{
    global $IP, $wgMessageCache;
    require_once $IP . '/includes/SpecialPage.php';
    require_once $IP . "/extensions/RebuildMessages/InitialiseMessages.inc";
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('rebuildmessages_button' => 'Go', 'rebuildmessages_help' => "This script is used to update the MediaWiki namespace after changing site language. You can choose either \n''update'' - Update messages to include latest additions to MessagesXX.php, or ''rebuild'' - Delete all messages and reinitialise namespace.\n\nIf a message dump file is given, messages will be read from it to supplement\nthe defaults in MediaWiki's Language*.php. The file should contain a serialized\nPHP associative array, as produced by dumpMessages.php.\n\n", 'rebuildmessages_caption' => "Message dump file", 'rebuildmessages_title' => "Rebuild Messages", 'rebuildmessages_this' => "this wiki", 'rebuildmessages_local' => "all local wikis", 'rebuildmessages_all' => "all wikis from a shared database", 'rebuildmessages_action' => "Options", 'rebuildmessages_options' => 'Choose action', 'rebuildmessages_success_title' => "Cleanup Spam Succedeed", 'rebuildmessages_success_subtitle' => "for \$1", 'rebuildmessages_error_not_valid' => "Not a valid hostname specification", 'rebuildmessages_error_empty' => "Please provide a file", 'rebuildmessages_count_zero' => "There are no articles containing links to \$1", 'rebuildmessages_cleanup_finished' => "The cleanup process has finished.", 'rebuildmessages_processing' => "cleaning up links to \$1", 'rebuildmessages_link_back' => "You can go back to the extension ", 'rebuildmessages_none_found' => "No articles found containing links to \$1.", 'rebuildmessages_no_local' => "There are no local wikis here. Try other modes.", 'rebuildmessages_update' => "running in update mode", 'rebuildmessages_rebuild' => "running in rebuild mode"));
    SpecialPage::addPage(new SpecialPage('Rebuildmessages', 'rebuildmessages', true, 'wfRebuildMessagesSpecial', false));
    $wgMessageCache->addMessages(array('rebuildmessages' => 'rebuild Messages'));
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:SpecialRebuildMessages.php

示例9: wfCleanupSpamSetup

function wfCleanupSpamSetup()
{
    global $IP, $wgMessageCache;
    require_once $IP . '/includes/SpecialPage.php';
    require_once "{$IP}/extensions/SilentArticle.php";
    /* add messages to all the translator people out there to play with */
    $wgMessageCache->addMessages(array('cleanupspam_button' => 'Clean up spam', 'cleanupspam_help' => 'This special page provides means to revert back all pages containing a given url back to their non-contaminated states, or even blank them if no clean revisions exist. It allows a cleanup of this particular wiki, cleanup of all local wikis, or cleanup of all wikis in a shared database.', 'cleanupspam_caption' => 'Containing ', 'cleanupspam_file' => 'Against SpamBlacklist file', 'cleanupspam_title' => 'Cleanup Spam', 'cleanupspam_this' => 'this wiki', 'cleanupspam_total' => 'Found $1 link(s) total.', 'cleanupspam_local' => 'all local wikis', 'cleanupspam_all' => 'all wikis from a shared database', 'cleanupspam_on' => 'Clean up articles on', 'cleanupspam_or' => '<b>OR</b>', 'cleanupspam_action' => 'Choose action', 'cleanupspam_success_title' => 'Cleanup Spam Succedeed', 'cleanupspam_success_subtitle' => 'for $1', 'cleanupspam_error_not_valid' => 'Not a valid hostname specification', 'cleanupspam_both_modes' => 'Pick either mode: provide a link considered as spam or check whether to use Spam Blacklist.', 'cleanupspam_error_empty' => 'Please specify a url to cleanup', 'cleanupspam_count_zero' => 'There are no articles containing links to $1', 'cleanupspam_cleanup_finished' => 'The cleanup process has finished.', 'cleanupspam_processing' => 'cleaning up links to $1', 'cleanupspam_link_back' => 'You can go back to the extension ', 'cleanupspam_none_found' => 'No articles found containing links to $1.', 'cleanupspam_no_local' => 'There are no local wikis here. Try other modes.', 'cleanupspam_bad_regex' => 'Please specify more complete url'));
    SpecialPage::addPage(new SpecialPage('Cleanupspam', 'cleanupspam', true, 'wfCleanupSpamSpecial', false));
    $wgMessageCache->addMessage('cleanupspam', 'Clean up spam');
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:SpecialCleanupSpam.php

示例10: wfRegexBlockStatsPageSetup

function wfRegexBlockStatsPageSetup()
{
    global $IP;
    if (!wfSimplifiedRegexCheckSharedDB()) {
        return;
    }
    require_once $IP . '/includes/SpecialPage.php';
    /* name, restrictions, */
    SpecialPage::addPage(new SpecialPage('Regexblockstats', 'regexblock', false, 'wfRegexBlockStatsCore', false));
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:10,代码来源:SpecialRegexBlockStats.php

示例11: setup

 function setup()
 {
     global $IP;
     require_once "{$IP}/includes/SpecialPage.php";
     require_once $this->file;
     if (!is_array($this->params)) {
         $this->params = array($this->params);
     }
     $className = array_shift($this->params);
     $obj = extCreateObject($className, $this->params);
     SpecialPage::addPage($obj);
 }
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:12,代码来源:ExtensionFunctions.php

示例12: setup

 /**
  * Extension setup
  */
 function setup()
 {
     global $wgParser, $wgLanguageCode, $wgMessageCache, $wgContLang;
     $this->cat = $wgContLang->getNsText(NS_CATEGORY);
     # Add the messages used (todo: move into i18n)
     if ($wgLanguageCode == 'en') {
         $wgMessageCache->addMessages(array('workflow' => $this->magic, 'workflowMissingStates' => "No workflow states defined", 'workflowStateUpdated' => "\$1 {$this->magic} state set to [[{$this->cat}:\$2|\$2]]."));
     }
     # Add the specialpage to the environment
     SpecialPage::addPage(new SpecialWorkflow());
     # Add the parser-function hook
     $wgParser->setFunctionHook($this->magic, array($this, 'expandMagic'));
     # Add the client-side scripts for changing states
     $this->addJS();
 }
开发者ID:saper,项目名称:organic-extensions,代码行数:18,代码来源:Workflow.php

示例13: execute

        function execute($par)
        {
            global $wgRequest, $wgEmailImage;
            $size = 4;
            $text = $wgRequest->getText('img');
            /* decode this rubbish */
            $text = rawurldecode($text);
            $text = str_rot13($text);
            $text = base64_decode($text);
            $text = str_replace($wgEmailImage['ugly'], "", $text);
            $fontwidth = imagefontwidth($size);
            $fontheight = imagefontheight($size);
            $width = strlen($text) * $fontwidth + 4;
            $height = $fontheight + 2;
            $im = @imagecreatetruecolor($width, $height) or exit;
            $trans = imagecolorallocate($im, 0, 0, 0);
            /* must be black! */
            $color = imagecolorallocate($im, 1, 1, 1);
            /* nearly black ;) */
            imagecolortransparent($im, $trans);
            /* seems to work only with black! */
            imagestring($im, $size, 2, 0, $text, $color);
            //header ("Content-Type: image/png"); imagepng($im); => IE is just so bad!
            header("Content-Type: image/gif");
            imagegif($im);
            exit;
        }
    }
    /* class */
    SpecialPage::addPage(new Email());
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:emailtag.php

示例14: doSpecialAddEditSitting

<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
require_once "{$IP}/includes/SpecialPage.php";
function doSpecialAddEditSitting()
{
    $MV_SpecialAddSitting = new MV_SpecialEditSitting();
    $MV_SpecialAddSitting->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_add_edit_Sitting', '', true, 'doSpecialAddEditSitting', false));
//SpecialPage::addPage( new SpecialPage('Mv_add_edit_Sitting','',true,'doSpecialAddSitting',false) );
class MV_SpecialEditSitting extends SpecialPage
{
    function execute()
    {
        global $wgRequest, $wgOut, $wgUser, $wgArticle;
        $sitting_of = $wgRequest->getVal('sitting_of');
        $session_number = $wgRequest->getVal('session_number');
        $sitting_start_date_time = $wgRequest->getVal('sitting_start_date_and_time');
        $sitting_end_date_time = $wgRequest->getVal('sitting_end_date_and_time');
        $sitting_session_number = $wgRequest->getVal('sitting_session_number');
        $wpEditToken = $wgRequest->getVal('wpEditToken');
        $sitting_desc = $wgRequest->getVal('sitting_desc');
        $sitting_start_date = substr($sitting_start_date_time, 0, strpos($sitting_start_date_time, ' '));
        $sitting_start_time = substr($sitting_start_date_time, strpos($sitting_start_date_time, ' ') + 1);
        $sitting_end_date = substr($sitting_end_date_time, 0, strpos($sitting_end_date_time, ' '));
        $sitting_end_time = substr($sitting_end_date_time, strpos($sitting_end_date_time, ' ') + 1);
        $sitting_name = $sitting_of . '-' . $sitting_start_date;
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:31,代码来源:MV_SpecialEditSitting.php

示例15: doSpecialSittingTypes

<?php

if (!defined('MEDIAWIKI')) {
    die;
}
global $IP;
//require_once( "$IP/includes/SpecialPage.php" );
function doSpecialSittingTypes()
{
    $MV_SpecialSittingTypes = new MV_SpecialSittingTypes();
    $MV_SpecialSittingTypes->execute();
}
SpecialPage::addPage(new SpecialPage('Mv_Sitting_Types', '', true, 'doSpecialSittingTypes', true));
class MV_SpecialSittingTypes
{
    function __construct()
    {
    }
    function displayTypes()
    {
        global $sittingTypesTable, $mvgScriptPath;
        $html = '';
        $html = '<fieldset><legend>Add a Sitting Type</legend>';
        $dbr = wfGetDB(DB_SLAVE);
        $result = $dbr->select($sittingTypesTable, '*');
        if ($result == 0) {
            $html = 'There are currently no sitting types';
        } else {
            while ($row = $dbr->fetchobject($result)) {
                $html .= '<a title="Remove sitting type"' . ' href="' . $wgRequest->getRequestURL() . '&mv_action=rm_sitting_type&rid=' . $row->id . '"><img src="' . $mvgScriptPath . '/skins/images/delete.png"></a>';
                $html .= $row->type . "<br>";
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:31,代码来源:MV_SpecialSittingTypes.php


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