public function render($isLoggedIn, LoginView $v, DateTimeView $dtv) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> <?php if ($isLoggedIn) { echo "<h2>Logged in</h2>"; } else { echo "<h2>Not logged in</h2>"; } ?> <div class="container" > <?php echo $v->response(); $dtv->show(); ?> </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> <?php }
/** * Sets up the layout HTML that goes around the selected tool * @param view $view * @param \view\DateTimeView $dtv */ public function render($view, DateTimeView $dtv) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Study Tools</title> </head> <body> <h1>Final Project</h1> <?php echo '<a href="?">Home | </a>'; echo '<a href="?calculator"> Calculator | </a>'; echo '<a href="?converter"> Unit Converter | </a>'; echo '<a href="?periodictable"> Periodic Table</a>'; ?> <div class="container" > <?php echo $view->doView(); $dtv->show(); ?> </div> </body> </html> <?php }
public function render($isLoggedIn, $view) { $dtv = new DateTimeView(); echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $this->renderURL($view) . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $view->response() . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, LoginView $v, DateTimeView $dtv, $msg, RegisterView $rv, $name) { if (!empty($_SESSION['reg'])) { $exit = '<form method="post" > <input type="submit" name="' . self::$login . '" value="back to login"/> </form>'; $view = $rv; $tit = '<h2>Register new user</h2>'; } else { $exit = ''; $view = $v; $tit = ''; } $out = '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 4</h1> ' . $exit . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' ' . $tit . ' <div class="container"> ' . $view->response($isLoggedIn, $msg, $name) . ' ' . $dtv->show() . ' </div> </body> </html> '; echo $out; }
public function render($isLoggedIn, LoginView $v, DateTimeView $dtv, RegistrationView $r, EditView $ev, ViewEntryView $vev) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>The Initiative for Procrastination</title> <link rel="stylesheet" type="text/css" href="css/stylesheet.css"/> </head> <body> <h1 id="headline">The Initiative for Procrastination</h1> <?php if ($isLoggedIn) { echo "<h2>Logged in</h2>"; if ($ev->clickedNewEntry()) { echo $ev->getStartLink(); } elseif ($v->userWantsToView()) { echo $vev->getStartLink(); } else { echo $ev->getEntryLink(); } } else { echo "<h2>Not logged in</h2>"; if ($r->clickedRegister()) { echo $r->getLoginLink(); } elseif (!$isLoggedIn) { echo $r->getRegLink(); } } ?> <div class="container" > <?php if ($r->clickedRegister() && $r->regSuccess() === false) { echo $r->response(); } elseif ($ev->clickedNewEntry() && $ev->saveSuccess() === false && $isLoggedIn) { echo $ev->response(); } elseif ($v->userWantsToView() && $v->clickedMenuItem() === true) { echo $vev->response(); } else { if ($isLoggedIn) { echo $v->response(); echo $v->getMenu(); echo $v->getLogoutButton(); } echo $v->response(); } $dtv->show(); ?> </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> <?php }
public function render($isLoggedIn, LoginView $v, DateTimeView $dtv, RegisterView $rv) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> <?php if ($rv->userClickedOnRegister()) { echo $rv->getBackLink(); } else { if (!$isLoggedIn) { echo $rv->getRegistrationLink(); } } if ($isLoggedIn) { echo "<h2>Logged in</h2>"; } else { echo "<h2>Not logged in</h2>"; } ?> <div class="container" > <?php if ($rv->userClickedOnRegister() && $rv->registrationSucceeded() === FALSE) { echo $rv->response(); } else { echo $v->response(); } $dtv->show(); ?> </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> <?php }
/** * Method that renders all the pages. It takes date/time, navigation object * and view chosen from the the controller. * @param object $dtv DateTimeView * @param object $nv NavigationView * @param object $chosenOption could be any of the views * does not return but writes to output nonetheless */ public function render(DateTimeView $dtv, NavigationView $nv, $chosenOption) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Converter</title> </head> <body> <h1><center>' . $chosenOption->header() . '</center></h1> ' . $nv->renderLink() . ' <div class="container"> ' . $this->response($chosenOption) . ' </div> <center> ' . $chosenOption->getInfo() . ' </center> ' . $dtv->show() . ' </body> </html> '; }
public function render($registerNewUser, $isLoggedIn, iLayoutView $v, DateTimeView $dtv, iLayoutView $content = null) { ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Todo-app Example</title> <link rel="stylesheet" href="/style/custom.css"> </head> <body> <h1>Project in PHP</h1> <?php if ($registerNewUser) { echo '<a href="./">Back to login</a>'; } else { echo '<a href="?register">Register a new user</a>'; } if ($isLoggedIn) { echo "<h2>Logged in</h2>"; } else { echo "<h2>Not logged in</h2>"; } ?> <div class="container" > <?php echo $v->response(); if ($content) { echo "<br />" . $content->response(); } $dtv->show(); ?> </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> <?php }
public function render($isLoggedIn, $view, DateTimeView $dtv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 4</h1> ' . $this->generateRegisterLinkHTML($isLoggedIn) . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $view->response() . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function renderRegister($isLoggedIn, RegisterView $rv, DateTimeView $dtv, NavigationView $nv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Assignment 4</title> </head> <body> <h1>Assignment 4</h1> ' . $nv->getLinks() . $this->renderIsLoggedIn($isLoggedIn) . ' <h2>Register new user</h2> <div class="container"> ' . $rv->generateRegistrationFormHTML() . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render(IView $v, DateTimeView $dtv, NavigationView $nav, $message) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 4</h1> ' . $this->renderIsLoggedIn($nav) . ' <div class="container"> ' . $v->response($message) . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn = false, $html, DateTimeView $dtv, NavigationView $navigationView) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $navigationView->render($isLoggedIn) . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $html . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, $pressedRegister, $didRegisterSucceed, LoginView $v, RegisterView $regView, DateTimeView $dtv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $this->renderRegisterLink($didRegisterSucceed) . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $this->renderContent($isLoggedIn, $pressedRegister, $didRegisterSucceed, $v, $regView) . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, $HTMLview, DateTimeView $dtv, $linkTag) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $linkTag . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $HTMLview . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render(LoginView $v, DateTimeView $dtv) { $ret = $v->response(); echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $this->renderIsLoggedIn() . ' <div class="container"> ' . $ret . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($LoggedIn, NavigationVIew $v, DateTimeView $dtv, $registerLink) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $registerLink . ' ' . $this->renderIsLoggedIn($LoggedIn) . ' <div class="container"> ' . $v->response() . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, NavigationView $nv, LoginView $v, RegisterView $rv, DateTimeView $dtv) { $ret1 = '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 4</h1>'; echo $ret1; if (!$isLoggedIn) { if ($nv->userWantsToRegister()) { $ret3 = $nv->getLinkToLogin(); } else { $ret3 = $nv->getLinkToRegister("Register a new user"); } } $ret3 .= ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> '; echo $ret3; if ($rv->isUserDoneRegistering() || !$nv->userWantsToRegister()) { $ret2 = $v->response($rv->getProvidedUsername()); } else { $ret2 = $rv->response(); } $ret2 .= ' ' . $dtv->show() . ' </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> '; echo $ret2; }
public function render($isLoggedIn, LoginView $v_lv, RegisterView $v_rv, DateTimeView $dtv, NavigationView $v_nv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 4</h1> ' . $this->renderIsLoggedIn($isLoggedIn, $v_nv) . ' <div class="container"> ' . $this->renderViewResponse($v_lv, $v_rv, $v_nv) . ' ' . $dtv->show() . ' </div> <div> <em>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</em> </div> </body> </html> '; }
public function render($isLoggedIn, LoginView $loginView, DateTimeView $dtv, RegisterView $registerView) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> </head> <body> <h1>Assignment 2</h1> ' . $this->getNavLink($isLoggedIn) . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' ' . $this->getFormDisplay($isLoggedIn, $loginView, $registerView) . ' <div class="container"> ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, $view, DateTimeView $dtv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Project</title> <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Shadows+Into+Light+Two" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="css/main.css" > </head> <body> <h1 class="projectH">Project</h1> ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $view->response() . ' ' . $dtv->show() . ' </div> </body> </html> '; }
public function render($isLoggedIn, IView $v, DateTimeView $dtv) { echo '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login Example</title> <link rel="stylesheet" href="css/stylesheet.css"> </head> <body> <h1>Assignment 2</h1> ' . $this->renderRegistrationLink($isLoggedIn, $v) . ' ' . $this->renderIsLoggedIn($isLoggedIn) . ' <div class="container"> ' . $v->response() . ' ' . $dtv->show() . ' </div> </body> </html> '; }