예제 #1
0
 /**
  * Get Ordered Files View
  */
 function get_ordered_files_view()
 {
     $this->EE->load->library('javascript');
     $files = $this->EE->input->post('files');
     $orderby = $this->EE->input->post('orderby');
     $sort = $this->EE->input->post('sort');
     $files = $files ? $files : array();
     // convert file paths to objects
     foreach ($files as $i => $id) {
         try {
             $files[$i] = $this->EE->assets_lib->get_file_by_id($id);
         } catch (Exception $exception) {
             // no-op
         }
     }
     Assets_helper::sort_files($files, $orderby, $sort);
     $vars['helper'] = $this->EE->assets_lib;
     $vars['files'] = $files;
     $vars['orderby'] = $orderby;
     $vars['sort'] = $sort;
     $vars['field_id'] = $this->EE->input->post('field_id');
     $vars['field_name'] = $this->EE->input->post('field_name');
     if (($show_cols = $this->EE->input->post('show_cols')) !== FALSE) {
         $vars['cols'] = $show_cols;
     }
     $output['html'] = $this->EE->load->view('listview/listview', $vars, TRUE);
     $output['requestId'] = $this->EE->input->post('requestId');
     exit(Assets_helper::get_json($output));
 }