1 | <?php |
---|
2 | require 'classes/master.php'; //should be at top of every page |
---|
3 | |
---|
4 | if (!isset($_SESSION['userUid'])) { |
---|
5 | redirect("index.php"); |
---|
6 | } |
---|
7 | |
---|
8 | if (!isset($_POST['questionUid']) || empty($_POST['questionUid'])) { |
---|
9 | redirect("index.php"); |
---|
10 | } else { |
---|
11 | $questionUid = $_POST['questionUid']; |
---|
12 | } |
---|
13 | |
---|
14 | $questions = Question::get(array()); //Get all questions |
---|
15 | ?> |
---|
16 | |
---|
17 | <!DOCTYPE html> |
---|
18 | <html> |
---|
19 | <head> |
---|
20 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
21 | <title>Research tool</title> |
---|
22 | <script type="text/javascript" src="js/generalScripts.js"></script> |
---|
23 | <script type="text/javascript" src="js/sequencerScripts.js"></script> |
---|
24 | <script type="text/javascript" src="js/questionEditorScripts.js"></script> |
---|
25 | <script type="text/javascript"> |
---|
26 | window.onload = loadfn; |
---|
27 | |
---|
28 | function saveAndReturn_override() { |
---|
29 | // This should be the override function for the save button on the questionEditor (smallFrame). |
---|
30 | // It should redirect back to the selectQuestion.php page after the standard questionEditor script saves the changes (or not). |
---|
31 | alert("DUH!"); |
---|
32 | window.location = "selectQuestion.php"; |
---|
33 | } |
---|
34 | |
---|
35 | function loadfn() { |
---|
36 | questionEditor.init(); |
---|
37 | ge("questionEditor_innerFrame").appendChild(questionEditor.element); |
---|
38 | ge("btnSave").addEventListener("mouseup", saveAndReturn_override, true); |
---|
39 | request = new Array({ |
---|
40 | type: "Question", |
---|
41 | uid: "<?php echo $questionUid ?>" |
---|
42 | }); |
---|
43 | |
---|
44 | var requestString = "args="+JSON.stringify(request); |
---|
45 | newAjaxRequest(requestString, "getObject.php", function(result){ |
---|
46 | questionEditor.setValues(result.responseText); |
---|
47 | }, true); |
---|
48 | |
---|
49 | } |
---|
50 | </script> |
---|
51 | |
---|
52 | <?php new Stylesheet('visualEditors'); ?> |
---|
53 | </head> |
---|
54 | <body> |
---|
55 | <div id="header"> |
---|
56 | <?php new Logo(); ?> |
---|
57 | </div> |
---|
58 | |
---|
59 | <div id="content"> |
---|
60 | <div id="wrapper"> |
---|
61 | <div id="questionEditor_outer" class="largeFrame"> |
---|
62 | <div class="largeTitle">Edit Question</div> |
---|
63 | <div class="innerLargeFrame" id="questionEditor_innerFrame"> |
---|
64 | </div> |
---|
65 | <div class="controls"> |
---|
66 | <input type="button" value="???" id="btnSaveQuestion" class="smallButton" onclick="" /> |
---|
67 | </div> |
---|
68 | </div> |
---|
69 | </div> |
---|
70 | </div> |
---|
71 | </body> |
---|
72 | </html> |
---|