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


PHP Language::get方法代码示例

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


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

示例1: 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 v.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'] = $this->config->get('config_url') . 'image/' . $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(html_entity_decode(sprintf($language->get('text_subject'), $voucher['from_name']), ENT_QUOTES, 'UTF-8'));
				$mail->setHtml($html);
				$mail->send();
			}
		}
	}
开发者ID:halfhope,项目名称:ocStore,代码行数:59,代码来源:voucher.php

示例2: editOrder

 public function editOrder($order_id, $data)
 {
     $this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id = '" . (int) $data['order_status_id'] . "', date_modified = NOW() WHERE order_id = '" . (int) $order_id . "'");
     $this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int) $order_id . "', order_status_id = '" . (int) $data['order_status_id'] . "', notify = '" . (isset($data['notify']) ? (int) $data['notify'] : 0) . "', comment = '" . $this->db->escape(strip_tags($data['comment'])) . "', date_added = NOW()");
     if (isset($data['notify'])) {
         $query = $this->db->query("SELECT *, os.name AS status, l.code AS language FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_status os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) LEFT JOIN " . DB_PREFIX . "language l ON (o.language_id = l.language_id) WHERE o.order_id = '" . (int) $order_id . "'");
         if ($query->num_rows) {
             $language = new Language($query->row['language']);
             $language->load('customer/order');
             $subject = sprintf($language->get('mail_subject'), html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'), $order_id);
             $message = $language->get('mail_order') . ' ' . $order_id . "\n";
             $message .= $language->get('mail_date_added') . ' ' . date($language->get('date_format_short'), strtotime($query->row['date_added'])) . "\n\n";
             $message .= $language->get('mail_order_status') . "\n\n";
             $message .= $query->row['status'] . "\n\n";
             $message .= $language->get('mail_invoice') . "\n";
             $message .= html_entity_decode(HTTP_CATALOG . 'index.php?route=account/invoice&order_id=' . $order_id, ENT_QUOTES, 'UTF-8') . "\n\n";
             if (isset($data['comment'])) {
                 $message .= $language->get('mail_comment') . "\n\n";
                 $message .= strip_tags(html_entity_decode($data['comment'], ENT_QUOTES, 'UTF-8')) . "\n\n";
             }
             $message .= $language->get('mail_footer');
             $mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password'), ENT_QUOTES, 'UTF-8'), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
             $mail->setTo($query->row['email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender(html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'));
             $mail->setSubject($subject);
             $mail->setText($message);
             $mail->send();
         }
     }
 }
开发者ID:RepublicMaster,项目名称:opencart,代码行数:31,代码来源:order.php

示例3: addOp

	/**
	 * 充值添加
	 */
	public function addOp(){
		if (!chksubmit()){
		    //信息输出
		    Tpl::output('menu_sign','predepositrecharge');
		    Tpl::output('menu_sign_url','index.php?act=predeposit');
		    Tpl::output('menu_sign1','predeposit_rechargeadd');
		    Tpl::showpage('charge_pd.add');
		    exit();
		}
		$pdr_amount = abs(floatval($_POST['pdr_amount']));
		if ($pdr_amount <= 0) {
		    showMessage(Language::get('predeposit_recharge_add_pricemin_error'),'','html','error');
		}
        $model_pdr = Model('predeposit');
        $data = array();
        $data['pdr_sn'] = $pay_sn = $model_pdr->makeSn();
        $data['pdr_member_id'] = $_SESSION['member_id'];
        $data['pdr_member_name'] = $_SESSION['member_name'];
        $data['pdr_amount'] = $pdr_amount;
        $data['pdr_add_time'] = TIMESTAMP;
        $insert = $model_pdr->addPdRecharge($data);
        if ($insert) {
            //转向到商城支付页面
            redirect('index.php?act=buy&op=pd_pay&pay_sn='.$pay_sn);
        }
	}
开发者ID:noikiy,项目名称:travel,代码行数:29,代码来源:charge.php

示例4: __construct

 public function __construct() {
     parent::__construct();
     //检查是否开启
     if (intval(C('promotion_allow')) !== 1) {
         showMessage(Language::get('promotion_unavailable'), urlShop('seller_center', 'index'),'','error');
     }
 }
