original_string: public function direct($sortAction = 'sort', $urlIdParam = 'id')
      {
          $view = $this->getView();
          \MUtil_JQuery::enableView($view);
  
          $jquery = $view->jQuery();
          $jquery->enable();  //Just to make sure
  
          $handler = \ZendX_JQuery_View_Helper_JQuery::getJQueryHandler();
          $url     = $view->serverUrl() . $view->baseUrl() . '/' . $this->getRequest()->getControllerName() . '/' . $sortAction;
  
          $script = file_get_contents(__DIR__ . '/js/SortableTable.js');
          $fields = array(
              'jQuery'  => $handler,
              'AJAXURL' => $url,
              'IDPARAM' => $urlIdParam
          );
  
          $js = str_replace(array_keys($fields), $fields, $script);
  
          $jquery->addOnLoad($js);
  
          $buttons        = \Mutil_Html::div();
          $buttons->class = 'buttons pull-right';
  
          $buttons->div($this->getActionController()->_('Sort'), array('id' => 'sort', 'class' => "btn"));
          $buttons->div($this->getActionController()->_('Ok'), array('id' => 'sort-ok', 'class' => "btn btn-success", 'style' => 'display:none;'));
          $buttons->div($this->getActionController()->_('Cancel'), array('id' => 'sort-cancel', 'class' => "btn btn-warning", 'style' => 'display:none;'));
  
          return $buttons;
      }
code: public function direct($sortAction = 'sort', $urlIdParam = 'id')
      {
          $view = $this->getView();
          \MUtil_JQuery::enableView($view);
  
          $jquery = $view->jQuery();
          $jquery->enable();  //Just to make sure
  
          $handler = \ZendX_JQuery_View_Helper_JQuery::getJQueryHandler();
          $url     = $view->serverUrl() . $view->baseUrl() . '/' . $this->getRequest()->getControllerName() . '/' . $sortAction;
  
          $script = file_get_contents(__DIR__ . '/js/SortableTable.js');
          $fields = array(
              'jQuery'  => $handler,
              'AJAXURL' => $url,
              'IDPARAM' => $urlIdParam
          );
  
          $js = str_replace(array_keys($fields), $fields, $script);
  
          $jquery->addOnLoad($js);
  
          $buttons        = \Mutil_Html::div();
          $buttons->class = 'buttons pull-right';
  
          $buttons->div($this->getActionController()->_('Sort'), array('id' => 'sort', 'class' => "btn"));
          $buttons->div($this->getActionController()->_('Ok'), array('id' => 'sort-ok', 'class' => "btn btn-success", 'style' => 'display:none;'));
          $buttons->div($this->getActionController()->_('Cancel'), array('id' => 'sort-cancel', 'class' => "btn btn-warning", 'style' => 'display:none;'));
  
          return $buttons;
      }
code_tokens: public function direct ( $ sortAction = 'sort' , $ urlIdParam = 'id' ) { $ view = $ this -> getView ( ) ; \ MUtil_JQuery :: enableView ( $ view ) ; $ jquery = $ view -> jQuery ( ) ; $ jquery -> enable ( ) ; //Just to make sure $ handler = \ ZendX_JQuery_View_Helper_JQuery :: getJQueryHandler ( ) ; $ url = $ view -> serverUrl ( ) . $ view -> baseUrl ( ) . '/' . $ this -> getRequest ( ) -> getControllerName ( ) . '/' . $ sortAction ; $ script = file_get_contents ( __DIR__ . '/js/SortableTable.js' ) ; $ fields = array ( 'jQuery' => $ handler , 'AJAXURL' => $ url , 'IDPARAM' => $ urlIdParam ) ; $ js = str_replace ( array_keys ( $ fields ) , $ fields , $ script ) ; $ jquery -> addOnLoad ( $ js ) ; $ buttons = \ Mutil_Html :: div ( ) ; $ buttons -> class = 'buttons pull-right' ; $ buttons -> div ( $ this -> getActionController ( ) -> _ ( 'Sort' ) , array ( 'id' => 'sort' , 'class' => "btn" ) ) ; $ buttons -> div ( $ this -> getActionController ( ) -> _ ( 'Ok' ) , array ( 'id' => 'sort-ok' , 'class' => "btn btn-success" , 'style' => 'display:none;' ) ) ; $ buttons -> div ( $ this -> getActionController ( ) -> _ ( 'Cancel' ) , array ( 'id' => 'sort-cancel' , 'class' => "btn btn-warning" , 'style' => 'display:none;' ) ) ; return $ buttons ; }
docstring: Get the sort buttons to add under the table with sortable rows
  
  @param string $sortAction The name of the ajax action
  @param string $urlIdParam The namr used to refer to the record ID in the url
  @return MUtil_Html_HtmlElement
docstring_tokens: Get the sort buttons to add under the table with sortable rows