source: Dev/trunk/classes/Step.php @ 149

Last change on this file since 149 was 146, checked in by fpvanagthoven, 13 years ago

Merged step/displaystep class functionality, division is unnecessary.
Added some javascript to manipulate editor objects in sequencerScripts.js

File size: 1.7 KB
Line 
1<?php
2
3/*
4 * To change this template, choose Tools | Templates
5 * and open the template in the editor.
6 */
7
8/**
9 * Placeholder class, for testing of pipelineEditor.php only.
10 * Will eventually be replaced by functioning Questionnaire, Notice, Dashboard and Application objects in array steps[].
11 *
12 * @author Thijs Schipper
13 */
14class Step {
15
16    public $type;
17    public $name;
18    public $id;
19    // merging step and displayStep
20
21    public $imageURL;
22
23    public function __construct($t, $n, $i) {
24
25        if (strtolower($t) == "application" || strtolower($t) == "dashboard" || strtolower($t) == "questionnaire") {
26            $this->type = $t;
27            $this->name = $n;
28            $this->id = $i;
29        } else {
30            die("Invalid type given: " . $t . "\n $n $i");
31        }
32
33        switch (strtolower($this->type)) {
34            case "questionnaire":
35                $this->imageURL = "images/icons/questionnaire.png";
36                break;
37            case "dashboard":
38                $this->imageURL = "images/icons/dashboard.png";
39                break;
40            case "application":
41                $this->imageURL = "images/icons/application.png";
42                break;
43            default:
44                $this->imageURL = "images/icons/unknowntype.png";
45                break;
46        }
47    }
48
49    public function AdjustID($offset) {
50        $this->id += $offset;
51    }
52
53    public function DrawStep() {
54        if (isset($this->type) && isset($this->imageURL) && isset($this->name)) {
55            ?>
56<div class="displayStep" onClick="checkSelectedStep('<?php echo $this->id; ?>');"><div class="displayStepIcon"><img src="<?php echo $this->imageURL; ?>" /></div><?php echo $this->name; ?></div>
57<?php       
58}
59    }
60
61}
62
63?>
Note: See TracBrowser for help on using the repository browser.