示例#1
0
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
/**
* This page renders the theme selector and the appropriate javascript
*/
Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . '/themes/x2engine/css/profile/themeSelector.css');
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/ThemeSelector.js', CClientScript::POS_END);
$user = Yii::app()->user->name;
$params = CJSON::encode(array('defaults' => array(ThemeGenerator::$defaultLight, ThemeGenerator::$defaultDark), 'active' => $selected, 'user' => $user, 'isAdmin' => Yii::app()->params->isAdmin ? 1 : 0, 'translations' => array('createNew' => Yii::t('profile', 'Create a new theme to edit'))));
Yii::app()->clientScript->registerScript('schemeJS', "\n\n\n\$(function () {\n    new x2.ThemeSelector({$params});\n});\n\n", CClientScript::POS_END);
echo "<input type='hidden' name='regenerate-theme' value='1'>";
echo "<div class='theme-picker' id='theme-picker'>";
$settings = ThemeGenerator::getSettingsList();
$themes = $myThemes->data;
foreach ($themes as $theme) {
    $scheme = CJSON::decode($theme->description);
    if (!is_array($scheme)) {
        continue;
    }
    $fileName = $theme->fileName;
    $uploadedBy = $theme->uploadedBy;
    echo CHtml::openTag('div', array('class' => "scheme-container", 'name' => $fileName, 'data-id' => $theme->id));
    echo CHtml::openTag('div', array('class' => 'scheme-container-inner', 'style' => "\n\t\t\t\tbackground: #{$scheme['content']};\n\t\t\t\tcolor: #{$scheme['text']};"));
    echo "<div id='name' > {$fileName} </div> ";
    if ($fileName == ThemeGenerator::$defaultLight || $fileName == ThemeGenerator::$defaultDark) {
        $uploadedByName = '';
    } else {
        $uploadedByName = $uploadedBy;