/** * Show the member edit page * * @return string Returns the member edit page as HTML code. */ public function boxEdit() { if ($Box = Box::get()->byID($this->request->param('ID'))) { $GLOBALS['BoxID'] = $Box->ID; } return $this->customise(new ArrayData(array("Title" => _t('AdminBoxEdit.TITLE', 'AdminBoxEdit.TITLE'), "Form" => $this->BoxEditForm(), "Box" => $Box)))->renderWith(array('BoxAdmin_boxedit', 'BoxAdmin', $this->stat('template_main'), $this->stat('template'))); }
public function doAdd(array $data) { //print_r($data, true); die(); if ($Box = Box::get()->byID($data['BoxID'])) { $Box->Description = $data['Description']; // Update Description $Box->write(); $Version = new BoxVersion(); $Version->Version = $data['Version']; $Version->BoxID = $Box->ID; $Version->write(); $Provider = new BoxProvider(); $Provider->Name = 'virtualbox'; $Provider->VersionID = $Version->ID; $Provider->ChecksumType = 'sha1'; $this->saveInto($Provider); //$Provider->write(); $Provider->Checksum = sha1_file($Provider->File()->getFullPath()); $Provider->write(); } else { $this->sessionMessage(_t('BoxAddVersionForm.INVALIDBOX', 'BoxAddVersionForm.INVALIDBOX'), 'bad'); return $this->controller->redirectBack(); } $this->controller->redirect('cloud/index'); }
public function doEdit(array $data) { if ($Box = Box::get()->byID($data['ID'])) { $this->saveInto($Box); $Box->write(); } $this->controller->redirect('boxadmin/boxes'); }
public function doAdd(array $data) { if ($Box = Box::get()->filter(array("Title" => $data['Title']))->first()) { $this->addErrorMessage('Title', _t('BoxAddForm.TITLEEXISTS', 'BoxAddForm.TITLEEXISTS'), 'bad'); $this->controller->redirectBack(); return false; } $Box = Box::create(); $this->saveInto($Box); $Box->write(); $this->controller->redirect('boxadmin/boxes'); }
/** * Show the "login" page * * @return string Returns the "login" page as HTML code. */ public function index() { // Vorerst keine Seite erstellt return $this->customise(new ArrayData(array("Title" => _t('Cloud.TITLE', 'Cloud.TITLE'), "Content" => _t('Cloud.CONTENT', 'Cloud.CONTENT'), "PublicBoxes" => Box::get()->filter(array('Public' => true)), "MyBoxes" => Member::currentUser()->Boxes())))->renderWith(array('Cloud_index', 'Home', $this->stat('template_main'), $this->stat('template'))); }