Exemple #1
0
 public static function sortLabel($colId, $label)
 {
     $args = url_args();
     $args['sort'] = $colId;
     $args['sortd'] = filter_input(INPUT_GET, 'sortd') == 'asc' ? 'desc' : 'asc';
     return anchor(current_path(), $label, $args);
 }
Exemple #2
0
 public function __construct(View $view)
 {
     // csv download check
     if (is_action('export_csv') && get_safe('object_id') == $view->identifier) {
         // send the download file and halt script
         $this->generateCsv($view);
     }
     // add "Export CSV" button on navbar
     $args = url_args();
     $args['action'] = 'export_csv';
     $args['object_id'] = $view->identifier;
     $url = url(current_path(), $args);
     $view->nav->addItem(new Item(array('label' => t('Export CSV'), 'icon' => 'glyphicon-download-alt', 'url' => $url)));
 }