Ignore:
Timestamp:
11/07/11 14:41:16 (13 years ago)
Author:
fpvanagthoven
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/Step.php

    r144 r146  
    1717    public $name;
    1818    public $id;
     19    // merging step and displayStep
     20
     21    public $imageURL;
    1922
    2023    public function __construct($t, $n, $i) {
    2124
    2225        if (strtolower($t) == "application" || strtolower($t) == "dashboard" || strtolower($t) == "questionnaire") {
     26            $this->type = $t;
    2327            $this->name = $n;
    24             $this->type = $t;
    2528            $this->id = $i;
     29        } else {
     30            die("Invalid type given: " . $t . "\n $n $i");
    2631        }
    27         else {
    28             die("Invalid type given: ".$t."\n $n $i");
     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;
    2946        }
     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}
    3059    }
    3160
Note: See TracChangeset for help on using the changeset viewer.