コード例 #1
0
 public function testAllPages()
 {
     $this->loginAdmin();
     $modules = AppManager::getModulesData();
     foreach ($modules as $module) {
         if (!$module["admin_menu"]) {
             continue;
         }
         foreach ($module["admin_menu"] as $title => $url) {
             $this->open($url);
             $this->assertFalse($this->isTextPresent('Error'), "Error on page " . $url);
             $this->assertFalse($this->isTextPresent('Exception'), "Exception on page " . $url);
             $this->assertElementNotPresent('//body[@jserror]', "Javascript error on page " . $url);
         }
     }
 }
コード例 #2
0
 public function actionModules()
 {
     $this->render('modules', array('modules' => AppManager::getModulesData(), 'active_modules' => AppManager::getActiveModulesArray()));
 }
コード例 #3
0
ファイル: ModelForm.php プロジェクト: blindest/Yii-CMS-2.0
<?php

//Yii::app()->clientScript->registerScript(
//    'model->form',
//    '
//    $("#model-form input[name=preview]").click(function() {
//        updateCode();
//    });
//
//    function updateCode() {
//        var data = $("#model-form").serialize();
//        $.post("/codegen/modelAdmin/getCode", data, function(html) {
//            $("#code_place").html(html);
//        });
//    }
//    ',
//    CClientScript::POS_READY
//);
return array('activeForm' => array('id' => 'model-form'), 'elements' => array('table' => array('type' => 'text'), 'class' => array('type' => 'text'), 'name' => array('type' => 'text'), 'module' => array('type' => 'dropdownlist', 'items' => CHtml::listData(AppManager::getModulesData(), 'dir', 'name'), 'empty' => 'не выбран'), 'behaviors' => array('type' => 'multi_select', 'items' => array_flip(Model::$extra_behaviors))), 'buttons' => array('submit' => array('type' => 'submit', 'value' => t('Создать')), 'preview' => array('type' => 'button', 'value' => 'Предпросмотр')));
コード例 #4
0
ファイル: ParamForm.php プロジェクト: blindest/Yii-CMS-2.0
    var oprions_element = $("#Param_options").parents("dl:eq(0)");

    if ($("#Param_element").val() != "select") {
        oprions_element.hide();
    }

    $("#Param_element").change(function() {
        if ($(this).val() == "select") {
            oprions_element.show();
        }
        else {
            oprions_element.hide();
        }
    });
    ', CClientScript::POS_READY);
if ($this->model->scenario == Param::SCENARIO_VALUE_UPDATE) {
    $elements = array('name' => array('type' => 'text', 'disabled' => true));
    if ($this->model->element == Param::ELEMENT_SELECT) {
        $items = array();
        foreach (explode("\n", $this->model->options) as $option) {
            list($name, $value) = explode(Param::OPTION_NAME_VALUE_SEPARATOR, $option);
            $items[trim($name)] = trim($value);
        }
        $elements['value'] = array('type' => 'dropdownlist', 'items' => $items);
    } else {
        $elements['value'] = array('type' => $this->model->element);
    }
} else {
    $elements = array('module_id' => array('type' => 'dropdownlist', 'items' => CHtml::listData(AppManager::getModulesData(), 'dir', 'name')), 'name' => array('type' => 'text'), 'code' => array('type' => 'text'), 'element' => array('type' => 'dropdownlist', 'items' => Param::$elements), 'options' => array('type' => 'textarea', 'label' => 'Список значений (Каждое название' . Param::OPTION_NAME_VALUE_SEPARATOR . 'значение на новой строке)'));
}
return array('enctype' => 'multipart/form-data', 'activeForm' => array('id' => 'Param-form'), 'elements' => $elements, 'buttons' => array('submit' => array('type' => 'submit', 'value' => 'Сохранить')));
コード例 #5
0
ファイル: AdminMenu.php プロジェクト: blindest/Yii-CMS-2.0
 public function renderContent()
 {
     $this->render('AdminMenu', array('modules' => AppManager::getModulesData(true, true)));
 }