Index: Dev/trunk/classes/Toolbox.php
===================================================================
--- Dev/trunk/classes/Toolbox.php	(revision 182)
+++ Dev/trunk/classes/Toolbox.php	(revision 185)
@@ -16,28 +16,14 @@
 
         <br />
-        
+
         <div id="toolbox" class="largeFrame">
             <div class="largeTitle">Toolbox</div>
             <div class="content">
                 <p style="float: left; clear:both; margin-bottom: 1em;">Add new:</p>
-                <div class="bigButton vert" onClick="SubmitToolbox('Survey');"><img src="images/icons/survey.png" class="buttonIcon" /><p>Survey</p></div>
-                <div class="bigButton vert" onClick="SubmitToolbox('Application');"><img src="images/icons/application.png" class="buttonIcon" /><p>Application</p></div>
-                <div class="bigButton vert" onClick="SubmitToolbox('Dashboard');"><img src="images/icons/dashboard.png" class="buttonIcon" /><p>Dashboard</p></div>
+                <div class="bigButton toolbox" onClick="submitToolbox('Survey');"><img src="images/icons/survey.png" class="buttonIcon" /><p>Survey</p></div>
+                <div class="bigButton toolbox" onClick="submitToolbox('Application');"><img src="images/icons/application.png" class="buttonIcon" /><p>Application</p></div>
+                <div class="bigButton toolbox" onClick="submitToolbox('Dashboard');"><img src="images/icons/dashboard.png" class="buttonIcon" /><p>Dashboard</p></div>
             </div>
         </div>
-        
-        
-        <!--
-        <form name="toolbox" action="pipelineEditor.php" method="POST">
-            <fieldset id="toolbox">
-                <div class="fieldsetTitle">Toolbox</div>
-                <p>Add new: </p>
-                <div class="creationButton" onClick="SubmitToolbox('Survey');"><img src="images/icons/survey.png" class="buttonIcon"/><p>Survey</p></div>
-                <div class="creationButton" onClick="SubmitToolbox('Application');"><img src="images/icons/application.png" class="buttonIcon"/><p>Application</p></div>
-                <div class="creationButton" onClick="SubmitToolbox('Dashboard');"><img src="images/icons/dashboard.png" class="buttonIcon"/><p>Dashboard</p></div>
-            </fieldset>
-        </form>
-        
-        -->
         <?php
     }
Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 182)
+++ Dev/trunk/classes/pipelineSequencer.php	(revision 185)
@@ -81,5 +81,5 @@
         <script type="text/javascript">
             $(document).ready(function() {
-                loadSequencer();      // true means it is the first refresh of the page.
+                loadSequencer();
             });
         </script>
@@ -87,61 +87,22 @@
     }
 
-    public function LoadSession($currentSession) {   // Initialize variables on page load.
-        if (!isset($currentSession)) {
+    public function LoadSession() {   // Initialize variables on page load.
+        // Redirect if no session is set
+        if (!isset($_SESSION['currentSession'])) {
             redirect("selectSession.php");
         }
-        if (isset($_SESSION['updateNeeded'])) {    // user has performed an operation that flags session to be reloaded from DB, or is first load of page for that session
-            $sessionResults = $this->dbi->get("Session", array("uid" => $currentSession));
-
-            if (count($sessionResults) > 0) {
-                $_SESSION['localSessionCopy'] = $sessionResults[0];
-                unset($_SESSION['updateNeeded']);
-            } else {
-                die("No session with that UID found!");
-            }
+        // Store the current session in internal variable
+        $results = $this->dbi->get("Session", array("uid"=> $_SESSION['currentSession']));
+        if (!empty($results)) {
+            (is_array($results)) ? $this->loadedSession = $results[0] : $this->loadedSession = $results;
         }
-
-        if (isset($_SESSION['localSessionCopy']) && !empty($_SESSION['localSessionCopy'])) {
-
-            $this->loadedSession = $_SESSION['localSessionCopy'];
-            unset($_SESSION['updateNeeded']);
+        else {
+            // Throw error and quit if no results found
+            die("No session with that UID found!");
         }
     }
 
     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'])) {
-                $this->MoveStep($_POST['selectedStep'], -1);
-            }
-        }
-
-        if (isset($_POST['moveSelectedRight'])) {
-            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
-                $this->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;
-            }
-        }
+                
     }
 
