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
Line 
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) {
15        ?> <div id="menu3" class="menu"> <?php
16        ?> <div class="menuButtons"> <?php
17        SurveyMenu::newSurveyButton();
18        SurveyMenu::loadSurveyButton();
19        ?> </div> <?php
20        SurveyMenu::loadSurveyList($surveys);
21        ?> </div> <?php
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     */
40    public static function loadSurveyButton() {
41        ?>
42        <form id="loadForm" action="surveycreation.php" method="post">
43            <input type="button" onclick="loadSurvey()" value="Load/Edit survey" class="surveyButton bigSurveyButton" />
44        </form>
45        <?php
46    }
47
48    public static function loadSurveyList($surveys) {
49        ?>
50        <select id="surveysToLoad" class="toLoad" size="1000">
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
59    }
60
61}
62?>
Note: See TracBrowser for help on using the repository browser.