本文整理汇总了PHP中Language::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getVar方法的具体用法?PHP Language::getVar怎么用?PHP Language::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->load->model('catalog/information');
$this->data['type'] = 'information';
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array('text' => Language::getVar('SUMO_NOUN_HOME'), 'href' => $this->url->link('common/home'), 'separator' => false);
if (isset($this->request->get['information_id'])) {
$information_id = (int) $this->request->get['information_id'];
} else {
$information_id = 0;
}
$information_info = $this->model_catalog_information->getInformation($information_id);
if ($information_info) {
$this->document->setTitle($information_info['title']);
if (!empty($information_info['parent_id'])) {
$parent = $this->model_catalog_information->getInformation($information_info['parent_id']);
$this->data['breadcrumbs'][] = array('text' => $parent['title'], 'href' => $this->url->link('information/information', 'information_id=' . $parent['information_id']));
}
$this->data['breadcrumbs'][] = array('text' => $information_info['title'], 'href' => $this->url->link('information/information', 'information_id=' . $information_id));
$this->data['heading_title'] = $information_info['title'];
$this->data['description'] = html_entity_decode($information_info['description'], ENT_QUOTES, 'UTF-8');
$this->data['settings'] = $this->config->get('details_information_information_' . $this->config->get('template'));
if (!is_array($this->data['settings']) || !count($this->data['settings'])) {
$this->data['settings']['left'][] = $this->getChild('app/widgetsimplesidebar/', array('type' => 'informationTree', 'data' => $information_info));
$this->data['settings']['left'][] = $this->getChild('app/widgetsimplesidebar/', array('type' => 'usp', 'location' => 'information'));
$this->data['settings']['left'][] = $this->getChild('app/widgetsimplesidebar/', array('type' => 'banner', 'location' => 'information', 'data' => $information_info));
$this->data['settings']['bottom'][] = $this->getChild('app/widgetsimpleproduct/', array('type' => 'latest', 'limit' => 6));
}
$this->template = 'information/content.tpl';
$this->children = array('common/footer', 'common/header');
$this->response->setOutput($this->render());
} else {
$this->redirect($this->url->link('error/not_found'));
}
}
示例2: getQuote
function getQuote($address)
{
$this->language->load('shipping/item');
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('item_geo_zone_id') . "' AND country_id = '" . (int) $address['country_id'] . "' AND (zone_id = '" . (int) $address['zone_id'] . "' OR zone_id = '0')");
if (!$this->config->get('item_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
$method_data = array();
if ($status) {
$items = 0;
foreach ($this->cart->getProducts() as $product) {
if ($product['shipping']) {
$items += $product['quantity'];
}
}
$quote_data = array();
$quote_data['item'] = array('code' => 'item.item', 'title' => Language::getVar('SUMO_SIHPPING_ITEM_DESCRIPTION'), 'cost' => $this->config->get('item_cost') * $items, 'tax_class_id' => $this->config->get('item_tax_class_id'), 'text' => $this->currency->format($this->tax->calculate($this->config->get('item_cost') * $items, $this->config->get('item_tax_class_id'), $this->config->get('config_tax'))));
$method_data = array('code' => 'item', 'title' => Language::getVar('SUMO_SHIPPING_ITEM_TITLE'), 'quote' => $quote_data, 'sort_order' => $this->config->get('item_sort_order'), 'error' => false);
}
return $method_data;
}
示例3: builder
public function builder()
{
if (empty($this->request->get['theme'])) {
$this->redirect($this->url->link('settings/themes', '', 'SSL'));
exit;
}
if (empty($this->request->get['store_id'])) {
$this->request->get['store_id'] = 0;
}
$theme = $this->request->get['theme'];
$this->document->setTitle(Language::getVar('SUMO_ADMIN_THEMES_BUILDER'));
$this->document->addBreadcrumbs(array('text' => Language::getVar('SUMO_ADMIN_SETTINGS_DASHBOARD'), 'href' => $this->url->link('settings/dashboard', '', 'SSL')));
$this->document->addBreadcrumbs(array('text' => Language::getVar('SUMO_ADMIN_THEMES_SETTINGS'), 'href' => $this->url->link('settings/themes/', '', 'SSL')));
$this->document->addBreadcrumbs(array('text' => Language::getVar('SUMO_ADMIN_THEMES_BUILDER')));
$this->document->addScript('view/js/jquery/jquery.ajaxupload.js');
$this->data['stores'] = $this->model_settings_stores->getStores();
$this->data['current_store'] = isset($this->request->get['store_id']) ? $this->request->get['store_id'] : 0;
if (empty($this->request->get['action'])) {
$this->request->get['action'] = 'colors';
}
$action = $this->request->get['action'];
if (!method_exists($this, $action)) {
Logger::warning('It seems ' . $action . ' is not callable?');
$action = 'colors';
}
$this->data['action'] = $action;
$this->data['theme'] = $theme;
$this->data['content'] = $this->{$action}($this->data['current_store'], $this->data['theme']);
$this->template = 'settings/themes/builder.tpl';
$this->children = array('common/header', 'common/footer');
//$this->data['content'] = $this->data[$action];
$this->response->setOutput($this->render());
}
示例4: ajaxGetList
public function ajaxGetList()
{
usleep(5000);
$type = !empty($this->request->post['type']) ? $this->request->post['type'] : '';
if (!empty($type) && in_array($type, $this->types)) {
$data = array();
$tmp = Database::fetchAll("SELECT name, " . $type . "_id AS id, language_id FROM PREFIX_" . $type);
if (!count($tmp)) {
$data['isEmpty'] = Language::getVar('SUMO_ADMIN_STATUS_SETTINGS_EMPTY');
} else {
// Default language first
foreach ($tmp as $list) {
if ($list['language_id'] == $this->config->get('language_id')) {
$data['return'][$list['id']] = $list;
}
}
// Secondary language?
foreach ($tmp as $list) {
if (!isset($data['return'][$list['id']])) {
if (!empty($list['name'])) {
$data['return'][$list['id']] = $list;
}
}
}
// Yeah well, we tried everything....
foreach ($tmp as $list) {
if (!isset($data['return'][$list['id']])) {
$list['name'] = Language::getVar('SUMO_NOUN_EMPTY');
$data['return'][$list['id']] = $list;
}
}
}
$this->response->setOutput(json_encode($data));
}
}
示例5: index
protected function index()
{
$this->language->load('module/affiliate');
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['text_register'] = Language::getVar('SUMO_ACCOUNT_REGISTER_TITLE');
$this->data['text_login'] = Language::getVar('SUMO_ACCOUNT_LOGIN_TITLE');
$this->data['text_logout'] = Language::getVar('SUMO_ACCOUNT_LOGOUT_TITLE');
$this->data['text_forgotten'] = Language::getVar('SUMO_ACCOUNT_FORGOTTEN_TITLE');
$this->data['text_account'] = Language::getVar('SUMO_ACCOUNT_TITLE');
$this->data['text_edit'] = $this->language->get('text_edit');
$this->data['text_password'] = $this->language->get('text_password');
$this->data['text_payment'] = $this->language->get('text_payment');
$this->data['text_tracking'] = $this->language->get('text_tracking');
$this->data['text_transaction'] = $this->language->get('text_transaction');
$this->data['logged'] = $this->affiliate->isLogged();
$this->data['register'] = $this->url->link('affiliate/register', '', 'SSL');
$this->data['login'] = $this->url->link('affiliate/login', '', 'SSL');
$this->data['logout'] = $this->url->link('affiliate/logout', '', 'SSL');
$this->data['forgotten'] = $this->url->link('affiliate/forgotten', '', 'SSL');
$this->data['account'] = $this->url->link('affiliate/account', '', 'SSL');
$this->data['edit'] = $this->url->link('affiliate/edit', '', 'SSL');
$this->data['password'] = $this->url->link('affiliate/password', '', 'SSL');
$this->data['payment'] = $this->url->link('affiliate/payment', '', 'SSL');
$this->data['tracking'] = $this->url->link('affiliate/tracking', '', 'SSL');
$this->data['transaction'] = $this->url->link('affiliate/transaction', '', 'SSL');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/affiliate.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/affiliate.tpl';
} else {
$this->template = 'default/template/module/affiliate.tpl';
}
$this->render();
}
示例6: getCustomerGroups
public function getCustomerGroups($data = array())
{
$sql = 'SELECT * FROM PREFIX_customer_group';
$sortData = array('sort_order');
if (isset($data['sort']) && in_array($data['sort'], $sortData)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY sort_order";
}
if (isset($data['order']) && $data['order'] == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int) $data['start'] . "," . (int) $data['limit'];
}
$return = array();
foreach ($this->fetchAll($sql) as $list) {
$description = $this->query("SELECT *\n FROM PREFIX_customer_group_description\n WHERE language_id = :lang\n AND customer_group_id = :group", array('lang' => $this->config->get('language_id'), 'group' => $list['customer_group_id']))->fetch();
if (is_array($description)) {
$list = array_merge($description, $list);
} else {
$list['name'] = Language::getVar('SUMO_NOUN_UNKNOWN');
}
$return[$list['customer_group_id']] = $list;
}
return $return;
}
示例7: index
public function index()
{
$this->document->addBreadcrumbs(array('text' => Language::getVar('SUMO_ADMIN_CMS_DASHBOARD')));
$this->template = 'dashboard/index.tpl';
$this->children = array('common/header', 'common/footer');
$this->response->setOutput($this->render());
}
示例8: addCustomer
public function addCustomer($data)
{
$this->load->model('account/customer_group');
if (empty($data['customer_group_id'])) {
$data['customer_group_id'] = $this->config->get('customer_group_id');
}
$group_info = $this->model_account_customer_group->getCustomerGroup($data['customer_group_id']);
$salt = substr(md5(uniqid(rand(), true) . $this->request->server['REMOTE_ADDR']), 0, 9);
$data['birthdate'] = date('Y-m-d', strtotime($data['birthdate']));
$this->query("INSERT INTO PREFIX_customer\n SET store_id = :store_id,\n firstname = :firstname,\n middlename = :middlename,\n lastname = :lastname,\n birthdate = :birthdate,\n email = :email,\n telephone = :telephone,\n mobile = :mobile,\n gender = :gender,\n fax = :fax,\n salt = :salt,\n password = :password,\n newsletter = :newsletter,\n customer_group_id = :group_id,\n language_id = :language_id,\n ip = :ip,\n status = 1,\n approved = :approval,\n date_added = :date", array('store_id' => $this->config->get('store_id'), 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'lastname' => $data['lastname'], 'birthdate' => $data['birthdate'], 'email' => $data['email'], 'telephone' => $data['telephone'], 'mobile' => $data['mobile'], 'gender' => $data['gender'], 'fax' => $data['fax'], 'salt' => $salt, 'password' => sha1($salt . sha1($salt . sha1($data['password']))), 'newsletter' => $data['newsletter'], 'ip' => $this->request->server['REMOTE_ADDR'], 'group_id' => $data['customer_group_id'], 'language_id' => $this->config->get('language_id'), 'approval' => !$group_info['approval'], 'date' => date('Y-m-d H:i:s')));
$customer_id = $this->lastInsertId();
if (!$customer_id) {
Logger::error('[ACCOUNT/CUSTOMER] The customer could not be created');
Logger::error(print_r(self::$connection->errorInfo(), true));
return false;
}
$this->query("INSERT INTO PREFIX_address\n SET customer_id = :id,\n firstname = :firstname,\n middlename = :middlename,\n lastname = :lastname,\n company = :company,\n company_id = :cid,\n tax_id = :tax,\n address_1 = :address_1,\n number = :number,\n addon = :addon,\n address_2 = :address_2,\n postcode = :postcode,\n city = :city,\n country_id = :country_id,\n zone_id = :zone_id", array('id' => $customer_id, 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'lastname' => $data['lastname'], 'company' => $data['company'], 'cid' => $data['company_id'], 'tax' => $data['tax_id'], 'address_1' => $data['address_1'], 'number' => $data['number'], 'addon' => $data['addon'], 'address_2' => $data['address_2'], 'postcode' => $data['postcode'], 'city' => $data['city'], 'country_id' => $data['country_id'], 'zone_id' => $data['zone_id']));
$address_id = $this->lastInsertId();
$this->query("UPDATE PREFIX_customer SET address_id = :aid WHERE customer_id = :cid", array('aid' => $address_id, 'cid' => $customer_id));
if ($group_info['approval']) {
$message = Language::getVar('SUMO_ACCOUNT_WAIT_FOR_APPROVAL');
} else {
$message = Language::getVar('SUMO_ACCOUNT_GO_TO_LOGIN', $this->url->link('account/login', '', 'SSL'));
}
Mailer::setCustomer($data);
$template = Mailer::getTemplate('account_register');
$template['content'] = str_replace('{approvalOrLogin}', $message, $template['content']);
Mail::setTo($data['email']);
Mail::setSubject($template['title']);
Mail::setHtml($template['content']);
Mail::send();
if ($this->config->get('admin_notify_email')) {
$sendTo = array($this->config->get('email'));
$extra = $this->config->get('extra_notify_email');
if (!empty($extra)) {
$extra = explode(',', $extra);
foreach ($extra as $mail) {
if (!empty($mail) && filter_var($mail, \FILTER_VALIDATE_EMAIL)) {
$sendTo[] = $mail;
}
}
}
$template = Mailer::getTemplate('account_register_admin_notify');
if ($group_info['approval']) {
$template['content'] = str_replace('{action}', Language::getVar('SUMO_ADMIN_ACTIVATE_ACCOUNT', $this->url->link('account/login')), $template['content']);
} else {
$template['content'] = str_replace('{action}', '', $template['content']);
}
foreach ($sendTo as $to) {
Mail::setTo($to);
Mail::setSubject($template['title']);
Mail::setHtml($template['content']);
Mail::send();
}
}
Cache::removeAll();
return $customer_id;
}
示例9: index
protected function index($setting)
{
$this->data['heading_title'] = Language::getVar('SUMO_PRODUCT_BESTSELLER');
$this->load->model('catalog/product');
$this->load->model('tool/image');
if ($this->registry->get('builder')) {
$this->data['settings'] = Cache::find('builder');
}
$this->data['products'] = array();
$results = $this->model_catalog_product->getBestSellerProducts($setting['limit']);
foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
} else {
$image = false;
}
$swapimages = $this->model_catalog_product->getProductImages($result['product_id']);
if ($swapimages) {
$swapimage = $this->model_tool_image->resize($swapimages[0]['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'), 'h');
} else {
$swapimage = false;
}
if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}
if ((double) $result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}
if ($this->config->get('config_review_status')) {
$rating = $result['rating'];
} else {
$rating = false;
}
if ($result['reviews']) {
if ($result['reviews'] > 1) {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_PLURAL', $result['reviews']);
} else {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_SINGULAR');
}
} else {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_NONE');
}
$this->data['products'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'thumb_swap' => $swapimage, 'name' => $result['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => $reviews, 'href' => $this->url->link('product/product', 'path=' . $result['category_id'] . '&product_id=' . $result['product_id']));
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/bestseller.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/bestseller.tpl';
} else {
$this->template = 'default/template/module/bestseller.tpl';
}
if (count($this->data['products'])) {
$this->render();
}
}
示例10: index
protected function index($setting)
{
$this->data['heading_title'] = Language::getVar('SUMO_PRODUCT_FEATURED');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$this->data['products'] = array();
$products = explode(',', $this->config->get('featured_product'));
if (empty($setting['limit'])) {
$setting['limit'] = 5;
}
$this->data['products'] = array();
//$products = array_slice($products, 0, (int)$setting['limit']);
$i = 0;
foreach ($products as $nr => $product_id) {
$product_info = $this->model_catalog_product->getProduct($product_id);
if ($product_info && $i++ <= (int) $setting['limit']) {
if ($product_info['image']) {
$image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']);
} else {
$image = false;
}
if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}
if ((double) $product_info['special']) {
$special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}
if ($this->config->get('config_review_status')) {
$rating = $product_info['rating'];
} else {
$rating = false;
}
if ($result['reviews']) {
if ($result['reviews'] > 1) {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_PLURAL', $result['reviews']);
} else {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_SINGULAR');
}
} else {
$reviews = Language::getVar('SUMO_PRODUCT_REVIEWS_NONE');
}
$this->data['products'][] = array('product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => $reviews, 'href' => $this->url->link('product/product', 'path=' . $result['category_id'] . '&product_id=' . $result['product_id']));
}
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/featured.tpl';
} else {
$this->template = 'default/template/module/featured.tpl';
}
if (count($this->data['products'])) {
$this->render();
}
}
示例11: index
public function index()
{
$this->document->setTitle(Language::getVar('SUMO_ERROR_NOT_FOUND_TITLE'));
$this->data['heading_title'] = Language::getVar('SUMO_ERROR_NOT_FOUND_TITLE');
$this->data['text_not_found'] = Language::getVar('SUMO_ERROR_NOT_FOUND_CONTENT');
$this->document->addBreadcrumbs(array('text' => Language::getVar('SUMO_ERROR_NOT_FOUND_TITLE')));
$this->template = 'error/not_found.tpl';
$this->children = array('common/header', 'common/footer');
$this->response->setOutput($this->render());
}
示例12: index
public function index()
{
$this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
$this->document->setTitle(Language::getVar('SUMO_ERROR_NOT_FOUND_TITLE'));
$this->data['title'] = Language::getVar('SUMO_ERROR_NOT_FOUND_TITLE');
$this->data['content'] = Language::getVar('SUMO_ERROR_NOT_FOUND_CONTENT');
$this->data['continue'] = $this->url->link('common/home');
$this->template = 'error/not_found.tpl';
$this->children = array('common/footer', 'common/header');
$this->response->setOutput($this->render());
}
示例13: validate
protected function validate()
{
$cookie = isset($_POST['remember']) && $_POST['remember'] == 'on' ? 1 : 0;
if (isset($this->request->post['username']) && isset($this->request->post['password']) && !$this->user->login($this->request->post['username'], $this->request->post['password'], $cookie)) {
$this->error['warning'] = Language::getVar('SUMO_ADMIN_LOGIN_ERROR');
}
if (!$this->error) {
return true;
}
return false;
}
示例14: info
public function info()
{
$this->document->setTitle(Language::getVar('SUMO_MAINTENANCE_TITLE'));
$this->data['title'] = Language::getVar('SUMO_MAINTENANCE_TITLE');
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array('text' => Language::getVar('SUMO_MAINTENANCE_TITLE'), 'href' => $this->url->link('common/maintenance'));
$this->data['debug'] = false;
$this->template = 'error/not_found.tpl';
$this->children = array('common/footer', 'common/header');
$this->response->setOutput($this->render());
}
示例15: validate
protected function validate()
{
if (!isset($this->request->post['email']) || empty($this->request->post['email']) || !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {
$this->error['warning'] = Language::getVar('SUMO_ERROR_MAIL_NOT_KNOWN');
} elseif (!$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])) {
$this->error['warning'] = Language::getVar('SUMO_ERROR_MAIL_NOT_KNOWN');
}
if (!$this->error) {
return true;
}
return false;
}