<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'content-category-form', 'enableAjaxValidation' => false)); ?> <p class="help-block">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row-fluid"> <div class="span12"> <?php if ($model->isNewRecord) { echo BannerCategory::get_category_new('BannerCategory', 'parent_id'); } else { echo BannerCategory::get_category_update('BannerCategory', 'parent_id', $model->parent_id); } ?> </div> </div> <?php echo $form->textFieldControlGroup($model, 'title', array('class' => 'span5', 'maxlength' => 255)); echo $form->labelEx($model, 'description'); $this->widget('application.extensions.xheditor.JXHEditor', array('model' => $model, 'attribute' => 'description', 'htmlOptions' => array('class' => 'xheditor', 'style' => 'width: 100%; height: 150px;'))); echo $form->dropDownListControlGroup($model, 'published', array('1' => 'Yes', '0' => 'No')); ?> <div class="form-actions"> <?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?> <?php echo TbHtml::resetButton('Reset', array('color' => TbHtml::BUTTON_COLOR_INFO));
<div class="widget-toolbar"> <a data-action="settings" href="#"><i class="icon-cog"></i></a> <a data-action="reload" href="#"><i class="icon-refresh"></i></a> <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a> <a data-action="close" href="#"><i class="icon-remove"></i></a> </div> <div class="widget-toolbar"> <?php echo CHtml::link('<i class="icon-plus"></i>', array('create'), array('data-rel' => 'tooltip', 'title' => 'Add', 'data-placement' => 'bottom')); ?> </div> <div class="widget-toolbar"> <?php echo CHtml::link('<i class="icon-search"></i>', '#', array('class' => 'search-button', 'data-rel' => 'tooltip', 'title' => 'Search', 'data-placement' => 'bottom')); ?> </div> </div><!--/.widget-header --> <div class="widget-body"> <div class="widget-main"> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'banner-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'catid', 'type' => 'raw', 'value' => 'DocumentCategory::getCategoryName($data->catid)', 'filter' => BannerCategory::get_category_new('Banner', 'catid'), 'htmlOptions' => array('style' => "text-align:left;", 'title' => 'Banner Category')), 'name', 'clickurl', array('name' => 'ordering', 'type' => 'raw', 'value' => '$data->ordering', 'htmlOptions' => array('style' => "text-align:center; width:50px;", 'title' => 'Ordering')), array('header' => 'Actions', 'class' => 'bootstrap.widgets.TbButtonColumn')))); ?> </div> </div><!--/.widget-body --> </div><!--/.widget-box -->
</div> <div class="widget-toolbar"> <?php echo CHtml::link('<i class="icon-search"></i>', '#', array('class' => 'search-button', 'data-rel' => 'tooltip', 'title' => 'Search', 'data-placement' => 'bottom')); ?> </div> </div><!--/.widget-header --> <div class="widget-body"> <div class="widget-main"> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('bootstrap.widgets.TbGridView', array('type' => TbHtml::GRID_TYPE_HOVER, 'id' => 'banner-category-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'parent_id', 'type' => 'raw', 'value' => 'getCategoryName($data->parent_id)', 'filter' => BannerCategory::get_category_new('BannerCategory', 'parent_id'), 'htmlOptions' => array('style' => "text-align:left;", 'title' => 'Parent Category')), 'title', array('name' => 'description', 'type' => 'raw', 'value' => '$data->description', 'htmlOptions' => array('style' => "text-align:left;", 'title' => 'Description')), array('name' => 'published', 'header' => "Status", 'value' => '$data->published?Yii::t(\'app\',\'Active\'):Yii::t(\'app\', \'Inactive\')', 'filter' => array('' => Yii::t('app', 'All'), '0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')), 'htmlOptions' => array('style' => "text-align:center;")), array('header' => 'Actions', 'class' => 'bootstrap.widgets.TbButtonColumn')))); /** * Retrieves Category name by ID. * @return string. */ function getCategoryName($id) { $returnValue = Yii::app()->db->createCommand()->select('title')->from('{{banner_category}}')->where('id=:id', array(':id' => $id))->queryScalar(); if ($returnValue <= '0') { $returnValue = 'No parent!'; } else { $returnValue = $returnValue; } return $returnValue; } ?>
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'banner-form', 'enableAjaxValidation' => false, 'htmlOptions' => array('enctype' => 'multipart/form-data'))); ?> <p class="help-block">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row-fluid"> <div class="span12"> <?php if ($model->isNewRecord) { echo BannerCategory::get_category_new('Banner', 'catid'); } else { echo BannerCategory::get_category_update('Banner', 'catid', $model->catid); } ?> </div> </div> <?php echo $form->textFieldControlGroup($model, 'name', array('class' => 'span5', 'maxlength' => 255)); ?> <div class="row-fluid"> <div class="span5"> <?php echo $form->fileFieldControlGroup($model, 'banner', array('maxlength' => 255, 'class' => 'span12')); ?> </div> </div> <?php