Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 155)
+++ Dev/trunk/classes/pipelineSequencer.php	(revision 156)
@@ -22,8 +22,13 @@
     public function init() {
         $stringPipeline = "";
+        if (is_array($this->loadedSession->pipeline)){
         foreach ($this->loadedSession->pipeline as $object) {
             $stringPipeline .= "$object->uid,";
         }
         $stringPipeline = rtrim($stringPipeline, ",");
+        }
+        else {
+            $stringPipeline = $this->loadedSession->pipeline;
+        }
         ?>
         <br /><form name="sequencerForm" action="pipelineEditor.php" method="post">
@@ -34,10 +39,10 @@
 
                 <div id="controls">
-                    <input type="submit" name="moveSelectedLeft" value="< Move" class="surveyButton" />
-                    <input type="submit" name="moveSelectedRight" value="Move >" class="surveyButton" />
-                    <input type="submit" name="editSelected" value="Edit step" class="surveyButton" />
-                    <input type="submit" name="deleteSelected" value="Delete step" class="surveyButton" />
-                    <input type="submit" name="clearPipeline" value="Clear pipeline" class="surveyButton dis" disabled="true"/>
-                    <input type="checkbox" name="confirmClear" onChange="IsCheckEnabled(this, document.sequencer.clearPipeline);" />Really clear?
+                    <input type="submit" id="moveSelectedLeft" name="moveSelectedLeft" value="< Move" class="surveyButton" />
+                    <input type="submit" id="moveSelectedRight" name="moveSelectedRight" value="Move >" class="surveyButton" />
+                    <input type="submit" id="editSelected" name="editSelected" value="Edit step" class="surveyButton" />
+                    <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?
                 </div>
                 <div id="hiddenInputs">
@@ -91,4 +96,5 @@
             die("Invalid session!");
         }
+        var_dump($this->loadedSession->pipeline);
     }
 
Index: Dev/trunk/createapplication.php
===================================================================
--- Dev/trunk/createapplication.php	(revision 155)
+++ Dev/trunk/createapplication.php	(revision 156)
@@ -15,8 +15,8 @@
 }
 
-$newApplication = new Application(null, "New application", null, null);
+$newApplication = new Application(null, "New application", "Default application", "Default style");
 $dbi->set($newApplication);
-$session->pipeline[] = $newApplication;
-$dbi->set($session);
+$session->pipeline[] = $newApplication->uid;
+//$dbi->set($session);
 
 redirect("pipelineEditor.php");
Index: Dev/trunk/createsurvey.php
===================================================================
--- Dev/trunk/createsurvey.php	(revision 156)
+++ Dev/trunk/createsurvey.php	(revision 156)
@@ -0,0 +1,29 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['username'])) {
+    redirect("index.php");
+}
+
+$dbi = new DatabaseInterface();
+$creator_results = $dbi->get("user", array("name" => $_SESSION['username']));
+if (count($creator_results) > 0) {
+    $creator = $creator_results[0];
+    $newSurvey = new Survey(null, "New survey", "Default description", $creator, null);
+    $dbi->set($newSurvey);
+} else {
+    die("No user with that uid found!");
+}
+
+// Optional part, for when the session needs to be set in pipelineEditor
+$session_results = $dbi->get("session", array("uid" => $_SESSION['currentSession']));
+if (count($session_results) > 0) {
+    $session = $session_results[0];
+    $session->pipeline[] = $newSurvey;
+    $dbi->set($session);
+}
+
+
+redirect("pipelineEditor.php");
+?>
Index: Dev/trunk/js/ajax.js
===================================================================
--- Dev/trunk/js/ajax.js	(revision 156)
+++ Dev/trunk/js/ajax.js	(revision 156)
@@ -0,0 +1,38 @@
+function loadContent (query, url, target, callback) {
+    newAjaxRequest(query, url, target, handleResponse());
+    return false;
+}
+
+// Waar is bovenstaande tussenstap voor nodig..? Hij doet niets anders dan redirecten naar loadExternalContent en false returnen.
+
+function newAjaxRequest(query, url, target, callback) {
+    var xmlhttp;
+    document.getElementById(target).innerHTML = 'Fetching data...';
+    if (window.XMLHttpRequest) {
+        xmlhttp = new XMLHttpRequest();
+    }
+    else if (window.ActiveXObject) {
+        xmlttp = new ActiveXObject("Microsoft.XMLHTTP");
+    }
+    else {
+        document.getElementById(target).innerHTML = "AJAX not supported!";
+    }
+    
+    if (xmlhttp !== undefined) {
+        xmlhttp.onreadystatechange = callback(xmlhttp, url, target);
+        xmlhttp.open("POST", url, true);
+        xmlhttp.send(query);
+    }
+}
+
+//Handle response is een soort standaard response functie, is het nodig om deze te kunnen overriden met een custom callback functie?
+function handleResponse(xmlhttp, url, target) {
+    if (xmlhttp.readyState == 4) {
+        if (xmlhttp.Status == 200) {
+            document.getElementById(target).innerHTML = xmlhttp.responseText;
+        }
+        else {
+            document.getElementById(target).innerHTML = "loadExternalContent error: \n" + xmlhttp.status + "\n" + xmlhttp.statusText;
+        }
+    }
+}
Index: Dev/trunk/selectSession.php
===================================================================
--- Dev/trunk/selectSession.php	(revision 155)
+++ Dev/trunk/selectSession.php	(revision 156)
@@ -74,5 +74,6 @@
                     <!-- 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'));">
-                        <?php
+                        <option value="" disabled="true" selected>Please select a session</option>
+            <?php
                         foreach ($sessions as $session) {
                             echo '<option value="' . $session->uid . '">' . $session->title . '</option>' . "\n";