开发者ID:noikiy,项目名称:ejia,代码行数:7,代码来源:store_promotion_booth.php

示例5: __construct

	/**
	 * 闲置市场首页
	 */
	public function __construct(){
		parent::__construct();
		Language::read('home_flea_index');
		if($GLOBALS['setting_config']['flea_isuse']!='1'){
			showMessage(Language::get('flea_index_unable'),'index.php','','error');
		}
	}
开发者ID:noikiy,项目名称:ejia,代码行数:10,代码来源:flea.php

示例6: __construct

 /**
  * Class constructor
  */
 public function __construct()
 {
     //  folder cache
     $dir = ROOT_PATH . DATA_FOLDER . 'cache/';
     if (\File::makeDirectory($dir)) {
         $this->cache_dir = $dir;
         $this->cache_expire = self::$cfg->get('cache_expire', 5);
         // clear old cache every day
         $d = is_file($dir . 'index.php') ? file_get_contents($dir . 'index.php') : 0;
         if ($d != date('d')) {
             $this->clear();
             $f = @fopen($dir . 'index.php', 'wb');
             if ($f) {
                 fwrite($f, date('d'));
                 fclose($f);
             } else {
                 $message = sprintf(\Language::get('The file or folder %s can not be created or is read-only, please create or adjust the chmod it to 775 or 777.'), 'cache/index.php');
                 log_message('Warning', $message, __FILE__, __LINE__);
             }
         }
     } else {
         $message = sprintf(\Language::get('The file or folder %s can not be created or is read-only, please create or adjust the chmod it to 775 or 777.'), 'cache/');
         log_message('Warning', $message, __FILE__, __LINE__);
     }
 }
开发者ID:roongr2k7,项目名称:kotchasan,代码行数:28,代码来源:cache.php

示例7: indexOp

 /**
  * 分类列表
  */
 public function indexOp()
 {
     Language::read('home_category_index');
     $lang = Language::getLangContent();
     //得到分类类型
     $type = trim($_GET['type']);
     switch ($type) {
         case 'store':
             $model_sc = Model('store_class');
             $sc_list = $model_sc->getTreeList();
             //导航
             $nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_store_class']));
             $model_store = Model('store');
             //推荐店铺
             $recommend_store = $model_store->getRecommendStore(5);
             Tpl::output('recommend_store', $recommend_store);
             //最新店铺
             $new_store = $model_store->getNewStore(5);
             Tpl::output('new_store', $new_store);
             Tpl::output('nav_link_list', $nav_link);
             Tpl::output('sc_list', $sc_list);
             Tpl::showpage('category_store');
             break;
         default:
             //导航
             $nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_goods_class']));
             //分类
             $show_goods_class = ($g = F('goods_class')) ? $g : H('goods_class', true, 'file');
             Tpl::output('nav_link_list', $nav_link);
             Tpl::output('gc_list', $show_goods_class);
             Tpl::output('html_title', C('site_name') . ' - ' . Language::get('category_index_goods_class'));
             Tpl::showpage('category_goods');
             break;
     }
 }
开发者ID:my1977,项目名称:shopnc,代码行数:38,代码来源:category.php

示例8: showTip

 protected function showTip($msg, $url = '', $show_type = 'html', $msg_type = 'succ', $is_show = 1, $time = 2000)
 {
     /**
      * 如果默认为空,则跳转至上一步链接
      */
     $url = $url != '' ? $url : getReferer();
     $msg_type = in_array($msg_type, array('succ', 'error')) ? $msg_type : 'error';
     if (is_array($url)) {
         foreach ($url as $k => $v) {
             $url[$k]['url'] = $v['url'] ? $v['url'] : getReferer();
         }
     }
     /**
      * 读取信息布局的语言包
      */
     Language::read("msg");
     /**
      * html输出形式
      * 指定为指定项目目录下的error模板文件
      */
     Tpl::setDir('');
     Tpl::output('html_title', Language::get('nc_html_title'));
     Tpl::output('msg', $msg);
     Tpl::output('url', $url);
     Tpl::output('msg_type', $msg_type);
     Tpl::output('is_show', $is_show);
     Tpl::showpage('msg', $this->layout, $time);
     exit;
 }
