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


PHP Skin::msg方法代码示例

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


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

示例1: mobileFooter

    /**
     * Prepares links used in the mobile footer
     * @param Skin $sk
     * @param QuickTemplate $tpl
     * @param MobileContext $ctx
     * @param Title $title
     * @param WebRequest $req
     * @return QuickTemplate
     */
    protected static function mobileFooter($sk, $tpl, $ctx, $title, $req)
    {
        $url = $sk->getOutput()->getProperty('desktopUrl');
        if ($url) {
            $url = wfAppendQuery($url, 'mobileaction=toggle_view_desktop');
        } else {
            $url = $title->getLocalUrl($req->appendQueryValue('mobileaction', 'toggle_view_desktop', true));
        }
        $url = htmlspecialchars($ctx->getDesktopUrl(wfExpandUrl($url, PROTO_RELATIVE)));
        $desktop = wfMessage('mobile-frontend-view-desktop')->escaped();
        $mobile = wfMessage('mobile-frontend-view-mobile')->escaped();
        $sitename = self::getSitename(true);
        $switcherHtml = <<<HTML
<h2>{$sitename}</h2>
<ul>
\t<li>{$mobile}</li><li><a id="mw-mf-display-toggle" href="{$url}">{$desktop}</a></li>
</ul>
HTML;
        // Generate the licensing text displayed in the footer of each page.
        // See Skin::getCopyright for desktop equivalent.
        $license = self::getLicense('footer');
        if (isset($license['link']) && $license['link']) {
            $licenseText = $sk->msg($license['msg'])->rawParams($license['link'])->text();
        } else {
            $licenseText = '';
        }
        // Enable extensions to add links to footer in Mobile view, too - bug 66350
        Hooks::run('MobileSiteOutputPageBeforeExec', array(&$sk, &$tpl));
        // FIXME: Deprecate this hook.
        Hooks::run('SkinMinervaOutputPageBeforeExec', array(&$sk, &$tpl), '1.26');
        $tpl->set('mobile-switcher', $switcherHtml);
        $tpl->set('mobile-license', $licenseText);
        $tpl->set('privacy', $sk->footerLink('mobile-frontend-privacy-link-text', 'privacypage'));
        $tpl->set('terms-use', self::getTermsLink($sk));
        $tpl->set('footerlinks', array('info' => array('mobile-switcher', 'mobile-license'), 'places' => array('terms-use', 'privacy')));
        return $tpl;
    }
开发者ID:micha6554,项目名称:mediawiki-extensions-MobileFrontend,代码行数:46,代码来源:MobileFrontend.skin.hooks.php

