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


PHP Wikia::addAssetsToOutput方法代码示例

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


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

示例1: articlePage

 /**
  * The template used for article pages and edit previews.
  */
 public function articlePage()
 {
     wfProfileIn(__METHOD__);
     // Template rendering cancelled by hook
     if (!wfRunHooks('CategorySelectArticlePage')) {
         wfProfileOut(__METHOD__);
         return false;
     }
     $categories = $this->wg->out->getCategories();
     $showHidden = (bool) $this->wg->User->getGlobalPreference('showhiddencats');
     $userCanEdit = $this->request->getVal('userCanEdit', CategorySelectHelper::isEditable());
     // There are no categories present and user can't edit, skip rendering
     if (!$userCanEdit && !count($categories)) {
         wfProfileOut(__METHOD__);
         return false;
     }
     // Categories link
     $categoriesLinkAttributes = array('class' => 'categoriesLink');
     $categoriesLinkPage = wfMessage('pagecategorieslink')->inContentLanguage()->text();
     $categoriesLinkText = wfMessage('pagecategories')->escaped();
     if (!empty($this->wg->WikiaUseNoFollow)) {
         $categoriesLinkAttributes['rel'] = 'nofollow';
     }
     $categoriesLink = Linker::link(Title::newFromText($categoriesLinkPage), $categoriesLinkText, $categoriesLinkAttributes);
     Wikia::addAssetsToOutput('category_select_css');
     Wikia::addAssetsToOutput('category_select_js');
     $this->response->setVal('categories', $categories);
     $this->response->setVal('categoriesLink', $categoriesLink);
     $this->response->setVal('showHidden', $showHidden);
     $this->response->setVal('userCanEdit', $userCanEdit);
     if ($this->app->checkSkin('venus')) {
         $this->overrideTemplate('articlePageVenus');
     }
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:38,代码来源:CategorySelectController.class.php

示例2: index

 public function index()
 {
     wfProfileIn(__METHOD__);
     Wikia::addAssetsToOutput('recent_wiki_activity_scss');
     Wikia::addAssetsToOutput('recent_wiki_activity_js');
     $this->changeList = WikiaDataAccess::cache(wfMemcKey(self::$memcKey), 0, function () {
         global $wgContentNamespaces, $wgLang;
         $maxElements = 4;
         $includeNamespaces = implode('|', $wgContentNamespaces);
         $parameters = array('type' => 'widget', 'maxElements' => $maxElements, 'flags' => array('shortlist'), 'uselang' => $wgLang->getCode(), 'includeNamespaces' => $includeNamespaces);
         $feedProxy = new ActivityFeedAPIProxy($includeNamespaces, $this->userName);
         $feedProvider = new DataFeedProvider($feedProxy, 1, $parameters);
         $feedData = $feedProvider->get($maxElements);
         foreach ($feedData['results'] as &$result) {
             if (!empty($result['articleComment'])) {
                 $title = Title::newFromText($result['title'], $result['ns']);
                 if ($title instanceof Title) {
                     $result['url'] = $title->getLocalURL();
                 }
             }
         }
         return $feedData['results'];
     });
     wfProfileOut(__METHOD__);
 }
开发者ID:yusufchang,项目名称:app,代码行数:25,代码来源:RecentWikiActivityController.class.php

示例3: index

 public function index()
 {
     $this->messages = $this->getVal('messages');
     // loading assets in Monobook that would normally load in oasis
     if ($this->app->checkSkin('monobook')) {
         $this->response->addAsset('skins/shared/styles/sprite.scss');
         $this->response->addAsset('extensions/wikia/Forum/css/monobook/RelatedForumMonobook.scss');
     }
     $title = $this->getContext()->getTitle();
     $topicTitle = Title::newFromText($title->getPrefixedText(), NS_WIKIA_FORUM_TOPIC_BOARD);
     // common data
     $this->sectionHeading = wfMessage('forum-related-discussion-heading', $title->getText())->escaped();
     $this->newPostButton = wfMessage('forum-related-discussion-new-post-button')->escaped();
     $this->newPostUrl = $topicTitle->getFullUrl('openEditor=1');
     $this->newPostTooltip = wfMessage('forum-related-discussion-new-post-tooltip', $title->getText())->escaped();
     $this->blankImgUrl = wfBlankImgUrl();
     $this->seeMoreUrl = $topicTitle->getFullUrl();
     $this->seeMoreText = wfMessage('forum-related-discussion-see-more')->escaped();
     // TODO: move classes to template when Venus will be live on all wikis
     $this->venusBtnClasses = '';
     if ($this->app->checkSkin('venus')) {
         $this->venusBtnClasses = 'wikia-button secondary';
         Wikia::addAssetsToOutput('related_forum_discussion_css');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:RelatedForumDiscussionController.class.php

示例4: onOutputPageBeforeHTML

 /**
  * Load JS needed to display the VideosModule at the bottom of the article content
  * @param OutputPage $out
  * @param string $text
  * @return bool
  */
 public static function onOutputPageBeforeHTML(OutputPage $out, &$text)
 {
     wfProfileIn(__METHOD__);
     // Check if we're on a page where we want to show the Videos Module.
     // If we're not, stop right here.
     if (!self::canShowVideosModule()) {
         wfProfileOut(__METHOD__);
         return true;
     }
     // On file pages, this hook can be called multiple times, so we're going to check if the
     // assets are loaded already before we load them again.
     $app = F::app();
     // Don't do anything if we've already loaded the assets
     if ($app->wg->VideosModuleAssetsLoaded) {
         wfProfileOut(__METHOD__);
         return true;
     }
     // Don't do anything if this is the main page of a site with the VPT enabled
     if ($app->wg->Title->isMainPage() && $app->wg->EnableVideoPageToolExt) {
         wfProfileOut(__METHOD__);
         return true;
     }
     JSMessages::enqueuePackage('VideosModule', JSMessages::EXTERNAL);
     if ($app->checkSkin('venus')) {
         Wikia::addAssetsToOutput('videos_module_venus_js');
         Wikia::addAssetsToOutput('videos_module_venus_scss');
     } else {
         Wikia::addAssetsToOutput('videos_module_js');
     }
     $app->wg->VideosModuleAssetsLoaded = true;
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:39,代码来源:VideosModuleHooks.class.php

示例5: addCaptchaJS

 /**
  * Load Captcha.js on demand when we're getting an instance of a Captcha.
  */
 public static function addCaptchaJS()
 {
     // Make sure we only load FancyCaptcha library once
     if (!\F::app()->wg->CaptchaLibraryLoaded) {
         \Wikia::addAssetsToOutput('captcha_js');
         \F::app()->wg->CaptchaLibraryLoaded = true;
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:Module.class.php

示例6: execute

 function execute($par)
 {
     $this->mName = 'WikiaNewFiles';
     $this->setHeaders();
     Wikia::addAssetsToOutput('upload_photos_dialog_js');
     Wikia::addAssetsToOutput('upload_photos_dialog_scss');
     wfSpecialWikiaNewFiles($par, $this);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:8,代码来源:WikiaNewFiles.class.php

示例7: 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

示例8: onBeforePageDisplay

 public static function onBeforePageDisplay(OutputPage $out, Skin $skin)
 {
     if (F::app()->checkSkin('monobook', $skin)) {
         Wikia::addAssetsToOutput('portable_infobox_monobook_scss');
     } else {
         Wikia::addAssetsToOutput('portable_infobox_scss');
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:PortableInfoboxHooks.class.php

示例9: onBlogArticleInitialized

 public static function onBlogArticleInitialized(CreateBlogPage $blogPage, $mode)
 {
     if ($mode == SpecialCustomEditPage::MODE_EDIT || !$blogPage->user->isAllowed(self::PERM_NAME)) {
         return true;
     }
     Wikia::addAssetsToOutput('extensions/wikia/BlogEditCategoryPrompter/becp.js');
     JSMessages::enqueuePackage('BECP', JSMessages::INLINE);
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:BECPHelper.class.php

示例10: index

 public function index()
 {
     Wikia::addAssetsToOutput('global_footer_scss');
     Wikia::addAssetsToOutput('global_footer_js');
     $this->response->setVal('footerLinks', $this->getGlobalFooterLinks());
     $this->response->setVal('copyright', RequestContext::getMain()->getSkin()->getCopyright());
     $this->response->setVal('isCorporate', WikiaPageType::isWikiaHomePage());
     $this->response->setVal('verticalShort', $this->getVerticalShortName());
     $this->response->setVal('verticalNameMessage', $this->verticalNameMessage());
     $this->response->setVal('logoLink', $this->getLogoLink());
 }
开发者ID:yusufchang,项目名称:app,代码行数:11,代码来源:GlobalFooterController.class.php

示例11: index

 /**
  * @brief Displays the main menu for the admin dashboard
  *
  */
 public function index()
 {
     $this->wg->Out->setPageTitle(wfMsg('admindashboard-title'));
     if (!$this->wg->User->isAllowed('admindashboard')) {
         $this->displayRestrictionError();
         return false;
         // skip rendering
     }
     $this->tab = $this->getVal('tab', 'general');
     // links
     $this->urlThemeDesigner = Title::newFromText('ThemeDesigner', NS_SPECIAL)->getFullURL();
     $this->urlRecentChanges = Title::newFromText('RecentChanges', NS_SPECIAL)->getFullURL();
     $this->urlTopNavigation = Title::newFromText('Wiki-navigation', NS_MEDIAWIKI)->getFullURL('action=edit');
     $this->urlWikiFeatures = Title::newFromText('WikiFeatures', NS_SPECIAL)->getFullURL();
     $this->urlListUsers = Title::newFromText('ListUsers', NS_SPECIAL)->getFullURL();
     $this->urlUserRights = Title::newFromText('UserRights', NS_SPECIAL)->getFullURL();
     $this->urlCommunityCorner = Title::newFromText('Community-corner', NS_MEDIAWIKI)->getFullURL('action=edit');
     $this->urlAllCategories = Title::newFromText('Categories', NS_SPECIAL)->getFullURL();
     $this->urlAddPage = Title::newFromText('CreatePage', NS_SPECIAL)->getFullURL();
     $this->urlAddPhoto = Title::newFromText('Upload', NS_SPECIAL)->getFullURL();
     if (!empty($this->wg->EnableSpecialVideosExt)) {
         $this->showVideoLink = true;
         $this->urlAddVideo = Title::newFromText('WikiaVideoAdd', NS_SPECIAL)->getFullURL();
         $this->urlAddVideoReturnUrl = SpecialPage::getTitleFor("Videos")->escapeLocalUrl("sort=recent");
     } else {
         $this->showVideoLink = false;
     }
     $this->urlCreateBlogPage = Title::newFromText('CreateBlogPage', NS_SPECIAL)->getFullURL();
     $this->urlMultipleUpload = Title::newFromText('MultipleUpload', NS_SPECIAL)->getFullURL();
     $this->urlLVS = Title::newFromText('LicensedVideoSwap', NS_SPECIAL)->getFullURL();
     $this->urlSpecialCss = SpecialPage::getTitleFor('CSS')->getFullURL();
     // special:specialpages
     $this->advancedSection = (string) $this->app->sendRequest('AdminDashboardSpecialPage', 'getAdvancedSection', array());
     // icon display logic
     $this->displayWikiFeatures = !empty($this->wg->EnableWikiFeatures);
     $this->displaySpecialCss = !empty($this->wg->EnableSpecialCssExt);
     // LicensedVideoSwap
     if (empty($this->wg->EnableLicensedVideoSwapExt)) {
         $this->displayLicensedVideoSwap = false;
         $this->badgeLicensedVideoSwap = '';
     } else {
         $this->displayLicensedVideoSwap = true;
         // alert badge
         $lvsHelper = new LicensedVideoSwapHelper();
         $this->badgeLicensedVideoSwap = $lvsHelper->getAlertBadge();
     }
     // add messages package
     JSMessages::enqueuePackage('AdminDashboard', JSMessages::INLINE);
     // Add Upload Photos Dialog
     Wikia::addAssetsToOutput('upload_photos_dialog_js');
     Wikia::addAssetsToOutput('upload_photos_dialog_scss');
 }
开发者ID:yusufchang,项目名称:app,代码行数:56,代码来源:AdminDashboardSpecialPageController.class.php

示例12: onBeforePageDisplay

 public static function onBeforePageDisplay(\OutputPage $out, \Skin $skin)
 {
     $helper = new FlagsHelper();
     /* Assets for flags view */
     if ($helper->shouldDisplayFlags() || $out->getTitle()->isSpecial('Flags')) {
         \Wikia::addAssetsToOutput('flags_view_scss');
     }
     /* Assets for flags edit form */
     if ($helper->areFlagsEditable()) {
         \Wikia::addAssetsToOutput('flags_editform_js');
         $out->addModules('ext.wikia.Flags.EditFormMessages');
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:14,代码来源:Flags.hooks.php

示例13: setBodyModules

 private function setBodyModules()
 {
     $this->globalNavigation = $this->getGlobalNavigation();
     $this->localNavigation = $this->getLocalNavigation();
     $this->categorySelect = $this->getCategorySelect();
     $this->notifications = $this->app->renderView('BannerNotifications', 'Confirmation');
     if ($this->isUserLoggedIn) {
         $this->recentWikiActivity = $this->getRecentWikiActivity();
     }
     if (WikiaPageType::isArticlePage()) {
         $this->articleNav = $this->getArticleNavigation();
         $this->setVal('header', $this->app->renderView('Venus', 'header'));
         Wikia::addAssetsToOutput('article_scss');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:VenusController.class.php

示例14: index

 /**
  * render index
  */
 public function index()
 {
     $app = F::app();
     Wikia::addAssetsToOutput('article_navigation_scss');
     Wikia::addAssetsToOutput('article_navigation_js');
     Wikia::addAssetsToOutput('article_js');
     $this->response->setTemplateEngine(WikiaResponse::TEMPLATE_ENGINE_MUSTACHE);
     $this->setVal('editActionsDropdown', $this->renderEditActions());
     $this->setVal('share', $app->renderView('ArticleNavigationController', 'share'));
     $this->setVal('userTools', json_encode($this->helper->extractDropdownData($this->generateUserTools())));
     // messages
     $this->setVal('tocTitle', wfMessage('article-navigation-icon-title-toc')->text());
     $this->setVal('editTitle', wfMessage('article-navigation-icon-title-edit')->text());
     $this->setVal('toolsTitle', wfMessage('article-navigation-icon-title-tools')->text());
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:18,代码来源:ArticleNavigationController.class.php

示例15: index

 public function index()
 {
     global $wgLang, $wgUser;
     Wikia::addAssetsToOutput('global_navigation_scss');
     Wikia::addAssetsToOutput('global_navigation_js');
     //Lang for centralUrl and CNW should be the same as user language not content language
     //That's why $wgLang global is used
     $lang = $wgLang->getCode();
     $centralUrl = $this->wikiaLogoHelper->getCentralUrlForLang($lang);
     $createWikiUrl = $this->helper->getCreateNewWikiUrl($lang);
     $userCanRead = $wgUser->isAllowed('read');
     $this->response->setVal('centralUrl', $centralUrl);
     $this->response->setVal('createWikiUrl', $createWikiUrl);
     $this->response->setVal('notificationsEnabled', !empty($userCanRead));
     $this->response->setVal('isAnon', $wgUser->isAnon());
     $isGameStarLogoEnabled = $this->isGameStarLogoEnabled();
     $this->response->setVal('isGameStarLogoEnabled', $isGameStarLogoEnabled);
     if ($isGameStarLogoEnabled) {
         $this->response->addAsset('extensions/wikia/GlobalNavigation/styles/GlobalNavigationGameStar.scss');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:GlobalNavigationController.class.php


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