Last change
on this file since 146 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
|
Rev | Line | |
---|
[144] | 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 | */ |
---|
| 14 | class Step { |
---|
| 15 | |
---|
| 16 | public $type; |
---|
| 17 | public $name; |
---|
| 18 | public $id; |
---|
[146] | 19 | // merging step and displayStep |
---|
[144] | 20 | |
---|
[146] | 21 | public $imageURL; |
---|
| 22 | |
---|
[144] | 23 | public function __construct($t, $n, $i) { |
---|
| 24 | |
---|
| 25 | if (strtolower($t) == "application" || strtolower($t) == "dashboard" || strtolower($t) == "questionnaire") { |
---|
[146] | 26 | $this->type = $t; |
---|
[144] | 27 | $this->name = $n; |
---|
| 28 | $this->id = $i; |
---|
[146] | 29 | } else { |
---|
| 30 | die("Invalid type given: " . $t . "\n $n $i"); |
---|
[144] | 31 | } |
---|
[146] | 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; |
---|
[144] | 46 | } |
---|
| 47 | } |
---|
| 48 | |
---|
[146] | 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 |
---|
[144] | 58 | } |
---|
[146] | 59 | } |
---|
[144] | 60 | |
---|
[146] | 61 | } |
---|
| 62 | |
---|
[144] | 63 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.