source: Dev/trunk/classes/ApplicationMenu.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/**
4 * Description of ApplicationMenu
5 *
6 * @author fpvanagthoven
7 */
8class ApplicationMenu {
9
10    public function __construct() {
[58]11        ?> <div id="menu2" class="menu"> <?php
12        ?> <div class="menuButtons"> <?php
[57]13        ApplicationMenu::createApplicationButton();
[58]14        ApplicationMenu::loadApplicationButton();
15        ?> </div> <?php
16        ApplicationMenu::loadApplicationList(null);
17        ?> </div> <?php
[57]18    }
19
20    public static function createApplicationButton() {
21        ?>
[58]22
[57]23        <form action="applicationcreation.php" method="post">
24
25            <input type="submit" value="Create new application" class="surveyButton bigSurveyButton" />
26
27        </form>
28
29        <?php
30    }
31
[58]32    /**
33     *
34     * @param Survey $surveys An array of surveys
35     */
36    public static function loadApplicationButton() {
37        ?>
38        <form id="loadApplicationForm" action="applicationcreation.php" method="post">
39            <input type="button" onclick="loadApplication()" value="Load/Edit application" class="surveyButton bigSurveyButton" />
40        </form>
41
42
43        <?php
44    }
45
46    public static function loadApplicationList($applications) {
47        ?>
48        <select id="applicationsToLoad" class="toLoad" size="1000">
49            <?php
50            foreach ($applications as $application) {
51                ?><option value='<?php echo $application->id; ?>'><?php echo $application->name; ?></option><?php
52        }
53            ?>
54        </select>
55        <?php
56
57    }
58
[57]59}
60?>
Note: See TracBrowser for help on using the repository browser.