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


PHP OutputPage::addModuleStyles方法代码示例

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


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

示例1: setupSkinUserCss

 /**
  * @param $out OutputPage object
  */
 function setupSkinUserCss(OutputPage $out)
 {
     // do not use non-standard MW less files anymore
     //		parent::setupSkinUserCss( $out );
     // load Bootstrap styles
     $out->addModuleStyles('ext.bootstrap.styles');
 }
开发者ID:ShakePeers,项目名称:mediawiki-skins-chameleon,代码行数:10,代码来源:SkinChameleon.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

 /**
  * 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

示例4: onBeforePageDisplay

 /**
  * BeofrePageDislpay hook. Load additional modules containing CSS before the page is displayed
  */
 public function onBeforePageDisplay(OutputPage &$out, Skin &$ski)
 {
     $page_title_with_namespace = $out->getTitle()->getPrefixedURL();
     if ($page_title_with_namespace === 'Special:HelperScripts') {
         $css_modules = array('ext.manuscriptdeskbasecss');
         $javascript_modules = array('ext.javascriptloader');
         $out->addModuleStyles($css_modules);
         $out->addModules($javascript_modules);
     }
     return true;
 }
开发者ID:akvankorlaar,项目名称:manuscriptdesk,代码行数:14,代码来源:HelperScripts.hooks.php

