Beispiel #1
0
echo $form->labelEx($model, 'type');
?>
		<?php 
echo $form->dropDownList($model, 'type', array("page" => "Page", "url" => "Custom URL"));
?>
		<?php 
echo $form->error($model, 'type');
?>
	</div>

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

	<div class="row">
		<?php 
echo $form->labelEx($model, 'place_holder_id');
?>
		<?php 
echo $form->dropDownList($model, 'place_holder_id', PlaceHolders::loadItems());
?>
		<?php 
echo $form->error($model, 'place_holder_id');
Beispiel #2
0
<?php

$this->breadcrumbs = array('Fe Menus');
$menus = array(array('label' => 'Create Fe 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('fe-menus-grid', {\n                url : \$(this).attr('action'),\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
Yii::app()->clientScript->registerScript('ajaxupdate', "\n\$('#fe-menus-grid a.ajaxupdate').live('click', function() {\n    \$.fn.yiiGridView.update('fe-menus-grid', {\n        type: 'POST',\n        url: \$(this).attr('href'),\n        success: function() {\n            \$.fn.yiiGridView.update('fe-menus-grid');\n        }\n    });\n    return false;\n});\n");
?>

<h1>List Fe Menus</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' => 'fe-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;')), 'name', array('name' => 'link', 'value' => '($data->type=="page") ? "" : "$data->link"'), array('name' => 'order', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'type', 'value' => '($data->type=="page") ? "Page" : "Custom URL"'), array('name' => 'parent_id', 'header' => 'Parent menu', 'value' => '(!is_null(FeMenus::model()->findByPk($data->parent_id))?FeMenus::model()->findByPk($data->parent_id)->name:"")', 'filter' => FeMenus::getDropDownList("FeMenus[parent_id]", "FeMenus_parent_id", 0, true), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'place_holder_id', 'value' => '$data->place_holder->position'), array('name' => 'status', 'type' => 'status', 'htmlOptions' => array('style' => 'text-align:center;'), 'value' => 'array("status"=>$data->status,"id"=>$data->id)'), array('class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions), 'buttons' => array('delete' => array('visible' => 'FeMenus::canDelete($data->id)==true'))))));
Beispiel #3
0
<?php

$this->breadcrumbs = array('Fe Menus' => array('index'), $model->name);
$menus = array(array('label' => 'Fe Menus Management', 'url' => array('index')), array('label' => 'Create Fe Menu', 'url' => array('create')), array('label' => 'Update Fe Menu', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Fe Menu', 'url' => array('delete'), 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
?>

<h1>View Fe Menu #<?php 
echo $model->id;
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('name', 'link', 'order', array('name' => 'required_login', 'value' => $model->required_login == 1 ? "Yes" : "No"), array('name' => 'status', 'value' => $model->status == 1 ? "Active" : "Inactive"), array('name' => 'type', 'value' => $model->type == "page" ? "Page" : "Custom URL"), array('name' => 'parent_id', 'value' => !is_null(FeMenus::model()->findByPk($model->parent_id)) ? FeMenus::model()->findByPk($model->parent_id)->name : ""), array('name' => 'place_holder_id', 'value' => $model->place_holder->position))));