Example #1
0
 private function generateItemForm()
 {
     $hasPage = isset($this->page);
     $title = $hasPage ? $this->page->getTitle() : '';
     $slug = $hasPage ? $this->page->getSlug() : '';
     $bodyContent = $hasPage ? $this->page->getBody() : '';
     return \Primitive\Tools::render($this->templates . 'form.html', ['titleId' => self::$title, 'titleContent' => $title, 'slugId' => self::$slug, 'slugContent' => $slug, 'textAreaId' => self::$body, 'textAreaContent' => $bodyContent, 'submitId' => self::$updatePage]);
 }
Example #2
0
 public function loginSuccessful(Credentials $credentials)
 {
     if (isset($_POST[self::$keep])) {
         $expiration = $credentials->getTemporaryExpiration();
         CookieHelper::set(self::$cookieName, $credentials->getUsername(), $expiration);
         CookieHelper::set(self::$cookiePassword, $credentials->getTemporaryPassword(), $expiration);
     }
     \Primitive\Tools::redirect();
 }
Example #3
0
 private function generateNavigation()
 {
     $logoutButton = \Primitive\Tools::render($this->templates . 'logoutButton.html', ['buttonName' => self::$logout]);
     return $this->links . $logoutButton;
 }