2015-08-02 04:47:45 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Variables
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
$theme = array(
|
|
|
|
'name'=>'',
|
|
|
|
'description'=>'',
|
|
|
|
'author'=>'',
|
|
|
|
'email'=>'',
|
|
|
|
'website'=>'',
|
|
|
|
'version'=>'',
|
|
|
|
'releaseDate'=>''
|
|
|
|
);
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main
|
|
|
|
// ============================================================================
|
|
|
|
|
2015-08-24 00:07:14 +02:00
|
|
|
$langLocaleFile = PATH_THEME.'languages'.DS.$Site->locale().'.json';
|
|
|
|
$langDefaultFile = PATH_THEME.'languages'.DS.'en_US.json';
|
2015-08-02 04:47:45 +02:00
|
|
|
$database = false;
|
|
|
|
|
|
|
|
// Check if exists locale language
|
|
|
|
if( Sanitize::pathFile($langLocaleFile) ) {
|
|
|
|
$database = new dbJSON($langLocaleFile, false);
|
|
|
|
}
|
|
|
|
// Check if exists default language
|
|
|
|
elseif( Sanitize::pathFile($langDefaultFile) ) {
|
|
|
|
$database = new dbJSON($langDefaultFile, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if($database!==false)
|
|
|
|
{
|
|
|
|
$databaseArray = $database->db;
|
|
|
|
|
|
|
|
// Theme data
|
|
|
|
$theme = $databaseArray['theme-data'];
|
|
|
|
|
|
|
|
// Remove theme data
|
|
|
|
unset($databaseArray['theme-data']);
|
|
|
|
|
|
|
|
// Add new words from language theme
|
|
|
|
$Language->add($databaseArray);
|
2015-11-28 15:47:03 +01:00
|
|
|
}
|