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


PHP Template::fetch方法代码示例

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


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

示例1: addCustomer

 public function addCustomer($data)
 {
     $this->db->query("INSERT INTO " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', birthday = '" . $this->db->escape($data['birthday_year']) . '-' . $this->db->escape($data['birthday_month']) . '-' . $this->db->escape($data['birthday_day']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', newsletter = '" . (int) $data['newsletter'] . "', customer_group_id = '" . (int) $data['customer_group_id'] . "', customer_type_id = '" . (int) $data['customer_type_id'] . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', status = '" . (int) $data['status'] . "', date_added = NOW()");
     $customer_id = $this->db->getLastId();
     if (isset($data['address'])) {
         foreach ($data['address'] as $address) {
             $this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int) $customer_id . "', firstname = '" . $this->db->escape($address['firstname']) . "', lastname = '" . $this->db->escape($address['lastname']) . "', company = '" . $this->db->escape($address['company']) . "', company_id = '" . $this->db->escape($address['company_id']) . "', tax_id = '" . $this->db->escape($address['tax_id']) . "', address_1 = '" . $this->db->escape($address['address_1']) . "', address_2 = '" . $this->db->escape($address['address_2']) . "', city = '" . $this->db->escape($address['city']) . "', postcode = '" . $this->db->escape($address['postcode']) . "', country_id = '" . (int) $address['country_id'] . "', zone_id = '" . (int) $address['zone_id'] . "'");
             if (isset($address['default'])) {
                 $address_id = $this->db->getLastId();
                 $this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . $address_id . "' WHERE customer_id = '" . (int) $customer_id . "'");
             }
         }
     }
     if ($data['send_mail']) {
         $customer_info = $this->getCustomer($customer_id);
         if ($customer_info) {
             $this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int) $customer_id . "'");
             $this->language->load('mail/customer');
             $this->load->model('setting/store');
             $store_info = $this->model_setting_store->getStore($customer_info['store_id']);
             if ($store_info) {
                 $store_name = $store_info['name'];
                 $store_url = $store_info['url'] . 'tai-khoan/dang-nhap';
             } else {
                 $store_name = $this->config->get('config_name');
                 $store_url = HTTP_CATALOG . 'tai-khoan/dang-nhap';
             }
             $template = new Template();
             $subject = sprintf($this->language->get('text_subject'), $store_name);
             $template->data['title'] = sprintf($this->language->get('text_subject'), $store_name);
             $template->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $store_name);
             $template->data['text_login'] = $this->language->get('text_login');
             $template->data['text_url'] = sprintf($this->language->get('text_url'), $store_url, $store_url);
             $template->data['text_email'] = sprintf($this->language->get('text_email'), $data['email']);
             $template->data['text_password'] = sprintf($this->language->get('text_password'), $data['password']);
             $template->data['text_services'] = $this->language->get('text_services');
             $template->data['text_thanks'] = $this->language->get('text_thanks');
             $template->data['text_store_name'] = $store_name;
             if (file_exists(DIR_TEMPLATE . 'mail/customer.tpl')) {
                 $html = $template->fetch('mail/customer.tpl');
             } else {
                 $html = $template->fetch('mail/customer.tpl');
             }
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mail->setTo($customer_info['email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender($store_name);
             $mail->setSubject($subject);
             $mail->setHtml($html);
             $mail->send();
         }
     }
 }
开发者ID:bamboo0079,项目名称:shopcart,代码行数:60,代码来源:customer.php

