public static function cancel($task = 'cancel', $alt = 'Cancel') { $bar = MiisToolbar::getInstance(); $arrParams = array('modules' => Yii::app()->controller->module->id, 'controller' => Yii::app()->controller->id, 'action' => ''); // Add a cancel button. $bar->setSlot('cancel', $alt, 'cancel', 'Cancel', Yii::app()->createUrl(MiisHelper::url($arrParams))); }
public function render() { if ($this->_hide) { return ''; } $html = array(); $html[] = '<div id="miis-toolbar-box">'; $html[] = '<div class="m">'; // Start toolbar div. $html[] = '<div class="toolbar-list" id="toolbar">'; $html[] = '<ul>'; // Render each button in the toolbar. foreach ($this->_slots as $slot) { if ($slot['id'] == 'divider') { $html[] = '<li class="divider"></li>'; } else { $arrParams = array('modules' => Yii::app()->controller->module->id, 'controller' => Yii::app()->controller->id, 'action' => Yii::app()->controller->action->id); $arrParams['action'] = $slot['id']; $html[] = '<li' . ($slot['ajax'] ? ' class="button"' : '') . '><a href="' . ($slot['ajax'] ? '#toolbar' : Yii::app()->createUrl(MiisHelper::url($arrParams))) . '" rel="' . $slot['id'] . '" title="' . $slot['alert'] . '" ' . ($slot['ajax'] ? 'name="' . $slot['ajax'] . '"' : '') . '><span class="icon-large icon-' . $slot['ico'] . '"></span>' . $slot['alt'] . '</a></li>'; } } // End toolbar div. $html[] = '</ul>'; $html[] = '<div class="clr"></div>'; $html[] = '</div>'; $html[] = $this->_title; $html[] = '</div>'; $html[] = '</div>'; return implode("\n", $html); }
<?php $arrParams = array('modules' => Yii::app()->controller->module->id, 'controller' => Yii::app()->controller->id, 'action' => Yii::app()->controller->action->id); ?> <form name="adminForm" id="adminForm" action="<?php echo Yii::app()->createUrl(MiisHelper::url($arrParams)); ?> " method="post"> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'Advertisement-grid', 'type' => 'striped bordered condensed', 'filter' => $model, 'dataProvider' => $model->search(), 'selectableRows' => 2, 'template' => "{items}{summary}{pager}", 'columns' => array(array('class' => 'CCheckBoxColumn', 'id' => 'cid', 'value' => '$data->id', 'headerHtmlOptions' => array('style' => 'width:25px;')), array('name' => 'id', 'header' => 'id', 'headerHtmlOptions' => array('class' => 'span1', 'style' => 'width:20px')), array('name' => 'title', 'header' => 'title'), array('name' => 'date_create', 'header' => 'date_create'), array('name' => 'date_end', 'header' => 'date_end'), array('name' => 'state', 'header' => 'state', 'value' => '@$data->state ? "Publish" : "Unpublish"', 'filter' => CHtml::activeDropDownList($model, 'state', array(1 => 'Publish', 0 => 'Unpublish'), array('empty' => 'None', 'class' => 'span2')), 'headerHtmlOptions' => array('class' => 'span1'))))); ?> </form>