FOF30\Form\Form::getView PHP Method

getView() public method

Returns the DataViewInterface attached to this form
public getView ( ) : FOF30\View\DataView\DataViewInterface
return FOF30\View\DataView\DataViewInterface
    public function &getView()
    {
        return $this->view;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Get the rendering of this field type for a repeatable (grid) display,
  * e.g. in a view listing many item (typically a "browse" task)
  *
  * @since 2.0
  *
  * @return  string  The field HTML
  *
  * @throws  DataModelRequired
  */
 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 == '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;
 }
All Usage Examples Of FOF30\Form\Form::getView