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


PHP EasyTemplate::render方法代码示例

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


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

示例1: 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' => ' ', 'BOXAD_1' => AdEngine::getInstance()->getAd('SPECIAL_INTERSTITIAL_BOXAD_1'), 'BOXAD_2' => ' ');
             $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

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

示例3: parseTag

 /**
  * Chat tag parser implementation
  */
 public static function parseTag($input, $args, $parser)
 {
     wfProfileIn(__METHOD__);
     $template = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $template->set('linkToSpecialChat', SpecialPage::getTitleFor("Chat")->escapeLocalUrl());
     if (F::app()->checkSkin('oasis')) {
         $html = $template->render('entryPointTag');
     } else {
         $html = $template->render('entryPointTagMonobook');
     }
     wfProfileOut(__METHOD__);
     return $html;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:16,代码来源:ChatEntryPoint.class.php

示例4: parseTag

 /**
  * Chat tag parser implementation
  */
 public static function parseTag($input, $args, $parser)
 {
     wfProfileIn(__METHOD__);
     $template = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $template->set_vars(self::getEntryPointTemplateVars(true));
     if (F::app()->checkSkin('oasis')) {
         $html = $template->render('entryPointTag');
     } else {
         $html = $template->render('entryPointTagMonobook');
     }
     // remove newlines so parser does not try to wrap lines into paragraphs
     $html = str_replace("\n", "", $html);
     wfProfileOut(__METHOD__);
     return '<nowiki>' . $html . '</nowiki>';
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:18,代码来源:ChatEntryPoint.class.php

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

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

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

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

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

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

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

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

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

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


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