diff --git a/nette/notejam/app/components/Notes/INotesFactory.php b/nette/notejam/app/components/Notes/INotesFactory.php index a99c33142..375c2e520 100644 --- a/nette/notejam/app/components/Notes/INotesFactory.php +++ b/nette/notejam/app/components/Notes/INotesFactory.php @@ -1,6 +1,5 @@ logger = $logger; } - /** * @return Nette\Application\IResponse */ diff --git a/nette/notejam/app/presenters/HomepagePresenter.php b/nette/notejam/app/presenters/HomepagePresenter.php index fc012dcbb..c9a8814cd 100644 --- a/nette/notejam/app/presenters/HomepagePresenter.php +++ b/nette/notejam/app/presenters/HomepagePresenter.php @@ -20,6 +20,9 @@ class HomepagePresenter extends SecuredBasePresenter /** @var object[] */ protected $notes; + + /********************* Controls ***********************************************************************************/ + /** * @return \App\Components\Notes\Notes */ @@ -28,6 +31,12 @@ protected function createComponentNotes() return $this->notesFactory->create($this->notes); } + /********************* Actions ************************************************************************************/ + + /** + * Homepage:default. + * @param string $order + */ public function actionDefault($order) { $this->notes = $this->noteManager->findAll(); @@ -36,6 +45,9 @@ public function actionDefault($order) } } + /** + * Homepage:default render. + */ public function renderDefault() { $this->template->notes = $this->notes; diff --git a/nette/notejam/app/presenters/NotePresenter.php b/nette/notejam/app/presenters/NotePresenter.php index e1acc9846..4a8d48918 100644 --- a/nette/notejam/app/presenters/NotePresenter.php +++ b/nette/notejam/app/presenters/NotePresenter.php @@ -1,6 +1,5 @@ loadNote($id); $this->notes = $this->noteManager->findByPad($id); } + /** + * Note:default render. + */ public function renderDefault() { $this->template->note = $this->note; } + /** + * Note:edit. + * @param int $id + * @throws BadRequestException + */ public function actionEdit($id) { $this->loadNote($id); } + /** + * Note:edit render. + */ public function renderEdit() { $this->template->note = $this->note; } + /** + * Note:delete. + * @param int $id + * @throws BadRequestException + */ public function actionDelete($id) { $this->loadNote($id); } + /** + * Note:delete render. + */ public function renderDelete() { $this->template->note = $this->note; } + /** + * Note:new. + * @param int $pad + */ public function actionNew($pad) { $this->padId = $pad; } /** + * Loads note with given id and if not found, throws BadRequestException. * @param int $id * @throws BadRequestException */ @@ -147,5 +179,4 @@ private function loadNote($id) } } - } diff --git a/nette/notejam/app/presenters/PadPresenter.php b/nette/notejam/app/presenters/PadPresenter.php index 4c1afc2dd..84b7759fb 100644 --- a/nette/notejam/app/presenters/PadPresenter.php +++ b/nette/notejam/app/presenters/PadPresenter.php @@ -1,6 +1,5 @@ loadPad($id); @@ -115,32 +124,52 @@ public function actionDefault($id, $order) } } + /** + * Pad:default render. + */ public function renderDefault() { $this->template->pad = $this->pad; } + /** + * Pad:edit. + * @param int $id + * @throws BadRequestException + */ public function actionEdit($id) { $this->loadPad($id); } + /** + * Pad:edit render. + */ public function renderEdit() { $this->template->pad = $this->pad; } + /** + * Pad:delete. + * @param int $id + * @throws BadRequestException + */ public function actionDelete($id) { $this->loadPad($id); } + /** + * Pad:delete render. + */ public function renderDelete() { $this->template->pad = $this->pad; } /** + * Loads pad with given id and if not found, throws BadRequestException. * @param int $id * @throws BadRequestException */ diff --git a/nette/notejam/app/presenters/SecuredBasePresenter.php b/nette/notejam/app/presenters/SecuredBasePresenter.php index 0cffc00bc..8899dd733 100644 --- a/nette/notejam/app/presenters/SecuredBasePresenter.php +++ b/nette/notejam/app/presenters/SecuredBasePresenter.php @@ -1,12 +1,14 @@ user->isLoggedIn()) { @@ -91,6 +95,9 @@ public function actionIn() } } + /** + * Sign:up. + */ public function actionUp() { if ($this->user->isLoggedIn()) { @@ -98,9 +105,12 @@ public function actionUp() } } + /** + * Sign:out. + */ public function actionOut() { - $this->getUser()->logout(TRUE); + $this->getUser()->logout(true); $this->flashMessage('You have been signed out.', 'info'); $this->redirect('in'); }