Last change
on this file since 144 was
144,
checked in by fpvanagthoven, 13 years ago
|
Fixed mkdir call in ApplicationConnector?.php, now actually makes a directory instead of errors.
Cleaning up of pipeline Sequencer, smaller icons, etc. Trying to get non-db version of editor working properly, then integrate db calls.
|
File size:
1.8 KB
|
Rev | Line | |
---|
[142] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * DisplayStep object is the visual representation of an existing step in a pipeline, to be displayed in the pipeline sequencer. |
---|
| 5 | * Note: Can also be used for creation icons in the Toolbox, as long as no reference to an existing step object is assigned. |
---|
| 6 | * |
---|
| 7 | * IMPORTANT: DisplayStep() should only be used to graphically display a certain Step object. |
---|
| 8 | * It only contains a reference to an existing object ($reference), and is not the database object itself! |
---|
| 9 | * General idea: handle real objects privately, only generate DisplaySteps() based on that data, not the other way around. |
---|
| 10 | * |
---|
| 11 | * @author tschipper |
---|
| 12 | */ |
---|
| 13 | class DisplayStep { |
---|
| 14 | |
---|
| 15 | //put your code here |
---|
| 16 | private $type; |
---|
| 17 | private $reference; |
---|
| 18 | public $imageURL; |
---|
| 19 | public $selected = false; |
---|
[144] | 20 | public $caption; |
---|
| 21 | public $id; |
---|
[142] | 22 | |
---|
[144] | 23 | public function __construct($t, $ref=null, $c, $id) { |
---|
| 24 | |
---|
[142] | 25 | $this->type = $t; |
---|
| 26 | $this->reference = $ref; |
---|
[144] | 27 | $this->caption = $c; |
---|
| 28 | $this->id = $id; |
---|
| 29 | |
---|
[142] | 30 | switch ($this->type) { |
---|
| 31 | case "Questionnaire": |
---|
[144] | 32 | $this->imageURL = "images/icons/questionnaire.png"; |
---|
[142] | 33 | break; |
---|
| 34 | case "Dashboard": |
---|
[144] | 35 | $this->imageURL = "images/icons/dashboard.png"; |
---|
[142] | 36 | break; |
---|
| 37 | case "Application": |
---|
[144] | 38 | $this->imageURL = "images/icons/application.png"; |
---|
[142] | 39 | break; |
---|
| 40 | default: |
---|
| 41 | $this->imageURL = null; |
---|
| 42 | break; |
---|
| 43 | } |
---|
[144] | 44 | |
---|
[142] | 45 | //output a display object |
---|
[144] | 46 | //echo '<div class="displayStep"><div class="displayStepIcon" style="background-image: url('.$this->imageURL.');"></div>'.$this->caption.'</div>'."\n"; |
---|
| 47 | echo '<div class="displayStep"><div class="displayStepIcon"><img src="' . $this->imageURL . '" /></div>' . $this->caption . '</div>'; |
---|
[142] | 48 | } |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.