- md5
- 0c71cc631f495fb7688529e6384f6c74
- sha1
- 8e541bb128075c1f31d3d9508bd5e35d66770daf
- sha256
- 573d2368166f3d01f2f71b7fc65d208e5c40bb9ed31ae8ae5cf1f4fc7e0e564a
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
<?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
/**
* Ordering field header
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormHeaderOrdering extends FOFFormHeader
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
$sortable = ($this->element['sortable'] != 'false');
$view = $this->form->getView();
$model = $this->form->getModel();
$hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
if (!$sortable)
{
// Non sortable?! I'm not sure why you'd want that, but if you insist...
return JText::_('JGRID_HEADING_ORDERING');
}
if (!$hasAjaxOrderingSupport)
{
// Ye olde Joomla! 2.5 method
$html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse');
$html .= JHTML::_('grid.order', $model->getList());
return $html;
}
else
{
// The new, drag'n'drop ordering support WITH a save order button
$html = JHtml::_(
'grid.sort',
'<i class="icon-menu-2"></i>',
'ordering',
$view->getLists()->order_Dir,
$view->getLists()->order,
null,
'asc',
'JGRID_HEADING_ORDERING'
);
$ordering = $view->getLists()->order == 'ordering';
if ($ordering)
{
$html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' .
'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">'
. '<span class="icon-ok"></span></a>';
}
return $html;
}
}
}
The same content is in 37 releases, Joomla 3.4.1-rc to 3.6.2. See them all, or every version of this file.