Index: Dev/trunk/classes/Logo.php
===================================================================
--- Dev/trunk/classes/Logo.php	(revision 167)
+++ Dev/trunk/classes/Logo.php	(revision 168)
@@ -17,5 +17,5 @@
         echo '<div id="logo"><a href="index.php">Research Tool</a>';
         if (isset($_SESSION['username'])) {
-            echo '<a href="index.php" onClick="savePipeline(true);" style="font-size: 12pt;">Log out</a>';
+            echo '<a href="index.php" onClick="savePipeline(true);" style="display:block; font-size: 12px;">Log out</a>';
         }
         echo '</div>';
Index: Dev/trunk/classes/PipelineInfoPanel.php
===================================================================
--- Dev/trunk/classes/PipelineInfoPanel.php	(revision 167)
+++ Dev/trunk/classes/PipelineInfoPanel.php	(revision 168)
@@ -21,6 +21,6 @@
                     Title
                 </div>
-                <div id="infoContent">
-                    Info goes here
+                <div id="infoPanelContent">
+                    
                 </div>
             </fieldset>
Index: Dev/trunk/classes/Toolbox.php
===================================================================
--- Dev/trunk/classes/Toolbox.php	(revision 167)
+++ Dev/trunk/classes/Toolbox.php	(revision 168)
@@ -18,5 +18,5 @@
         <form name="toolbox" action="pipelineEditor.php" method="POST">
             <fieldset id="toolbox">
-                <div class="fieldsetTitle">Toolbox</div><br /><br />
+                <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>
Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 167)
+++ Dev/trunk/classes/pipelineSequencer.php	(revision 168)
@@ -51,11 +51,9 @@
                     <input type="button" id="moveSelectedL" value="< Move" class="surveyButton"  onClick="moveStep(-1);" />
                     <input type="button" id="moveSelectedR" value="Move >" class="surveyButton"  onClick="moveStep(1);" />
-                    <input type="button" id="editSelected" value="Edit step" class="surveyButton" />
+                    <input type="button" id="editSelected" value="Edit step" class="surveyButton" onClick="editStep();" />
                     <input type="submit" id="deleteSelected" name="deleteSelected" value="Delete step" class="surveyButton" />
                     <input type="submit" id ="clearPipeline" name="clearPipeline" value="Clear pipeline" class="surveyButton dis" disabled="true"/>
                     <input type="checkbox" id="confirmClear" name="confirmClear" onChange="IsCheckEnabled(this, document.getElementById('clearPipeline'));" />Really clear?
-                    <input type="button" id="t_saveSession" name="t_saveSession" onClick="savePipeline(true);" value="t_Save_session!" />
-                    <input type="button" id="t_setOOD" name="t_setOOD" onClick="t_setOutOfDate();" value="t_Set_OOD" />
-                    <input type="button" id="t_updateSeq" name="t_updateSeq" onClick="updateSequencer();" value="t_Update_Seq" />
+                    <input type="button" value="debug_save" onClick="savePipeline(true);" />
                 </div>
                 <div id="hiddenInputs">
@@ -72,15 +70,5 @@
     }
 
-    public function DrawSteps() {
-        // Use AJAX to draw visual representations of step objects in a pipeline
-        // <TODO> Implement parameters such as screen size in the drawing of objects </TODO>
-        ?>
-        <script type="text/javascript">
-            drawSteps();
-        </script>
-
-
-        <?php
-    }
+    
 
     public function Javascript() {
@@ -90,5 +78,5 @@
         <script type="text/javascript">
             $(document).ready(function() {
-                updateSequencer();
+                updateSequencer(true);      // true means it is the first refresh of the page.
             });
         </script>
Index: Dev/trunk/css/awesome.css
===================================================================
--- Dev/trunk/css/awesome.css	(revision 167)
+++ Dev/trunk/css/awesome.css	(revision 168)
@@ -108,5 +108,6 @@
     font-weight: bold;
     text-align: center;
-    line-height: 2em;
+    padding-top: 15px;
+    /*line-height: 2em;*/
     text-shadow: #555 0px 0px .2em;
     height: 189px;
@@ -653,5 +654,5 @@
     text-align: right;
     margin-bottom: -0.5em;
-    float: left;
+    float: right;
 }
 
@@ -799,5 +800,10 @@
     font-size: 1.25em;
     color: #FFF;
