Changeset 75 for Dev/trunk/classes
- Timestamp:
- 08/08/11 15:12:46 (14 years ago)
- Location:
- Dev/trunk/classes
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/Application.php
r57 r75 7 7 */ 8 8 class Application { 9 public $title; 10 public $description; 11 public $style; 9 12 10 private $title; 11 private $description; 12 private $style; 13 14 public function __construct() { 15 13 public function __construct($title = null, $description = null, $style = null) { 14 $this->title = $title; 15 $this->description = $description; 16 $this->style = $style; 16 17 } 17 18 -
Dev/trunk/classes/ApplicationCreationTool.php
r72 r75 10 10 * @author fpvanagthoven 11 11 */ 12 class ApplicationCreationTool { 12 class ApplicationCreationTool 13 { 14 private $application; 13 15 14 private $application; 16 public function __construct($application = null) 17 { 18 $this->application = $application; 15 19 16 public function __construct($application = null) { 17 $this->application = $application; 18 19 $this->javascript(); 20 if(!empty($_POST)) 21 redirect('mainmenu.php'); 22 ?> 23 <div class="creation"> 24 <form id="applicationCreationForm" action="" method="post"> 25 <?php 26 $this->title(); 27 $this->description(); 28 29 $this->done(); 30 ?> 31 </form> 32 </div> 33 <?php 34 } 35 36 private function javascript() { 37 ?> 38 <script type="text/javascript" src="js/creation.js"></script> 39 <script language="JavaScript" type="text/javascript"> 20 $this->javascript(); 40 21 41 </script> 42 <?php 43 } 22 $this->init(); 23 } 44 24 45 private function title() { 46 if (isset($this->application->title)) 47 $value = $this->application->title; 48 else 49 $value = 'Untitled Application'; 50 ?> 51 <input type="text" id="applicationTitle" class="titleBox" name="applicationTitle" value="<?php echo str_replace("\"", """, $value); ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> 52 <?php 53 } 25 private function javascript() 26 { 27 ?> 28 <script type="text/javascript" src="js/creation.js"></script> 29 <script language="JavaScript" type="text/javascript"> 54 30 55 private function description() { 56 if (isset($this->application->description)) 57 $value = $this->application->description; 58 else 59 $value = 'Write a description for this application here.'; 60 ?> 61 <textarea id="applicationDescription" class="descriptionBox" name="applicationDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea> 62 <?php 63 } 64 65 private function done() { 66 ?> 67 <input type="submit" class="surveyButton topRight" value="Done" /> 68 <?php 69 } 31 </script> 32 <?php 33 } 70 34 35 private function init() 36 { 37 ?> 38 <div class="creation"> 39 <form id="applicationCreationForm" action="" method="post"> 40 <?php 41 $this->title(); 42 $this->description(); 43 44 $this->done(); 45 ?> 46 </form> 47 </div> 48 <?php 49 } 50 51 private function title() 52 { 53 if (isset($this->application->title)) 54 $value = $this->application->title; 55 else 56 $value = 'Untitled Application'; 57 ?> 58 <input type="text" id="applicationTitle" class="titleBox" name="applicationTitle" value="<?php echo str_replace("\"", """, $value); ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> 59 <?php 60 } 61 62 private function description() 63 { 64 if (isset($this->application->description)) 65 $value = $this->application->description; 66 else 67 $value = 'Write a description for this application here.'; 68 ?> 69 <textarea id="applicationDescription" class="descriptionBox" name="applicationDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea> 70 <?php 71 } 72 73 private function done() 74 { 75 ?> 76 <input type="submit" class="surveyButton topRight" value="Done" /> 77 <?php 78 } 71 79 } 72 80 ?> -
Dev/trunk/classes/Survey.php
r57 r75 16 16 public $description; 17 17 public $questions; 18 19 public $results; 18 20 19 21 public function __construct($id, $title, $description = null) { … … 22 24 $this->description = $description; 23 25 $this->questions = array(); 26 27 $this->results = null; 24 28 } 29 30 public function addQuestion($question) 31 { 32 array_push($this->questions, $question); 33 } 34 35 public function setResults($surveyResults) 36 { 37 $this->results = $surveyResults; 38 } 25 39 26 40 public static function getSurvey($info) { … … 56 70 return $survey; 57 71 } 72 73 /** 74 * TODO: Should return Results-object from reading RDF-database 75 * @param type $surveyID 76 */ 77 public static function getResults($surveyID) 78 { 79 80 } 58 81 59 82 }
Note: See TracChangeset
for help on using the changeset viewer.