Пример #1
0
    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 
    }
Пример #2
0
    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 
    }
 private function renderViewResponse(LoginView $v_lv, RegisterView $v_rv, NavigationView $v_nv)
 {
     if ($v_nv->inRegistration()) {
         return $v_rv->response();
     } else {
         return $v_lv->response();
     }
 }
Пример #4
0
    public function doAdminPanel($isLoggedIn, LoginView $v, AdminPanelView $av)
    {
        ?>
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <title><?php 
        echo \Settings::HOMEPAGE_TITLE;
        ?>
 - Admin Panel</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
      </head>
      <body>
            <main>
                <header>
                    <?php 
        if ($isLoggedIn) {
            echo "<h1>Admin Panel</h1>";
        } else {
            echo "<h1>Log in</h1>";
        }
        ?>
                </header>
                <div id="menu">
                      <?php 
        if ($isLoggedIn) {
            echo $av->getMenuHTML();
        }
        ?>
                </div>
                <div id="content">
                      <?php 
        echo $v->response();
        ?>
                      <?php 
        echo $av->response();
        ?>
                </div>
            </main>

            <footer>
                <a href="?">Back to public page</a>
                <p>This site uses cookies to improve user experience. By continuing to browse the site you are agreeing to our use of cookies.</p>
            </footer>
       </body>
    </html>
    <?php 
    }
Пример #5
0
    /**
     * @param LoginView $v
     * @param PostView $pv
     */
    public function render(LoginView $v, PostView $pv)
    {
        echo '<!DOCTYPE html>
                <html>
                    <head>
                         <meta charset="utf-8">
                         <title>The Blogster</title>
                    </head>
                    <body>
                        <h1>Blogster A.K.A The Reddit of 1995</h1>
                        <div class="container">
                            ' . $v->response() . '

                            ' . $pv->show() . '
                        </div>
                    </body>
                </html>';
    }
    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 
    }
Пример #7
0
 public function render($isLoggedIn, LoginView $v, DateTimeView $dtv)
 {
     echo '<!DOCTYPE html>
   <html>
     <head>
       <meta charset="utf-8">
       <title>Login Example</title>
     </head>
     <body>
       <h1>Assignment 2</h1>
       ' . $this->renderIsLoggedIn($isLoggedIn) . '
       
       <div class="container">
           ' . $v->response() . '
           
           ' . $dtv->show() . '
       </div>
      </body>
   </html>
 ';
 }
Пример #8
0
 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;
 }