public function generateSortableColumnHeader($params, &$smarty)
    {
        // The current order of the table
        $current_order = $this->getParam($params, 'current_order');

        // The column ascending order
        $order = $this->getParam($params, 'order');

        // The column descending order label
        $reverse_order = $this->getParam($params, 'reverse_order');

        // The order change path
        $path = $this->getParam($params, 'path');

        // The column label
        $label = $this->getParam($params, 'label');

        // The request parameter
        $request_parameter_name = $this->getParam($params, 'request_parameter_name', 'order');

        if ($current_order == $order) {
            $sort_direction = 'up';
            $order_change = $reverse_order;
        } elseif ($current_order == $reverse_order) {
            $sort_direction = 'down';
            $order_change = $order;
        } else {
            $order_change = $order;
        }

        return $this->fetchSnippet($smarty, 'includes/admin-utilities-sortable-column-header', array(
                'admin_utilities_sort_direction' => $sort_direction,
                'admin_utilities_sorting_url'    => URL::getInstance()->absoluteUrl($path, array($request_parameter_name => $order_change)),
                'admin_utilities_header_text'    => $label
        ));
    }
public function generateSortableColumnHeader($params, &$smarty)
    {
        // The current order of the table
        $current_order = $this->getParam($params, 'current_order');

        // The column ascending order
        $order = $this->getParam($params, 'order');

        // The column descending order label
        $reverse_order = $this->getParam($params, 'reverse_order');

        // The order change path
        $path = $this->getParam($params, 'path');

        // The column label
        $label = $this->getParam($params, 'label');

        // The request parameter
        $request_parameter_name = $this->getParam($params, 'request_parameter_name', 'order');

        if ($current_order == $order) {
            $sort_direction = 'up';
            $order_change = $reverse_order;
        } elseif ($current_order == $reverse_order) {
            $sort_direction = 'down';
            $order_change = $order;
        } else {
            $order_change = $order;
        }

        return $this->fetchSnippet($smarty, 'includes/admin-utilities-sortable-column-header', array(
                'admin_utilities_sort_direction' => $sort_direction,
                'admin_utilities_sorting_url'    => URL::getInstance()->absoluteUrl($path, array($request_parameter_name => $order_change)),
                'admin_utilities_header_text'    => $label
        ));
    }
public function generateSortableColumnHeader ( $ params , & $ smarty ) { // The current order of the table $ current_order = $ this -> getParam ( $ params , 'current_order' ) ; // The column ascending order $ order = $ this -> getParam ( $ params , 'order' ) ; // The column descending order label $ reverse_order = $ this -> getParam ( $ params , 'reverse_order' ) ; // The order change path $ path = $ this -> getParam ( $ params , 'path' ) ; // The column label $ label = $ this -> getParam ( $ params , 'label' ) ; // The request parameter $ request_parameter_name = $ this -> getParam ( $ params , 'request_parameter_name' , 'order' ) ; if ( $ current_order == $ order ) { $ sort_direction = 'up' ; $ order_change = $ reverse_order ; } elseif ( $ current_order == $ reverse_order ) { $ sort_direction = 'down' ; $ order_change = $ order ; } else { $ order_change = $ order ; } return $ this -> fetchSnippet ( $ smarty , 'includes/admin-utilities-sortable-column-header' , array ( 'admin_utilities_sort_direction' => $ sort_direction , 'admin_utilities_sorting_url' => URL :: getInstance ( ) -> absoluteUrl ( $ path , array ( $ request_parameter_name => $ order_change ) ) , 'admin_utilities_header_text' => $ label ) ) ; }
Generates the link of a sortable column header

@param  array   $params
@param  \Smarty $smarty
@return string  no text is returned.
@throws \Exception
@throws \SmartyException
Generates the link of a sortable column header