<?php $pid = (int) $_GET['pid'] > 0 ? (int) $_GET['pid'] : 0; $this->breadcrumbs = array(__('album') => url('album/default/index'), "[" . $row['name'] . "]"); core_js('jquery'); core_js('jquery.ui'); /*widget('masonry' , array( 'tag'=>'#masonry', 'scroll'=>true, ));*/ UiHelper::sort('#sortable', url('album/image/sort'), 'ul'); css_code("\n#sortable ul{margin:0;padding:0;}\n#sortable li{ list-style:none; float:left;margin-right:5px; margin-bottom:5px;}\n"); ?> <blockquote><h3><?php echo $row['name']; ?> </h3></blockquote> <div class='well'> <?php $this->beginWidget('ActiveForm', array('enableAjaxValidation' => false)); ?> <input type="hidden" name="id" value="<?php echo $id; ?> "> <div class="form-group"> <?php echo CHtml::submitButton(__('save'), array('class' => 'btn btn-primary')); ?>
<?php $pid = (int) $_GET['pid'] > 0 ? (int) $_GET['pid'] : 0; $this->breadcrumbs = array(__('menu')); $this->menu = array(array('label' => __('manage'), 'url' => array('index')), array('label' => __('create'), 'url' => array('create'))); ?> <blockquote><?php echo __('admin menu'); ?> </blockquote> <?php UiHelper::sort('#sort', url('menu/default/sort')); $this->widget('BuilderIndex', array('config' => 'application.modules.menu.config.menus', 'function' => array('where' => "pid=" . $pid . " and is_admin=1", 'order' => "sort desc,id desc"), 'uisort' => true)); ?> <blockquote><?php echo __('front menu'); ?> </blockquote> <?php UiHelper::sort('#sort2', url('menu/default/sort')); $this->widget('BuilderIndex', array('config' => 'application.modules.menu.config.menus', 'function' => array('where' => "pid=" . $pid . " and is_admin=0", 'order' => "sort desc,id desc"), 'uisort' => true, 'sortId' => 'sort2')); ?>
<?php $pid = (int) $_GET['pid'] > 0 ? (int) $_GET['pid'] : 0; $this->breadcrumbs = array(__('album')); $this->menu = array(array('label' => __('manage'), 'url' => array('index')), array('label' => __('create'), 'url' => array('create'))); $form = $this->beginWidget('CActiveForm', array('id' => 'sort')); ?> <?php UiHelper::sort('#sort', url('album/default/sort')); $this->widget('BuilderIndex', array('config' => 'application.modules.album.config.albums', 'function' => array('order' => "sort desc,id desc"), 'action' => array('<span class="glyphicon glyphicon-camera"></span>' => 'album/image/index'))); ?> <?php $this->endWidget(); ?>
function run() { parent::run(); foreach ($this->row as $k => $v) { if ($v['search']) { $this->search = true; } } if (true === $this->uisort) { if (!$this->uisortUrl) { $this->uisortUrl = url($this->controller->module->id . '/' . $this->controller->id . '/sort'); } UiHelper::sort('#sort', $this->uisortUrl); if (!$this->function['order']) { $this->function['order'] = "sort desc,id desc"; } } $criteria = new CDbCriteria(); $result = Yii::app()->db->createCommand()->from($this->table); $posts = Yii::app()->db->createCommand()->from($this->table); $where = $_GET['AutoModel']; $result = $result->andWhere("1 = 1"); $posts = $posts->andWhere("1 = 1"); if ($where) { foreach ($where as $k => $v) { if (!$v) { continue; } $this->model->{$k} = $v; $result = $result->andWhere("{$k}=:{$k}", array(":{$k}" => trim($v))); $posts = $posts->andWhere("{$k}=:{$k}", array(":{$k}" => trim($v))); } } if ($this->function) { foreach ($this->function as $k => $v) { $result = $result->{$k}($v); $posts = $posts->{$k}($v); } } if ($this->functiond) { foreach ($this->functiond as $k => $v) { $result = $result->{$k} = $v; $posts = $posts->{$k} = $v; } } $result = $result->query(); $pages = new CPagination($result->rowCount); $pages->pageSize = $this->pageSize; $pages->applyLimit($criteria); $posts = $posts->limit($pages->pageSize); $posts = $posts->offset($pages->currentPage * $pages->pageSize); $posts = $posts->query(); $show = false; if ($this->edit === true || $this->delete === true) { $show = true; } if (!$this->editUrl) { $this->editUrl = array($this->controller->module->id . '/' . $this->controller->id . '/update', array("id" => '{id}')); } if (!$this->deleteUrl) { $this->deleteUrl = array($this->controller->module->id . '/' . $this->controller->id . '/delete', array("id" => '{id}', 'table' => '{table}')); } if (!$this->indexUrl) { $this->indexUrl = url($this->controller->module->id . '/' . $this->controller->id . '/index'); } $this->render('BuilderIndex', array('posts' => $posts, 'pages' => $pages, 'row' => $this->row, 'show' => $show, 'editUrl' => $this->editUrl, 'deleteUrl' => $this->deleteUrl, 'uisort' => $this->uisort, 'model' => $this->model, 'table' => $this->table, 'indexUrl' => $this->indexUrl, 'action' => $this->action, 'search' => $this->search, 'sortId' => $this->sortId)); }