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


PHP wfLoadExtensionMessages函数代码示例

本文整理汇总了PHP中wfLoadExtensionMessages函数的典型用法代码示例。如果您正苦于以下问题:PHP wfLoadExtensionMessages函数的具体用法?PHP wfLoadExtensionMessages怎么用?PHP wfLoadExtensionMessages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: execute

 function execute($par)
 {
     global $wgRequest, $wgUser, $wgOut;
     wfLoadExtensionMessages('OpenID');
     $this->setHeaders();
     if ($wgUser->getID() == 0) {
         $wgOut->showErrorPage('openiderror', 'notloggedin');
         return;
     }
     $this->outputHeader();
     switch ($par) {
         case 'Finish':
             $this->finish();
             break;
         case 'Delete':
             $this->delete();
             break;
         default:
             $openid_url = $wgRequest->getText('openid_url');
             if (isset($openid_url) && strlen($openid_url) > 0) {
                 $this->convert($openid_url);
             } else {
                 $this->form();
             }
     }
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:26,代码来源:SpecialOpenIDConvert.body.php

示例2: loadMessages

 public static function loadMessages()
 {
     global $wgVersion;
     if (version_compare($wgVersion, '1.16', '<')) {
         wfLoadExtensionMessages('DataTransfer');
     }
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:7,代码来源:DT_Utils.php

示例3: wfNewuserlogHook

function wfNewuserlogHook($user = null, $byEmail = false)
{
    global $wgUser, $wgContLang, $wgVersion;
    wfLoadExtensionMessages('Newuserlog');
    if (is_null($user)) {
        // Compatibility with old versions which didn't pass the parameter
        $user = $wgUser;
    }
    $talk = $wgContLang->getFormattedNsText(NS_TALK);
    $contribs = wfMsgForContent('contribslink');
    $block = wfMsgForContent('blocklink');
    if ($user->getName() == $wgUser->getName()) {
        $message = '';
        $action = 'create';
    } else {
        // Links not necessary for self-creations, they will appear already in
        // recentchanges and special:log view for the creating user.
        // For compatability: From 1.10alpha the 'user tools' are used at special:log
        // see bug 4756: Long usernames break block link in new user log entries
        $action = 'create2';
        $message = '';
        if (version_compare($wgVersion, '1.10alpha', '>=')) {
            if ($byEmail) {
                $message = wfMsgForContent('newuserlog-byemail');
            }
        } else {
            $message = wfMsgForContent('newuserlog-create-text', $user->getName(), $talk, $contribs, $block);
        }
    }
    $log = new LogPage('newusers');
    $log->addEntry($action, $user->getUserPage(), $message, array($user->getId()));
    return true;
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:33,代码来源:Newuserlog.php

示例4: execute

 function execute($subpage = '')
 {
     global $wgOut, $wgRequest;
     wfLoadExtensionMessages('EditMessages');
     if ($wgUser->isBlocked()) {
         $wgOut->blockedPage();
         return;
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if (!$wgUser->isAllowed('siteadmin')) {
         $this->displayRestrictionError();
         return;
     }
     $this->setHeaders();
     $messageName = $wgRequest->getVal('messageName');
     if ($wgRequest->getVal('editmsg_search')) {
         $this->showEditForm($messageName);
     } elseif ($wgRequest->getVal('editmsg_get_patch')) {
         $this->generatePatch();
     } elseif ($wgRequest->getVal('editmsg_apply_patch')) {
         $this->applyPatch();
     } else {
         $this->showSearchForm($messageName);
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:28,代码来源:EditMessages_body.php

示例5: execute

 /**
  * main()
  */
 public function execute($par)
 {
     global $wgRequest, $wgOut, $wgContLang;
     wfLoadExtensionMessages('Editcount');
     $target = isset($par) ? $par : $wgRequest->getText('username');
     list($username, $namespace) = $this->extractParamaters($target);
     $username = Title::newFromText($username);
     $username = is_object($username) ? $username->getText() : '';
     $uid = User::idFromName($username);
     if ($this->including()) {
         if ($namespace === null) {
             if ($uid != 0) {
                 $out = $wgContLang->formatNum(User::edits($uid));
             } else {
                 $out = "";
             }
         } else {
             $out = $wgContLang->formatNum($this->editsInNs($uid, $namespace));
         }
         $wgOut->addHTML($out);
     } else {
         if ($uid != 0) {
             $total = $this->getTotal($nscount = $this->editsByNs($uid));
         }
         $html = new EditcountHTML();
         $html->outputHTML($username, $uid, @$nscount, @$total);
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:31,代码来源:SpecialEditcount_body.php

示例6: execute

 function execute($par)
 {
     global $wgRequest, $wgUser, $wgLanguageCode, $wgContLang, $wgOut;
     wfLoadExtensionMessages('GPlusLogin');
     //disconnecting?
     if ($wgRequest->getVal('disconnect')) {
         self::userDisco();
         return;
     }
     //returning to the community dashboard
     $this->returnto = $wgLanguageCode == 'en' ? wfMsg('gpl_returnto') : "/" . $wgContLang->getNSText(NS_PROJECT) . ":" . wfMsg('communityportal');
     //set that user (if we can)
     $this->userid = $wgRequest->getVal('gplus_id') ? $wgRequest->getVal('gplus_id') : $wgRequest->getVal('user_id');
     if ($this->userid) {
         $this->setWgUser();
     }
     if ($wgRequest->wasPosted() && $wgRequest->getVal('gplus_id')) {
         self::processForm();
         return;
     }
     //get user's G+ info
     $gp_id = $wgRequest->getVal('user_id');
     $gp_name = $wgRequest->getVal('user_name');
     $gp_email = $wgRequest->getVal('user_email');
     $gp_avatar = $wgRequest->getVal('user_avatar');
     self::showForm($gp_id, $gp_name, $gp_email, $gp_avatar);
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:GPlusLogin.body.php

示例7: __construct

 public function __construct()
 {
     // Initialize special page
     parent::__construct('Drafts');
     // Internationalization
     wfLoadExtensionMessages('Drafts');
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:Drafts.pages.php

示例8: parserFunction

 public static function parserFunction($parser, $vid = null, $img = null)
 {
     global $wgTitle, $wgContLang;
     wfLoadExtensionMessages('WHVid');
     if ($vid === null || $img === null) {
         return '<div class="errorbox">' . wfMsg('missing-params') . '</div>';
     }
     $vid = htmlspecialchars($vid);
     $divId = "whvid-" . md5($vid . mt_rand(1, 1000));
     $vidUrl = self::getVidUrl($vid);
     $imgTitle = Title::newFromURL($img, NS_IMAGE);
     $imgUrl = null;
     if ($imgTitle) {
         $imgFile = RepoGroup::singleton()->findFile($imgTitle);
         $smallImgUrl = '';
         $largeImgUrl = '';
         if ($imgFile) {
             $width = 550;
             $height = 309;
             $thumb = $imgFile->getThumbnail($width, $height);
             $largeImgUrl = wfGetPad($thumb->getUrl());
             $width = 240;
             //$height = 135;
             $thumb = $imgFile->getThumbnail($width);
             $smallImgUrl = wfGetPad($thumb->getUrl());
         }
     }
     return $parser->insertStripItem(wfMsgForContent('embed-html', $divId, $vidUrl, $largeImgUrl, $smallImgUrl));
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:29,代码来源:WHVid.body.php

示例9: wfEmbedVideoParserFunction

function wfEmbedVideoParserFunction($parser, $service = null, $id = null, $width = null)
{
    global $wgTitle;
    if ($service === null || $id === null) {
        return '<div class="errorbox">' . wfMsg('embedvideo-missing-params') . '</div>';
    }
    wfLoadExtensionMessages('EmbedVideo');
    $params = array('service' => trim($service), 'id' => trim($id), 'width' => $width === null ? null : trim($width));
    global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;
    if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100) {
        $wgEmbedVideoMinWidth = 100;
    }
    if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024) {
        $wgEmbedVideoMaxWidth = 1024;
    }
    global $wgEmbedVideoServiceList;
    $service = $wgEmbedVideoServiceList[$params['service']];
    if (!$service) {
        return '<div class="errorbox">' . wfMsg('embedvideo-unrecognized-service', @htmlspecialchars($params['service'])) . '</div>';
    }
    $id = htmlspecialchars($params['id']);
    $idpattern = isset($service['id_pattern']) ? $service['id_pattern'] : '%[^A-Za-z0-9_\\-]%';
    #echo wfBacktrace(); print_r($params); echo $id; exit;
    if ($id == null || $idpattern != '' && preg_match($idpattern, $id)) {
        return '<div class="errorbox">' . wfMsgForContent('embedvideo-bad-id', $id, @htmlspecialchars($params['service'])) . '</div>';
    }
    # Build URL and output embedded flash object
    $ratio = 425 / 350;
    $width = 425;
    if ($params['width'] !== null) {
        if (!is_numeric($params['width']) || $params['width'] < $wgEmbedVideoMinWidth || $params['width'] > $wgEmbedVideoMaxWidth) {
            return '<div class="errorbox">' . wfMsgForContent('embedvideo-illegal-width', @htmlspecialchars($params['width'])) . '</div>';
        }
        $width = $params['width'];
    }
    $height = round($width / $ratio);
    $url = wfMsgReplaceArgs($service['url'], array($id, $width, $height));
    if ($params['service'] == 'videojug') {
        return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-videojug', $url, $width, $height));
    } else {
        if ($params['service'] == 'popcorn') {
            return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-popcorn', $url, $width, $height));
        } else {
            if ($params['service'] == 'wonderhowto') {
                $id = str_replace("&61;", "=", htmlspecialchars_decode($id));
                // youtube now requires a ? after the http://www.youtube.com/v/[^?&]+). If you use
                // an ampersand things will autoplay.  Very bad!
                $id = preg_replace("@(http://www.youtube.com/v/[^?&]+)(&)autoplay=@", "\$1?", $id);
                return $parser->insertStripItem($id);
            } else {
                if ($params['service'] == 'howcast') {
                    return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause-howcast', $url, $width, $height));
                } else {
                    return $parser->insertStripItem(wfMsgForContent('embedvideo-embed-clause', $url, $width, $height));
                }
            }
        }
    }
    #return wfMsgForContent('embedvideo-embed-clause', $url, $width, $height);
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:60,代码来源:EmbedVideo.php

示例10: getTopLevelCategories

 function getTopLevelCategories()
 {
     global $wgCategoriesArticle;
     wfLoadExtensionMessages('Sitemap');
     $results = array();
     $revision = Revision::newFromTitle(Title::newFromText(wfMsg('categories_article')));
     if (!$revision) {
         return $results;
     }
     // INTL: If there is a redirect to a localized page name, follow it
     if (strpos($revision->getText(), "#REDIRECT") !== false) {
         $revision = Revision::newFromTitle(Title::newFromRedirect($revision->getText()));
     }
     $lines = split("\n", $revision->getText());
     foreach ($lines as $line) {
         if (preg_match('/^\\*[^\\*]/', $line)) {
             $line = trim(substr($line, 1));
             switch ($line) {
                 case "Other":
                 case "wikiHow":
                     break;
                 default:
                     $results[] = $line;
             }
         }
     }
     return $results;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:28,代码来源:Sitemap.body.php

示例11: DSMWGeneralExhibits

 function DSMWGeneralExhibits()
 {
     if (defined('SRF_VERSION')) {
         SpecialPage::SpecialPage('DSMWGeneralExhibits');
     }
     wfLoadExtensionMessages('DSMW');
 }
开发者ID:hala54,项目名称:DSMW,代码行数:7,代码来源:DSMWGeneralExhibits.php

示例12: wfSpecialCiteToolbox

function wfSpecialCiteToolbox(&$monobook)
{
    wfLoadExtensionMessages('SpecialCite');
    if (isset($monobook->data['nav_urls']['cite'])) {
        if ($monobook->data['nav_urls']['cite']['href'] == '') {
            ?>
<li id="t-iscite"><?php 
            echo $monobook->msg('cite_article_link');
            ?>
</li><?php 
        } else {
            ?>
<li id="t-cite"><?php 
            ?>
<a href="<?php 
            echo htmlspecialchars($monobook->data['nav_urls']['cite']['href']);
            ?>
"><?php 
            echo $monobook->msg('cite_article_link');
            ?>
</a><?php 
            ?>
</li><?php 
        }
    }
    return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:SpecialCite.php

示例13: execute

 /**
  * Main execution function
  * @param $par Parameters passed to the page
  */
 function execute($par)
 {
     global $wgOut, $wgUser;
     wfLoadExtensionMessages('Gadgets');
     $skin = $wgUser->getSkin();
     $this->setHeaders();
     $wgOut->setPagetitle(wfMsg("gadgets-title"));
     $wgOut->addWikiText(wfMsg("gadgets-pagetext"));
     $gadgets = wfLoadGadgetsStructured();
     if (!$gadgets) {
         return;
     }
     $listOpen = false;
     $msgOpt = array('parseinline', 'parsemag');
     foreach ($gadgets as $section => $entries) {
         if ($section !== false && $section !== '') {
             $t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-section-{$section}");
             $lnk = $t ? $skin->makeLinkObj($t, wfMsgHTML("edit")) : htmlspecialchars($section);
             $ttext = wfMsgExt("gadget-section-{$section}", $msgOpt);
             if ($listOpen) {
                 $wgOut->addHTML('</ul>');
                 $listOpen = false;
             }
             $wgOut->addHTML("\n<h2>{$ttext} &nbsp; &nbsp; [{$lnk}]</h2>\n");
         }
         foreach ($entries as $gname => $code) {
             $t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-{$gname}");
             if (!$t) {
                 continue;
             }
             $lnk = $skin->makeLinkObj($t, wfMsgHTML("edit"));
             $ttext = wfMsgExt("gadget-{$gname}", $msgOpt);
             if (!$listOpen) {
                 $listOpen = true;
                 $wgOut->addHTML('<ul>');
             }
             $wgOut->addHTML("<li>");
             $wgOut->addHTML("{$ttext} &nbsp; &nbsp; [{$lnk}]<br/>");
             $wgOut->addHTML(wfMsgHTML("gadgets-uses") . ": ");
             $first = true;
             foreach ($code as $codePage) {
                 $t = Title::makeTitleSafe(NS_MEDIAWIKI, "Gadget-{$codePage}");
                 if (!$t) {
                     continue;
                 }
                 if ($first) {
                     $first = false;
                 } else {
                     $wgOut->addHTML(", ");
                 }
                 $lnk = $skin->makeLinkObj($t, htmlspecialchars($t->getText()));
                 $wgOut->addHTML($lnk);
             }
             $wgOut->addHtml("</li>");
         }
     }
     if ($listOpen) {
         $wgOut->addHTML('</ul>');
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:64,代码来源:SpecialGadgets.php

示例14: wfNewuserlogAutoCreate

function wfNewuserlogAutoCreate($user)
{
    wfLoadExtensionMessages('Newuserlog');
    $log = new LogPage('newusers');
    $log->addEntry('autocreate', $user->getUserPage(), '', array($user->getId()));
    return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:Newuserlog.php

示例15: processLogoutRequest

 function processLogoutRequest()
 {
     global $wgUser;
     $wgUser->logout();
     wfLoadExtensionMessages('AjaxLogin');
     return new AjaxResponse(wfMsg('ajaxlogin-nowloggedout'));
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:7,代码来源:AjaxLogin.body.php


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