コード例 #1
0
ファイル: manage.php プロジェクト: blindest/Yii-CMS-2.0
<?php

$this->tabs = array('Добавить параметр' => $this->createUrl('create'));
$this->widget('AdminGridView', array('id' => 'settings-grid', 'dataProvider' => $model->search(isset($module_id) ? $module_id : null), 'filter' => $model, 'columns' => array(array('name' => 'module_id', 'value' => 'AppManager::getModuleName($data->module_id)', 'filter' => AppManager::getModulesNames()), array('name' => 'name', 'htmlOptions' => array('update' => true)), array('name' => 'value', 'value' => '$data->formated_value;', 'type' => 'raw'), array('class' => 'CButtonColumn', 'template' => '{updateValue} {view} {update} {delete}', 'buttons' => array('updateValue' => array('imageUrl' => '/img/icons/floppy.png', 'label' => 'Изменить значение', 'url' => 'Yii::app()->controller->createUrl("update", array("id" => $data->id, "scenario" => "value_update"))', 'options' => array('class' => 'popup')))))));
コード例 #2
0
 protected function getModulesTasks()
 {
     $tasks = array();
     $modules = AppManager::getModulesNames();
     foreach ($modules as $module_name => $module_desc) {
         $operations = array();
         $module_actions = AppManager::getModuleActions(ucfirst($module_name) . 'Module');
         foreach ($module_actions as $controller => $actions) {
             $prefix = str_replace('Controller', '', $controller);
             foreach ($actions as $name => $description) {
                 $name = $prefix . '_' . $name;
                 $exists = AuthItem::model()->exists(" name = '{$name}' AND type = '" . CAuthItem::TYPE_OPERATION . "'");
                 $operations[] = array('name' => $name, 'description' => $description, 'exists' => $exists);
             }
         }
         $exists = AuthItem::model()->exists(" name = '{$module_name}' AND type = '" . CAuthItem::TYPE_TASK . "'");
         $tasks[] = array('exists' => $exists, 'name' => $module_name, 'description' => $module_desc, 'operations' => $operations);
     }
     return $tasks;
 }
コード例 #3
0
<?php

$tables = Yii::app()->db->schema->tableNames;
$tables = array_combine($tables, $tables);
return array('activeForm' => array('id' => 'migration-form', 'enableAjaxValidation' => false), 'elements' => array('module' => array('type' => 'dropdownlist', 'items' => AppManager::getModulesNames(), 'label' => t('Модуль')), 'table' => array('type' => 'dropdownlist', 'items' => $tables, 'label' => t('Таблица'))), 'buttons' => array('submit' => array('type' => 'submit', 'value' => t('Создать'))));