public function getRepeatable()
{
if (!$this->item instanceof DataModel) {
throw new DataModelRequired(__CLASS__);
}
$class = isset($this->class) ? $this->class : 'input-mini';
$icon = isset($this->element['icon']) ? $this->element['icon'] : 'icon-menu';
$html = '';
$view = $this->form->getView();
$ordering = $view->getLists()->order == $this->item->getFieldAlias('ordering');
if (!$view->hasAjaxOrderingSupport()) {
// Ye olde Joomla! 2.5 method
$disabled = $ordering ? '' : 'disabled="disabled"';
$html .= '<span>';
$html .= $view->getPagination()->orderUpIcon($this->rowid, true, 'orderup', 'Move Up', $ordering);
$html .= '</span><span>';
$html .= $view->getPagination()->orderDownIcon($this->rowid, $view->getPagination()->total, true, 'orderdown', 'Move Down', $ordering);
$html .= '</span>';
$html .= '<input type="text" name="order[]" size="5" value="' . $this->value . '" ' . $disabled;
$html .= 'class="text-area-order" style="text-align: center" />';
} else {
// The modern drag'n'drop method
if ($view->getPerms()->editstate) {
$disableClassName = '';
$disabledLabel = '';
$hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
if (!$hasAjaxOrderingSupport['saveOrder']) {
$disabledLabel = JText::_('JORDERINGDISABLED');
$disableClassName = 'inactive tip-top';
}
$orderClass = $ordering ? 'order-enabled' : 'order-disabled';
$html .= '<div class="' . $orderClass . '">';
$html .= '<span class="sortable-handler ' . $disableClassName . '" title="' . $disabledLabel . '" rel="tooltip">';
$html .= '<i class="' . $icon . '"></i>';
$html .= '</span>';
if ($ordering) {
$html .= '<input type="text" name="order[]" size="5" class="' . $class . ' text-area-order" value="' . $this->value . '" />';
}
$html .= '</div>';
} else {
$html .= '<span class="sortable-handler inactive" >';
$html .= '<i class="' . $icon . '"></i>';
$html .= '</span>';
}
}
return $html;
}