source: Dev/trunk/classes/SurveyMenu.php @ 58

Last change on this file since 58 was 58, checked in by fpvanagthoven, 14 years ago

mainmenu.php tweaked for usability. When not logged in, the user gets redirected to index.php

File size: 1.5 KB
RevLine 
[57]1<?php
2/*
3 * To change this template, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/**
8 * Description of SurveyMenu
9 *
10 * @author fpvanagthoven
11 */
12class SurveyMenu {
13
14    public function __construct($surveys) {
[58]15        ?> <div id="menu3" class="menu"> <?php
16        ?> <div class="menuButtons"> <?php
[57]17        SurveyMenu::newSurveyButton();
[58]18        SurveyMenu::loadSurveyButton();
19        ?> </div> <?php
20        SurveyMenu::loadSurveyList($surveys);
21        ?> </div> <?php
[57]22    }
23
24    public static function newSurveyButton() {
25        ?>
26
27        <form action="surveycreation.php" method="post">
28
29            <input type="submit" value="Create new survey" class="surveyButton bigSurveyButton" />
30
31        </form>
32
33        <?php
34    }
35
36    /**
37     *
38     * @param Survey $surveys An array of surveys
39     */
[58]40    public static function loadSurveyButton() {
[57]41        ?>
42        <form id="loadForm" action="surveycreation.php" method="post">
[58]43            <input type="button" onclick="loadSurvey()" value="Load/Edit survey" class="surveyButton bigSurveyButton" />
[57]44        </form>
[58]45        <?php
46    }
47
48    public static function loadSurveyList($surveys) {
49        ?>
50        <select id="surveysToLoad" class="toLoad" size="1000">
[57]51            <?php
52            foreach ($surveys as $survey) {
53                ?><option value='<?php echo $survey->id; ?>'><?php echo $survey->title; ?></option><?php
54        }
55            ?>
56        </select>
57        <?php
[58]58
[57]59    }
60
61}
62?>
Note: See TracBrowser for help on using the repository browser.