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

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

Refactoring main menu

File size: 1.2 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) {
15        SurveyMenu::newSurveyButton();
16        SurveyMenu::loadSurveyButton($surveys);
17    }
18
19    public static function newSurveyButton() {
20        ?>
21
22        <form action="surveycreation.php" method="post">
23
24            <input type="submit" value="Create new survey" class="surveyButton bigSurveyButton" />
25
26        </form>
27
28        <?php
29    }
30
31    /**
32     *
33     * @param Survey $surveys An array of surveys
34     */
35    public static function loadSurveyButton($surveys) {
36        ?>
37        <form id="loadForm" action="surveycreation.php" method="post">
38            <input type="button" onclick="loadSurvey()" value="Load survey" class="surveyButton bigSurveyButton" />
39        </form>
40        <br/>
41        <select id="surveysToLoad" size="1000">
42            <?php
43            foreach ($surveys as $survey) {
44                ?><option value='<?php echo $survey->id; ?>'><?php echo $survey->title; ?></option><?php
45        }
46            ?>
47        </select>
48        <?php
49    }
50
51}
52?>
Note: See TracBrowser for help on using the repository browser.