コード例 #1
0
ファイル: ThemeBehavior.php プロジェクト: Cheren/union
 /**
  * Write data in json file.
  *
  * @return void
  */
 protected function _write()
 {
     $this->_bufferActivated();
     $this->_bufferLoaded();
     $JSON = new JSON($this->_buffer);
     $file = Path::loadedFolder() . $this->_config['file'];
     $File = new File($file);
     $File->write($JSON->write());
 }
コード例 #2
0
ファイル: loader.php プロジェクト: Cheren/union
<?php

/**
 * This is a simple content management system based on CakePHP.
 *
 * @version         1.0.x
 * @copyright       Copyright (C) by cool-code.ru
 * @license         http://www.opensource.org/licenses/mit-license.php MIT License
 * @author          Segrey Kalistratov <*****@*****.**>
 */
use Cake\Core\Configure;
use Union\Core\Lib\Plugin;
use Union\Core\Utility\Path;
//  Default plugins.
$plugins = ['Search', 'Union/Menus', 'Union/Community', 'Union/Extensions', 'Union/TinyMce', 'Union/Modules', 'Union/FileManager'];
$activatedTheme = Path::loadedFolder() . 'themes.json';
//  Check activated themes.
if (file_exists($activatedTheme)) {
    $jsonData = file_get_contents($activatedTheme);
    $themes = json_decode($jsonData, true);
    $plugins += $themes['activated'];
    if (isset($themes['activated'])) {
        Configure::write('Theme', $themes['activated']);
    }
}
Plugin::load($plugins);