Changeset 150 for Dev/trunk/classes/Step.php
- Timestamp:
- 11/07/11 18:02:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/Step.php
r146 r150 1 1 <?php 2 3 2 /* 4 3 * To change this template, choose Tools | Templates … … 16 15 public $type; 17 16 public $name; 18 public $ id;17 public $uid; 19 18 // merging step and displayStep 20 19 21 20 public $imageURL; 22 21 23 public function __construct($t , $n, $i) {22 public function __construct($type, $name, $uid) { 24 23 25 if (strtolower($t) == "application" || strtolower($t) == "dashboard" || strtolower($t) == "questionnaire") { 26 $this->type = $t; 27 $this->name = $n; 28 $this->id = $i; 24 // check if type given is valid, set internal variables 25 if (strtolower($type) == "application" || strtolower($type) == "dashboard" || strtolower($type) == "questionnaire") { 26 $this->type = strtolower($type); 27 $this->name = strtolower($name); 28 $this->id = strtolower($uid); 29 29 } else { 30 die("Invalid type given: " . $t . "\n $n $i");30 die("Invalid type given: " . $type . "\n $name $uid"); 31 31 } 32 32 33 switch (strtolower($this->type)) { 33 // assign relevant icon 34 switch ($this->type) { 34 35 case "questionnaire": 35 36 $this->imageURL = "images/icons/questionnaire.png"; … … 47 48 } 48 49 50 public function init() { 51 if (isset($this->type) && isset($this->imageURL) && isset($this->name)) { 52 ?> 53 <div class="displayStep" onClick="checkSelectedStep('<?php echo $this->id; ?>');"><div class="displayStepIcon"><img src="<?php echo $this->imageURL; ?>" /></div><?php echo $this->name; ?></div> 54 <?php 55 } 56 } 57 49 58 public function AdjustID($offset) { 50 59 $this->id += $offset; 51 60 } 52 61 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 <?php58 62 } 59 }60 61 }62 63 63 ?>
Note: See TracChangeset
for help on using the changeset viewer.