Index: Dev/trunk/classes/surveyEditorWidget.php
===================================================================
--- Dev/trunk/classes/surveyEditorWidget.php	(revision 182)
+++ Dev/trunk/classes/surveyEditorWidget.php	(revision 185)
@@ -12,60 +12,63 @@
 class surveyEditorWidget {
 
-    private $loadedSession;
+    private $loadedSurvey;
+    private $dbi;
 
     public function __construct() {
         // Set basic variables
         // Should probably include a default empty survey for the sake of safety
+        $dbi = new DatabaseInterface();
     }
 
     public function handlePost() {
         // Get POSTed data and store variables to class instance properties
-        // Most important: loadedSession!
-
-        //var_dump($_POST);
-
         $dbi = new DatabaseInterface();
         if (isset($_POST['objectUid']) && !empty($_POST['objectUid'])) {
             $surveyResults = $dbi->get("Survey", array("uid" => $_POST['objectUid']));
-            if (count($surveyResults) > 0) {
-                $this->loadedSurvey = $surveyResults[0];
+            if (!empty($surveyResults)) {
+                (is_array($surveyResults)) ? $this->loadedSurvey = $surveyResults[0] : $this->loadedSurvey = $surveyResults;
             } else {
-                var_dump("No surveys found!");
+                die("No surveys found!");
             }
         } else {
-            var_dump("Incorrect or null uid passed!");
+            die("Incorrect or null uid passed!");
         }
     }
 
     public function init() {
+        $questionString = "";
+        foreach ($this->loadedSurvey->questions as $question) {
+            $questionString .= $question->uid . ",";
+        }
         // echo the HTML markup to display the editor on the screen
         ?>
 
         <div id="surveyEditor" class="largeFrame">
-            <div class="largeTitle">
-                Survey name
+            <div class="largeTitle" id="surveyTitle">
+                <?php echo $this->loadedSurvey->title; ?>
             </div>
-            <div id="surveyEditorContent" class="innerLargeFrame">
+            <div id="seqContent" class="innerLargeFrame">
+                <div id="seqContentWrapper">
 
-                <!--
-                <div id="questionUID" class="smallFrame">
-                    <div class="smallTitle"><div class="listNumber">1</div>#QUESTION-IDENT-NO</div>
-                    <div class="content">
-                        <p class="questionBody">
-                            This is the question body text. This is what the user will read when he is answering the survey.This is the question body text. This is what the user will read when he is answering the survey.This is the question body text. This is what the user will read when he is answering the survey.
-                        </p>
-                        <div class="questionParamsView">
-                            PARAMETERS GO HERE, probably in one line (Only answer type and identifier?) Tags?
-                        </div>
-                    </div>
-                    <div id="questionDisplayControls" class="controls">
-                        <input type="button" value="Edit" onClick="javascript:alert('editing not yet supported');" class =" smallButton"/>
-                        <input type="button" value="Remove" onClick="javascript:alert('removing not yet supported');" class =" smallButton"/>
-                    </div>
                 </div>
-                -->
-
+            </div>
+            <div id="surveyEditorVertControls" class="vertControls">
+                <div class="segment">
+                    <label>Move</label>
+                    <input type="button" id="vertControls_MoveUp" class="bigButton vertical" value="Ë" />
+                    <input type="button" id="vertControls_MoveDown" class="bigButton vertical" value="Ë
+" />
+                </div>
+                <input type="button" id="vertControls_Add" class="bigButton vertical" value="+" onClick="addQuestion_Click();" />
             </div>
             <div id="surveyEditorControls" class="controls">
+                <div id="pageControls">
+                    <input type="button" value="<<" id="pageControls_first" onClick="" />
+                    <input type="button" value="<" id="pageControls_previous" onClick="" />
+                    Page <input type="text" value="1" id="pageControls_current" onChange="" class="smallTextField" /> of 5
+                    <input type="button" value=">" id="pageControls_next" onClick="" />
+                    <input type="button" value=">>" id="pageControls_last" onClick="" />
+                </div>
+
                 <input type="button" value="Discard survey" onClick="javascript:alert('discard not yet supported');" class="smallButton" />
                 <input type="button" value="Save survey" onClick="javascript:alert('save not yet supported');" class="smallButton" />
@@ -75,10 +78,10 @@
 
 
-        <form name="hiddenFields">
-            <input type="hidden" id="surveyUid" value="<?php echo $this->loadedSurvey->uid; ?>" />
-            <input type="hidden" id="questionUids" value="<?php echo $this->loadedSurvey->questions; ?>" />
-            <input type="hidden" id="surveyTitle" value="<?php echo $this->loadedSurvey->title; ?>" />
-            <input type="hidden" id="numQuestions" value="<?php echo count($this->loadedSurvey->questions); ?>" />
-            <input type="hidden" id="surveyDescription" value="<?php echo $this->loadedSurvey->description; ?>" />
+        <form id="hiddenInputs">
+            <input type="hidden" id="surveyUidField" value="<?php echo $this->loadedSurvey->uid; ?>" />
+            <input type="hidden" id="questionUidsField" value="<?php echo $questionString ?>" />
+            <input type="hidden" id="surveyTitleField" value="<?php echo $this->loadedSurvey->title; ?>" />
+            <input type="hidden" id="numQuestionsField" value="<?php echo count($this->loadedSurvey->questions); ?>" />
+            <input type="hidden" id="surveyDescriptionField" value="<?php echo $this->loadedSurvey->description; ?>" />
         </form>
 
@@ -90,9 +93,10 @@
         // output the javascript tags and needed functions in the head of the page
         ?>
-        <script type="text/javascript" src="js/surveyEditorScripts.js"></script>
+        <script type="text/javascript" src="js/sequencerScripts.js"></script>
+        <script type="text/javascript" src="js/generalscripts.js"></script>
         <script type="text/javascript" src="js/jquery.js"></script>
         <script type="text/javascript">
             $(document).ready(function() {
-                loadSurvey();
+                loadSequencer();
             });
         </script>
