1 <?php
2 3 4 5 6 7
8
9 defined('FOF_INCLUDED') or die;
10
11 12 13 14 15 16
17 class extends FOFFormHeader
18 {
19 20 21 22 23
24 protected function ()
25 {
26 $sortable = ($this->element['sortable'] != 'false');
27
28 $view = $this->form->getView();
29 $model = $this->form->getModel();
30
31 $hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
32
33 if (!$sortable)
34 {
35
36 return JText::_('JGRID_HEADING_ORDERING');
37 }
38
39 if (!$hasAjaxOrderingSupport)
40 {
41
42 $html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse');
43 $html .= JHTML::_('grid.order', $model->getList());
44
45 return $html;
46 }
47 else
48 {
49
50 $html = JHtml::_(
51 'grid.sort',
52 '<i class="icon-menu-2"></i>',
53 'ordering',
54 $view->getLists()->order_Dir,
55 $view->getLists()->order,
56 null,
57 'asc',
58 'JGRID_HEADING_ORDERING'
59 );
60
61 $ordering = $view->getLists()->order == 'ordering';
62
63 if ($ordering)
64 {
65 $html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' .
66 'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">'
67 . '<span class="icon-ok"></span></a>';
68 }
69
70 return $html;
71 }
72 }
73 }
74