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

PHP EasyTemplate类代码示例

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

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



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

示例1: getForm

 /**
  * @access public
  * @author eloy@wikia
  *
  * @param $title mixed - Title object
  * @param $data array default null - unserialized arguments for task
  *
  * @return string HTML form for task
  */
 public function getForm($title, $data = null)
 {
     global $wgOut;
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/CloseWikiTask/");
     $oTmpl->set_vars(array("data" => $data, "type" => $this->mType, "title" => $title));
     return $oTmpl->render("form");
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:16,代码来源:CloseWikiTask.php


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


示例3: getHTML

 /**
  * Returns HTML internals of the widget box.
  */
 public function getHTML($initialData)
 {
     $tmpl = new EasyTemplate(dirname(__FILE__));
     $tmpl->set_vars(array('data' => $initialData, 'completedToday' => $this->getCompletion(), 'thresholds' => $this->getThresholds(), 'header' => $this->getHeaderHTML(), 'weather' => $this->getWeatherClass($initialData['ct']), 'countDescription' => $this->getCountDescription(), 'moreLink' => $this->getMoreLink(), 'widgetName' => $this->getName(), 'title' => $this->getLeaderboardTitle(), 'getAvatarLink' => array($this, 'getAvatarLink'), 'getUserLink' => array($this, 'getUserLink'), 'status' => $this->getWidgetStatus(), 'login' => $this->getLoginLink(), 'widgetMWName' => $this->getMWName(), 'extraInternalHTML' => $this->getExtraInternalHTML()));
     $html = $tmpl->execute('widgets/dashboardWidget.tmpl.php');
     return $html;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:10,代码来源:DashboardWidget.php


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


示例5: getHTML

 public function getHTML()
 {
     wfProfileIn(__METHOD__);
     $this->report->loadSources();
     $aData = array();
     $aLabel = array();
     if (count($this->report->reportSources) == 0) {
         wfProfileOut(__METHOD__);
         return '';
     }
     foreach ($this->report->reportSources as $reportSource) {
         $reportSource->getData();
         $this->actualDate = $reportSource->actualDate;
         if (!empty($reportSource->dataAll) && !empty($reportSource->dataTitles)) {
             if (is_array($reportSource->dataAll)) {
                 foreach ($reportSource->dataAll as $key => $val) {
                     if (isset($aData[$key])) {
                         $aData[$key] = array_merge($aData[$key], $val);
                     } else {
                         $aData[$key] = $val;
                     }
                 }
             }
             $aLabel += $reportSource->dataTitles;
         }
     }
     sort($aData);
     $this->sourceData = array_reverse($aData);
     $this->sourceLabels = array_reverse($aLabel);
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array('data' => $this->sourceData, 'labels' => $this->sourceLabels));
     wfProfileOut(__METHOD__);
     $this->beforePrint();
     return $oTmpl->render('../../templates/output/' . self::TEMPLATE_MAIN);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:35,代码来源:SDOutputCSV.class.php


示例6: execute

 function execute($par)
 {
     wfProfileIn(__METHOD__);
     global $wgOut, $wgRequest, $wgExtensionsPath, $wgStylePath;
     global $wgPhalanxSupportedLanguages, $wgUser, $wgTitle;
     // check restrictions
     if (!$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return;
     }
     $this->setHeaders();
     $wgOut->addStyle("{$wgExtensionsPath}/wikia/Phalanx/css/Phalanx.css");
     $wgOut->addScript("<script type='text/javascript' src='{$wgExtensionsPath}/wikia/Phalanx/js/Phalanx.js'></script>\n");
     $wgOut->addExtensionStyle("{$wgStylePath}/common/wikia_ui/tabs.css");
     $wgOut->setPageTitle(wfMsg('phalanx-title'));
     $template = new EasyTemplate(dirname(__FILE__) . '/templates');
     $pager = new PhalanxPager();
     $listing = $pager->getNavigationBar();
     $listing .= $pager->getBody();
     $listing .= $pager->getNavigationBar();
     $data = $this->prefillForm();
     $template->set_vars(array('expiries' => Phalanx::getExpireValues(), 'languages' => $wgPhalanxSupportedLanguages, 'listing' => $listing, 'data' => $data, 'action' => $wgTitle->getFullURL(), 'showEmail' => $wgUser->isAllowed('phalanxemailblock')));
     $wgOut->addHTML($template->render('phalanx'));
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:26,代码来源:SpecialPhalanx.body.php


示例7: getHTML

 public function getHTML()
 {
     wfProfileIn(__METHOD__);
     if ($this->isVisible()) {
         $ownerName = $this->ownerUser->getName();
         $tmplData = array();
         $tmplData['ownerBadges'] = $this->getBadgesAnnotated();
         $tmplData['challengesBadges'] = $this->getChallengesAnnotated();
         $tmplData['title_no'] = wfMsg('achievements-profile-title-no', $ownerName);
         $tmplData['title'] = wfMsgExt('achievements-profile-title', array('parsemag'), $ownerName, $this->owner->getBadgesCount());
         $tmplData['title_challenges'] = wfMsg('achievements-profile-title-challenges', $ownerName);
         $tmplData['leaderboard_url'] = Skin::makeSpecialUrl("Leaderboard");
         if ($this->owner->getBadgesCount() > 0) {
             $rankingService = new AchRankingService();
             $tmplData['user_rank'] = $rankingService->getUserRankingPosition($this->ownerUser);
         }
         if ($this->viewerUser->isAllowed('editinterface')) {
             $tmplData['customize_url'] = Skin::makeSpecialUrl("AchievementsCustomize");
         }
         $template = new EasyTemplate(dirname(__FILE__) . '/../templates');
         $template->set_vars($tmplData);
         $out = $template->render('ProfileBox');
     } else {
         $out = '';
     }
     wfProfileOut(__METHOD__);
     return $out;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:28,代码来源:AchUserProfileService.class.php


示例8: execute

 /**
  * Show the special page
  *
  * @param mixed $par Parameter passed to the page
  */
 public function execute($par)
 {
     wfProfileIn(__METHOD__);
     global $wgOut, $wgUser, $wgTitle, $wgRequest, $wgStatsDBEnabled, $wgJsMimeType;
     $this->setHeaders();
     $oAssetsManager = AssetsManager::getInstance();
     $sSrc = $oAssetsManager->getOneCommonURL('/extensions/wikia/UserRenameTool/js/NewUsernameUrlEncoder.js');
     $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$sSrc}\"></script>");
     if (wfReadOnly() || !$wgStatsDBEnabled) {
         $wgOut->readOnlyPage();
         wfProfileOut(__METHOD__);
         return;
     }
     if (!$wgUser->isAllowed('renameuser')) {
         wfProfileOut(__METHOD__);
         throw new PermissionsError('renameuser');
     }
     // Get the request data
     $oldusername = $wgRequest->getText('oldusername', $par);
     $newusername = $wgRequest->getText('newusername');
     $reason = $wgRequest->getText('reason');
     $token = $wgUser->getEditToken();
     $notifyRenamed = $wgRequest->getBool('notify_renamed', false);
     $confirmaction = false;
     if ($wgRequest->wasPosted() && $wgRequest->getInt('confirmaction')) {
         $confirmaction = true;
     }
     $warnings = array();
     $errors = array();
     $infos = array();
     if ($wgRequest->wasPosted() && $wgRequest->getText('token') !== '' && $wgUser->matchEditToken($wgRequest->getVal('token'))) {
         $process = new RenameUserProcess($oldusername, $newusername, $confirmaction, $reason);
         $status = $process->run();
         $warnings = $process->getWarnings();
         $errors = $process->getErrors();
         if ($status) {
             $infos[] = wfMessage('userrenametool-info-in-progress')->inContentLanguage()->text();
         }
     }
     $showConfirm = empty($errors) && empty($infos);
     // note: errors and infos beyond this point are non-blocking
     if (!empty($oldusername)) {
         $olduser = User::newFromName($oldusername);
         if ($olduser->getGlobalFlag('requested-rename', 0)) {
             $infos[] = wfMsg('userrenametool-requested-rename', $oldusername);
         } else {
             $errors[] = wfMsg('userrenametool-did-not-request-rename', $oldusername);
         }
         if ($olduser->getGlobalFlag('wasRenamed', 0)) {
             $errors[] = wfMsg('userrenametool-previously-renamed', $oldusername);
         }
     }
     $template = new EasyTemplate(dirname(__FILE__) . '/templates/');
     $template->set_vars(array("submitUrl" => $wgTitle->getLocalUrl(), "oldusername" => $oldusername, "oldusername_hsc" => htmlspecialchars($oldusername), "newusername" => $newusername, "newusername_hsc" => htmlspecialchars($newusername), "reason" => $reason, "move_allowed" => $wgUser->isAllowed('move'), "confirmaction" => $confirmaction, "warnings" => $warnings, "errors" => $errors, "infos" => $infos, "show_confirm" => $showConfirm, "token" => $token, "notify_renamed" => $notifyRenamed));
     $text = $template->render("rename-form");
     $wgOut->addHTML($text);
     wfProfileOut(__METHOD__);
     return;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:64,代码来源:SpecialRenameuser_body.php


示例9: outHeader

 function outHeader()
 {
     global $wgVersion;
     $this->outXmlHeader();
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array("language" => $this->getLanguage(), "feedId" => $this->getFeedId(), "title" => $this->getTitle(), "selfUrl" => $this->getSelfUrl(), "url" => $this->getUrl(), "timeNow" => $this->formatTime(wfTimestampNow()), "description" => $this->getDescription(), "version" => $wgVersion));
     echo $oTmpl->render("atom-header");
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:8,代码来源:PartnerFeed.class.php


示例10: getCTA

 public static function getCTA(&$t)
 {
     if (self::isActivePage() && !self::isReferredFromArticleCreator() && self::isValidTitle($t)) {
         $tmpl = new EasyTemplate(dirname(__FILE__));
         $tmpl->set_vars(array('title' => $t->getText()));
         return $tmpl->execute('AltMethodAdder.tmpl.php');
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:8,代码来源:AltMethodAdder.body.php


示例11: execute

 public function execute($subpage)
 {
     global $wgOut, $wgUser, $wgRequest, $wgStylePath;
     global $wgExternalDatawareDB;
     wfProfileIn(__METHOD__);
     // Allow any logged in users to use this page (below, we make it so that non-staff can only see emails sent to themselves).
     if (!$wgUser || !$wgUser->isLoggedIn()) {
         $login = SpecialPage::getTitleFor('UserLogin');
         $wgOut->redirect($login->getFullURL('returnto=Special:MailerLog'));
         return false;
     }
     // Setup extra resources
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/SpecialMailerLog/css/oasis.scss'));
     // Keep track of the query parameters we need to add back to any URLs we write on this page
     $query = array();
     $filter_roster = array();
     // Create an array of filters based on was was passed to us
     $filter = self::getFilters($query, $filter_roster);
     // Set sorting and page length
     $sort = $wgRequest->getVal('new_sort', $wgRequest->getVal('sort', 'created'));
     $sort_dir = $wgRequest->getVal('new_sort_dir', $wgRequest->getVal('sort_dir', 'desc'));
     $limit = $wgRequest->getVal('new_limit', $wgRequest->getVal('limit', 100));
     $offset = $wgRequest->getVal('new_offset', $wgRequest->getVal('offset', '0'));
     // Add sorting terms
     if ($sort) {
         $query[] = "sort={$sort}";
     }
     if ($sort_dir) {
         $query[] = "sort_dir={$sort_dir}";
     }
     // Make 500 a hard upper limit
     $limit = $limit > 500 ? 500 : $limit;
     if ($limit) {
         $query[] = "limit={$limit}";
     }
     if ($offset) {
         $query[] = "offset={$offset}";
     }
     $num_rows = 0;
     $mail_records = array();
     if ($this->do_query()) {
         $dbr = wfGetDB(DB_SLAVE, array(), $wgExternalDatawareDB);
         $num_rows = $dbr->selectField('wikia_mailer.mail', 'COUNT(*)', $filter, __METHOD__);
         $res = $dbr->select('wikia_mailer.mail', array('id', 'created', 'attempted', 'city_id', 'dst', 'hdr', 'subj', 'msg', 'transmitted', 'is_error', 'error_status', 'error_msg', 'opened'), $filter, __METHOD__, array('ORDER BY' => $sort . ' ' . $sort_dir, 'LIMIT' => $limit, 'OFFSET' => $offset));
         while ($row = $dbr->fetchObject($res)) {
             $body = self::getBody($row->msg);
             $mail_records[] = array('id' => $row->id, 'created' => $row->created, 'city_id' => $row->city_id, 'wiki_name' => Wikifactory::IdtoDB($row->city_id), 'to' => $row->dst, 'user_url' => self::getUserURL($row->dst), 'subject' => $row->subj, 'subj_short' => self::shortenStr($row->subj), 'msg_full' => $body, 'msg_short' => self::shortenStr($body), 'attempted' => $row->attempted, 'transmitted' => $row->transmitted, 'is_error' => $row->is_error, 'error_status' => $row->error_status, 'error_msg' => $row->error_msg, 'opened' => $row->opened);
         }
     }
     $titleObj = SpecialPage::getTitleFor("MailerLog");
     $scriptURL = $titleObj->getLocalURL();
     $query_string = join('&', $query);
     // Create a template object and give it all the data it needs
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array('wgUser' => $wgUser, 'wgStylePath' => $wgStylePath, 'records' => $mail_records, 'scriptURL' => $scriptURL, 'query_string' => $query_string, 'cur_limit' => $limit, 'num_rows' => $num_rows, 'cur_offset' => $offset, 'query' => $query, 'filter_roster' => $filter_roster));
     $wgOut->addHtml($oTmpl->render("wikia-mailer-log"));
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:58,代码来源:SpecialMailerLog.php


示例12: execute

 function execute()
 {
     global $wgOut, $wgUser, $wgRequest, $wgExtensionsPath, $wgOutboundScreenConfig, $wgCityId, $wgEnableOutboundScreenExt;
     $url = $wgRequest->getText('u');
     $noAutoRedirect = $wgRequest->getText('noredirect') == 1 ? true : false;
     $loggedIn = $wgUser->isLoggedIn();
     if (trim($url) == "") {
         // Nowhere to go.  Display an appropriate explanation (nowhere to go).
         $wgOut->addWikiText(wfMsg('outbound-screen-already-logged-in-no-link'));
     } else {
         if ($wgOutboundScreenConfig['anonsOnly'] == true && $loggedIn || empty($wgEnableOutboundScreenExt)) {
             $wgOut->redirect(htmlspecialchars_decode($url));
             return true;
         } else {
             // output only template content
             $wgOut->setArticleBodyOnly(true);
             // render template
             $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
             // Need to have the skinname correct before calling Athena.
             $skin = RequestContext::getMain()->getSkin();
             $skinName = get_class($skin);
             // this may not be set yet (and needs to be before setupUserCss in order for the right CSS$
             if ($skin->getSkinName() == '') {
                 $skin->skinname = strtolower(substr($skinName, 4));
             }
             $adSlots = array('INVISIBLE' => AdEngine::getInstance()->getAd('EXIT_STITIAL_INVISIBLE', array('ghostwriter' => true)), 'BOXAD_1' => AdEngine::getInstance()->getAd('EXIT_STITIAL_BOXAD_1', array('ghostwriter' => true)), 'BOXAD_2' => AdEngine::getInstance()->getAd('EXIT_STITIAL_BOXAD_2', array('ghostwriter' => true)));
             $oTmpl->set_vars(array('adSlots' => $adSlots));
             switch ($this->adLayoutMode) {
                 case 'V1':
                     $adTemplate = 'adLayoutV1';
                     break;
                 case 'V2':
                     $adTemplate = 'adLayoutV2';
                     break;
                 case 'V3':
                     $adTemplate = 'adLayoutV3';
                     break;
                 case 'V4':
                     $adTemplate = 'adLayoutV4';
                     break;
                 case 'V5':
                     $adTemplate = 'adLayoutV5';
                     break;
                 case 'CLASSIC':
                 default:
                     $adTemplate = 'adLayoutClassic';
             }
             $athenaInitStuff = AdProviderAthena::getInstance()->getSetupHtml();
             $adCode = $oTmpl->render($adTemplate);
             $loginMsg = wfMsgExt('outbound-screen-login-text', array('parseinline', 'content'));
             $pageBarMsg = wfMsg('outbound-screen-you-are-leaving');
             $oTmpl->set_vars(array('adCode' => $adCode, 'athenaInitStuff' => $athenaInitStuff, 'loginMsg' => $loginMsg, 'pageBarMsg' => $pageBarMsg, 'pageType' => 'exitPage', 'redirectDelay' => $noAutoRedirect ? 0 : $this->redirectDelay, 'skip' => wfMsg('interstitial-skip-ad'), 'url' => htmlspecialchars_decode($url)));
             // just output content of template
             $wgOut->clearHTML();
             $wgOut->addHTML($oTmpl->render('page'));
         }
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:58,代码来源:SpecialOutboundScreen_body.php


示例13: execute

 function execute($par)
 {
     global $wgRequest, $wgOut;
     global $wgAdsInterstitialsEnabled;
     global $wgUser;
     $url = trim($wgRequest->getVal('u'));
     $noAutoRedirect = $wgRequest->getText('noredirect') == 1 ? true : false;
     if ($wgAdsInterstitialsEnabled && !$wgUser->isLoggedIn()) {
         $COOKIE_KEY = "IntPgCounter";
         $pageCounter = isset($_COOKIE[$COOKIE_KEY]) ? $_COOKIE[$COOKIE_KEY] : 0;
         // By incrementing the count even for interstitials, we can know when to avoid repeated interstitials for tabbed-browsing.
         // In the calculations for when to display the interstitial, however, this is not considered a "page" (we add 1 to wgAdsInterstitialsPagesBetweenAds to accomplish this).
         global $wgCookiePath, $wgCookieDomain;
         setcookie($COOKIE_KEY, $pageCounter + 1, 0, $wgCookiePath, $wgCookieDomain);
         // If the user shouldn't be seeing an interstitial on this pv, then assume that we are only here because of the user opening many tabs and just redirect to destination right away.
         global $wgAdsInterstitialsPagesBeforeFirstAd;
         global $wgAdsInterstitialsPagesBetweenAds;
         $numToSkip = 2;
         // skip the interstitial and the page it was blocking as candidates
         if ($url != "" && !($wgAdsInterstitialsPagesBeforeFirstAd == $pageCounter - 1 || $pageCounter > $wgAdsInterstitialsPagesBeforeFirstAd && ($pageCounter - $wgAdsInterstitialsPagesBeforeFirstAd - 1) % ($wgAdsInterstitialsPagesBetweenAds + $numToSkip) == 0)) {
             return $this->redirectTo($url);
         }
         $redirectDelay = empty($wgAdsInterstitialsDurationInSeconds) ? INTERSTITIAL_DEFAULT_DURATION_IN_SECONDS : $wgAdsInterstitialsDurationInSeconds;
         // Set up the CSS
         $wgOut->setArticleBodyOnly(true);
         $skin = RequestContext::getMain()->getSkin();
         $skinName = get_class($skin);
         // this may not be set yet (and needs to be before setupUserCss in order for the right CSS file to be included)
         if ($skin->getSkinName() == '') {
             $skin->skinname = substr($skinName, 4);
         }
         if ($skinName == 'SkinMonaco') {
             $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
             $adSlots = array('INVISIBLE' => '&nbsp;', 'BOXAD_1' => AdEngine::getInstance()->getAd('SPECIAL_INTERSTITIAL_BOXAD_1'), 'BOXAD_2' => '&nbsp;');
             $oTmpl->set_vars(array('adSlots' => $adSlots));
             $adTemplate = 'adLayoutClassic';
             $athenaInitStuff = AdProviderAthena::getInstance()->getSetupHtml();
             $adCode = $oTmpl->render($adTemplate);
             $oTmpl->set_vars(array('adCode' => $adCode, 'athenaInitStuff' => $athenaInitStuff, 'pageType' => 'interstitial', 'redirectDelay' => $noAutoRedirect ? 0 : $this->redirectDelay, 'skip' => wfMsg('interstitial-skip-ad'), 'url' => $url));
             $wgOut->clearHTML();
             $wgOut->addHTML($oTmpl->render('page'));
         } else {
             return $this->redirectTo($url);
         }
     } else {
         if ($url == "") {
             // Nowhere to go.  Display an appropriate explanation (either wgAdsInterstitialsEnabled is false or the user is logged in).
             if ($wgUser->isLoggedIn()) {
                 $wgOut->addWikiText(wfMsg('interstitial-already-logged-in-no-link') . wfMsg('interstitial-link-away'));
             } else {
                 $wgOut->addWikiText(wfMsg('interstitial-disabled-no-link') . wfMsg('interstitial-link-away'));
             }
         } else {
             // Since interstitials aren't enabled or the user is logged in, just redirect to the destination URL immediately.
             return $this->redirectTo($url);
         }
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:58,代码来源:SpecialInterstitial_body.php


示例14: getPlatinumForm

 public static function getPlatinumForm($badge)
 {
     wfProfileIn(__METHOD__);
     $template = new EasyTemplate(dirname(__FILE__) . '/../templates');
     $template->set_vars($badge);
     $out = $template->render('PlatinumForm');
     wfProfileOut(__METHOD__);
     return $out;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:AchPlatinumService.class.php


示例15: setTemplatePath

 private function setTemplatePath($templateName)
 {
     $path = $this->config->getSystemUITemplatesLocation();
     $et = new EasyTemplate($path);
     // If there isn't a template that is system specific, template should exist in WAP templates
     if (!$et->template_exists($templateName)) {
         $path = $this->config->getWAPUITemplatesLocation();
     }
     EasyTemplate::set_path($path);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:10,代码来源:WAPTemplate.class.php


示例16: addBubbleTipToElement

 public function addBubbleTipToElement($element, $cookiePrefix, $text)
 {
     global $wgOut;
     $wgOut->addHTML(HtmlSnips::makeUrlTags('css', array('tipsbubble.css'), 'extensions/wikihow/interfaceelements', false));
     $wgOut->addScript(HtmlSnips::makeUrlTags('js', array('interfaceelements/tipsbubble.js', 'common/jquery.cookie.js'), 'extensions/wikihow', false));
     $tmpl = new EasyTemplate(dirname(__FILE__));
     $tmpl->set_vars(array('text' => $text));
     InterfaceElements::addJSVars(array('bubble_target_id' => $element, 'cookieName' => $cookiePrefix . '_b'));
     $wgOut->addHTML($tmpl->execute('TipsBubble.tmpl.php'));
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:10,代码来源:InterfaceElements.php


示例17: getFormHTML

 function getFormHTML()
 {
     global $wgTitle;
     $categoryExhibitionSection = new CategoryExhibitionSection($wgTitle);
     $categoryExhibitionSection->setSortTypeFromParam();
     $categoryExhibitionSection->setDisplayTypeFromParam();
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array('path' => $wgTitle->getFullURL(), 'current' => $categoryExhibitionSection->getSortType(), 'sortTypes' => $categoryExhibitionSection->getSortTypes(), 'displayType' => $categoryExhibitionSection->getDisplayType()));
     return $oTmpl->render("form");
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:10,代码来源:CategoryPageII.php


示例18: getCalculator

 function getCalculator($widget)
 {
     global $wgArticleWidgets;
     if (isset($wgArticleWidgets[$widget])) {
         $tmpl = new EasyTemplate(dirname(__FILE__));
         $html = $tmpl->execute($widget . '/' . $widget . '.tmpl.php');
     } else {
         $html = '';
     }
     return $html;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:11,代码来源:ArticleWidgets.body.php


示例19: execute

 function execute($par)
 {
     global $wgOut, $wgRequest, $wgUser, $wgParser;
     wfLoadExtensionMessages("MethodGuardian");
     if ($wgUser->isBlocked()) {
         $wgOut->blockedPage();
         return;
     }
     if ($wgUser->isAnon()) {
         $wgOut->setRobotpolicy('noindex,nofollow');
         $wgOut->errorpage('nosuchspecialpage', 'nospecialpagetext');
         return;
     }
     $this->skipTool = new ToolSkip("methodguardian", MethodGuardian::TABLE_NAME, "ama_checkout", "ama_checkout_user", "ama_id");
     if ($wgRequest->getVal('getNext')) {
         $wgOut->disable();
         $result = $this->getNextMethod();
         echo json_encode($result);
         return;
     } else {
         if ($wgRequest->getVal('skipMethod')) {
             $wgOut->disable();
             $methodId = $wgRequest->getVal('methodId');
             $this->skipTool->skipItem($methodId);
             $this->skipTool->unUseItem($methodId);
             $result = $this->getNextMethod();
             echo json_encode($result);
             return;
         } elseif ($wgRequest->getVal('deleteMethod')) {
             $wgOut->disable();
             $methodId = $wgRequest->getVal('methodId');
             $articleId = $wgRequest->getVal('articleId');
             $this->deleteMethod($methodId, $articleId);
             $result = $this->getNextMethod();
             echo json_encode($result);
             return;
         } elseif ($wgRequest->getVal('keepMethod')) {
             $wgOut->disable();
             $methodId = $wgRequest->getVal('methodId');
             $articleId = $wgRequest->getVal('articleId');
             $this->keepMethod($methodId, $articleId);
             $result = $this->getNextMethod();
             echo json_encode($result);
             return;
         }
     }
     $wgOut->setHTMLTitle(wfMsg('methodguardian'));
     $wgOut->setPageTitle(wfMsg('methodguardian'));
     $wgOut->addScript(HtmlSnips::makeUrlTags('css', array('methodguardian.css'), 'extensions/wikihow/altmethodadder', false));
     $wgOut->addScript(HtmlSnips::makeUrlTags('js', array('methodguardian.js'), 'extensions/wikihow/altmethodadder', false));
     $tmpl = new EasyTemplate(dirname(__FILE__));
     $wgOut->addHTML($tmpl->execute('MethodGuardian.tmpl.php'));
     $this->displayLeaderboards();
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:54,代码来源:MethodGuardian.body.php


示例20: getPlayer

 protected function getPlayer()
 {
     global $wgOut;
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/Crunchyroll/css/Crunchyroll.scss'));
     if ($this->episodeId > 0 && !empty($this->serieId)) {
         $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
         $oTmpl->set_vars(array('episodeId' => $this->episodeId));
         return $oTmpl->render("CrunchyrollPlayer");
     } else {
         return '';
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:Crunchyroll.body.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP EbatNs_ComplexType类代码示例发布时间:2022-05-23
下一篇:
PHP EasySCP_TemplateEngine类代码示例发布时间: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