<?php defined('C5_EXECUTE') or die("Access Denied."); class FormBlockController extends Concrete5_Controller_Block_Form {} class FormBlockStatistics extends Concrete5_Controller_Block_FormStatistics {} class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey { function loadSurvey( $qsID, $showEdit=false, $bID=0, $hideQIDs=array(), $showPending=0 ){ //loading questions $questionsRS=$this->loadQuestions( $qsID, $bID, $showPending); if(!$showEdit){ echo '<table class="formBlockSurveyTable">'; while( $questionRow=$questionsRS->fetchRow() ){ if( in_array($questionRow['qID'], $hideQIDs) ) continue; $requiredSymbol=($questionRow['required'])?' <span class="required">*</span>':''; echo '<tr> <td valign="top" class="question"><label for="Question'.intval($questionRow['msqID']).'">'.$questionRow['question'].''.$requiredSymbol.'</label></td>
<?php defined('C5_EXECUTE') or die("Access Denied."); class FormBlockController extends Concrete5_Controller_Block_Form {} class FormBlockStatistics extends Concrete5_Controller_Block_FormStatistics {} class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey { function loadSurvey( $qsID, $showEdit=false, $bID=0, $hideQIDs=array(), $showPending=0 ){ //loading questions $questionsRS=$this->loadQuestions( $qsID, $bID, $showPending); if(!$showEdit){ echo '<table class="formBlockSurveyTable">'; while( $questionRow=$questionsRS->fetchRow() ){ if( in_array($questionRow['qID'], $hideQIDs) ) continue; $requiredSymbol=($questionRow['required'])?' <span class="required">*</span>':''; echo '<tr> <td valign="top" class="question"><label for="Question'.intval($questionRow['msqID']).'">'.$questionRow['question'].''.$requiredSymbol.'</label></td> <td valign="top">'.$this->loadInputType($questionRow, $showEdit).'</td> </tr>'; //} } $surveyBlockInfo = $this->getMiniSurveyBlockInfoByQuestionId($qsID,intval($bID)); if($surveyBlockInfo['displayCaptcha']) { echo '<tr><td colspan="2">'; $captcha = Loader::helper('validation/captcha'); echo $captcha->label(); echo '</td></tr><tr><td> </td><td>'; $captcha->showInput(); $captcha->display(); //echo isset($errors['captcha'])?'<span class="error">' . $errors['captcha'] . '</span>':''; echo '</td></tr>'; } echo '<tr><td> </td><td><input class="formBlockSubmitButton ccm-input-button" name="Submit" type="submit" value="'.t('Submit').'" /> <input class="formBlockSubmitButton ccm-input-button" name="Clear" type="reset" value="'.t('Clear').'" /></td></tr>'; echo '</table>'; } else { echo '<div id="miniSurveyTableWrap"><div id="miniSurveyPreviewTable" class="miniSurveyTable">'; while( $questionRow=$questionsRS->fetchRow() ){ if( in_array($questionRow['qID'], $hideQIDs) ) continue; $requiredSymbol=($questionRow['required'])?'<span class="required">*</span>':''; ?> <div id="miniSurveyQuestionRow<?php echo $questionRow['msqID']?>" class="miniSurveyQuestionRow"> <div class="miniSurveyQuestion"><?php echo $questionRow['question'].' '.$requiredSymbol?></div> <?php /* <div class="miniSurveyResponse"><?php echo $this->loadInputType($questionRow,$showEdit)?></div> */ ?> <div class="miniSurveyOptions"> <div style="float:right"> <a href="javascript:void(0)" onclick="miniSurvey.moveUp(this,<?php echo $questionRow['msqID']?>);return false" class="moveUpLink"></a> <a href="javascript:void(0)" onclick="miniSurvey.moveDown(this,<?php echo $questionRow['msqID']?>);return false" class="moveDownLink"></a> </div> <a href="javascript:void(0)" onclick="miniSurvey.reloadQuestion(<?php echo intval($questionRow['qID']) ?>);return false"><?php echo t('edit')?></a> <a href="javascript:void(0)" onclick="miniSurvey.deleteQuestion(this,<?php echo intval($questionRow['msqID']) ?>,<?php echo intval($questionRow['qID'])?>);return false"><?php echo t('remove')?></a> </div> <div class="miniSurveySpacer"></div> </div> <?php } echo '</div></div>'; } } }
You are allowed to delete your post for 5 minutes after it's posted.
Delete
Are you sure you would like to mark this post as spam?
Mark as Spam
This script will report this post as spam and add a permanent IP ban for this user, type "DESTROY" below to continue.
DESTROY SPAMMER
You must have a user account and be signed to perform this action.
/concrete5install/blocks/form
Then, make a blank php file named "controller.php" inside this form folder.
then copy code below into your blank controller.php file.
Be sure to view the entire code! Clear your cache afterwards!