Source for file ordering.php
Documentation is available at ordering.php
* @package FrameworkOnFramework
* @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
// Protect from unauthorized access
* Form Field class for FOF
* Renders the row ordering interface checkbox in browse views
* @package FrameworkOnFramework
/** @var FOFTable The item being rendered in a repeatable form field */
/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
* Method to get certain otherwise inaccessible properties from the form field object.
* @param string $name The property name for which to the the value.
* @return mixed The property value or null.
public function __get($name)
return parent::__get($name);
* Method to get the field input markup for this field type.
* @return string The field input markup.
throw
new Exception(__CLASS__ .
' cannot be used in input forms');
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
* @return string The field HTML
throw
new Exception(__CLASS__ .
' cannot be used in single item display forms');
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
* @return string The field HTML
throw
new Exception(__CLASS__ .
' needs a FOFTable to act upon');
$viewObject =
$this->form->getView();
$ordering =
$viewObject->getLists()->order ==
'ordering';
if (!$viewObject->hasAjaxOrderingSupport())
// Ye olde Joomla! 2.5 method
$disabled =
$ordering ?
'' :
'disabled="disabled"';
$html .=
$viewObject->pagination->orderUpIcon($this->rowid, true, 'orderup', 'Move Up', $ordering);
$html .=
'</span><span>';
$html .=
$viewObject->pagination->orderDownIcon($this->rowid, $viewObject->pagination->total, true, 'orderdown', 'Move Down', $ordering);
$html .=
'<input type="text" name="order[]" size="5" value="' .
$this->value .
'" ' .
$disabled;
$html .=
'class="text_area" style="text-align: center" />';
// The modern drag'n'drop method
if ($viewObject->getPerms()->editstate)
$hasAjaxOrderingSupport =
$viewObject->hasAjaxOrderingSupport();
if (!$hasAjaxOrderingSupport['saveOrder'])
$disabledLabel =
JText::_('JORDERINGDISABLED');
$disableClassName =
'inactive tip-top';
$html .=
'<span class="sortable-handler ' .
$disableClassName .
'" title="' .
$disabledLabel .
'" rel="tooltip">';
$html .=
'<i class="icon-menu"></i>';
$html .=
'<input type="text" style="display:none" name="order[]" size="5"';
$html .=
'value="' .
$this->value .
'" class="input-mini text-area-order " />';
$html .=
'<span class="sortable-handler inactive" >';
$html .=
'<i class="icon-menu"></i>';
Documentation generated on Tue, 19 Nov 2013 15:09:53 +0100 by phpDocumentor 1.4.3