Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Localization Class.
|
||||
*
|
||||
* Used for handling language text, money formatting, etc.
|
||||
* Last Updated: $Date: 2010-10-06 06:09:32 -0400 (Wed, 06 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-07-19 19:39:43 -0400 (Tue, 19 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Joshua Williams <josh@invisionpower.com>
|
||||
* @version $Rev: 6946 $
|
||||
* @author Joshua Williams
|
||||
* @version $Rev: 9291 $
|
||||
* @since 1.0
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @link http://www.invisionpower.com
|
||||
* @license This is NULLED!
|
||||
* @link http://hatynka.in
|
||||
* @package IP.Board
|
||||
*/
|
||||
|
||||
@@ -42,11 +42,15 @@ class class_localization
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
@@ -84,10 +88,10 @@ class class_localization
|
||||
/**
|
||||
* Offset has been set
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
private $offset_set;
|
||||
protected $offset_set;
|
||||
|
||||
/**
|
||||
* Determines if lang entries are loaded from the db or the filesystem
|
||||
@@ -100,17 +104,17 @@ class class_localization
|
||||
/**
|
||||
* Force UK/English language
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
private $_forceEnglish = false;
|
||||
protected $_forceEnglish = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param string [$lang] Language file to load, english by default
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -209,7 +213,7 @@ class class_localization
|
||||
// Did we choose a language?
|
||||
//--------------------------------
|
||||
|
||||
if ( isset( $this->request['setlanguage'] ) AND $this->request['setlanguage'] AND $this->request['langid'] )
|
||||
if ( !empty( $this->request['setlanguage'] ) AND $this->request['langid'] )
|
||||
{
|
||||
/* Forcing english? */
|
||||
if ( $this->request['langid'] == '__english__' )
|
||||
@@ -366,7 +370,7 @@ class class_localization
|
||||
$actual = array($this->local_data['decimal_point'], $this->local_data['thousands_sep']);
|
||||
|
||||
// format number with placeholders
|
||||
$formatted = number_format($number, $places, $placeholders[0], $placeholders[1]);
|
||||
$formatted = number_format((float)$number, $places, $placeholders[0], $placeholders[1]);
|
||||
|
||||
// replace by localized characters
|
||||
if( strpos( strtolower( PHP_OS ), 'win' ) === 0 )
|
||||
@@ -385,7 +389,7 @@ class class_localization
|
||||
* @param string [$format] Type of formatting to use: short or long
|
||||
* @param bool [$relative] Determines if date will be displayed in relative format
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
public function formatTime( $ts=0, $format='short', $relative=1 )
|
||||
{
|
||||
return $this->getDate( $ts, strtoupper( $format ), $relative ? 0 : 1 );
|
||||
@@ -667,7 +671,7 @@ class class_localization
|
||||
$r += ($this->settings['time_adjust'] * 60);
|
||||
}
|
||||
|
||||
if ( isset($this->memberData['dst_in_use']) AND $this->memberData['dst_in_use'] )
|
||||
if ( !empty($this->memberData['dst_in_use']) )
|
||||
{
|
||||
$r += 3600;
|
||||
}
|
||||
@@ -708,7 +712,7 @@ class class_localization
|
||||
* @param string [$app] Specify application to use
|
||||
* @param string [$lang] Language pack to use
|
||||
* @param boolean [$forceReload] Force a language pack to load regardless if it has already
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function loadLanguageFile( $load=array(), $app='', $lang='', $forceReload=false )
|
||||
{
|
||||
@@ -733,9 +737,9 @@ class class_localization
|
||||
}
|
||||
|
||||
/* Has the global language file been loaded? */
|
||||
if ( ! in_array( $app . '_' . $global, $this->loaded_lang_files ) AND ( $app == 'core' AND ! in_array( $_global, $load ) ) )
|
||||
if ( ! in_array( $global, $this->loaded_lang_files ) AND ( $app == 'core' AND ! in_array( $_global, $load ) ) )
|
||||
{
|
||||
$load[] = $global;
|
||||
$load[] = $_global;
|
||||
}
|
||||
|
||||
/* Load the language file */
|
||||
@@ -809,9 +813,9 @@ class class_localization
|
||||
|
||||
if ( ! in_array( $_test, $this->loaded_lang_files ) OR $forceReload === TRUE )
|
||||
{
|
||||
if ( file_exists( $_file ) )
|
||||
if ( is_file( $_file ) )
|
||||
{
|
||||
require( $_file );
|
||||
include( $_file );/*noLibHook*/
|
||||
|
||||
foreach( $lang as $k => $v )
|
||||
{
|
||||
@@ -837,7 +841,7 @@ class class_localization
|
||||
}
|
||||
}
|
||||
|
||||
if( isset( $tempLangId ) AND $tempLangId )
|
||||
if( !empty( $tempLangId ) )
|
||||
{
|
||||
$this->lang_id = $tempLangId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user