當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OutputPage::addModules方法代碼示例

本文整理匯總了PHP中OutputPage::addModules方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutputPage::addModules方法的具體用法?PHP OutputPage::addModules怎麽用?PHP OutputPage::addModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OutputPage的用法示例。


在下文中一共展示了OutputPage::addModules方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: beforePageDisplay

 /**
  * BeforePageDisplay hook
  * 
  * Adds the modules to the page
  * 
  * @param OutputPage $out output page
  * @param Skin $skin current skin
  */
 public static function beforePageDisplay($out, $skin)
 {
     if ($skin instanceof SkinSkinzam) {
         $out->addModules(array('jquery.scrollto', 'jquery.backstretch', 'ext.skinzam.global', 'ext.languageSelector'));
         // Add modules for enabled features
         foreach (self::$features as $name => $feature) {
             if (isset($feature['modules']) && self::isEnabled($name)) {
                 $out->addModules($feature['modules']);
             }
         }
     }
     return true;
 }
開發者ID:eFFemeer,項目名稱:seizamcore,代碼行數:21,代碼來源:Skinzam.hooks.php

示例2: onBeforePageDisplay

 /**
  * BeforePageDisplay hook
  *
  * Add the modules to the page
  *
  * @param $out OutputPage output page
  * @param $skin Skin current skin
  *
  * @return true
  */
 public static function onBeforePageDisplay(OutputPage $out, $skin)
 {
     //Add modules:
     $out->addModuleStyles('ext.wr.ShareBar');
     $out->addModules('ext.wr.ShareBar.js');
     return true;
 }
開發者ID:kolzchut,項目名稱:mediawiki-extensions-ShareBar,代碼行數:17,代碼來源:ShareBar.hooks.php

示例3: onBeforePageDisplay

 public static function onBeforePageDisplay(\OutputPage &$output, \Skin &$skin)
 {
     $title = $output->getTitle();
     // Disallow commenting on pages without article id
     if ($title->getArticleID() == 0) {
         return true;
     }
     if ($title->isSpecialPage()) {
         return true;
     }
     // These could be explicitly allowed in later version
     if (!$title->canTalk()) {
         return true;
     }
     if ($title->isTalkPage()) {
         return true;
     }
     if ($title->isMainPage()) {
         return true;
     }
     // Do not display when printing
     if ($output->isPrintable()) {
         return true;
     }
     // Disable if not viewing
     if ($skin->getRequest()->getVal('action', 'view') != 'view') {
         return true;
     }
     // Blacklist several namespace
     if (in_array($title->getNamespace(), array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY, NS_FILE, NS_USER))) {
         return true;
     }
     $output->addModules('ext.pagerating');
     return true;
 }
開發者ID:nbdd0121,項目名稱:MW-PageRating,代碼行數:35,代碼來源:Hooks.php

示例4: onOutputPageBeforeHTML

 public static function onOutputPageBeforeHTML(OutputPage &$out, &$text)
 {
     global $wgEnableRecommendationsExt;
     if (!empty($wgEnableRecommendationsExt) && F::app()->checkSkin('venus')) {
         $out->addModules('ext.wikia.recommendations');
     }
     return true;
 }
開發者ID:yusufchang,項目名稱:app,代碼行數:8,代碼來源:RecommendationsHooks.class.php

示例5: onBeforePageDisplay

 /**
  *
  * @param OutputPage $oOutputPage
  * @param SkinTemplate $oSkinTemplate
  * @return boolean
  */
 public function onBeforePageDisplay($oOutputPage, $oSkinTemplate)
 {
     if (!SpecialPage::getTitleFor('RSSFeeder')->equals($this->getTitle())) {
         return true;
     }
     $oOutputPage->addModules('ext.bluespice.rssStandards');
     return true;
 }
開發者ID:hfroese,項目名稱:mediawiki-extensions-BlueSpiceExtensions,代碼行數:14,代碼來源:RSSStandards.class.php

示例6: onBeforePageDisplay

 /**
  * BeforePageDisplay hook
  * Adds the modules to the page
  *
  * @param $out OutputPage output page
  * @param $skin Skin current skin
  *
  * @return bool
  */
 public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
 {
     global $wgSurveyGizmoBeaconID, $wgSurveyGizmoBeaconUrl;
     if (!empty($wgSurveyGizmoBeaconID) && !empty($wgSurveyGizmoBeaconUrl)) {
         $out->addModules('ext.surveyGizmo');
     }
     return true;
 }
開發者ID:kolzchut,項目名稱:mediawiki-extensions-SurveyGizmo,代碼行數:17,代碼來源:SurveyGizmo.hooks.php

示例7: onBeforePageDisplay

 /**
  * Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if needed.
  * @param OutputPage $oOutputPage
  * @param Skin $oSkin
  * @return bool
  */
 public function onBeforePageDisplay(&$oOutputPage, &$oSkin)
 {
     if (BsConfig::get('MW::BlueSpiceProjectFeedbackHelper::Active') == false) {
         return true;
     }
     $oOutputPage->addModules('ext.bluespice.blueSpiceprojectfeedbackhelper');
     return true;
 }