示例2: index

 public function index()
 {
     $this->language->load('newsletter/active');
     $this->load->model('catalog/newsletter');
     $code = $this->request->get['code'];
     $check = $this->model_catalog_newsletter->getNewsLetterVerifyCode($code);
     if ($check) {
         $newsletter_info = $this->model_catalog_newsletter->getNewsLetterbyEmail($check['email']);
         $this->model_catalog_newsletter->updateNewsLetterStatusEmail($newsletter_info['email']);
         $this->model_catalog_newsletter->deleteNewsLetterVerifyEmail($newsletter_info['email']);
         $this->data['text_desc_active'] = $this->language->get('text_desc_active');
         // HTML Mail
         $template = new Template();
         $subject = $this->language->get('text_subject');
         $template->data['title'] = $this->language->get('text_subject');
         $template->data['text_hello'] = sprintf($this->language->get('text_hello'), $newsletter_info['email'], $newsletter_info['name']);
         $template->data['text_greeting'] = $this->language->get('text_greeting');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/verify_success.tpl')) {
             $html = $template->fetch($this->config->get('config_template') . '/template/mail/verify_success.tpl');
         } else {
             $html = $template->fetch('default/template/mail/verify_success.tpl');
         }
         $mail = new Mail();
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($newsletter_info['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
         $mail->setHtml($html);
         $mail->send();
     } else {
         $this->data['text_desc_active'] = $this->language->get('text_desc_code');
     }
     $this->document->setTitle($this->language->get('heading_title'));
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('href' => $this->url->link('common/home'), 'text' => $this->language->get('text_home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('href' => $this->url->link('newsletter/confirm'), 'text' => $this->language->get('text_confirm'), 'separator' => $this->language->get('text_separator'));
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['button_continue'] = $this->language->get('button_continue');
     $this->data['continue'] = $this->url->link('common/home');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/newsletter/active.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/newsletter/active.tpl';
     } else {
         $this->template = 'default/template/newsletter/active.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
开发者ID:bamboo0079,项目名称:shopcart,代码行数:54,代码来源:active.php

示例3: confirm

 public function confirm($order_id)
 {
     $this->load->model('checkout/order');
     $order_info = $this->model_checkout_order->getOrder($order_id);
     if ($order_info) {
         $this->load->model('localisation/language');
         $language = new Language($order_info['language_directory']);
         $language->load($order_info['language_filename']);
         $language->load('mail/voucher');
         $voucher_query = $this->db->query("SELECT *, vtd.name AS theme FROM `" . DB_PREFIX . "voucher` v LEFT JOIN " . DB_PREFIX . "voucher_theme vt ON (v.voucher_theme_id = vt.voucher_theme_id) LEFT JOIN " . DB_PREFIX . "voucher_theme_description vtd ON (vt.voucher_theme_id = vtd.voucher_theme_id) AND vtd.language_id = '" . (int) $order_info['language_id'] . "' WHERE order_id = '" . (int) $order_id . "'");
         foreach ($voucher_query->rows as $voucher) {
             // HTML Mail
             $template = new Template();
             $template->data['title'] = sprintf($language->get('text_subject'), $voucher['from_name']);
             $template->data['text_greeting'] = sprintf($language->get('text_greeting'), $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']));
             $template->data['text_from'] = sprintf($language->get('text_from'), $voucher['from_name']);
             $template->data['text_message'] = $language->get('text_message');
             $template->data['text_redeem'] = sprintf($language->get('text_redeem'), $voucher['code']);
             $template->data['text_footer'] = $language->get('text_footer');
             if (file_exists(DIR_IMAGE . $voucher['image'])) {
                 $template->data['image'] = 'cid:' . md5(basename($voucher['image']));
             } else {
                 $template->data['image'] = '';
             }
             $template->data['store_name'] = $order_info['store_name'];
             $template->data['store_url'] = $order_info['store_url'];
             $template->data['message'] = nl2br($voucher['message']);
             if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/voucher.tpl')) {
                 $html = $template->fetch($this->config->get('config_template') . '/template/mail/voucher.tpl');
             } else {
                 $html = $template->fetch('default/template/mail/voucher.tpl');
             }
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mail->setTo($voucher['to_email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender($order_info['store_name']);
             $mail->setSubject(sprintf($language->get('text_subject'), $voucher['from_name']));
             $mail->setHtml($html);
             if (file_exists(DIR_IMAGE . $voucher['image'])) {
                 $mail->addAttachment(DIR_IMAGE . $voucher['image'], md5(basename($voucher['image'])));
             }
             $mail->send();
         }
     }
 }
开发者ID:Tambralinga,项目名称:drupal-opencart,代码行数:52,代码来源:voucher.php

示例4: child

 public function child()
 {
     $this->language->load('comment/write');
     $this->load->model('catalog/comment');
     $json = array();
     if (strlen(utf8_decode($this->request->post['name'])) < 3 || strlen(utf8_decode($this->request->post['name'])) > 255) {
         $json['error'] = $this->language->get('error_name');
     }
     if (strlen(utf8_decode($this->request->post['text'])) < 3) {
         $json['error'] = $this->language->get('error_text');
     }
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && !isset($json['error'])) {
         $this->model_catalog_comment->addCommentChild($this->request->post);
         $json['success'] = $this->language->get('text_success');
         $info = $this->model_catalog_comment->getComment($this->request->post['parent_id']);
         if ($this->request->post['send_mail'] == 'on' && $info['email'] != '') {
             // HTML Mail
             $email = $info['email'];
             $name = $info['name'];
             $template = new Template();
             $subject = $this->language->get('text_subject');
             $template->data['title'] = $this->language->get('text_subject');
             $template->data['text_hello'] = sprintf($this->language->get('text_hello'), $email, $name);
             $template->data['text_greeting'] = $this->language->get('text_greeting');
             $template->data['text_greeting'] .= sprintf($this->language->get('text_faq'), $info['text']);
             $template->data['text_greeting'] .= sprintf($this->language->get('text_ans'), $this->request->post['text']);
             if (file_exists(DIR_TEMPLATE . 'mail/reply_comment.tpl')) {
                 $html = $template->fetch('mail/reply_comment.tpl');
             } else {
                 $html = $template->fetch('mail/reply_comment.tpl');
             }
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mail->setTo($email);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender($this->config->get('config_name'));
             $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
             $mail->setHtml($html);
             $mail->send();
         }
     }
     $this->response->setOutput(json_encode($json));
 }
开发者ID:bamboo0079,项目名称:shopcart,代码行数:49,代码来源:write.php

示例5: addslashes

 function event_ExecuteEditor(&$data)
 {
     global $lang, $manager;
     if ($data['type'] == 'external' && $data['sheet'] == 'external') {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             if ($_REQUEST['url'] != 'http://') {
                 $res = sql::query("\r\n\t\t\t\t\t\t\tREPLACE \r\n\t\t\t\t\t\t\t\t" . _TABLE_PREFIX_ . "contents_external\r\n\t\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\t\tID='" . $data['params']['id'] . "',\r\n\t\t\t\t\t\t\t\trevision='" . $data['params']['revision'] . "',\r\n\t\t\t\t\t\t\t\turl='" . addslashes($_REQUEST['url']) . "'\r\n\t\t\t\t\t\t");
             }
             // Mark this action as a modification
             revisions::updateModificationDate($data['params']['id'], $data['params']['revision']);
             header("Location: " . url::item($data['params']['id'], 'edit') . "/external?revision=" . $data['params']['revision']);
             exit;
         }
         $res = sql::query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t*\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\t" . _TABLE_PREFIX_ . "contents_external\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tID='" . $data['params']['id'] . "' AND\r\n\t\t\t\t\t\trevision='" . $data['params']['revision'] . "'\r\n\t\t\t\t");
         $tpl = new Template($this->getTemplate('editor.template'));
         if ($row = sql::fetch_array($res)) {
             $tpl->set("url", $row['url']);
         } else {
             $tpl->set("url", 'http://');
         }
         $tpl->set("id", $data['params']['id']);
         $tpl->set("revision", $data['params']['revision']);
         $data['template']->append('content', $tpl->fetch());
     }
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:25,代码来源:plugin.php

示例6: html

 public function html()
 {
     $content = null;
     if (!$this->totalItems) {
         return $content;
     }
     $numberOfPages = ceil($this->totalItems / $this->itemsPerPage);
     if ($numberOfPages == 1) {
         return $content;
     }
     $onFirstPage = $this->currentPage == 1;
     $onLastPage = $this->currentPage == $numberOfPages;
     $pageLinks = array();
     if (!$onFirstPage) {
         $pageLinks[] = array('id' => $this->currentPage - 1, 'title' => _('Previous'));
     }
     for ($i = 1; $i <= $numberOfPages; ++$i) {
         $isCurrentPage = (int) ($i == $this->currentPage);
         $pageLinks[] = array('id' => $i, 'title' => $i, 'active' => $isCurrentPage);
     }
     if (!$onLastPage) {
         $pageLinks[] = array('id' => $this->currentPage + 1, 'title' => _('Next'));
     }
     $template = new Template('parts/paging');
     $template->assign('pageLinks', $pageLinks);
     return $template->fetch();
 }
开发者ID:robkaper,项目名称:kiki,代码行数:27,代码来源:paging.php

示例7: array

 function action_sitemap($args)
 {
     global $manager, $language;
     $sitemap = array();
     $user = new anonymousUser();
     $list = new languages();
     while (list(, $lang) = each($list->nodes)) {
         $language = $lang->id;
         $tree = new pageTree($user, $manager, $lang->id);
         while (list($id, $item) = each($tree->data)) {
             if ($item['visible'] && $item['navigation']) {
                 $tz = date('O', $item['meta']['modified']);
                 $tz = substr($tz, 0, 3) . ':' . substr($tz, 3, 2);
                 if (time() - $item['meta']['modified'] < 86400 * 2) {
                     $fq = 'hourly';
                 } elseif (time() - $item['meta']['modified'] < 86400 * 14) {
                     $fq = 'daily';
                 } elseif (time() - $item['meta']['modified'] < 86400 * 62) {
                     $fq = 'weekly';
                 } else {
                     $fq = 'monthly';
                 }
                 $sitemap[] = array('loc' => 'http://' . $_SERVER['HTTP_HOST'] . $item['url'], 'lastmod' => gmdate('Y-m-d\\TH:i:s', $item['meta']['modified']) . $tz, 'changefreq' => $fq, 'priority' => '1.0');
             }
         }
     }
     $tpl = new Template($this->getTemplate('main.template'));
     $tpl->set('sitemap', $sitemap);
     header("Content-type: text/xml;charset=UTF-8");
     echo $tpl->fetch();
     exit;
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:32,代码来源:plugin.php

示例8: createRequest

 /**
  * Create new request and sends email to user
  * @static
  * @param string Mail adress
  * @throws MailFailureException, UserNotFoundException
  */
 public static function createRequest($mail)
 {
     LostPW::cleanUp();
     $user = User::find('email', $mail);
     if ($user == NULL) {
         throw new UserNotFoundException();
     }
     // Delete old requests
     $sql = System::getDatabase()->prepare('DELETE FROM lostpw WHERE user_ID = :uid');
     $sql->execute(array(':uid' => $user->uid));
     // Create new request
     $hash = LostPW::createHash();
     $sql = System::getDatabase()->prepare('INSERT INTO lostpw (user_ID, hash, time) VALUES (:uid, :hash, :time)');
     $sql->execute(array(':uid' => $user->uid, ':hash' => $hash, ':time' => time()));
     // Send Mail
     $content = new Template();
     $content->assign('link', Router::getInstance()->build('AuthController', 'lostpw_check', array('hash' => $hash)));
     $content->assign('user', $user);
     $content->assign('title', System::getLanguage()->_('LostPW'));
     // Determine template file
     $tpl = 'mails/lostpw.' . LANGUAGE . '.tpl';
     foreach ($content->getTemplateDir() as $dir) {
         $file = 'mails/lostpw.' . $user->lang . '.tpl';
         if (file_exists($dir . $file)) {
             $tpl = $file;
             break;
         }
     }
     $mail = new Mail(System::getLanguage()->_('LostPW'), $content->fetch($tpl), $user);
     $mail->send();
 }
开发者ID:nicefirework,项目名称:sharecloud,代码行数:37,代码来源:LostPW.class.php

示例9: buildSite

 /**
  * Build site content depending on requested action.
  */
 protected function buildSite()
 {
     switch ($this->s->action) {
         case 'info':
             $site = $this->s->getConfig('site');
             $site['modules']['all'] = Module::getNumber();
             $site['modules']['active'] = Module::getNumber(true);
             $site['users'] = User::getNumber(true);
             $db = DB::getInstance();
             $server = array('type' => $_SERVER['SERVER_SOFTWARE'], 'php' => array('version' => phpversion(), 'safe_mode' => ini_get('safe_mode'), 'magic_quotes_gpc' => ini_get('magic_quotes_gpc'), 'magic_quotes_runtime' => ini_get('magic_quotes_runtime'), 'gpc_order' => ini_get('gpc_order'), 'memory_limit' => ini_get('memory_limit'), 'max_execution_time' => ini_get('max_execution_time'), 'disable_functions' => ini_get('disable_functions'), 'sql_safe_mode' => ini_get('sql.safe_mode'), 'include_path' => ini_get('include_path')), 'gd' => $this->getPhpModuleInfo('gd'), 'db' => $db->info());
             $file = 'CHANGELOG.txt';
             $changelog = is_readable($file) ? file_get_contents($file) : false;
             $file = 'logs/error.log';
             $errorlog = is_readable($file) ? file_get_contents($file) : false;
             if ($errorlog == '') {
                 $errorlog = 'Errorlog ist leer!';
             }
             $tpl = new Template('system');
             $tpl->assign('chispa', $this->s->getConfig('chispa'));
             $tpl->assign('site', $site);
             $tpl->assign('server', $server);
             $tpl->assign('changelog', $changelog);
             $tpl->assign('errorlog', $errorlog);
             $content = $tpl->fetch('info.html');
             break;
     }
     parent::buildSite($content);
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:31,代码来源:backend.class.php

示例10: Template

 function action_linkpopup($args)
 {
     global $config, $manager, $tree, $user, $lang;
     $tpl = new Template($this->getTemplate('main.template'));
     if ($config->get('multiLanguageSupport')) {
         @(include _BASE_LIBRARIES_ . 'resources/iso639to3166.php');
         $languages = array();
         $list = new languages(_DEFAULT_SITE_);
         while (list(, $language) = each($list->nodes)) {
             if ($language->public) {
                 $languages[] = array('id' => $language->id, 'name' => $language->name, 'flag' => strtolower($iso639to3166[$language->id]));
             }
         }
         $tpl->set('languages', $languages);
     }
     // Call the RetrieveObjects functions of each plugin
     if (count($args)) {
         $id = array_shift($args);
         $result = array();
         $files = array();
         $data = array('id' => intval($id), 'result' => &$result);
         $manager->handleEvent('RetrieveObjects', $data);
         while (list(, $entries) = each($result)) {
             $files = array_merge($files, $entries);
         }
         $tpl->set('files', $files);
     }
     echo $tpl->fetch();
     exit;
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:30,代码来源:plugin.php

示例11: switch

 function generate_inner_html()
 {
     $inner_template = NULL;
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_html.tpl';
     }
     if (!empty($this->profile_feeds)) {
         $counter = 0;
         foreach ($this->profile_feeds as $data) {
             $params = array('feed_id' => $data['feed_id']);
             $ExternalFeed = new ExternalFeed();
             try {
                 //Getting the feed data corresponding to the feed id
                 $this->profile_feeds[$counter]['links'] = $ExternalFeed->get_feed_data($params);
             } catch (PAException $e) {
                 //TODO: pending error handling if function fails.
                 //$error = $e->message;
             }
             $counter++;
         }
     }
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('profile_feeds', @$this->profile_feeds);
     $inner_html_gen->set('feed_id', $this->feed_id);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:28,代码来源:ViewFeedsModule.php

示例12: Template

 function filter_AddTitle($string, $template)
 {
     global $config;
     $tpl = new Template($this->getTemplate('title.template'));
     $tpl->set('title', $template->get('title'));
     return str_replace('{%TITLE%}', $tpl->fetch(), $string);
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:7,代码来源:plugin.php

示例13: Template

 /** !!
  * Uses the template in this directory to compute the innerHTML for this module.
  *
  * @return A string used by {@see render()} which is passed for display.
  */
 function generate_inner_html()
 {
     $tpl = new Template(PA::$blockmodule_path . '/' . get_class($this) . "/center_inner_public.tpl", $this);
     $tpl->set("test_blob", PA::$login_user->get_profile_field("echo_test_module", "test_blob"));
     $inner_html = $tpl->fetch();
     return $inner_html;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:12,代码来源:EchoTestModule.php

示例14: addslashes

 function event_ExecuteEditor(&$data)
 {
     global $lang, $manager;
     if ($data['sheet'] == 'background') {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $res = sql::query("\r\n\t\t\t\t\t\tREPLACE INTO \r\n\t\t\t\t\t\t\t" . _TABLE_PREFIX_ . "contents_background\r\n\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\tID='" . $data['params']['id'] . "', \r\n\t\t\t\t\t\t\trevision='" . $data['params']['revision'] . "',\r\n\t\t\t\t\t\t\timage='" . addslashes($_REQUEST['image']) . "', \r\n\t\t\t\t\t\t\tmodified=NOW()\r\n\t\t\t\t\t");
             // Mark this action as a modification
             revisions::updateModificationDate($data['params']['id'], $data['params']['revision']);
             header("Location: " . url::item($data['params']['id'], 'edit') . "/background?revision=" . $data['params']['revision']);
             exit;
         }
         $res = sql::query("\r\n\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t* \r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t\t" . _TABLE_PREFIX_ . "contents_background\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tid='" . $data['params']['id'] . "' AND\r\n\t\t\t\t\t\trevision='" . $data['params']['revision'] . "'\r\n\t\t\t\t");
         if ($row = sql::fetch_array($res)) {
             $image = $row['image'];
         } else {
             $image = '';
         }
         $tpl = new Template($this->getTemplate('editor.template'));
         $tpl->set('id', $data['params']['id']);
         $tpl->set('revision', $data['params']['revision']);
         $tpl->set('image', $image);
         $data['template']->append('content', $tpl->fetch());
         // Make sure the following assets are included
         $data['page']->assets->registerJavascript('/core/assets/javascript/modaldialog.js');
         $data['page']->assets->registerCSS($this->localAsset('editor.css'));
     }
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:27,代码来源:plugin.php

示例15: Pagination

 function generate_inner_html()
 {
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_prev = $Pagination->getPreviousPage();
     $this->page_next = $Pagination->getNextPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_template = NULL;
     switch ($this->mode) {
         case 'relations':
         case 'in_relations':
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_relation.tpl';
             break;
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_relation.tpl';
     }
     $obj_inner_template = new Template($inner_template, $this);
     $obj_inner_template->set_object('links', $this->links);
     $obj_inner_template->set_object('gid', @$this->gid);
     $obj_inner_template->set('sub_title', @$this->sub_title);
     $obj_inner_template->set('total', $this->Paging['count']);
     $obj_inner_template->set('reciprocated_relationship_set', @$this->reciprocated_relationship_set);
     $obj_inner_template->set('relations', @$this->relations);
     $obj_inner_template->set('in_relations', @$this->in_relations);
     $obj_inner_template->set('user_name', $this->page_user);
     $obj_inner_template->set('page_prev', $this->page_prev);
     $obj_inner_template->set('page_next', $this->page_next);
     $obj_inner_template->set('page_links', $this->page_links);
     $obj_inner_template->set('view_type', $this->view_type);
     $inner_html = $obj_inner_template->fetch();
     return $inner_html;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:32,代码来源:FaceBookModule.php


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