本文整理匯總了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;
}
示例2: efEventsExtn
function efEventsExtn()
{
global $wgMessageCache;
SpecialPage::addPage(new EventsExtn());
$wgMessageCache->addMessage('events', 'Events');
$wgMessageCache->addMessage('events-header', '');
}
示例3: wfExtensionAWCMultiFileUploader
function wfExtensionAWCMultiFileUploader()
{
global $wgMessageCache;
$wgMessageCache->addMessages(array('awcmultifileuploader' => 'Multi-File Uploader'));
//will expand
SpecialPage::addPage(new SpecialPage('AWCMultiFileUploader', 'MultiFileUploader', true));
}
示例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));
}
示例5: wfExtensionSpecialGoogleSitemap
function wfExtensionSpecialGoogleSitemap()
{
global $wgMessageCache;
$wgMessageCache->addMessages(array('googlesitemap' => 'Google Sitemap'));
$wgAvailableRights[] = 'googlesitemap';
$wgGroupPermissions['bureaucrat']['googlesitemap'] = true;
SpecialPage::addPage(new SpecialPage('GoogleSitemap', 'userrights'));
}
示例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));
}
示例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');
}
示例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'));
}
示例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');
}
示例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));
}
示例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);
}
示例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();
}
示例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());
}
示例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;
示例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>";