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


PHP locale::instance方法代码示例

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


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

示例1: mime_mail

 function mime_mail()
 {
     $this->html_images = array();
     $this->headers = array();
     $this->is_built = false;
     $this->image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash');
     $locale =& locale::instance();
     $this->build_params['html_encoding'] = '8bit';
     $this->build_params['text_encoding'] = '8bit';
     $this->build_params['html_charset'] = $locale->get_charset();
     $this->build_params['text_charset'] = $locale->get_charset();
     $this->build_params['head_charset'] = $locale->get_charset();
     $this->build_params['text_wrap'] = 998;
     if (!empty($_SERVER['HTTP_HOST'])) {
         $helo = $_SERVER['HTTP_HOST'];
     } elseif (!empty($_SERVER['SERVER_NAME'])) {
         $helo = $_SERVER['SERVER_NAME'];
     } else {
         $helo = 'localhost';
     }
     $this->smtp_params['host'] = 'localhost';
     $this->smtp_params['port'] = 25;
     $this->smtp_params['helo'] = $helo;
     $this->smtp_params['auth'] = false;
     $this->smtp_params['user'] = '';
     $this->smtp_params['pass'] = '';
     $this->headers['MIME-Version'] = '1.0';
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:28,代码来源:mime_mail.class.php

示例2: instance

	function get_cart_summ()
	{
		$cart =& cart :: instance();
		$locale = locale :: instance();
		
		return number_format($cart->get_total_summ(), $locale->fract_digits, $locale->decimal_symbol, $locale->thousand_separator);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:cart_summ_component.class.php

示例3: run

  function run(&$filter_chain, &$request, &$response) 
  {
    debug :: add_timing_point('locale filter started');
    
    if(!$node = map_request_to_node($request))
    {
    	define('CONTENT_LOCALE_ID', DEFAULT_CONTENT_LOCALE_ID);
    	define('MANAGEMENT_LOCALE_ID', CONTENT_LOCALE_ID);
    	
    	$locale =& locale :: instance();    	
    	$locale->setlocale();
    	
      $filter_chain->next();
      return;
    }
          
    if($object_locale_id = site_object :: get_locale_by_id($node['object_id']))
    	define('CONTENT_LOCALE_ID', $object_locale_id);
    else
      define('CONTENT_LOCALE_ID', DEFAULT_CONTENT_LOCALE_ID);
    
    $user = user :: instance();
    if($user_locale_id = $user->get_locale_id())
    	define('MANAGEMENT_LOCALE_ID', $user_locale_id);
    else
      define('MANAGEMENT_LOCALE_ID', CONTENT_LOCALE_ID);
              
    debug :: add_timing_point('locale filter finished');

  	$locale =& locale :: instance();    	
  	$locale->setlocale();
    
    $filter_chain->next();
  }   
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:locale_definition_filter.class.php

示例4: instance

	function _set_period_filter()
	{
		$locale =& locale :: instance();
		$start_date = new date();
		$start_date->set_hour(0);
		$start_date->set_minute(0);
		$start_date->set_second(0);

		if (isset($_REQUEST['stats_start_date']))
		{
			$start_date->set_by_string($_REQUEST['stats_start_date'], $locale->get_short_date_time_format());
		}
		
		$finish_date = new date();

		if (isset($_REQUEST['stats_finish_date']))
		{
			$finish_date->set_by_string($_REQUEST['stats_finish_date'], $locale->get_short_date_time_format());
		}

		$finish_date->set_hour(23);
		$finish_date->set_minute(59);
		$finish_date->set_second(59);
		
		$this->stats_report->set_period_filter($start_date, $finish_date);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:stats_search_engines_list_datasource.class.php

示例5: setUp

 function setUp()
 {
     $this->report = new Mockstats_referers_report($this);
     $this->ds = new stats_referers_except_groups_list_datasource_test_version($this);
     $this->ds->setReturnReference('_create_referers_report', $this->report);
     $this->ds->stats_referers_list_datasource();
     $this->locale =& locale::instance();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:stats_referers_except_groups_list_datasource_test.class.php

示例6: check

 function check($value)
 {
     $locale =& locale::instance();
     $date =& new date();
     $date->set_by_string($value, $locale->get_short_date_format());
     if (!$date->is_valid()) {
         $this->error('INVALID_DATE');
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:locale_date_rule.class.php

示例7: locale_format

 function locale_format($number, $locale_string = null)
 {
     $locale = locale::instance($locale_string);
     $neg = $number < 0;
     $num = $neg ? -$number : $number;
     $num_text =& number_format($num, $locale->get_currency_fract_digits(), $locale->get_currency_decimal_symbol(), $locale->get_currency_thousand_separator());
     $text =& utf8_str_replace(array('%c', '%p', '%q'), array($locale->get_currency_symbol(), $neg ? $locale->get_currency_negative_symbol() : $locale->get_currency_positive_symbol(), $num_text), $neg ? $locale->get_currency_negative_format() : $locale->get_currency_positive_format());
     return $text;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:currency.class.php

示例8: format

 function format()
 {
     if ($this->format_string) {
         $format_string = $this->format_string;
     } else {
         $locale =& locale::instance($this->locale_type);
         $format_string = $locale->get_short_date_format();
     }
     echo $this->date->format($format_string);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:locale_date_format_component.class.php

示例9: _set_period_filter

 function _set_period_filter(&$request)
 {
     $locale =& locale::instance();
     $start_date = new date();
     $start_date->set_hour(0);
     $start_date->set_minute(0);
     $start_date->set_second(0);
     if ($stats_start_date = $request->get_attribute('stats_start_date')) {
         $start_date->set_by_string($stats_start_date, $locale->get_short_date_time_format());
     }
     $finish_date = new date();
     if ($stats_finish_date = $request->get_attribute('stats_finish_date')) {
         $finish_date->set_by_string($stats_finish_date, $locale->get_short_date_time_format());
     }
     $finish_date->set_hour(23);
     $finish_date->set_minute(59);
     $finish_date->set_second(59);
     $this->stats_report->set_period_filter($start_date, $finish_date);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:stats_pages_list_datasource.class.php

示例10: _get_mail_body

 function _get_mail_body($template_path)
 {
     $template = new template($template_path);
     $locale =& locale::instance();
     $date = new date();
     $template->set('date', $date->format($locale->get_short_date_format()));
     $cart =& cart::instance();
     $list =& $template->find_child('cart_items');
     $list->register_dataset($cart->get_items_array_dataset());
     $template->set('name', $this->dataspace->get('name'));
     $template->set('notes', $this->dataspace->get('notes'));
     $template->set('phone', $this->dataspace->get('phone'));
     $template->set('address', $this->dataspace->get('address'));
     $template->set('email', $this->dataspace->get('email'));
     ob_start();
     $template->display();
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:20,代码来源:checkout_cart_order_action.class.php

示例11: format

 function format($value)
 {
     $locale =& locale::instance();
     if (!isset($this->attributes['fract_digits']) || !$this->attributes['fract_digits']) {
         $fract_digits = $locale->fract_digits;
     } else {
         $fract_digits = (int) $this->attributes['fract_digits'];
     }
     if (!isset($this->attributes['decimal_symbol']) || !$this->attributes['decimal_symbol']) {
         $decimal_symbol = $locale->decimal_symbol;
     } else {
         $decimal_symbol = $this->attributes['dec_point'];
     }
     if (!isset($this->attributes['thousand_separator']) || !$this->attributes['thousand_separator']) {
         $thousand_separator = $locale->thousand_separator;
     } else {
         $thousand_separator = $this->attributes['thousand_separator'];
     }
     return number_format($value, $fract_digits, $decimal_symbol, $thousand_separator);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:20,代码来源:locale_number_format_component.class.php

示例12: get_current_locale_code

 function get_current_locale_code()
 {
     $locale =& locale::instance();
     return $locale->locale_code();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:5,代码来源:locale.class.php

示例13: get_available_locales_data

 function get_available_locales_data()
 {
     if (isset($GLOBALS['AVAILABLE_LOCALES']) && is_array($GLOBALS['AVAILABLE_LOCALES'])) {
         $available_locales = $GLOBALS['AVAILABLE_LOCALES'];
     } else {
         return array();
     }
     $locales_data = array();
     foreach ($available_locales as $locale_id) {
         $locale_data =& locale::instance($locale_id);
         $locales_data[$locale_id] = $locale_data->get_language_name() ? $locale_data->get_language_name() : $locale_id;
     }
     return $locales_data;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:14,代码来源:locale.class.php

示例14: instance

	function get_value()
	{		
		$form =& $this->find_parent_by_class('form_component');
		
		$value = parent :: get_value();

		if(empty($value))
			$value = $this->get_attribute('default_value');		
		
		if($form->is_first_time())
		{				
			$locale =& locale :: instance();
			$date =& new date($value);
			
			$value = $date->format($locale->get_short_date_format());
		}
			
		return $value;
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:date_component.class.php

示例15: start_user_session

require_once LIMB_DIR . 'core/lib/date/date.class.php';
require_once LIMB_DIR . 'core/lib/util/mime_type.class.php';
require_once LIMB_DIR . 'core/model/chat/chat_user.class.php';
require_once LIMB_DIR . 'core/model/chat/chat_system.class.php';
require_once LIMB_DIR . 'core/model/chat/smiles.class.php';
start_user_session();
$smiles =& new smiles();
$chat_user_data = chat_user::get_chat_user_data();
chat_system::update_user_time($chat_user_data['id']);
$last_message_ids = session::get("last_message_ids");
if (!($last_message_id = $last_message_ids[$chat_user_data['chat_room_id']])) {
    $last_message_id = 0;
}
$messages = chat_system::get_messages_for_user($chat_user_data['id'], $chat_user_data['chat_room_id'], $last_message_id);
$date =& new date();
$locale =& locale::instance($this->locale_type);
$format_string = $locale->get_short_date_time_format();
echo "<html>\r\n\t\t\t<script>";
foreach ($messages as $message) {
    $message_text = $smiles->decode_smiles($message['message']);
    $message_text = str_replace("\r", "", $message_text);
    $message_text = str_replace("\n", "<br>", $message_text);
    $message_color = $message['color'];
    $sender_name = $message['nickname'];
    $date->set_by_stamp($message['time']);
    $message_date = $date->format($format_string);
    switch (true) {
        case $message['sender_id'] == -1:
            list($message_type, $string) = explode(':', $message['message'], 2);
            if ($message_type == 'system_message') {
                echo "top.add_system_message('{$message_date}', {$message['id']}, '{$string}');\n";
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:get_messages.php


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