Example #1
0
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!'));
}
Example #2
0
 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);
     }
 }
Example #3
0
 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';
 }
Example #4
0
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. '));
}
Example #5
0
function wfImagecounter()
{
    SpecialPage::AddPage(new SpecialPage('Imagecounter'));
}
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');
}
Example #7
0
function wfCheckquality()
{
    SpecialPage::AddPage(new UnlistedSpecialPage('Checkquality'));
    global $wgMessageCache;
    $wgMessageCache->addMessages(array('checkquality' => 'Check Article Quality'));
}