function edit($parameter) { $this->page_template_id = $this->getPTIFromId($parameter); $this->set('page_template_id', $this->page_template_id); $this->loadSubnav($parameter); parent::edit($parameter); }
/** * Show the form for editing the specified resource. * GET /users/{id}/edit * * @param int $id * @return Response */ public function edit($id) { //Estas funciones son para definir que las diferencias de las funciones heredadas del controlador padre //Es decir aquí se definen las diferencias que hya aocn el controller de AdminController //Una vez definidas las diferencias se devuelve al controlado padre unset($this->model->form['password']); $this->model->form['email'] = 'disabled'; //aquí es caundo devuelvo al controlador padre return parent::edit($id); }
function edit($parameter) { $this->checkUserId($parameter); parent::edit($parameter); }
public function edit() { $this->configVars(); parent::edit(); }
public function edit($id = null) { $this->MediaFile = parent::edit($id); $this->data->set('pageTitle', $this->MediaFile->getText('title', $this->MediaFile->filename)); // language and texts foreach ($this->Languages as $Language) { $TextModel = $this->MediaFile->{'Text' . String::ucFirst($Language->id)}; $TextModel->MediaFile = $this->MediaFile; $TextModel->User = $this->UserLogin->User; $Form = new AdminMediaTextForm(); $Form->attributes->set('name', 'AdminMediaTextForm' . ucfirst($Language->id)); $Form->attributes->set('id', 'AdminMediaTextForm' . ucfirst($Language->id)); $Form->init($this); $Form->startup(); $Form->configure(); $Form->fromModel($TextModel); $Form->attributes->set('action', Router::uri()); $Form->language_id->value($Language->id); $this->data->set('AdminMediaTextForm' . String::ucFirst($Language->id), $Form); if ($Form->ok() && $this->request->data['language_id'] == $Language->id) { $Form->toModel($TextModel); if (!$TextModel->save()) { $Form->errors = $TextModel->validationErrors; } else { $Form->success = __('Erfolgreich :1 gespeichert', $Language->get('name'), FlashMessageType::SUCCESS); $this->redirect(Router::url()); } } } // newly uploaded files $this->AdminMediaFileForm->file->mandatory(false); if ($this->AdminMediaFileForm->ok()) { $this->AdminMediaFileForm->toModel($this->MediaFile); if ($newFile = $this->AdminMediaFileForm->file->value()) { $this->MediaFile->replace($newFile, $this->AdminMediaFileForm->file->originalFilename()); } if (!$this->MediaFile->save()) { $this->AdminMediaFileForm->errors = $this->MediaFile->validationErrors; } else { $this->FlashMessage->set(__('Erfolgreich gespeichert'), FlashMessageType::SUCCESS); } } }