示例5: outputPageParserOutput

 /**
  * OutputPageParserOutput hook handler
  * @param OutputPage $out
  * @param ParserOutput $parserOutput
  * @return type 
  */
 public static function outputPageParserOutput(OutputPage &$out, ParserOutput $parserOutput)
 {
     $out->addModuleStyles('ext.articleEmblems');
     if (isset($parserOutput->articleEmblems)) {
         $emblems = array();
         foreach ($parserOutput->articleEmblems as $emblem) {
             $emblems[] = '<li class="articleEmblem">' . $emblem . '</li>';
         }
         $parserOutput->setText('<ul id="articleEmblems" class="noprint">' . implode($emblems) . '</ul>' . $parserOutput->getText());
     }
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:18,代码来源:ArticleEmblems.hooks.php

示例6: initPage

 public function initPage(OutputPage $out)
 {
     $baseURL = $GLOBALS['egBootyBaseURL'];
     //add the css modules separately to prevent a FOUC
     $out->addModuleStyles('bootstrap.css');
     $out->addModuleStyles('skin.booty.css');
     $out->addModuleStyles('font-awesome');
     //since we're using theb mediawiki generated head element, we have to add the viewport meta tag
     //so the layout scaled properly to mobile devices
     $out->addMeta('viewport', 'width=device-width');
     //,initial-width=1,maximum-width=1' );
     /* Until ResourceLoader can correctly parse multiple urls in a single font-family
     		webfont files have to be defined in the head to prevent it screwing things up */
     $out->addInlineStyle("@font-face {\n\t\t  font-family: 'Glyphicons Halflings';\n\t\t  src: url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot');\n\t\t  src: url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.woff') format('woff'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');\n\t\t}");
     $out->addInlineStyle("@font-face {\n\t\t  font-family: 'FontAwesome';\n\t\t  src: url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.eot?v=4.0.3');\n\t\t  src: url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');\n\t\t  font-weight: normal;\n\t\t  font-style: normal;\n\t\t}");
     //js items will be appended after page load
     $out->addModules('bootstrap.js');
     $out->addModules('skin.booty.js');
     $out->addHeadItem('meta-viewport', '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">');
     parent::initPage($out);
 }
开发者ID:tinymighty,项目名称:booty,代码行数:21,代码来源:Skin.php

示例7: setupSkinUserCss

 /**
  * Add specific styles for this skin
  *
  * @param OutputPage $out
  */
 function setupSkinUserCss(OutputPage $out)
 {
     $moduleStyles = array('mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint', 'mediawiki.sectionAnchor');
     if ($out->isSyndicated()) {
         $moduleStyles[] = 'mediawiki.feedlink';
     }
     // Deprecated since 1.26: Unconditional loading of mediawiki.ui.button
     // on every page is deprecated. Express a dependency instead.
     if (strpos($out->getHTML(), 'mw-ui-button') !== false) {
         $moduleStyles[] = 'mediawiki.ui.button';
     }
     $out->addModuleStyles($moduleStyles);
 }
开发者ID:Kaph-Noir,项目名称:mediawiki,代码行数:18,代码来源:SkinTemplate.php

示例8: injectStyleForSpecial

 /**
  * Add FlaggedRevs css for relevant special pages.
  * @param OutputPage $out
  */
 protected static function injectStyleForSpecial(&$out)
 {
     $title = $out->getTitle();
     $spPages = array('UnreviewedPages', 'PendingChanges', 'ProblemChanges', 'Watchlist', 'Recentchanges', 'Contributions', 'Recentchangeslinked');
     foreach ($spPages as $key) {
         if ($title->isSpecial($key)) {
             $out->addModuleStyles('ext.flaggedRevs.basic');
             // CSS only
             break;
         }
     }
     return true;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:FlaggedRevsUI.hooks.php

示例9: 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)
 {
     $output->addModules(array('ext.visualEditor.desktopArticleTarget.init', 'ext.visualEditor.targetLoader'));
     $output->addModuleStyles(array('ext.visualEditor.desktopArticleTarget.noscript'));
     // add scroll offset js variable to output
     $veConfig = ConfigFactory::getDefaultInstance()->makeConfig('visualeditor');
     $skinsToolbarScrollOffset = $veConfig->get('VisualEditorSkinToolbarScrollOffset');
     $toolbarScrollOffset = 0;
     $skinName = $skin->getSkinName();
     if (isset($skinsToolbarScrollOffset[$skinName])) {
         $toolbarScrollOffset = $skinsToolbarScrollOffset[$skinName];
     }
     $output->addJsConfigVars('wgVisualEditorToolbarScrollOffset', $toolbarScrollOffset);
     return true;
 }
开发者ID:eliagbayani,项目名称:eoearth,代码行数:24,代码来源:VisualEditor.hooks.php

示例10: injectCss

 public static function injectCss(OutputPage $out, $text)
 {
     global $wgTranslatePageTranslationULS;
     $title = $out->getTitle();
     $isSource = TranslatablePage::isSourcePage($title);
     $isTranslation = TranslatablePage::isTranslationPage($title);
     if ($isSource || $isTranslation) {
         $out->addModuleStyles('ext.translate');
         if ($wgTranslatePageTranslationULS) {
             $out->addModules('ext.translate.pagetranslation.uls');
         }
         // Per bug T63331
         $type = $isSource ? 'source' : 'translation';
         $out->addJsConfigVars('wgTranslatePageTranslation', $type);
     }
     return true;
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:17,代码来源:PageTranslationHooks.php

示例11: viewHook

	/**
	 * Hook into Article::view() to provide syntax highlighting for
	 * custom CSS and JavaScript pages
	 *
	 * @param string $text
	 * @param Title $title
	 * @param OutputPage $output
	 * @return bool
	 */
	public static function viewHook( $text, $title, $output ) {
		global $wgUseSiteCss;
		// Determine the language
		$matches = array();
		preg_match( '!\.(css|js)$!u', $title->getText(), $matches );
		$lang = $matches[1] == 'css' ? 'css' : 'javascript';
		// Attempt to format
		$geshi = self::prepare( $text, $lang );
		if( $geshi instanceof GeSHi ) {
			$out = $geshi->parse_code();
			if( !$geshi->error() ) {
				// Done
				$output->addHeadItem( "source-$lang", self::buildHeadItem( $geshi ) );
				$output->addHTML( "<div dir=\"ltr\">{$out}</div>" );
				if( $wgUseSiteCss ) {
					$output->addModuleStyles( 'ext.geshi.local' );
				}
				return false;
			}
		}
		// Bottle out
		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:32,代码来源:SyntaxHighlight_GeSHi.class.php

示例12: editPageShowEditFormInitial

 /**
  * EditPage::showEditForm:initial hook
  *
  * Adds the modules to the edit form
  *
  * @param EditPage $editPage the current EditPage object.
  * @param OutputPage $outputPage object.
  * @return bool
  */
 public static function editPageShowEditFormInitial($editPage, $outputPage)
 {
     if ($editPage->contentModel !== CONTENT_MODEL_WIKITEXT) {
         return true;
     }
     // Add modules for enabled features
     foreach (self::$features as $name => $feature) {
         if (!self::isEnabled($name)) {
             continue;
         }
         if (isset($feature['stylemodules'])) {
             $outputPage->addModuleStyles($feature['stylemodules']);
         }
         if (isset($feature['modules'])) {
             $outputPage->addModules($feature['modules']);
         }
     }
     $article = $editPage->getArticle();
     $request = $article->getContext()->getRequest();
     // Don't run this if the request was posted - we don't want to log 'init' when the
     // user just pressed 'Show preview' or 'Show changes', or switched from VE keeping
     // changes.
     if (class_exists('EventLogging') && !$request->wasPosted()) {
         $data = array();
         $data['editingSessionId'] = self::getEditingStatsId();
         if ($request->getVal('section')) {
             $data['action.init.type'] = 'section';
         } else {
             $data['action.init.type'] = 'page';
         }
         if ($request->getHeader('Referer')) {
             if ($request->getVal('section') === 'new' || !$article->exists()) {
                 $data['action.init.mechanism'] = 'new';
             } else {
                 $data['action.init.mechanism'] = 'click';
             }
         } else {
             $data['action.init.mechanism'] = 'url';
         }
         self::doEventLogging('init', $article, $data);
     }
     return true;
 }
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:52,代码来源:WikiEditor.hooks.php

示例13: onBeforePageDisplay

 public function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
 {
     $out->addModuleStyles('ext.bluespice.universalExport.css');
     return true;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:5,代码来源:UniversalExport.class.php

示例14: onBeforePageDisplay

 /**
  * Adds resources to ResourceLoader
  * @param OutputPage $out
  * @param Skin $skin
  * @return boolean Always true to keep hook running
  */
 public function onBeforePageDisplay(&$out, &$skin)
 {
     //Having a dedicated module for styles and loading it through
     //'addModuleStyles' prevents CSS flickering. It shoult obly be done
     //when styling elements that are available in the source HTML. If you
     //want to style markup that gets generated by JavaScript embed your
     //styling in the same module and use 'addModules'.
     $out->addModuleStyles('ext.bluespice.boilerPlate.styles');
     //Adding JavaScript and clientside I18N
     $out->addModules('ext.bluespice.boilerPlate.scripts');
     //Additional context sensitive data for the clientside
     $bVar = date('w') == 3;
     //Is it Wednesday?
     $out->addJsConfigVars('bsBoilerPlateSomeCalculatedVar', $bVar);
     return true;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:22,代码来源:BoilerPlate.class.php

示例15: __construct

 public function __construct(OutputPage $output)
 {
     $this->output = $output;
     $output->addModules('mediawiki.checkboxtoggle');
     $output->addModuleStyles('mediawiki.checkboxtoggle.styles');
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:6,代码来源:ListToggle.php


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