Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+4 -47
View File
@@ -11,7 +11,7 @@
namespace IPS\Lang\Setup;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -22,49 +22,6 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class _Lang extends \IPS\_Lang
{
/**
* Languages
*
* @param null|\IPS\Db\Select $iterator Select iterator
* @return array
*/
public static function languages( $iterator=NULL )
{
if ( !self::$gotAll )
{
if( $iterator === NULL )
{
if ( isset( \IPS\Data\Store::i()->languages ) )
{
$rows = \IPS\Data\Store::i()->languages;
}
else
{
$rows = iterator_to_array( \IPS\Db::i()->select( '*', 'core_sys_lang' )->setKeyField('lang_id') );
\IPS\Data\Store::i()->languages = $rows;
}
}
else
{
$rows = iterator_to_array( $iterator );
}
foreach( $rows as $id => $lang )
{
if ( $lang['lang_default'] )
{
self::$defaultLanguageId = $lang['lang_id'];
}
self::$multitons[ $id ] = static::constructFromData( $lang );
}
self::$outputSalt = mt_rand();
self::$gotAll = TRUE;
}
return self::$multitons;
}
/**
* Add to output stack
*
@@ -75,8 +32,8 @@ class _Lang extends \IPS\_Lang
*/
public function addToStack( $key, $vle=TRUE, $options=array() )
{
/** if we don't have any options, there's no need to add it to the stack */
if (count($options) == 0)
/* if we don't have any options, there's no need to add it to the stack */
if( \count($options) == 0 )
{
return ( isset( $this->words[ $key ] ) ) ? $this->words[ $key ] : $key;
}
@@ -100,7 +57,7 @@ class _Lang extends \IPS\_Lang
{
/* Do we actually have any? */
if( !count( $this->outputStack ) )
if( !\count( $this->outputStack ) )
{
return;
}