order.php
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* The following variables are available in this template:
* - $this: the CrudCode object
*/
?>
<?php
echo "<?php\n";
$label=$this->pluralize($this->class2name($this->modelClass));
?>
$this->actionsMenu = array(
array('label' => 'Управление <?php echo $this->modelClass; ?>', 'url' => array('admin'), 'icon'=>'icon-list', 'active'=>'/'.$this->id.'\/admin/'),
array('label' => 'Добавить <?php echo $this->modelClass; ?>', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/'.$this->id.'\/create/'),
);
?>
<h1>Список</h1>
<br/>
<?php
echo <<<EOD
<?php
echo CHtml::beginForm();
\$items = CHtml::listData(\$dataProvider->getData(), 'id', 'i18n.name');
\$this->widget('zii.widgets.jui.CJuiSortable',
array(
'id' => 'orderList',
'options' => array(
'stop' => 'js:function(event, ui) {
var val=$("#orderList").sortable("toArray");
$("#orderInput").attr("value",val);
}',
),
'items' => \$items,
'htmlOptions' => array(
'class' => 'user-list'
),
));
echo CHtml::hiddenField('Order', 'none', array('id' => 'orderInput'));
echo CHtml::submitButton('Сохранить порядок', array('class' => 'btn btn-primary'));
echo Chtml::endForm();
?>
EOD;