-    float: left;
-    display: block;
-}
+    /*float: left;*/
+    display: block;
+    clear: right;
+}
+
+fieldset p {
+    display: block;
+}
Index: Dev/trunk/getInfo.php
===================================================================
--- Dev/trunk/getInfo.php	(revision 167)
+++ Dev/trunk/getInfo.php	(revision 168)
@@ -3,41 +3,82 @@
 require 'classes/master.php'; //should be at top of every page
 
-/*
- * Add extra POST variable in functions using this php return, describing object type.
- * This makes it easier to decide what properties to echo and also to query the database.
- * (Prevents repetitive session->query->question->application->user->respondent->etc queries!)
- */
-
-if (isset($_POST['uid'])) {
-    if (!empty($_POST['uid'])) {
+if (isset($_POST['uid']) && isset($_POST['type'])) {
+    if (!empty($_POST['uid']) && !empty($_POST['type'])) {
         $uid = $_POST['uid'];
+        $type = $_POST['type'];
     } else {
-        //$errors[] = "No uid passed!";
+//$errors[] = "No uid passed!";
+        return;
     }
 } else {
-    //$errors[] = "Wrong call, no uid property in POST data!";
+//$errors[] = "Wrong call, no uid property in POST data!";
+    return;
 }
 
 $dbi = new DatabaseInterface();
 
-// For the moment only supports sessions as object to get information for!
-$results = $dbi->get("Session", array("uid" => $uid));
+$results = $dbi->get($type, array("uid" => $uid));
 
-if (count($results) > 0) {
+if (count($results) > 0) {      // check if DB object exists and assign it to variable
     if ($results[0] != null) {
-        $returnString = "";
+        $returnString = "<table border='0'>";
+        $result = $results[0];
+    } else
+        return;
+} else
+    return;
 
-        $result = $results[0];
-        $returnString = $returnString . "Title: $result->title. <br />";
-        $length = count($result->pipeline);
-        $returnString = $returnString .  "Number of steps: $length <br />";
-        $returnString = $returnString . "UID: $uid";
-    } else {
-        $returnString = "Null error!";
-    }
-} else {
-    $returnString = "Non-existing uid!";
+switch ($type) {
+    case "Session":
+        $returnString .= "<tr> <td>Name</td> <td>$result->title</td> </tr>";
+        $returnString .= "<tr><td>Created</td><td>" . $result->datetime->format("H:i:s, d-m-Y") . " by " . $result->creator[0]->name . "</td></tr>";
+        $cS = 0; $cD = 0; $cA = 0;
+        foreach ($result->pipeline as $step) {
+            switch (get_class($step)){
+                case "Survey":
+                    $cS++;
+                    break;
+                case "Application":
+                    $cA++;
+                    break;
+                case "Dashboard":
+                    $cD++;
+                    break;
+                default:
+                    //derp?
+                    break;
+            }
+        }
+        $returnString .= "<tr><td>Number of steps</td><td><ul style='list-style-type: none;'><li style='margin-left: -40px;'>$cS Surveys<li style='margin-left: -40px;'>$cA Applications<li style='margin-left: -40px;'>$cD Dashboards</ul></td></tr>";
+        break;
+    case "Survey":
+        $returnString .= "<tr> <td>Name</td><td>$result->title</td> </tr>";
+        $returnString .= "<tr> <td>Creator</td> <td>LOLOL ME!!!</td> </tr>";
+        $qCount = 0;
+        foreach ($result->questions as $q) {
+            $qCount++;
+        }
+        $returnString .= "<tr> <td>Questions</td> <td>$qCount</td> </tr>";
+        $returnString .= "<tr> <td>Description</td> <td>$result->description</td> </tr>";
+        
+        break;
+    case "Application":
+        $returnString .= "<tr> <td>Name</td> <td>$result->title</td> </tr>";
+        $returnString .= "<tr> <td>Location</td> <td>C:/folder_of_awesomeness/epicgame.exe</td> </tr>";
+        $returnString .= "<tr> <td>Description</td> <td>$result->description</td> </tr>";
+        break;
+    case "Dashboard":
+        break;
+    case "Respondent":
+        break;
+    case "Question":
+        break;
+    case "Answer":
+        break;
+    default:
+        break;
 }
 
+$returnString .= "</table>";
 echo $returnString;
 ?>
Index: Dev/trunk/js/sequencerScripts.js
===================================================================
--- Dev/trunk/js/sequencerScripts.js	(revision 167)
+++ Dev/trunk/js/sequencerScripts.js	(revision 168)
@@ -3,4 +3,19 @@
  * and open the template in the editor.
  */
+var timeDiff  =  {
+    setStartTime:function (){
+        d = new Date();
+        time  = d.getTime();
+    },
+
+    getDiff:function (){
+        d = new Date();
+        return (d.getTime()-time);
+    }
+}
+
+
+
+
 
 function IsItemSelected(check, target) {
@@ -36,4 +51,5 @@
     var pipelineType = document.getElementById("pipelineTypeField");
     var pipelineUpdated = document.getElementById("pipelineUpdatedField");
+    document.getElementById("numSteps").value++;
     
     newAjaxRequest(c, u, function(result){
@@ -70,4 +86,6 @@
 
 function selectStep(uid) {
+    /*
+    
     var nodes = document.getElementById("seqContentWrapper").childNodes;
     for (var i = 0; i < nodes.length; i++) {     //loop through childNodes. Skip first node (whitespace)
@@ -86,9 +104,44 @@
         }
     }
-    
-    // Update selected step field with uid of currently selected step.
+    */
+    // Hier is een snellere manier voor!
+    var element = document.getElementById(uid);
+    var prevElement = document.getElementById(document.getElementById("selectedStepField").value);
+    
+    if (!element || !hasClass(element, "displayStep")) {
+        return;
+    }
+    // misschien nog checks inbouwen of het echt wel een element is?
     var selectedStepField = document.getElementById("selectedStepField");
-    selectedStepField.value = uid;
-    
+    if (!hasClass(element, "selected")) {
+        if (prevElement) {
+            removeClass(prevElement, "selected");
+        }
+        addClass(element, "selected");
+        selectedStepField.value = uid;
+        
+        var pl = stringToArray(document.getElementById("pipelineStringField").value, ",");
+        var plType = stringToArray(document.getElementById("pipelineTypeField").value, ",");
+        var type = plType[pl.indexOf(uid)];
+        ajaxInfoRequest(uid, document.getElementById("infoPanelContent"), type);
+        
+        
+    }
+    else {
+        deselectStep(uid);
+    }
+    
+    
+// Update selected step field with uid of currently selected step.
+    
+    
+}
+
+function deselectStep(uid) {
+    var field = document.getElementById("selectedStepField");
+    field.value = "";
+    var element = document.getElementById(uid);
+    removeClass(element, "selected");
+    document.getElementById("infoPanelContent").innerHTML = "";
 }
                                                                             
@@ -148,7 +201,7 @@
 }
 
-function ajaxInfoRequest(id, el) {
-    var uid = id;
+function ajaxInfoRequest(uid, el, type) {
     var c = "uid="+uid;
+    c += "&type="+type;
     var u = "getInfo.php";
     newAjaxRequest(c, u, function(result) {
@@ -169,77 +222,110 @@
 }
 
-function drawSteps() {
-    
-}
-
-function updateSequencer() {
+
+function updateSequencer(firstLoad) {
+    // Load hidden field values
     var plString = document.getElementById("pipelineStringField").value;
     var plTypeString = document.getElementById("pipelineTypeField").value;
     var plUpdatedString = document.getElementById("pipelineUpdatedField").value;
-    
-    
-    var pl = stringToArray(plString, ",");    
-    var plType = stringToArray(plTypeString, ",");    
-    var plUpdated = stringToArray(plUpdatedString, ",");
-    
-    var count = pl.length;
-    
-    document.getElementById("numSteps").value = count;
-    
-    for (var i = 0; i < pl.length; i++) {   // loop through pipeline contents
-        if (plUpdated[i] == "0") {   // if the element is not up to date
-            // first remove the step representation from the sequencer
+    var count = document.getElementById("numSteps").value;
+    
+    if (count < 1) {
+        return;
+    }
+    // If this is on page-load time
+    if (firstLoad == true) {
+        requestString = plString.slice(0, -1);
+        requestString = requestString.replace(/,/g, ",divider,");
+        newAjaxRequest("uids="+requestString, "returnStep.php", function(result) {
             var seqContent = document.getElementById("seqContentWrapper");
-            var element = document.getElementById(pl[i]);
-            if (element == null) {
-                element = document.createElement("div");
-                element.name = "placeholder";
-                seqContent.appendChild(element);
+            seqContent.innerHTML = result.responseText;
+        }, true);
+        
+        plUpdatedString = "";
+        for (var i = 0; i < plString.split(",").length-1; i++) {
+            plUpdatedString += "1,";
+        }
+        
+        document.getElementById("pipelineUpdatedField").value = plUpdatedString;
+    }
+    else {      // if not
+        var pl = stringToArray(plString, ",");    
+        var plType = stringToArray(plTypeString, ",");    
+        var plUpdated = stringToArray(plUpdatedString, ",");
+    
+        var count = pl.length;
+    
+        document.getElementById("numSteps").value = count;
+        var seqContent = document.getElementById("seqContentWrapper");
+        if (seqContent.childNodes.length > (2*count)-1) {
+            seqContent.removeChild(seqContent.childNodes[0]);
+            
+        }
+        
+        
+        for (var i = 0; i < pl.length; i++) {   // loop through pipeline contents
+            if (plUpdated[i] == "0") {   // if the element is not up to date
+                // first remove the step representation from the sequencer
+                //timeDiff.setStartTime();
+                
+            
+                // IMPROVISE !!!!!!!!!!
+                var elementByIndex = seqContent.childNodes[2*i];    // works with moved steps
+                var elementById = document.getElementById(pl[i]);   // works with ???, not moved steps though... Keeping this in here for future bugfixing. This value is not currently used.
+                var element = elementByIndex;
+            
+            
+                // END IMPROVISE !!!!!!!!!!!!
+                if (element == null) {
+                    element = document.createElement("div");
+                    element.name = "placeholder";
+                    seqContent.appendChild(element);
+                }
+                if (element.nextSibling) {
+                    var nextElement = element.nextSibling;
+                }
+                else {
+                    var nextElement = document.createElement("div");
+                    nextElement.name = "placeholderNext";
+                    seqContent.appendChild(nextElement);
+                }
+            
+                // now request a new step representation and insert it after previousElement
+                var holderDiv = document.createElement("div");
+                var requestString = "uids="+pl[i];
+            
+                if (plType[i]) {
+                    requestString += "&types="+plType[i];
+                }
+                // globally declare newDiv so it can be passed to the updateDividers function
+                var newDiv;
+            
+                newAjaxRequest(requestString, "returnStep.php", function(result) {
+                    holderDiv.innerHTML = result.responseText;
+                    newDiv = holderDiv.childNodes[1];            
+                    seqContent.replaceChild(newDiv, element);
+                    if (nextElement.name == "placeholderNext") {
+                        seqContent.removeChild(nextElement);
+                    }
+                    plUpdated[i] = "1";
+                }, false);
+            
+                       
+                // ALTERNATIVE METHOD TO REPLACECHILD!!!
+                //seqContent.removeChild(element);
+                //seqContent.insertBefore(newDiv, nextElement);
+            
+                // Now check if dividers are necessary.
+            
+                //alert("INSERT CODE FOR UPDATEDIVIDERS HERE!");
+                //alert(timeDiff.getDiff());
+                updateDividers(newDiv);
             }
-            if (element.nextSibling) {
-                var nextElement = element.nextSibling;
-            }
-            else {
-                var nextElement = document.createElement("div");
-                nextElement.name = "placeholderNext";
-                seqContent.appendChild(nextElement);
-            }
-            
-            // now request a new step representation and insert it after previousElement
-            var holderDiv = document.createElement("div");
-            var requestString = "uids="+pl[i];
-            
-            if (plType[i]) {
-                requestString += "&types="+plType[i];
-            }
-            // globally declare newDiv so it can be passed to the updateDividers function
-            var newDiv;
-            
-            newAjaxRequest(requestString, "returnStep.php", function(result) {
-                holderDiv.innerHTML = result.responseText;
-                newDiv = holderDiv.childNodes[1];            
-                seqContent.replaceChild(newDiv, element);
-                if (nextElement.name == "placeholderNext") {
-                    seqContent.removeChild(nextElement);
-                }
-                plUpdated[i] = "1";
-            }, false);
-            
-                       
-            // ALTERNATIVE METHOD TO REPLACECHILD!!!
-            //seqContent.removeChild(element);
-            //seqContent.insertBefore(newDiv, nextElement);
-            
-            // Now check if dividers are necessary.
-            
-            //alert("INSERT CODE FOR UPDATEDIVIDERS HERE!");
-            updateDividers(newDiv);
-        }
-    }
-    
-    // afterwards, convert the arrays back to strings and set to appropriate fields
-    var newUpdatedString = arrayToString(plUpdated, ",");
-    document.getElementById("pipelineUpdatedField").value = newUpdatedString;
-    
+        }
+    
+        // afterwards, convert the arrays back to strings and set to appropriate fields
+        var newUpdatedString = arrayToString(plUpdated, ",");
+        document.getElementById("pipelineUpdatedField").value = newUpdatedString;
+    }
 }
 
@@ -366,5 +452,5 @@
     // eerst saven, dan de object type zoeken in de typelist, dan redirecten naar de goede pagina
     savePipeline(false);
-    debugger;
+    
     var pipeline = document.getElementById("pipelineStringField").value;
     var pipelineTypes = document.getElementById("pipelineTypeField").value;
@@ -375,5 +461,5 @@
     
     var postForm = document.createElement("form");
-    postForm.action = stepType.toLowerCase()+"Editor.php";
+    postForm.action = stepType.toLowerCase()+"Editor.php";      //redirect to "type"editor.php
     postForm.method = "POST";
     var objectUid = document.createElement("input");
@@ -388,5 +474,5 @@
 function moveStep (direction) {
     // misschien maar eens een loadhiddenfields functie maken voor deze meuk?
-    debugger;
+    
     var selectedStep = document.getElementById("selectedStepField").value;
     
@@ -402,7 +488,14 @@
     
     var id = pipeline.indexOf(selectedStep);
-    // Dit werkt niet, hij replaced dingen de verkeerde kant op. Lelijke versie met placeholder variables maar weer doen?
-    pipeline[id] = pipeline.splice(pipeline[id+direction], 1, pipeline[id])[0];
-    pipelineTypes[id] = pipelineTypes.splice(pipelineTypes[id+direction], 1, pipelineTypes[id])[0];
+    if ((id == 0 && direction == -1) || (id == pipeline.length-1 && direction == 1)){
+        alert("Cannot move out of bounds!");
+        return;
+    }
+    var tempString = pipeline[id], tempType = pipelineTypes[id];
+    
+    pipeline[id] = pipeline[id+direction];
+    pipelineTypes[id] = pipelineTypes[id+direction];
+    pipeline[id+direction] = tempString;
+    pipelineTypes[id+direction] = tempType;
     updated[id] = "0";
     updated[id+direction] = "0";
@@ -417,5 +510,5 @@
     updateSequencer();
     
-    
-    
-}
+    // Then reselect the previously selected step
+    addClass(document.getElementById(selectedStep), "selected");
+}
Index: Dev/trunk/returnStep.php
===================================================================
--- Dev/trunk/returnStep.php	(revision 167)
+++ Dev/trunk/returnStep.php	(revision 168)
@@ -40,6 +40,6 @@
     }
 } else {
-    foreach ($uids as $uid) {
-        $response .= processUid($uid);
+    for ($i = 0; $i < count($uids); $i++) {
+        $response .= processUid($uids[$i]);
     }
 }
Index: Dev/trunk/savesession.php
===================================================================
--- Dev/trunk/savesession.php	(revision 167)
+++ Dev/trunk/savesession.php	(revision 168)
@@ -36,5 +36,5 @@
 
         $dbi->set($session);
-        echo "true";
+        var_dump($session);
     }
 }
Index: Dev/trunk/selectSession.php
===================================================================
--- Dev/trunk/selectSession.php	(revision 167)
+++ Dev/trunk/selectSession.php	(revision 168)
@@ -76,5 +76,5 @@
                 <fieldset name="selectionMenu">
                     <!-- onchange van volgende select linkt deze aan de ajax-based info panel, script staat in sequencerScripts.js -->
-                    <select name="sessionUID" style="float: left;" onChange="ajaxInfoRequest(this.value, document.getElementById('sessionDescription'));">
+                    <select name="sessionUID" style="float: left;" onChange="ajaxInfoRequest(this.value, document.getElementById('infoPanelContent'), 'Session');">
                         <option value="" disabled="true" selected>Please select a session</option>
             <?php
@@ -105,5 +105,9 @@
                 </fieldset>
                 <fieldset id="sessionDescription">
-                    Info goes here: 
+                    <div class="fieldsetTitle">
+                        Info
+                    </div>
+                    <div id="infoPanelContent">
+                    </div>
                 </fieldset>
             </form>
