Ejemplo n.º 1
0
 public function publish()
 {
     if (!$this->loadData()) {
         $this->dataError();
         sendBack();
     }
     $systemcompany = $this->_uses[$this->modeltype];
     $flash = Flash::Instance();
     $errors = array();
     if (Publish::systemCompany($systemcompany, $errors)) {
         $flash->addMessage($systemcompany->company . ' successfully published');
     } else {
         $flash->addError('Failed to publish ' . $systemcompany->company);
     }
     if (count($errors) > 0) {
         $flash->addErrors($errors);
     }
     sendTo($this->name, 'index', $this->_modules);
 }