Index: Dev/trunk/classes/DisplayStep.php
===================================================================
--- Dev/trunk/classes/DisplayStep.php	(revision 153)
+++ 	(revision )
@@ -1,52 +1,0 @@
-<?php
-
-/**
- * DisplayStep object is the visual representation of an existing step in a pipeline, to be displayed in the pipeline sequencer.
- * Note: Can also be used for creation icons in the Toolbox, as long as no reference to an existing step object is assigned.
- * 
- * IMPORTANT: DisplayStep() should only be used to graphically display a certain Step object. 
- * It only contains a reference to an existing object ($reference), and is not the database object itself!
- * General idea: handle real objects privately, only generate DisplaySteps() based on that data, not the other way around.
- *
- * @author tschipper
- */
-class DisplayStep {
-
-//put your code here
-    private $type;
-    private $reference;
-    public $imageURL;
-    public $selected = false;
-    public $caption;
-    public $id;
-
-    public function __construct($t, $ref=null, $c, $id) {
-
-        $this->type = $t;
-        $this->reference = $ref;
-        $this->caption = $c;
-        $this->id = $id;
-
-        switch ($this->type) {
-            case "Questionnaire":
-                $this->imageURL = "images/icons/questionnaire.png";
-                break;
-            case "Dashboard":
-                $this->imageURL = "images/icons/dashboard.png";
-                break;
-            case "Application":
-                $this->imageURL = "images/icons/application.png";
-                break;
-            default:
-                $this->imageURL = null;
-                break;
-        }
-
-        //output a display object
-        //echo '<div class="displayStep"><div class="displayStepIcon" style="background-image: url('.$this->imageURL.');"></div>'.$this->caption.'</div>'."\n";
-        echo '<div class="displayStep" onClick="checkSelectedStep('.$this->id.');"><div class="displayStepIcon"><img src="' . $this->imageURL . '" /></div>' . $this->caption . '</div>';
-    }
-
-}
-
-?>
Index: Dev/trunk/classes/Step.php
===================================================================
--- Dev/trunk/classes/Step.php	(revision 153)
+++ 	(revision )
@@ -1,63 +1,0 @@
-<?php
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * Placeholder class, for testing of pipelineEditor.php only.
- * Will eventually be replaced by functioning Questionnaire, Notice, Dashboard and Application objects in array steps[].
- *
- * @author Thijs Schipper
- */
-class Step {
-
-    public $type;
-    public $name;
-    public $uid;
-    // merging step and displayStep
-
-    public $imageURL;
-
-    public function __construct($type, $name, $uid) {
-
-        // check if type given is valid, set internal variables
-        if (strtolower($type) == "application" || strtolower($type) == "dashboard" || strtolower($type) == "questionnaire") {
-            $this->type = strtolower($type);
-            $this->name = strtolower($name);
-            $this->id = strtolower($uid);
-        } else {
-            die("Invalid type given: " . $type . "\n $name $uid");
-        }
-
-        // assign relevant icon
-        switch ($this->type) {
-            case "questionnaire":
-                $this->imageURL = "images/icons/questionnaire.png";
-                break;
-            case "dashboard":
-                $this->imageURL = "images/icons/dashboard.png";
-                break;
-            case "application":
-                $this->imageURL = "images/icons/application.png";
-                break;
-            default:
-                $this->imageURL = "images/icons/unknowntype.png";
-                break;
-        }
-    }
-
-    public function init() {
-        if (isset($this->type) && isset($this->imageURL) && isset($this->name)) {
-            ?>
-            <div class="displayStep" onClick="checkSelectedStep('<?php echo $this->id; ?>');"><div class="displayStepIcon"><img src="<?php echo $this->imageURL; ?>" /></div><?php echo $this->name; ?></div>
-            <?php
-        }
-    }
-
-    public function AdjustID($offset) {
-        $this->id += $offset;
-    }
-
-}
-?>
Index: Dev/trunk/classes/Toolbox.php
===================================================================
--- Dev/trunk/classes/Toolbox.php	(revision 153)
+++ Dev/trunk/classes/Toolbox.php	(revision 154)
@@ -20,5 +20,5 @@
                 <div class="title">Toolbox</div>
                 <p>Add new: </p>
