Commits

Christoffer Niska committed 1d98523

Fixed sorting in the node index view.

Comments (0)

Files changed (4)

controllers/AdminController.php

 {
 	public function actionIndex()
 	{
-		$nodeDp = new CActiveDataProvider('CmsNode', array(
-			'criteria'=>array(
-				'order'=>'parentId ASC, id ASC',
-			),
-		));
-
-		$this->render('index', array(
-			'nodeDp'=>$nodeDp,
-		));
+		$this->render('index');
 	}
 }

controllers/NodeController.php

 
 	public function actionIndex()
 	{
-		$nodeDp = new CActiveDataProvider('CmsNode', array(
-			'criteria'=>array(
-				'order'=>'parentId ASC, id ASC',
-			),
-		));
+		$model = new CmsNode('search');
+		$model->unsetAttributes();  // clear any default values
 
 		$this->layout = 'cms-column1';
 
 		$this->render('index', array(
-			'nodeDp'=>$nodeDp,
+			'model'=>$model,
 		));
 	}
 

views/admin/index.php

 
 	<div class="nodes">
 		<h2><?php echo CHtml::link(Yii::t('CmsModule.core','Nodes'),array('node/index')); ?></h2>
+		<p><?php echo Yii::t('CmsModule.core','Administer nodes.'); ?></p>
 	</div>
 
 	<!--

views/node/index.php

 	<p><?php echo CHtml::link(Yii::t('CmsModule.core','Create a new node'),array('node/create'),array('class'=>'btn')) ?></p>
 
 	<?php $this->widget('bootstrap.widgets.BootGridView',array(
-		'dataProvider'=>$nodeDp,
+		'dataProvider'=>$model->search(),
 		'columns'=>array(
 			'id',
 			'name',