开发者ID:noikiy,项目名称:shopnc-2,代码行数:29,代码来源:control.php

示例9: profile_menu

	/**
	 * 用户中心右边,小导航
	 *
	 * @param string	$menu_type	导航类型
	 * @param string 	$menu_key	当前导航的menu_key
	 * @param array 	$array		附加菜单
	 * @return
	 */
	private function profile_menu($menu_key='') {
		$menu_array = array(
			1=>array('menu_key'=>'voucher_list','menu_name'=>Language::get('nc_myvoucher'),'menu_url'=>'index.php?act=member_voucher&op=voucher_list'),
		);
		Tpl::output('member_menu',$menu_array);
		Tpl::output('menu_key',$menu_key);
    }
开发者ID:noikiy,项目名称:ejia,代码行数:15,代码来源:member_voucher.php

示例10: save

 function save()
 {
     $this->import_parameters();
     //we need to determine if this is a new client before we do the initial save (it won't be new once we do the
     //initial save
     $is_new = $this->is_new();
     //unset params that aren't saved to the db
     $this->unset_param('primary_contact_name');
     $this->unset_param('primary_contact_image');
     $result = parent::save();
     if ($is_new == true) {
         $primary_contact = new User($_POST['client']);
         $primary_contact->set('client_id', $this->id);
         $primary_contact->validate();
         if ($primary_contact->validation_passed()) {
             $primary_contact->save();
             //set the client email and the primary contact id
             $this->set('email', $primary_contact->email);
             $this->set('primary_contact_id', $primary_contact->id);
             parent::save();
         } else {
             $this->set_error('first_name', Language::get('errors.saving_primary_contact'));
             return false;
         }
     }
     return $result;
 }
开发者ID:neevan1e,项目名称:Done,代码行数:27,代码来源:client.php

示例11: getApps

 /**
  * 分享接口数组
  */
 public function getApps()
 {
     $app_arr = array();
     $app_arr['qqweibo'] = array('name' => Language::get('nc_shareset_qqweibo'), 'url' => "http://t.qq.com", 'applyurl' => 'http://dev.t.qq.com');
     $app_arr['sinaweibo'] = array('name' => Language::get('nc_shareset_sinaweibo'), 'url' => "http://www.weibo.com", 'applyurl' => 'http://open.weibo.com/developers');
     return $app_arr;
 }
开发者ID:xuxuecheng,项目名称:shopnc,代码行数:10,代码来源:sns_binding.model.php

示例12: payment_saveOp

 /**
  * 编辑保存
  */
 public function payment_saveOp()
 {
     $payment_id = intval($_POST["payment_id"]);
     $data = array();
     $data['payment_state'] = intval($_POST["payment_state"]);
     switch ($_POST['payment_code']) {
         case 'alipay':
             $payment_config = array('alipay_account' => $_POST['alipay_account'], 'alipay_key' => $_POST['alipay_key'], 'alipay_partner' => $_POST['alipay_partner']);
             break;
         case 'wxpay':
             $payment_config = array('wxpay_appid' => $_POST['wxpay_appid'], 'wxpay_mch_id' => $_POST['wxpay_mch_id'], 'wxpay_appsecret' => $_POST['wxpay_appsecret'], 'wxpay_key' => $_POST['wxpay_key']);
             break;
         case 'unionpay':
             $payment_config = array('unionpay_account' => $_POST['unionpay_account'], 'cert_passwd' => $_POST['cert_passwd']);
             break;
         default:
             showMessage(L('param_error'), '');
     }
     $data['payment_config'] = $payment_config;
     $model_mb_payment = Model('mb_payment');
     $result = $model_mb_payment->editMbPayment($data, array('payment_id' => $payment_id));
     if ($result) {
         showMessage(Language::get('nc_common_save_succ'), urlAdmin('mb_payment', 'payment_list'));
     } else {
         showMessage(Language::get('nc_common_save_fail'), urlAdmin('mb_payment', 'payment_list'));
     }
 }
