[66] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * To change this template, choose Tools | Templates |
---|
| 4 | * and open the template in the editor. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | /** |
---|
| 8 | * Description of ApplicationCreationTool |
---|
| 9 | * |
---|
| 10 | * @author fpvanagthoven |
---|
| 11 | */ |
---|
| 12 | class ApplicationCreationTool { |
---|
| 13 | |
---|
| 14 | private $application; |
---|
| 15 | |
---|
| 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"> |
---|
| 40 | |
---|
| 41 | </script> |
---|
| 42 | <?php |
---|
| 43 | } |
---|
| 44 | |
---|
| 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 $value; ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> |
---|
| 52 | <?php |
---|
| 53 | } |
---|
| 54 | |
---|
| 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" value="Done" /> |
---|
| 68 | <?php |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | } |
---|
| 72 | ?> |
---|