Changeset 75 for Dev/trunk/classes


Ignore:
Timestamp:
08/08/11 15:12:46 (14 years ago)
Author:
fpvanagthoven
Message:

Application should now just be RDF-saved. Beginning on DashboardTool?.php.

Location:
Dev/trunk/classes
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/Application.php

    r57 r75  
    77 */
    88class Application {
     9    public $title;
     10    public $description;
     11    public $style;
    912
    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;
    1617    }
    1718
  • Dev/trunk/classes/ApplicationCreationTool.php

    r72 r75  
    1010 * @author fpvanagthoven
    1111 */
    12 class ApplicationCreationTool {
     12class ApplicationCreationTool
     13{
     14        private $application;
    1315
    14     private $application;
     16        public function __construct($application = null)
     17        {
     18                $this->application = $application;
    1519
    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();
    4021
    41         </script>
    42         <?php
    43     }
     22                $this->init();
     23        }
    4424
    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("\"", "&quot;", $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">
    5430
    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        }
    7034
     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("\"", "&quot;", $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        }
    7179}
    7280?>
  • Dev/trunk/classes/Survey.php

    r57 r75  
    1616    public $description;
    1717    public $questions;
     18       
     19        public $results;
    1820
    1921    public function __construct($id, $title, $description = null) {
     
    2224        $this->description = $description;
    2325        $this->questions = array();
     26               
     27                $this->results = null;
    2428    }
     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        }
    2539
    2640    public static function getSurvey($info) {
     
    5670        return $survey;
    5771    }
     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        }
    5881
    5982}
Note: See TracChangeset for help on using the changeset viewer.