开发者ID:qqq232575,项目名称:extends,代码行数:30,代码来源:mb_payment.php

示例13: modifypwOp

 /**
  * 修改密码
  */
 public function modifypwOp()
 {
     if (chksubmit()) {
         if (trim($_POST['new_pw']) !== trim($_POST['new_pw2'])) {
             //showMessage('两次输入的密码不一致,请重新输入');
             showMessage(Language::get('index_modifypw_repeat_error'));
         }
         $admininfo = $this->getAdminInfo();
         //查询管理员信息
         $admin_model = Model('admin');
         $admininfo = $admin_model->getOneAdmin($admininfo['id']);
         if (!is_array($admininfo) || count($admininfo) <= 0) {
             showMessage(Language::get('index_modifypw_admin_error'));
         }
         //旧密码是否正确
         if ($admininfo['admin_password'] != md5(trim($_POST['old_pw']))) {
             showMessage(Language::get('index_modifypw_oldpw_error'));
         }
         $new_pw = md5(trim($_POST['new_pw']));
         $result = $admin_model->updateAdmin(array('admin_password' => $new_pw, 'admin_id' => $admininfo['admin_id']));
         if ($result) {
             showMessage(Language::get('index_modifypw_success'));
         } else {
             showMessage(Language::get('index_modifypw_fail'));
         }
     } else {
         Language::read('admin');
         Tpl::showpage('admin.modifypw');
     }
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:33,代码来源:index.php

示例14: share_saveOp

 /**
  * 分享保存
  **/
 public function share_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $share_id = intval($_POST['share_id']);
     $share_type = $_GET['type'];
     if ($share_id <= 0 || empty($share_type) || mb_strlen($_POST['commend_message']) > 140) {
         showDialog(Language::get('wrong_argument'), 'reload', 'fail', '');
     }
     if (!empty($_SESSION['member_id'])) {
         $model = Model('cms_' . $share_type);
         $model->modify(array($share_type . '_share_count' => array('exp', $share_type . '_share_count+1')), array($share_type . '_id' => $share_id));
         //分享内容
         if (isset($_POST['share_app_items'])) {
             $info['commend_message'] = $_POST['commend_message'];
             $info['share_title'] = $_POST['share_title'];
             $info['share_image'] = $_POST['share_image'];
             if (empty($info['commend_message'])) {
                 $info['commend_message'] = Language::get('share_text');
             }
             $info['url'] = CMS_SITE_URL . DS . "index.php?act={$_GET['type']}&op={$_GET['type']}_detail&{$_GET['type']}_id=" . $_POST['share_id'];
             self::share_app_publish($info);
         }
         showDialog(Language::get('nc_common_save_succ'), '', 'succ', '');
     } else {
         showDialog(Language::get('no_login'), 'reload', 'fail', '');
     }
 }
开发者ID:ff00x0,项目名称:shopnc-api,代码行数:31,代码来源:share.php

示例15: editOp

 /**
  * 编辑
  */
 public function editOp()
 {
     $model_payment = Model('payment');
     if (chksubmit()) {
         $payment_id = intval($_POST["payment_id"]);
         $data = array();
         $data['payment_state'] = intval($_POST["payment_state"]);
         $payment_config = '';
         $config_array = explode(',', $_POST["config_name"]);
         //配置参数
         if (is_array($config_array) && !empty($config_array)) {
             $config_info = array();
             foreach ($config_array as $k) {
                 $config_info[$k] = trim($_POST[$k]);
             }
             $payment_config = serialize($config_info);
         }
         $data['payment_config'] = $payment_config;
         //支付接口配置信息
         $model_payment->editPayment($data, array('payment_id' => $payment_id));
         showMessage(Language::get('nc_common_save_succ'), 'index.php?act=payment&op=index');
     }
     $payment_id = intval($_GET["payment_id"]);
     $payment = $model_payment->getPaymentInfo(array('payment_id' => $payment_id));
     if ($payment['payment_config'] != '') {
         Tpl::output('config_array', unserialize($payment['payment_config']));
     }
     Tpl::output('payment', $payment);
     Tpl::showpage('payment.edit');
 }
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:33,代码来源:payment.php


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