示例2: onSkinEditSectionLinks

 /**
  * Changes the section edit links to add a VE edit link.
  *
  * This is attached to the MediaWiki 'SkinEditSectionLinks' hook.
  *
  * @param $skin Skin
  * @param $title Title
  * @param $section string
  * @param $tooltip string
  * @param $result array
  * @param $lang Language
  * @return bool true
  */
 public static function onSkinEditSectionLinks(Skin $skin, Title $title, $section, $tooltip, &$result, $lang)
 {
     // Only do this if the user has VE enabled
     // (and we're not in parserTests)
     // (and we're not on a foreign file description page)
     if (isset($GLOBALS['wgVisualEditorInParserTests']) || !$skin->getUser()->getOption('visualeditor-enable') || $skin->getUser()->getOption('visualeditor-betatempdisable') || $title->inNamespace(NS_FILE) && WikiPage::factory($title) instanceof WikiFilePage && !WikiPage::factory($title)->isLocal()) {
         return true;
     }
     $config = ConfigFactory::getDefaultInstance()->makeConfig('visualeditor');
     $tabMessages = $config->get('VisualEditorTabMessages');
     $veEditSection = $tabMessages['editsection'] !== null ? $tabMessages['editsection'] : 'editsection';
     $sourceEditSection = $tabMessages['editsectionsource'] !== null ? $tabMessages['editsectionsource'] : 'editsection';
     $result['editsection']['text'] = $skin->msg($sourceEditSection)->inLanguage($lang)->text();
     $veLink = array('text' => $skin->msg($veEditSection)->inLanguage($lang)->text(), 'targetTitle' => $title, 'attribs' => $result['editsection']['attribs'] + array('class' => 'mw-editsection-visualeditor'), 'query' => array('veaction' => 'edit', 'vesection' => $section), 'options' => array('noclasses', 'known'));
     $result['veeditsection'] = $veLink;
     if ($config->get('VisualEditorTabPosition') === 'before') {
         krsort($result);
         // TODO: This will probably cause weird ordering if any other extensions added something already.
         // ... wfArrayInsertBefore?
     }
     return true;
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:35,代码来源:VisualEditor.hooks.php

示例3: translateTab

 /**
  * Converts the edit tab (if exists) for translation pages to translate tab.
  * Hook: SkinTemplateNavigation
  * @since 2013.06
  */
 static function translateTab(Skin $skin, array &$tabs)
 {
     $title = $skin->getTitle();
     $handle = new MessageHandle($title);
     $code = $handle->getCode();
     $page = TranslatablePage::isTranslationPage($title);
     if (!$page) {
         return true;
     }
     // The source language has a subpage too, but cannot be translated
     if ($page->getSourceLanguageCode() === $code) {
         return true;
     }
     if (isset($tabs['views']['edit'])) {
         $tabs['views']['edit']['text'] = $skin->msg('tpt-tab-translate')->text();
         $tabs['views']['edit']['href'] = $page->getTranslationUrl($code);
     }
     return true;
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:24,代码来源:PageTranslationHooks.php

示例4: onSkinEditSectionLinks

 /**
  * Changes the section edit links to add a VE edit link.
  *
  * This is attached to the MediaWiki 'SkinEditSectionLinks' hook.
  *
  * @param $skin Skin
  * @param $title Title
  * @param $section string
  * @param $tooltip string
  * @param $result array
  * @param $lang Language
  * @return bool true
  */
 public static function onSkinEditSectionLinks(Skin $skin, Title $title, $section, $tooltip, &$result, $lang)
 {
     $config = ConfigFactory::getDefaultInstance()->makeConfig('visualeditor');
     // Exit if we're using the single edit tab.
     if ($config->get('VisualEditorUseSingleEditTab') && $skin->getUser()->getOption('visualeditor-tabs') !== 'multi-tab') {
         return true;
     }
     // Exit if we're in parserTests
     if (isset($GLOBALS['wgVisualEditorInParserTests'])) {
         return true;
     }
     // Exit if the user doesn't have VE enabled
     if (!$skin->getUser()->getOption('visualeditor-enable') || $skin->getUser()->getOption('visualeditor-betatempdisable') || $skin->getUser()->getOption('visualeditor-autodisable') || $config->get('VisualEditorDisableForAnons') && $skin->getUser()->isAnon()) {
         return true;
     }
     // Exit if we're on a foreign file description page
     if ($title->inNamespace(NS_FILE) && WikiPage::factory($title) instanceof WikiFilePage && !WikiPage::factory($title)->isLocal()) {
         return true;
     }
     $tabMessages = $config->get('VisualEditorTabMessages');
     $sourceEditSection = $tabMessages['editsectionsource'] !== null ? $tabMessages['editsectionsource'] : 'editsection';
     $result['editsection']['text'] = $skin->msg($sourceEditSection)->inLanguage($lang)->text();
     $availableNamespaces = $config->get('VisualEditorAvailableNamespaces');
     // add VE edit section in VE available namespaces
     if ($title->inNamespaces(array_keys(array_filter($availableNamespaces)))) {
         $veEditSection = $tabMessages['editsection'] !== null ? $tabMessages['editsection'] : 'editsection';
         $veLink = array('text' => $skin->msg($veEditSection)->inLanguage($lang)->text(), 'targetTitle' => $title, 'attribs' => $result['editsection']['attribs'] + array('class' => 'mw-editsection-visualeditor'), 'query' => array('veaction' => 'edit', 'vesection' => $section), 'options' => array('noclasses', 'known'));
         $result['veeditsection'] = $veLink;
         if ($config->get('VisualEditorTabPosition') === 'before') {
             krsort($result);
             // TODO: This will probably cause weird ordering if any other extensions added something
             // already.
             // ... wfArrayInsertBefore?
         }
     }
     return true;
 }
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:50,代码来源:VisualEditor.hooks.php


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