開發者ID:hfroese,項目名稱:mediawiki-extensions-BlueSpiceExtensions,代碼行數:14,代碼來源:BlueSpiceProjectFeedbackHelper.class.php

示例8: onBeforePageDisplay

 /**
  * Add JS module to the output
  * @param \OutputPage $out An output object passed from a hook
  * @return bool
  */
 public static function onBeforePageDisplay(\OutputPage $out)
 {
     // use resource loader for i18n messages in JS
     $out->addModules('ext.cookiePolicyMessages');
     // use AssetsManager for script loading to avoid race conditions (SOC-528)
     \Wikia::addAssetsToOutput('cookie_policy_js');
     return true;
 }
開發者ID:yusufchang,項目名稱:app,代碼行數:13,代碼來源:CookiePolicy.hooks.php

示例9: onBeforePageDisplay

 /**
  * Adds module
  * @param OutputPage $out
  * @param SkinTemplate $skin
  * @return boolean
  */
 public static function onBeforePageDisplay(&$out, &$skin)
 {
     if (!$out->getTitle()->equals($out->getUser()->getUserPage())) {
         return true;
     }
     $out->addModules("ext.bluespice.avatars.js");
     return true;
 }
開發者ID:hfroese,項目名稱:mediawiki-extensions-BlueSpiceExtensions,代碼行數:14,代碼來源:Avatars.class.php

示例10: onBeforePageDisplay

 /**
  * Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if needed.
  * @param OutputPage $oOutputPage
  * @param Skin $oSkin
  * @return bool
  */
 public function onBeforePageDisplay(&$oOutputPage, &$oSkin)
 {
     if (!SpecialPage::getTitleFor('Preferences')->equals($oOutputPage->getTitle())) {
         return true;
     }
     $oOutputPage->addModules('ext.bluespice.userpreferences');
     return true;
 }
開發者ID:hfroese,項目名稱:mediawiki-extensions-BlueSpiceExtensions,代碼行數:14,代碼來源:UserPreferences.class.php

示例11: initPage

 public function initPage(OutputPage $out)
 {
     global $wgLocalStylePath;
     $this->skinname = 'cbptranscription';
     $this->stylename = 'CbpTranscription';
     $this->template = 'CbpTranscriptionTemplate';
     $out->addModules('skins.cbptranscription');
     parent::initPage($out);
 }
開發者ID:tomcbe,項目名稱:cbp-transcription-desk,代碼行數:9,代碼來源:CbpTranscription.php

示例12: hookOutputPageBeforeHTML

function hookOutputPageBeforeHTML(OutputPage &$out, &$text)
{
    if ($out->getTitle()->getNamespace() == 6) {
        //6 is the File Namespace
        $out->includeJQuery();
        $out->addModules('ext.SemanticImageAnnotator');
    }
    return true;
}
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:9,代碼來源:SemanticImageAnnotator.php

示例13: onBeforePageDisplay

 /**
  * Add welcome module to the load queue of all pages
  */
 public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
 {
     global $wgExampleEnableWelcome;
     if ($wgExampleEnableWelcome) {
         $out->addModules('ext.Example.welcome.init');
     }
     // Always return true, indicating that parser initialization should
     // continue normally.
     return true;
 }
開發者ID:coderwassananmol,項目名稱:mediawiki-extensions-examples,代碼行數:13,代碼來源:Example.hooks.php

示例14: onBeforePageDisplay

 /**
  * Adds VisualEditor JS to the output.
  *
  * This is attached to the MediaWiki 'BeforePageDisplay' hook.
  *
  * @param OutputPage $output
  * @param Skin $skin
  * @return boolean
  */
 public static function onBeforePageDisplay(OutputPage &$output, Skin &$skin)
 {
     // Wikia change
     if (self::isAvailable($skin)) {
         $output->addModules(array('ext.visualEditor.wikia.viewPageTarget.init'));
     }
     //$output->addModules( array( 'ext.visualEditor.viewPageTarget.init' ) );
     //$output->addModuleStyles( array( 'ext.visualEditor.viewPageTarget.noscript' ) );
     return true;
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:19,代碼來源:VisualEditor.hooks.php

示例15: onBeforePageDisplay

 /**
  * This function adds additional modules containing CSS before the page is displayed
  */
 public function onBeforePageDisplay(OutputPage &$out, Skin &$ski)
 {
     $title_object = $out->getTitle();
     $page_title = $title_object->getPrefixedURL();
     if ($page_title === 'Special:UserPage' || $page_title === 'Special:AllCollections' || $page_title === 'Special:SingleManuscriptPages' || $page_title === 'Special:AllCollations' || $page_title === 'Special:RecentManuscriptPages' || $page_title === 'Special:AllStylometricAnalysis') {
         $out->addModuleStyles(array('ext.userpagecss', 'ext.manuscriptdeskbasecss'));
         $out->addModules("ext.javascriptloaderdots");
     }
     return true;
 }
開發者ID:akvankorlaar,項目名稱:manuscriptdesk,代碼行數:13,代碼來源:SummaryPages.hooks.php


注:本文中的OutputPage::addModules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。