Changeset 50 for Dev/trunk/classes


Ignore:
Timestamp:
07/25/11 17:45:22 (14 years ago)
Author:
fpvanagthoven
Message:

Saving now gives the link to participant survey.

File:
1 edited

Legend:

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

    r49 r50  
    2222        ?>
    2323
    24         <div id="surveyCreation"><form id="survey" action="submitsurvey.php" method="post">
     24        <div id="surveyCreation"><form id="survey" action="surveycreation.php" method="post">
    2525                <?php
    2626                $this->surveyHead();
     
    2828                SurveyCreationTool::addQuestionButton();
    2929                SurveyCreationTool::removeLastQuestionButton();
    30                 SurveyCreationTool::submitButton();
    3130                ?></form></div>
    3231        <?php
     
    338337                form.submit();
    339338            }
    340                                                                                                                                                                                                                                            
    341                                                                                                                                                                                                                                                                                                                                                                                                                            
     339           
     340            function selectAll(input)
     341            {
     342                input.select();
     343            }
     344                                                                                                                                                                                                                                                                                                                                                                                                           
    342345        </script>
    343346        <?php
     
    350353        $this->saveSurvey();
    351354        $this->descriptionBox();
     355        $this->surveyLink();
    352356        ?></div>
    353357        <?php
     
    384388        <textarea id="surveyDescription" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>
    385389        <?php
     390    }
     391   
     392    private function surveyLink() {
     393        if (isset($this->survey))
     394        {
     395                $surveyID = $this->survey->id;
     396               
     397                $link = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) .
     398                    '/survey.php?id=' . $surveyID;
     399        ?>
     400        <input type="text" value="<?php echo $link; ?>" id="surveyLink" onclick="selectAll(this)">
     401        <?php
     402        }
    386403    }
    387404
     
    449466    }
    450467
    451     private static function submitbutton() {
    452         ?>
    453         <input type="submit" name="submitSurvey"
    454                value="Submit Survey!" class="surveyButton" id="submitSurvey"/>
    455         <?php
    456     }
    457 
    458468}
    459469?>
Note: See TracChangeset for help on using the changeset viewer.