Changeset 144 for Dev/trunk/pipelineEditor.php
- Timestamp:
- 11/03/11 10:30:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/pipelineEditor.php
r142 r144 2 2 require 'classes/master.php'; //should be at top of every page 3 3 4 /*5 if(isset($_SESSION['username'])){ //user is logged in6 //get pipeline contents from database, and store in displayObject() array "pipelineSteps"7 //nu nog even gewoon een hardcoded workaround8 foreach ()9 4 10 } 11 * */ 5 $pipeline = $_SESSION['currentPipeline']; 12 6 13 // generate a random array of pipeline contents 14 $displaySteps = array(); // array containing a number of random-generated stings "$type", to fill up the sequencer 15 $numSteps = 9; // number of steps to random-generate for testing purposes. 16 $maxNumSteps = 9; // maximum number of steps that can be displayed in the sequencer (without scrollbars, at current) 7 // generate a set array of pipeline contents, in lieue of working database interface 8 //if (isset($pipeline)){ 9 //$pipeline = array(new Step("Questionnaire", "Questionnaire 1", 1), new Step("Dashboard", "Dashboard 1", 2), new Step("Application", "Application 1", 3)); 10 //} 11 //else { 12 $pipeline = $_SESSION['currentPipeline']; 13 //} 17 14 18 for ($n = 1; $n <= $numSteps; $n++) { // fill the array of types 19 $rnd = rand(1, 4); 20 switch ($rnd) { 21 case 1: 22 $type = "Dashboard"; 23 break; 24 case 2: 25 $type = "Questionnaire"; 26 break; 27 case 3: 28 $type = "Notice"; 29 break; 30 case 4: 31 $type = "Application"; 32 break; 33 default: 34 $type = "Questionnaire"; 35 break; 36 } 37 $displaySteps[] = $type; 15 if (isset($_POST['objectToCreate'])){ 16 $pipeline[] = new Step($_POST['objectToCreate'], $_POST['objectToCreate']." NEW", 4); 17 unset($_POST); 38 18 } 39 19 20 $_SESSION['currentPipeline'] = $pipeline; 21 22 $pipelineCount = 3; 40 23 $pipelineName = "Test pipeline"; 24 25 $dbi = new DatabaseInterface(); //mkdir error?!?!?! 41 26 ?> 42 27 … … 46 31 --> 47 32 <!DOCTYPE html> 33 48 34 <html> 49 35 <head> … … 53 39 <script type="text/javascript" src="js/menu.js"></script> 54 40 <script type="text/javascript" src="js/jquery.jps"></script> 41 <script type="text/javascript" src="js/editorScripts.js"></script> 55 42 </head> 56 43 <body> 57 <div id=" logo">44 <div id="header"> 58 45 <?php new Logo(); ?> 59 46 </div> … … 61 48 <div id="wrapper"> 62 49 <div id="content"> 63 <form action="pipelineEditor.php" method="POST"> 64 65 <fieldset id="sequencer"> 66 67 <div class="title">Name: <?php echo $pipelineName; ?></div> 68 69 <div id="seqContent"> 70 <?php 71 $n = 0; 72 foreach ($displaySteps as $displayStep) { 73 if ($n <= $maxNumSteps) { 74 $n++; 75 new DisplayStep($displayStep, null, "Step " . $n); 76 if ($n != $numSteps){ 77 echo "<div class='divider'></div>"; 78 } 79 } 80 } 81 ?> 82 </div> 83 84 <div id="controls"> 85 <input type="submit" name="moveSelectedLeft" value="< Move" class="surveyButton" /> 86 <input type="submit" name="moveSelectedRight" value="Move >" class="surveyButton" /> 87 <input type="submit" name="editSelected" value="Edit step" class="surveyButton" /> 88 <input type="submit" name="deleteSelected" value="Delete step" class="surveyButton" /> 89 <input type="hidden" name="selectedStep" /> 90 </div> 91 92 </fieldset> 93 94 <br /> 95 <fieldset id="toolbox"> 96 <div class="title">Toolbox</div> 97 <?php 98 new DisplayStep("Questionnaire", null, "Questionnaire"); 99 new DisplayStep("Notice", null, "Notice"); 100 new DisplayStep("Application", null, "Application"); 101 new DisplayStep("Dashboard", null, "Dashboard"); 102 ?> 103 </fieldset> 104 </form> 50 <?php new pipelineSequencer($pipeline); ?> 51 <?php new Toolbox(); ?> 105 52 </div> 106 53 </body>
Note: See TracChangeset
for help on using the changeset viewer.