-                <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Questionnaire'; SubmitToolbox();"><img src="images/icons/questionnaire.png" class="buttonIcon"/><p>Questionnaire</p></div>
+                <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Survey'; SubmitToolbox();"><img src="images/icons/survey.png" class="buttonIcon"/><p>Survey</p></div>
                 <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Application'; SubmitToolbox();"><img src="images/icons/application.png" class="buttonIcon"/><p>Application</p></div>
                 <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Dashboard'; SubmitToolbox();"><img src="images/icons/dashboard.png" class="buttonIcon"/><p>Dashboard</p></div>
Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 153)
+++ Dev/trunk/classes/pipelineSequencer.php	(revision 154)
@@ -27,11 +27,9 @@
         $stringPipeline = rtrim($stringPipeline, ",");
         ?>
-        <br /><form name="sequencer" action="pipelineEditor.php" method="post">
+        <br /><form name="sequencerForm" action="pipelineEditor.php" method="post">
             <fieldset id="sequencer">
                 <div class="title">Name: <?php echo $this->loadedSession->title; ?> </div>
 
-                <div id="seqContent">
-
-                </div>
+                <div id="seqContent"></div>
 
                 <div id="controls">
@@ -43,7 +41,7 @@
                     <input type="checkbox" name="confirmClear" onChange="IsCheckEnabled(this, document.sequencer.clearPipeline);" />Really clear?
                 </div>
-                <div id="hiddeInputs">
+                <div id="hiddenInputs">
                     <input type="hidden" name="selectedStep" id="selectedStepField" value="" />
-                    <input type="hidden" name="pipelineString" id="pipelineStringField" value="123,456,123" />
+                    <input type="hidden" name="pipelineString" id="pipelineStringField" value="123,456" />
                 </div>
             </fieldset>
@@ -66,7 +64,6 @@
     public function Javascript() {
         $pipelineString = "ERROR";
-        
+
         echo "<!--$pipelineString-->";
-        
         ?>
         <script type="text/javascript" src="js/sequencerScripts.js"></script>
@@ -90,9 +87,62 @@
         if (count($sessionResults) > 0) {
             $this->loadedSession = $sessionResults[0];
-        } else {
+        } else {        //No session with that UID found in database!
             die("Invalid session!");
         }
     }
 
+    public function HandlePostData() {
+        if (isset($_POST['editSelected'])) {
+            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
+                redirect("editredirect.php");
+            }
+        }
+
+        if (isset($_POST['moveSelectedLeft'])) {
+            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
+                MoveStep($_POST['selectedStep'], -1);
+            }
+        }
+
+        if (isset($_POST['moveSelectedRight'])) {
+            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
+                MoveStep($_POST['selectedStep'], 1);
+            }
+        }
+
+        if (isset($_POST['objectToCreate']) && !empty($_POST['objectToCreate'])) {
+            switch (strtolower($_POST['objectToCreate'])) {
+                case "survey":
+                    redirect("createsurvey.php");
+                    break;
+                case "application":
+                    redirect("createapplication.php");
+                    break;
+                case "dashboard":
+                    redirect("createdashboard.php");
+                    break;
+                default:
+                    // Er is iets fout gegaan, want er is geen valid type meegegeven!
+                    break;
+            }
+        }
+    }
+
+    // Dit is een pure php versie. Deze slaat nog niet op in de Database, en reageert nog niet op 
+    public function MoveStep($uid, $direction) {
+        $newSession = $this->loadedSession;
+
+        for ($i = 0; $i < count($newSession->pipeline); $i++) {
+            if ($newSession->pipeline[i]->uid == $uid) {
+                $temp = $newSession->pipeline[i];
+                $newSession->pipeline[i] = $newSession->pipeline[i + $direction];
+                $newSession->pipeline[i + $direction] = $newSession->pipeline[i];
+                break;
+            }
+        }
+
+        $this->loadedSession = $newSession;
+    }
+
 }
 ?>
