bludit/kernel/boot/rules/99.themes.php

53 lines
1.4 KiB
PHP
Raw Normal View History

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;
2015-11-29 00:21:04 +01:00
// Theme meta data from English
if( Sanitize::pathFile($langDefaultFile) ) {
$database = new dbJSON($langDefaultFile, false);
$themeMetaData = $database->db['theme-data'];
}
2015-08-02 04:47:45 +02:00
// Check if exists locale language
if( Sanitize::pathFile($langLocaleFile) ) {
$database = new dbJSON($langLocaleFile, false);
}
if($database!==false)
{
$databaseArray = $database->db;
// Theme data
2015-11-29 00:21:04 +01:00
$theme = $themeMetaData;
2015-08-02 04:47:45 +02:00
2015-11-29 00:21:04 +01:00
// Remove theme meta data
2015-08-02 04:47:45 +02:00
unset($databaseArray['theme-data']);
2015-11-29 00:21:04 +01:00
// Add new words/phrase from language theme
2015-08-02 04:47:45 +02:00
$Language->add($databaseArray);
}