• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AssetsManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sassProcessing

 private function sassProcessing()
 {
     global $IP, $wgSassExecutable, $wgDevelEnvironment;
     wfProfileIn(__METHOD__);
     $tempDir = sys_get_temp_dir();
     //replace \ to / is needed because escapeshellcmd() replace \ into spaces (?!!)
     $tempOutFile = str_replace('\\', '/', tempnam($tempDir, 'Sass'));
     $tempDir = str_replace('\\', '/', $tempDir);
     $params = urldecode(http_build_query($this->mParams, '', ' '));
     $cmd = "{$wgSassExecutable} {$IP}/{$this->mOid} {$tempOutFile} --cache-location {$tempDir}/sass -r {$IP}/extensions/wikia/SASS/wikia_sass.rb {$params}";
     $escapedCmd = escapeshellcmd($cmd) . " 2>&1";
     $sassResult = shell_exec($escapedCmd);
     if ($sassResult != '') {
         Wikia::log(__METHOD__, false, "commandline error: " . $sassResult . " -- Full commandline was: {$escapedCmd}", true);
         Wikia::log(__METHOD__, false, "Full commandline was: {$escapedCmd}", true);
         Wikia::log(__METHOD__, false, AssetsManager::getRequestDetails(), true);
         if (file_exists($tempOutFile)) {
             unlink($tempOutFile);
         }
         if (!empty($wgDevelEnvironment)) {
             $exceptionMsg = "Problem with SASS processing: {$sassResult}";
         } else {
             $exceptionMsg = 'Problem with SASS processing. Check the PHP error log for more info.';
         }
         throw new Exception("/* {$exceptionMsg} */");
     }
     $this->mContent = file_get_contents($tempOutFile);
     unlink($tempOutFile);
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:AssetsManagerSassBuilder.class.php


示例2: testGeneral

 public function testGeneral()
 {
     $manager = new AssetsManager();
     $manager->getDescription();
     $manager->getUrl('/test');
     $manager->title()->add('temporary');
     $manager->setTitle(new Title());
     $manager->requirejs()->renderConfig();
     $manager->requirejs()->renderConfigHtml();
     $manager->requirejs()->renderScript();
     $manager->requirejs()->renderScriptHtml();
 }
开发者ID:kendolabdev,项目名称:kendoplatform,代码行数:12,代码来源:ManagerTest.php


示例3: __construct

 /**
  * WikiaSkin constructor
  *
  * @param String $templateClassName Mame of the QuickTemplate subclass to associate to this skin
  * @param String $skinName Name of the skin (lowercase)
  * @param String $styleName The style name, will use $skinName if not specified
  * @param null $themeName The theme name, will use $skinName if not specified
  */
 function __construct($templateClassName = null, $skinName = null, $themeName = null, $styleName = null)
 {
     $this->app = F::app();
     $this->wg = $this->app->wg;
     $this->wf = $this->app->wf;
     $this->assetsManager = AssetsManager::getInstance();
     /**
      * old skins initialize template, skinname, stylename and themename statically in the class declaration,
      * we need to support them too so, that's what the following checks are meant for
      */
     if ($templateClassName !== null) {
         $this->template = $templateClassName;
     }
     if ($skinName !== null) {
         $this->skinname = $skinName;
     }
     if ($styleName !== null) {
         $this->stylename = $styleName;
     } elseif (!isset($this->stylename)) {
         $this->stylename = $this->skinname;
     }
     if ($themeName !== null) {
         $this->themename = $themeName;
     } elseif (!isset($this->themename)) {
         $this->themename = $this->skinname;
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:35,代码来源:WikiaSkin.class.php


示例4: execute

 public function execute()
 {
     global $wgUser, $wgOut, $wgExtensionsPath, $wgEnableUserLoginExt;
     wfProfileIn(__METHOD__);
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if (!$wgUser->isAllowed('createnewwiki')) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return;
     }
     $wgOut->setPageTitle(wfMsg('cnw-title'));
     $wgOut->addHtml(F::app()->renderView('CreateNewWiki', 'Index'));
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/CreateNewWiki/css/CreateNewWiki.scss'));
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/ThemeDesigner/js/ThemeDesigner.js"></script>');
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/AjaxLogin/AjaxLogin.js"></script>');
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/CreateNewWiki/js/CreateNewWiki.js"></script>');
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/CreateNewWiki/js/CreateNewWikiSupplemental.js"></script>');
     if ($wgEnableUserLoginExt) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/UserLogin/css/UserLoginModal.scss'));
     }
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:SpecialCreateNewWiki.class.php


示例5: onBeforePageDisplay

 /**
  * Add JS and CSS to File Page (except mobile skin - see onWikiaMobileAssetsPackages)
  *
  * @param OutputPage $out
  * @param $skin
  * @return bool
  */
 public static function onBeforePageDisplay(OutputPage $out, $skin)
 {
     global $wgEnableVideoPageRedesign;
     $app = F::app();
     wfProfileIn(__METHOD__);
     if ($app->wg->Title->getNamespace() == NS_FILE) {
         $assetsManager = AssetsManager::getInstance();
         $wikiaFilePageJs = 'wikia_file_page_js';
         foreach ($assetsManager->getURL($wikiaFilePageJs) as $url) {
             $out->addScript("<script src=\"{$url}\"></script>");
         }
         // load assets when File Page redesign is enabled
         if ($app->checkSkin('oasis') && !empty($wgEnableVideoPageRedesign)) {
             $filePageTabbedCss = 'file_page_tabbed_css';
             $filePageTabbedJs = 'file_page_tabbed_js';
             foreach ($assetsManager->getURL($filePageTabbedCss) as $url) {
                 $out->addStyle($url);
             }
             foreach ($assetsManager->getURL($filePageTabbedJs) as $url) {
                 $out->addScript("<script src=\"{$url}\"></script>");
             }
         }
     }
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:33,代码来源:FilePageHooks.class.php


示例6: __construct

 public function __construct(WebRequest $request)
 {
     parent::__construct($request);
     global $IP;
     if (strpos($this->mOid, '..') !== false) {
         throw new Exception('File path must not contain \'..\'.');
     }
     if (endsWith($this->mOid, '.js', false)) {
         $this->mContentType = AssetsManager::TYPE_JS;
     } else {
         if (endsWith($this->mOid, '.css', false)) {
             $this->mContentType = AssetsManager::TYPE_CSS;
         } else {
             throw new Exception('Requested file must be .css or .js.');
         }
     }
     $filePath = $IP . '/' . $this->mOid;
     if (file_exists($filePath)) {
         $this->mContent = file_get_contents($filePath);
     } else {
         $requestDetails = AssetsManager::getRequestDetails();
         Wikia::log(__METHOD__, false, "file '{$filePath}' doesn't exist ({$requestDetails})", true);
         throw new Exception('File does not exist');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:AssetsManagerOneBuilder.class.php


示例7: __construct

 function __construct($message)
 {
     // add referer and user agent info to the exception message
     $details = AssetsManager::getRequestDetails();
     $message .= " ({$details})";
     parent::__construct($message);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:AssetsManagerException.class.php


示例8: view

 /**
  * Render Quiz namespace page
  */
 public function view()
 {
     global $wgOut, $wgUser, $wgTitle, $wgRequest;
     wfProfileIn(__METHOD__);
     // let MW handle basic stuff
     parent::view();
     // don't override history pages
     $action = $wgRequest->getVal('action');
     if (in_array($action, array('history', 'historysubmit'))) {
         wfProfileOut(__METHOD__);
         return;
     }
     // quiz doesn't exist
     if (!$wgTitle->exists() || empty($this->mQuiz)) {
         wfProfileOut(__METHOD__);
         return;
     }
     // set page title
     $title = $this->mQuiz->getTitle();
     $wgOut->setPageTitle($title);
     // add CSS/JS
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/WikiaQuiz/css/WikiaQuizBuilder.scss'));
     // render quiz page
     $wgOut->clearHTML();
     $wgOut->addHTML($this->mQuiz->render());
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:30,代码来源:WikiaQuizIndexArticle.class.php


示例9: execute

 public function execute($subpage)
 {
     global $wgOut, $wgUser, $wgExtensionsPath, $wgResourceBasePath;
     // Boilerplate special page permissions
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (!$wgUser->isAllowed('wikiaquiz')) {
         $this->displayRestrictionError();
         return;
     }
     if (wfReadOnly() && !wfAutomaticReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     $wgOut->addScript('<script src="' . $wgResourceBasePath . '/resources/wikia/libraries/jquery-ui/jquery-ui-1.8.14.custom.js"></script>');
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/WikiaQuiz/js/CreateWikiaQuizArticle.js"></script>');
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('/extensions/wikia/WikiaQuiz/css/WikiaQuizBuilder.scss'));
     if ($subpage != '') {
         // We came here from the edit link, go into edit mode
         $wgOut->addHtml(F::app()->renderView('WikiaQuiz', 'EditQuizArticle', array('title' => $subpage)));
     } else {
         $wgOut->addHtml(F::app()->renderView('WikiaQuiz', 'CreateQuizArticle'));
     }
 }
开发者ID:yusufchang,项目名称:app,代码行数:25,代码来源:SpecialCreateWikiaQuizArticle.class.php


示例10: execute

 public function execute($subpage)
 {
     global $wgOut;
     $this->checkPermission();
     if ($this->getUser()->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (!$this->getUser()->isAllowed('videoupload')) {
         $wgOut->addHTML(wfMessage('videos-error-admin-only')->plain());
         return;
     }
     // Add css for form
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/VideoEmbedTool/css/WikiaVideoAdd.scss'));
     $this->mTitle = Title::makeTitle(NS_SPECIAL, 'WikiaVideoAdd');
     $wgOut->setRobotpolicy('noindex,nofollow');
     $wgOut->setPageTitle("WikiaVideoAdd");
     $wgOut->setArticleRelated(false);
     $this->mAction = $this->getRequest()->getVal("action");
     $this->mPosted = $this->getRequest()->wasPosted();
     switch ($this->mAction) {
         case 'submit':
             if ($this->mPosted) {
                 $this->mAction = $this->doSubmit();
             }
             break;
         default:
             $this->showForm();
             break;
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:30,代码来源:WikiaVideoAdd_body.php


示例11: executeIndex

 public function executeIndex($params)
 {
     $page_owner = User::newFromName($this->wg->Title->getText());
     if (!is_object($page_owner) || $page_owner->getId() == 0) {
         // do not show module if page owner does not exist or is an anonymous user
         return false;
     }
     // add CSS for this module
     $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/FollowedPages.scss"));
     $showDeletedPages = isset($params['showDeletedPages']) ? (bool) $params['showDeletedPages'] : true;
     // get 6 followed pages
     $watchlist = FollowModel::getWatchList($page_owner->getId(), 0, 6, null, $showDeletedPages);
     $data = array();
     // weird.  why is this an array of one element?
     foreach ($watchlist as $unused_id => $item) {
         $pagelist = $item['data'];
         foreach ($pagelist as $page) {
             $data[] = $page;
         }
     }
     // only display  your own page
     if ($page_owner->getId() == $this->wg->User->getId()) {
         $this->follow_all_link = Wikia::specialPageLink('Following', 'oasis-wikiafollowedpages-special-seeall', 'more');
     }
     $this->data = $data;
     $this->max_followed_pages = min(self::MAX_FOLLOWED_PAGES, count($this->data));
 }
开发者ID:yusufchang,项目名称:app,代码行数:27,代码来源:FollowedPagesController.class.php


示例12: executeIndex

 public function executeIndex()
 {
     $maxBadgesToDisplay = 6;
     // Could make this a global if we want
     wfProfileIn(__METHOD__);
     // include oasis.css override
     $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/AchievementsII/css/oasis.scss'));
     // This code was taken from SpecialLeaderboard so it can be used by both the module and the old Monaco .tmpl
     $rankingService = new AchRankingService();
     // ignore welcome badges
     $blackList = array(BADGE_WELCOME);
     $awardedBadges = $rankingService->getRecentAwardedBadges(null, $maxBadgesToDisplay, 3, $blackList);
     $recents = array();
     $count = 1;
     // getRecentAwardedBadges can sometimes return more than $max items
     foreach ($awardedBadges as $badgeData) {
         //$level = $badgeData['badge']->getLevel();
         $recents[] = $badgeData;
         if ($count++ >= $maxBadgesToDisplay) {
             break;
         }
     }
     $this->recents = $recents;
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:LatestEarnedBadgesController.class.php


示例13: executeIndex

 public function executeIndex()
 {
     wfProfileIn(__METHOD__);
     $this->partnerId = "Wikia";
     $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/HuluVideoPanel.scss'));
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:HuluVideoPanelController.class.php


示例14: execute

 public function execute($subpage)
 {
     global $wgOut, $wgUser, $wgExtensionsPath, $wgResourceBasePath;
     // Boilerplate special page permissions
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (wfReadOnly() && !wfAutomaticReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if (!$wgUser->isAllowed('createpage') || !$wgUser->isAllowed('edit')) {
         $this->displayRestrictionError();
         return;
     }
     $wgOut->addModules("wikia.jquery.ui");
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/WikiaPoll/js/CreateWikiaPoll.js"></script>');
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('/extensions/wikia/WikiaPoll/css/CreateWikiaPoll.scss'));
     if ($subpage != '') {
         // We came here from the edit link, go into edit mode
         $wgOut->addHtml(F::app()->renderView('WikiaPoll', 'SpecialPageEdit', array('title' => $subpage)));
     } else {
         $wgOut->addHtml(F::app()->renderView('WikiaPoll', 'SpecialPage'));
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:SpecialCreateWikiaPoll.class.php


示例15: index

 public function index()
 {
     if (!$this->wg->User->isAllowed('gameguidescontent')) {
         $this->displayRestrictionError();
         return false;
         // skip rendering
     }
     $title = $this->wf->Msg('wikiagameguides-content-title');
     $this->wg->Out->setPageTitle($title);
     $this->wg->Out->setHTMLTitle($title);
     $this->wg->Out->addModules('jquery.autocomplete');
     $assetManager = AssetsManager::getInstance();
     $styles = $assetManager->getUrl('extensions/wikia/GameGuides/css/GameGuidesContentManagmentTool.scss');
     foreach ($styles as $s) {
         $this->wg->Out->addStyle($s);
     }
     $scripts = $assetManager->getURL('extensions/wikia/GameGuides/js/GameGuidesContentManagmentTool.js');
     foreach ($scripts as $s) {
         $this->wg->Out->addScriptFile($s);
     }
     F::build('JSMessages')->enqueuePackage('GameGuidesContentMsg', JSMessages::INLINE);
     $tags = WikiFactory::getVarValueByName('wgWikiaGameGuidesContent', $this->wg->CityId);
     $this->response->setVal('tags', $tags);
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:GameGuidesSpecialContentController.class.php


示例16: wfLatestQuestionsAjaxAddScript

function wfLatestQuestionsAjaxAddScript(&$out)
{
    global $wgJsMimeType, $wgExtensionsPath;
    $out->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$wgExtensionsPath}/wikia/LatestQuestions/LatestQuestions.js\"></script>\n");
    $out->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/LatestQuestions/LatestQuestions.scss'));
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:7,代码来源:LatestQuestions.php


示例17: pageNotFound

 /**
  * Page Not Found
  *
  * Get 20 most recent edited page
  * get 5 images per page
  *
  * display random image on 404 page
  * example:
  *
  * Open non existent page on any wiki
  *
  */
 function pageNotFound()
 {
     //setup all needed assets on 404 page
     /**
      * @var $out OutputPage
      */
     $out = $this->request->getVal('out', $this->wg->Out);
     $assetManager = AssetsManager::getInstance();
     //add styles that belongs only to 404 page
     $styles = $assetManager->getURL(array('wikiamobile_404_scss'));
     //this is going to be additional call but at least it won't be loaded on every page
     foreach ($styles as $s) {
         $out->addStyle($s);
     }
     //this is mainly for tracking
     $scipts = $assetManager->getURL(array('wikiamobile_404_js'));
     foreach ($scipts as $s) {
         $out->addScript('<script src="' . $s . '"></script>');
     }
     //suppress rendering stuff that is not to be on 404 page
     WikiaMobileFooterService::setSkipRendering(true);
     WikiaMobilePageHeaderService::setSkipRendering(true);
     /**
      * @var $wikiaMobileStatsModel WikiaMobileStatsModel
      */
     $wikiaMobileStatsModel = new WikiaMobileStatsModel();
     $ret = $wikiaMobileStatsModel->getRandomPopularPage();
     $this->response->setVal('title', $this->wg->Out->getTitle());
     $this->response->setVal('link', $ret[0]);
     $this->response->setVal('img', $ret[1]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:43,代码来源:WikiaMobileErrorService.class.php


示例18: execute

 function execute($par)
 {
     global $wgOut, $wgCityId, $wgSuppressWikiHeader, $wgSuppressPageHeader, $wgShowMyToolsOnly, $wgExtensionsPath, $wgBlankImgUrl, $wgJsMimeType, $wgTitle, $wgUser, $wgRequest;
     wfProfileIn(__METHOD__);
     // redirect to www.wikia.com
     if ($wgCityId == 177) {
         $destServer = WikiFactory::getVarValueByName('wgServer', $this->destCityId);
         $destArticlePath = WikiFactory::getVarValueByName('wgArticlePath', $this->destCityId);
         $wgOut->redirect($destServer . str_replace('$1', 'Special:LandingPage', $destArticlePath));
         return;
     }
     $this->setHeaders();
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/LandingPage/css/LandingPage.scss'));
     // hide wiki and page header
     $wgSuppressWikiHeader = true;
     $wgSuppressPageHeader = true;
     // only shown "My Tools" on floating toolbar
     $wgShowMyToolsOnly = true;
     // parse language links (RT #71622)
     $languageLinks = array();
     $parsedMsg = wfStringToArray(wfMsg('landingpage-language-links'), '*', 10);
     foreach ($parsedMsg as $item) {
         if ($item != '') {
             list($text, $lang) = explode('|', $item);
             $languageLinks[] = array('text' => $text, 'href' => $wgTitle->getLocalUrl("uselang={$lang}"));
         }
     }
     // fetching the landingpage sites
     $landingPageLinks = CorporatePageHelper::parseMsgImg('landingpage-sites', false, false);
     // render HTML
     $template = new EasyTemplate(dirname(__FILE__) . '/templates');
     $template->set_vars(array('imagesPath' => $wgExtensionsPath . '/wikia/LandingPage/images/', 'languageLinks' => $languageLinks, 'wgBlankImgUrl' => $wgBlankImgUrl, 'wgTitle' => $wgTitle, 'landingPageLinks' => $landingPageLinks, 'landingPageSearch' => F::app()->getView("SearchController", "Index", array("placeholder" => "Search Wikia", "fulltext" => "0", "wgBlankImgUrl" => $wgBlankImgUrl, "wgTitle" => $wgTitle))));
     $wgOut->addHTML($template->render('main'));
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:35,代码来源:SpecialLandingPage.class.php


示例19: renderSpoilerControl

function renderSpoilerControl($input, $argv, $parser)
{
    // check arguments
    if (empty($argv['source'])) {
        return;
    }
    $controlOptionsStr = wfMsg('wikiaspoiler-' . $argv['source']);
    willdebug($controlOptionsStr);
    if (empty($controlOptionsStr)) {
        return;
    }
    $controlOptions = explode("\n", $controlOptionsStr);
    $numOptions = sizeof($controlOptions);
    // load assets
    $extPath = F::app()->wg->extensionsPath;
    F::app()->wg->out->addScript("<script src=\"{$extPath}/wikia/WikiaSpoiler/js/WikiaSpoiler.js\"></script>");
    F::app()->wg->out->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/WikiaSpoiler/css/WikiaSpoiler.scss'));
    $output = '<form id="wikiaspoilercontrol" action="" onsubmit="return false;"><p>';
    $output .= wfMsg('wikiaspoiler-control-heading');
    $output .= '<select class="wikiaspoilerselect">';
    $output .= '<option value="0">none</option>';
    for ($i = 0; $i < $numOptions; $i++) {
        $output .= '<option value="' . ($i + 1) . '">' . $controlOptions[$i] . '</option>';
    }
    willdebug($output);
    $output .= '</select></p></form>';
    return $output;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:28,代码来源:WikiaSpoiler.setup.php


示例20: execute

 function execute($par)
 {
     wfProfileIn(__METHOD__);
     global $wgOut, $wgExtensionsPath, $wgResourceBasePath, $wgJsMimeType, $wgUser;
     // set basic headers
     $this->setHeaders();
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         wfProfileOut(__METHOD__);
         return;
     }
     if (!$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return;
     }
     // include resources (css and js)
     $wgOut->addExtensionStyle("{$wgExtensionsPath}/wikia/AchievementsII/css/platinum.css\n");
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/AchievementsII/css/oasis.scss'));
     $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$wgExtensionsPath}/wikia/AchievementsII/js/platinum.js\"></script>\n");
     $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$wgResourceBasePath}/resources/wikia/libraries/aim/jquery.aim.js\"></script>\n");
     // call service to get needed data
     $badges = AchPlatinumService::getList();
     // pass data to template
     $template = new EasyTemplate(dirname(__FILE__) . '/templates');
     $template->set_vars(array('badges' => $badges));
     // render template
     $wgOut->addHTML($template->render('SpecialPlatinum'));
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:SpecialPlatinum.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Assets_Page类代码示例发布时间:2022-05-23
下一篇:
PHP AssetsHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap