示例#1
0
echo $form->labelEx($model, 'application_id');
?>
		<?php 
echo $form->dropDownList($model, 'application_id', Applications::loadItems());
?>
		<?php 
echo $form->error($model, 'application_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'parent_id');
?>
		<?php 
echo Menus::getDropDownList('Menus[parent_id]', 'Menus_parent_id', $model->parent_id, true);
?>
		<?php 
echo $form->error($model, 'parent_id');
?>
	</div>

    <div class="row">

        <?php 
/*?>
		<?php echo $form->labelEx($model,'roles'); ?>
        <div class="menus-role-list">
            <?php echo CHtml::checkBoxList("roles", $aSelectedRoles, $aRoles); ?>
        </div>
        <?php */
示例#2
0
echo $form->labelEx($model, 'role_id');
?>
                <?php 
echo $form->dropDownList($model, 'role_id', Roles::loadItems());
?>
		<?php 
echo $form->error($model, 'role_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'menu_id');
?>
                <?php 
echo Menus::getDropDownList('RolesMenus[menu_id]', 'RolesMenus_menu_id', $model->menu_id, true);
?>
		<?php 
echo $form->error($model, 'menu_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
?>
示例#3
0
<?php

$this->breadcrumbs = array('Manage Menu');
$menus = array(array('label' => 'Create Menu', 'url' => array('create')));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('menus-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Manage Menu</h1>


<?php 
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'menus-grid', 'dataProvider' => $model->search(), 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions)), array('name' => 'menu_name', 'filter' => ''), 'controller_name', array('name' => 'roles', 'type' => 'raw', 'value' => 'RolesMenus::getActionName($data->id)'), 'menu_link', array('name' => 'parent_id', 'header' => 'Parent menu', 'value' => '(!is_null(Menus::model()->findByPk($data->parent_id))?Menus::model()->findByPk($data->parent_id)->menu_name:"")', 'filter' => Menus::getDropDownList("Menus[parent_id]", "Menus_parent_id", 0, true), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'display_order', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'show_in_menu', 'value' => '(!empty($data->show_in_menu) && $data->show_in_menu==1) ? "Yes" : "No"', 'filter' => array('1' => 'Yes', '0' => 'No'), 'htmlOptions' => array('style' => 'text-align:center;')))));