[144] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * To change this template, choose Tools | Templates |
---|
| 4 | * and open the template in the editor. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | /** |
---|
[151] | 8 | * A visual interface object for editing and viewing a session's pipeline. |
---|
[144] | 9 | * |
---|
[151] | 10 | * @author Tschipper |
---|
[144] | 11 | */ |
---|
[146] | 12 | class PipelineSequencer { |
---|
[144] | 13 | |
---|
| 14 | // properties |
---|
[152] | 15 | private $loadedSession; |
---|
[144] | 16 | private $selectedStep; |
---|
| 17 | |
---|
[152] | 18 | public function __construct() { |
---|
| 19 | //nothing yet |
---|
[146] | 20 | } |
---|
[144] | 21 | |
---|
[150] | 22 | public function init() { |
---|
[144] | 23 | ?> |
---|
[151] | 24 | <br /><form name="sequencer" action="pipelineEditor.php" method="post"> |
---|
| 25 | <fieldset id="sequencer"> |
---|
[152] | 26 | <div class="title">Name: <?php echo $this->loadedSession->title; ?> </div> |
---|
[144] | 27 | |
---|
[151] | 28 | <div id="seqContent"> |
---|
[146] | 29 | <?php $this->DrawSteps(); ?> |
---|
[144] | 30 | </div> |
---|
| 31 | |
---|
| 32 | <div id="controls"> |
---|
| 33 | <input type="submit" name="moveSelectedLeft" value="< Move" class="surveyButton" /> |
---|
| 34 | <input type="submit" name="moveSelectedRight" value="Move >" class="surveyButton" /> |
---|
| 35 | <input type="submit" name="editSelected" value="Edit step" class="surveyButton" /> |
---|
| 36 | <input type="submit" name="deleteSelected" value="Delete step" class="surveyButton" /> |
---|
[146] | 37 | <input type="submit" name="clearPipeline" value="Clear pipeline" class="surveyButton dis" disabled="true"/> |
---|
| 38 | <input type="checkbox" name="confirmClear" onChange="IsCheckEnabled(this, document.sequencer.clearPipeline);" />Really clear? |
---|
[144] | 39 | <input type="hidden" name="selectedStep" /> |
---|
[151] | 40 | <input type="hidden" name="numSteps" /> |
---|
| 41 | <input type="hidden" name="pipeline" /> |
---|
[144] | 42 | </div> |
---|
| 43 | </fieldset> |
---|
| 44 | </form> |
---|
| 45 | <?php |
---|
| 46 | } |
---|
| 47 | |
---|
[146] | 48 | public function DrawSteps() { |
---|
[150] | 49 | |
---|
[146] | 50 | } |
---|
| 51 | |
---|
[150] | 52 | private function Javascript() { |
---|
| 53 | ?> |
---|
[152] | 54 | <script type="text/javascript" src="js/sequencerScripts.js"></script> |
---|
[151] | 55 | |
---|
[150] | 56 | <?php |
---|
| 57 | } |
---|
| 58 | |
---|
[152] | 59 | public function GetFromDB($currentSession) { // Initialize variables on page load. |
---|
[151] | 60 | $dbi = new DatabaseInterface(); |
---|
[152] | 61 | if (!isset($currentSession)) { |
---|
| 62 | $_SESSION['message'] = "No session set!"; |
---|
| 63 | redirect("selectSession.php"); |
---|
[151] | 64 | } |
---|
[152] | 65 | |
---|
| 66 | $sessionResults = $dbi->get("Session", array("uid" => $currentSession)); |
---|
| 67 | if (count($sessionResults) > 0) { |
---|
| 68 | $this->loadedSession = $sessionResults[0]; |
---|
| 69 | } |
---|
| 70 | else { |
---|
| 71 | die("Invalid session!"); |
---|
| 72 | } |
---|
[151] | 73 | } |
---|
| 74 | |
---|
[144] | 75 | } |
---|
| 76 | ?> |
---|