Esempio n. 1
0
 /**
  * Display records
  *
  * @return  void
  */
 public function displayTask()
 {
     // Get filters
     $this->view->filters = array('limit' => Request::getState($this->_option . '.' . $this->_controller . '.limit', 'limit', Config::get('list_limit'), 'int'), 'start' => Request::getState($this->_option . '.' . $this->_controller . '.limitstart', 'limitstart', 0, 'int'), 'state' => array(1), 'sort' => 'name', 'sort_Dir' => 'ASC', 'type' => 'members');
     // get all imports from archive
     $archive = \Hubzero\Content\Import\Model\Hook\Archive::getInstance();
     $this->view->total = $archive->hooks('count', $this->view->filters);
     $this->view->hooks = $archive->hooks('list', $this->view->filters);
     // Set any errors
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     // Output the HTML
     $this->view->setLayout('display')->display();
 }
Esempio n. 2
0
 /**
  * Edit an Import
  *
  * @param   object  $row  \Members\Models\Import
  * @return  void
  */
 public function editTask($row = null)
 {
     Request::setVar('hidemainmenu', 1);
     // get the import object
     if (!$row instanceof \Components\Members\Models\Import) {
         // get request vars
         $id = Request::getVar('id', array(0));
         if (is_array($id)) {
             $id = isset($id[0]) ? $id[0] : 0;
         }
         $row = new \Components\Members\Models\Import($id);
     }
     $this->view->import = $row;
     // import params
     $this->view->params = new \Hubzero\Config\Registry($this->view->import->get('params'));
     // get all files in import filespace
     if ($this->view->import->exists()) {
         if ($this->_createImportFilespace($this->view->import)) {
             $this->view->files = Filesystem::files($this->view->import->fileSpacePath(), '.');
         }
     }
     // get all imports from archive
     $hooksArchive = \Hubzero\Content\Import\Model\Hook\Archive::getInstance();
     $this->view->hooks = $hooksArchive->hooks('list', array('state' => array(1)));
     // Set any errors
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     // Output the HTML
     $this->view->setLayout('edit')->display();
 }