Index: Dev/trunk/pipelineEditor.php
===================================================================
--- Dev/trunk/pipelineEditor.php	(revision 142)
+++ Dev/trunk/pipelineEditor.php	(revision 144)
@@ -2,41 +2,26 @@
 require 'classes/master.php'; //should be at top of every page
 
-/*
-  if(isset($_SESSION['username'])){   //user is logged in
-  //get pipeline contents from database, and store in displayObject() array "pipelineSteps"
-  //nu nog even gewoon een hardcoded workaround
-  foreach ()
 
-  }
- * */
+$pipeline = $_SESSION['currentPipeline'];
 
-// generate a random array of pipeline contents
-$displaySteps = array();    // array containing a number of random-generated stings "$type", to fill up the sequencer
-$numSteps = 9;              // number of steps to random-generate for testing purposes.
-$maxNumSteps = 9;           // maximum number of steps that can be displayed in the sequencer (without scrollbars, at current)
+// generate a set array of pipeline contents, in lieue of working database interface
+//if (isset($pipeline)){
+//$pipeline = array(new Step("Questionnaire", "Questionnaire 1", 1), new Step("Dashboard", "Dashboard 1", 2), new Step("Application", "Application 1", 3));
+//}
+//else {
+    $pipeline = $_SESSION['currentPipeline'];
+//}
 
-for ($n = 1; $n <= $numSteps; $n++) {   // fill the array of types
-    $rnd = rand(1, 4);
-    switch ($rnd) {
-        case 1:
-            $type = "Dashboard";
-            break;
-        case 2:
-            $type = "Questionnaire";
-            break;
-        case 3:
-            $type = "Notice";
-            break;
-        case 4:
-            $type = "Application";
-            break;
-        default:
-            $type = "Questionnaire";
-            break;
-    }
-    $displaySteps[] = $type;
+if (isset($_POST['objectToCreate'])){
+    $pipeline[] = new Step($_POST['objectToCreate'], $_POST['objectToCreate']." NEW", 4);
+    unset($_POST);
 }
 
+$_SESSION['currentPipeline'] = $pipeline;
+
+$pipelineCount = 3;
 $pipelineName = "Test pipeline";
+
+$dbi = new DatabaseInterface();       //mkdir error?!?!?!
 ?>
 
@@ -46,4 +31,5 @@
 -->
 <!DOCTYPE html>
+
 <html>
     <head>
@@ -53,7 +39,8 @@
         <script type="text/javascript" src="js/menu.js"></script>
         <script type="text/javascript" src="js/jquery.jps"></script>
+        <script type="text/javascript" src="js/editorScripts.js"></script>
     </head>
     <body>
-        <div id="logo">
+        <div id="header">
             <?php new Logo(); ?>
         </div>
@@ -61,46 +48,6 @@
         <div id="wrapper">
             <div id="content">
-                <form action="pipelineEditor.php" method="POST">
-                    
-                    <fieldset id="sequencer">
-                        
-                        <div class="title">Name: <?php echo $pipelineName; ?></div>
-
-                        <div id="seqContent">
-                            <?php
-                            $n = 0;
-                            foreach ($displaySteps as $displayStep) {
-                                if ($n <= $maxNumSteps) {
-                                    $n++;
-                                    new DisplayStep($displayStep, null, "Step " . $n);
-                                    if ($n != $numSteps){
-                                        echo "<div class='divider'></div>";
-                                    }
-                                }
-                            }
-                            ?>                                
-                        </div>
-
-                        <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="hidden" name="selectedStep" />
-                        </div>
-
-                    </fieldset>
-                    
-                    <br />
-                    <fieldset id="toolbox">
-                        <div class="title">Toolbox</div>
-                        <?php
-                            new DisplayStep("Questionnaire", null, "Questionnaire");
-                            new DisplayStep("Notice", null, "Notice");
-                            new DisplayStep("Application", null, "Application");
-                            new DisplayStep("Dashboard", null, "Dashboard");
-                        ?>
-                    </fieldset>
-                </form>
+                <?php new pipelineSequencer($pipeline); ?>
+                <?php new Toolbox(); ?>
             </div>
     </body>
