Пример #1
0
<?php

$tabs = array();
$classNames = CMap::mergeArray(Yii::app()->params['coreModels'], array_keys(ContentModel::getInstalledModels(true)));
foreach ($classNames as $className) {
    $title = method_exists($className, 'modelName') ? call_user_func(array($className, 'modelName')) : $className;
    $tmp = $this->widget('AccessRights', array('name' => 'Rights[' . $className . ']', 'objects' => array($className)), true);
    if ($tmp) {
        $tabs[$title] = $tmp;
    }
}
$this->widget('zii.widgets.jui.CJuiTabs', array('tabs' => $tabs));
Пример #2
0
 public static function form()
 {
     return array('elements' => array('class_name' => array('type' => 'ComboBox', 'array' => ContentModel::getInstalledModels(true)), 'rule' => array('type' => 'Scopes', 'classNameAttribute' => 'class_name')));
 }