• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fixCKeditorText函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fixCKeditorText函数的典型用法代码示例。如果您正苦于以下问题:PHP fixCKeditorText函数的具体用法?PHP fixCKeditorText怎么用?PHP fixCKeditorText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fixCKeditorText函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: insert

 /**
  * Saves the new survey after the creation screen is submitted
  *
  * @param $iSurveyID  The survey id to be used for the new survey. If already taken a new random one will be used.
  */
 function insert($iSurveyID = null)
 {
     if (Permission::model()->hasGlobalPermission('surveys', 'create')) {
         // Check if survey title was set
         if (!$_POST['surveyls_title']) {
             Yii::app()->session['flashmessage'] = gT("Survey could not be created because it did not have a title");
             redirect($this->getController()->createUrl('admin'));
             return;
         }
         Yii::app()->loadHelper("surveytranslator");
         // If start date supplied convert it to the right format
         $aDateFormatData = getDateFormatData(Yii::app()->session['dateformat']);
         $sStartDate = $_POST['startdate'];
         if (trim($sStartDate) != '') {
             Yii::import('application.libraries.Date_Time_Converter');
             $converter = new Date_Time_Converter($sStartDate, $aDateFormatData['phpdate'] . ' H:i:s');
             $sStartDate = $converter->convert("Y-m-d H:i:s");
         }
         // If expiry date supplied convert it to the right format
         $sExpiryDate = $_POST['expires'];
         if (trim($sExpiryDate) != '') {
             Yii::import('application.libraries.Date_Time_Converter');
             $converter = new Date_Time_Converter($sExpiryDate, $aDateFormatData['phpdate'] . ' H:i:s');
             $sExpiryDate = $converter->convert("Y-m-d H:i:s");
         }
         $iTokenLength = $_POST['tokenlength'];
         //token length has to be at least 5, otherwise set it to default (15)
         if ($iTokenLength < 5) {
             $iTokenLength = 15;
         }
         if ($iTokenLength > 36) {
             $iTokenLength = 36;
         }
         // Insert base settings into surveys table
         $aInsertData = array('expires' => $sExpiryDate, 'startdate' => $sStartDate, 'template' => App()->request->getPost('template'), 'owner_id' => Yii::app()->session['loginID'], 'admin' => App()->request->getPost('admin'), 'active' => 'N', 'anonymized' => App()->request->getPost('anonymized'), 'faxto' => App()->request->getPost('faxto'), 'format' => App()->request->getPost('format'), 'savetimings' => App()->request->getPost('savetimings'), 'language' => App()->request->getPost('language'), 'datestamp' => App()->request->getPost('datestamp'), 'ipaddr' => App()->request->getPost('ipaddr'), 'refurl' => App()->request->getPost('refurl'), 'usecookie' => App()->request->getPost('usecookie'), 'emailnotificationto' => App()->request->getPost('emailnotificationto'), 'allowregister' => App()->request->getPost('allowregister'), 'allowsave' => App()->request->getPost('allowsave'), 'navigationdelay' => App()->request->getPost('navigationdelay'), 'autoredirect' => App()->request->getPost('autoredirect'), 'showxquestions' => App()->request->getPost('showxquestions'), 'showgroupinfo' => App()->request->getPost('showgroupinfo'), 'showqnumcode' => App()->request->getPost('showqnumcode'), 'shownoanswer' => App()->request->getPost('shownoanswer'), 'showwelcome' => App()->request->getPost('showwelcome'), 'allowprev' => App()->request->getPost('allowprev'), 'questionindex' => App()->request->getPost('questionindex'), 'nokeyboard' => App()->request->getPost('nokeyboard'), 'showprogress' => App()->request->getPost('showprogress'), 'printanswers' => App()->request->getPost('printanswers'), 'listpublic' => App()->request->getPost('public'), 'htmlemail' => App()->request->getPost('htmlemail'), 'sendconfirmation' => App()->request->getPost('sendconfirmation'), 'tokenanswerspersistence' => App()->request->getPost('tokenanswerspersistence'), 'alloweditaftercompletion' => App()->request->getPost('alloweditaftercompletion'), 'usecaptcha' => App()->request->getPost('usecaptcha'), 'publicstatistics' => App()->request->getPost('publicstatistics'), 'publicgraphs' => App()->request->getPost('publicgraphs'), 'assessments' => App()->request->getPost('assessments'), 'emailresponseto' => App()->request->getPost('emailresponseto'), 'tokenlength' => $iTokenLength);
         $warning = '';
         // make sure we only update emails if they are valid
         if (Yii::app()->request->getPost('adminemail', '') == '' || validateEmailAddress(Yii::app()->request->getPost('adminemail'))) {
             $aInsertData['adminemail'] = Yii::app()->request->getPost('adminemail');
         } else {
             $aInsertData['adminemail'] = '';
             $warning .= gT("Warning! Notification email was not updated because it was not valid.") . '<br/>';
         }
         if (Yii::app()->request->getPost('bounce_email', '') == '' || validateEmailAddress(Yii::app()->request->getPost('bounce_email'))) {
             $aInsertData['bounce_email'] = Yii::app()->request->getPost('bounce_email');
         } else {
             $aInsertData['bounce_email'] = '';
             $warning .= gT("Warning! Bounce email was not updated because it was not valid.") . '<br/>';
         }
         if (!is_null($iSurveyID)) {
             $aInsertData['wishSID'] = $iSurveyID;
         }
         $iNewSurveyid = Survey::model()->insertNewSurvey($aInsertData);
         if (!$iNewSurveyid) {
             die('Survey could not be created.');
         }
         // Prepare locale data for surveys_language_settings table
         $sTitle = $_POST['surveyls_title'];
         $sDescription = $_POST['description'];
         $sWelcome = $_POST['welcome'];
         $sURLDescription = $_POST['urldescrip'];
         $sTitle = html_entity_decode($sTitle, ENT_QUOTES, "UTF-8");
         $sDescription = html_entity_decode($sDescription, ENT_QUOTES, "UTF-8");
         $sWelcome = html_entity_decode($sWelcome, ENT_QUOTES, "UTF-8");
         $sURLDescription = html_entity_decode($sURLDescription, ENT_QUOTES, "UTF-8");
         // Fix bug with FCKEditor saving strange BR types
         $sTitle = fixCKeditorText($sTitle);
         $sDescription = fixCKeditorText($sDescription);
         $sWelcome = fixCKeditorText($sWelcome);
         // Insert base language into surveys_language_settings table
         $aInsertData = array('surveyls_survey_id' => $iNewSurveyid, 'surveyls_title' => $sTitle, 'surveyls_description' => $sDescription, 'surveyls_welcometext' => $sWelcome, 'surveyls_language' => $_POST['language'], 'surveyls_urldescription' => $_POST['urldescrip'], 'surveyls_endtext' => $_POST['endtext'], 'surveyls_url' => $_POST['url'], 'surveyls_dateformat' => (int) $_POST['dateformat'], 'surveyls_numberformat' => (int) $_POST['numberformat']);
         $langsettings = new SurveyLanguageSetting();
         $langsettings->insertNewSurvey($aInsertData);
         Yii::app()->session['flashmessage'] = $warning . gT("Survey was successfully added.");
         // Update survey permissions
         Permission::model()->giveAllSurveyPermissions(Yii::app()->session['loginID'], $iNewSurveyid);
         $this->getController()->redirect(array('admin/survey/sa/view/surveyid/' . $iNewSurveyid));
     }
 }
开发者ID:nicbon,项目名称:LimeSurvey,代码行数:84,代码来源:surveyadmin.php


示例2: update

 /**
  * Provides an interface for updating a group
  *
  * @access public
  * @param int $gid
  * @return void
  */
 public function update($gid)
 {
     $gid = (int) $gid;
     $group = QuestionGroup::model()->findByAttributes(array('gid' => $gid));
     $surveyid = $group->sid;
     if (Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'update')) {
         Yii::app()->loadHelper('surveytranslator');
         $grplangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
         $baselang = Survey::model()->findByPk($surveyid)->language;
         array_push($grplangs, $baselang);
         foreach ($grplangs as $grplang) {
             if (isset($grplang) && $grplang != "") {
                 $group_name = $_POST['group_name_' . $grplang];
                 $group_description = $_POST['description_' . $grplang];
                 $group_name = html_entity_decode($group_name, ENT_QUOTES, "UTF-8");
                 $group_description = html_entity_decode($group_description, ENT_QUOTES, "UTF-8");
                 // Fix bug with FCKEditor saving strange BR types
                 $group_name = fixCKeditorText($group_name);
                 $group_description = fixCKeditorText($group_description);
                 $aData = array('group_name' => $group_name, 'description' => $group_description, 'randomization_group' => $_POST['randomization_group'], 'grelevance' => $_POST['grelevance']);
                 $condition = array('gid' => $gid, 'sid' => $surveyid, 'language' => $grplang);
                 $group = QuestionGroup::model()->findByAttributes($condition);
                 foreach ($aData as $k => $v) {
                     $group->{$k} = $v;
                 }
                 $ugresult = $group->save();
                 if ($ugresult) {
                     $groupsummary = getGroupList($gid, $surveyid);
                 }
             }
         }
         Yii::app()->session['flashmessage'] = gT("Question group successfully saved.");
         $this->getController()->redirect(array('admin/survey/sa/view/surveyid/' . $surveyid . '/gid/' . $gid));
     }
 }
开发者ID:venurasasanka,项目名称:LimeSurvey,代码行数:42,代码来源:questiongroups.php


示例3: modifyquota

 function modifyquota($iSurveyId)
 {
     $iSurveyId = sanitize_int($iSurveyId);
     $this->_checkPermissions($iSurveyId, 'update');
     $aData = $this->_getData($iSurveyId);
     $aLangs = $aData['aLangs'];
     $oQuota = Quota::model()->findByPk(Yii::app()->request->getPost('quota_id'));
     $oQuota->name = Yii::app()->request->getPost('quota_name');
     $oQuota->qlimit = Yii::app()->request->getPost('quota_limit');
     $oQuota->action = Yii::app()->request->getPost('quota_action');
     $oQuota->autoload_url = Yii::app()->request->getPost('autoload_url');
     $oQuota->save();
     //Iterate through each language posted, and make sure there is a quota message for it
     $sError = '';
     foreach ($aLangs as $sLang) {
         if (!$_POST['quotals_message_' . $sLang]) {
             $sError .= getLanguageNameFromCode($sLang, false) . "\\n";
         }
     }
     if ($sError != '') {
         $aData['sShowError'] = $sError;
     } else {
         foreach ($aLangs as $sLang) {
             //Clean XSS - Automatically provided by CI
             $_POST['quotals_message_' . $sLang] = html_entity_decode($_POST['quotals_message_' . $sLang], ENT_QUOTES, "UTF-8");
             // Fix bug with FCKEditor saving strange BR types
             $_POST['quotals_message_' . $sLang] = fixCKeditorText($_POST['quotals_message_' . $sLang]);
             $oQuotaLanguageSettings = QuotaLanguageSetting::model()->findByAttributes(array('quotals_quota_id' => Yii::app()->request->getPost('quota_id'), 'quotals_language' => $sLang));
             $oQuotaLanguageSettings->quotals_name = Yii::app()->request->getPost('quota_name');
             $oQuotaLanguageSettings->quotals_message = $_POST['quotals_message_' . $sLang];
             $oQuotaLanguageSettings->quotals_url = $_POST['quotals_url_' . $sLang];
             $oQuotaLanguageSettings->quotals_urldescrip = $_POST['quotals_urldescrip_' . $sLang];
             $oQuotaLanguageSettings->save();
         }
     }
     //End insert language based components
     self::_redirectToIndex($iSurveyId);
 }
开发者ID:joaocc,项目名称:LimeSurvey--LimeSurvey,代码行数:38,代码来源:quotas.php


示例4: insert

 /**
  * Saves the new survey after the creation screen is submitted
  *
  * @param $iSurveyID  The survey id to be used for the new survey. If already taken a new random one will be used.
  */
 function insert($iSurveyID = null)
 {
     if (Yii::app()->session['USER_RIGHT_CREATE_SURVEY']) {
         // Check if survey title was set
         if (!$_POST['surveyls_title']) {
             Yii::app()->session['flashmessage'] = $clang->gT("Survey could not be created because it did not have a title");
             redirect($this->getController()->createUrl('admin'));
             return;
         }
         // Check if template may be used
         $sTemplate = $_POST['template'];
         if (!$sTemplate || Yii::app()->session['USER_RIGHT_SUPERADMIN'] != 1 && Yii::app()->session['USER_RIGHT_MANAGE_TEMPLATE'] != 1 && !hasTemplateManageRights(Yii::app()->session['loginID'], $_POST['template'])) {
             $sTemplate = "default";
         }
         Yii::app()->loadHelper("surveytranslator");
         // If start date supplied convert it to the right format
         $aDateFormatData = getDateFormatData(Yii::app()->session['dateformat']);
         $sStartDate = $_POST['startdate'];
         if (trim($sStartDate) != '') {
             Yii::import('application.libraries.Date_Time_Converter');
             $converter = new Date_Time_Converter($sStartDate, $aDateFormatData['phpdate'] . ' H:i:s');
             $sStartDate = $converter->convert("Y-m-d H:i:s");
         }
         // If expiry date supplied convert it to the right format
         $sExpiryDate = $_POST['expires'];
         if (trim($sExpiryDate) != '') {
             Yii::import('application.libraries.Date_Time_Converter');
             $converter = new Date_Time_Converter($sExpiryDate, $aDateFormatData['phpdate'] . ' H:i:s');
             $sExpiryDate = $converter->convert("Y-m-d H:i:s");
         }
         // Insert base settings into surveys table
         $aInsertData = array('expires' => $sExpiryDate, 'startdate' => $sStartDate, 'template' => $sTemplate, 'owner_id' => Yii::app()->session['loginID'], 'admin' => $_POST['admin'], 'active' => 'N', 'adminemail' => $_POST['adminemail'], 'bounce_email' => $_POST['bounce_email'], 'anonymized' => $_POST['anonymized'], 'faxto' => $_POST['faxto'], 'format' => $_POST['format'], 'savetimings' => $_POST['savetimings'], 'language' => $_POST['language'], 'datestamp' => $_POST['datestamp'], 'ipaddr' => $_POST['ipaddr'], 'refurl' => $_POST['refurl'], 'usecookie' => $_POST['usecookie'], 'emailnotificationto' => $_POST['emailnotificationto'], 'allowregister' => $_POST['allowregister'], 'allowsave' => $_POST['allowsave'], 'navigationdelay' => $_POST['navigationdelay'], 'autoredirect' => $_POST['autoredirect'], 'showxquestions' => $_POST['showxquestions'], 'showgroupinfo' => $_POST['showgroupinfo'], 'showqnumcode' => $_POST['showqnumcode'], 'shownoanswer' => $_POST['shownoanswer'], 'showwelcome' => $_POST['showwelcome'], 'allowprev' => $_POST['allowprev'], 'allowjumps' => $_POST['allowjumps'], 'nokeyboard' => $_POST['nokeyboard'], 'showprogress' => $_POST['showprogress'], 'printanswers' => $_POST['printanswers'], 'listpublic' => $_POST['public'], 'htmlemail' => $_POST['htmlemail'], 'sendconfirmation' => $_POST['sendconfirmation'], 'tokenanswerspersistence' => $_POST['tokenanswerspersistence'], 'alloweditaftercompletion' => $_POST['alloweditaftercompletion'], 'usecaptcha' => $_POST['usecaptcha'], 'publicstatistics' => $_POST['publicstatistics'], 'publicgraphs' => $_POST['publicgraphs'], 'assessments' => $_POST['assessments'], 'emailresponseto' => $_POST['emailresponseto'], 'tokenlength' => $_POST['tokenlength']);
         if (!is_null($iSurveyID)) {
             $aInsertData['wishSID'] = $iSurveyID;
         }
         $iNewSurveyid = Survey::model()->insertNewSurvey($aInsertData);
         if (!$iNewSurveyid) {
             die('Survey could not be created.');
         }
         // Prepare locale data for surveys_language_settings table
         $sTitle = $_POST['surveyls_title'];
         $sDescription = $_POST['description'];
         $sWelcome = $_POST['welcome'];
         $sURLDescription = $_POST['urldescrip'];
         if (Yii::app()->getConfig('filterxsshtml')) {
             //$p = new CHtmlPurifier();
             //$p->options = array('URI.AllowedSchemes'=>array('http' => true,  'https' => true));
             //$sTitle=$p->purify($sTitle);
             //$sDescription=$p->purify($sDescription);
             //$sWelcome=$p->purify($sWelcome);
             //$sURLDescription=$p->purify($sURLDescription);
         }
         $sTitle = html_entity_decode($sTitle, ENT_QUOTES, "UTF-8");
         $sDescription = html_entity_decode($sDescription, ENT_QUOTES, "UTF-8");
         $sWelcome = html_entity_decode($sWelcome, ENT_QUOTES, "UTF-8");
         $sURLDescription = html_entity_decode($sURLDescription, ENT_QUOTES, "UTF-8");
         // Fix bug with FCKEditor saving strange BR types
         $sTitle = fixCKeditorText($sTitle);
         $sDescription = fixCKeditorText($sDescription);
         $sWelcome = fixCKeditorText($sWelcome);
         // Insert base language into surveys_language_settings table
         $aInsertData = array('surveyls_survey_id' => $iNewSurveyid, 'surveyls_title' => $sTitle, 'surveyls_description' => $sDescription, 'surveyls_welcometext' => $sWelcome, 'surveyls_language' => $_POST['language'], 'surveyls_urldescription' => $_POST['urldescrip'], 'surveyls_endtext' => $_POST['endtext'], 'surveyls_url' => $_POST['url'], 'surveyls_dateformat' => (int) $_POST['dateformat'], 'surveyls_numberformat' => (int) $_POST['numberformat']);
         $langsettings = new Surveys_languagesettings();
         $langsettings->insertNewSurvey($aInsertData);
         Yii::app()->session['flashmessage'] = $this->getController()->lang->gT("Survey was successfully added.");
         // Update survey permissions
         Survey_permissions::model()->giveAllSurveyPermissions(Yii::app()->session['loginID'], $iNewSurveyid);
         $this->getController()->redirect($this->getController()->createUrl('admin/survey/sa/view/surveyid/' . $iNewSurveyid));
     }
 }
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:75,代码来源:surveyadmin.php


示例5: set_question_group

 /**
  * RPC Routine to edit question groups
  *
  * @access public
  * @param string $sSessionKey - Auth credentials
  * @param int $userName - the user to whom the participant belongs to
  * @param string $email - Participants email
  * 
  * */
 public function set_question_group($sSessionKey, $group_id)
 {
     // Check sessionkey
     if (!$this->_checkSessionKey($sSessionKey)) {
         return array('status' => 'Invalid session key');
     }
     // Check permissions
     if (Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'update')) {
         return array('status' => 'No permission');
     }
     $gid = (int) $gid;
     $group = QuestionGroup::model()->findByAttributes(array('gid' => $gid));
     $surveyid = $group->sid;
     Yii::app()->loadHelper('surveytranslator');
     $grplangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
     $baselang = Survey::model()->findByPk($surveyid)->language;
     array_push($grplangs, $baselang);
     foreach ($grplangs as $grplang) {
         if (isset($grplang) && $grplang != "") {
             $group_name = $_POST['group_name_' . $grplang];
             $group_description = $_POST['description_' . $grplang];
             $group_name = html_entity_decode($group_name, ENT_QUOTES, "UTF-8");
             $group_description = html_entity_decode($group_description, ENT_QUOTES, "UTF-8");
             // Fix bug with FCKEditor saving strange BR types
             $group_name = fixCKeditorText($group_name);
             $group_description = fixCKeditorText($group_description);
             $aData = array('group_name' => $group_name, 'description' => $group_description, 'randomization_group' => $_POST['randomization_group'], 'grelevance' => $_POST['grelevance']);
             $condition = array('gid' => $gid, 'sid' => $surveyid, 'language' => $grplang);
             $group = QuestionGroup::model()->findByAttributes($condition);
             foreach ($aData as $k => $v) {
                 $group->{$k} = $v;
             }
             $ugresult = $group->save();
             if ($ugresult) {
                 $groupsummary = getGroupList($gid, $surveyid);
             }
         }
     }
 }
开发者ID:sevenearths,项目名称:limesurvey-api-test,代码行数:48,代码来源:remotecontrol_handle.php


示例6: index


//.........这里部分代码省略.........
         array_unshift($alllanguages, $baselang);
         $resrow = Questions::model()->findByAttributes(array('qid' => $qid));
         $questiontype = $resrow['type'];
         // Checked)
         $qtypes = getQuestionTypeList('', 'array');
         $scalecount = $qtypes[$questiontype]['answerscales'];
         $count = 0;
         $invalidCode = 0;
         $duplicateCode = 0;
         //require_once("../classes/inputfilter/class.inputfilter_clean.php");
         //$myFilter = new InputFilter('','',1,1,1);
         //First delete all answers
         Answers::model()->deleteAllByAttributes(array('qid' => $qid));
         LimeExpressionManager::RevertUpgradeConditionsToRelevance($surveyid);
         for ($scale_id = 0; $scale_id < $scalecount; $scale_id++) {
             $maxcount = (int) Yii::app()->request->getPost('answercount_' . $scale_id);
             for ($sortorderid = 1; $sortorderid < $maxcount; $sortorderid++) {
                 $code = sanitize_paranoid_string(Yii::app()->request->getPost('code_' . $sortorderid . '_' . $scale_id));
                 if (Yii::app()->request->getPost('oldcode_' . $sortorderid . '_' . $scale_id)) {
                     $oldcode = sanitize_paranoid_string(Yii::app()->request->getPost('oldcode_' . $sortorderid . '_' . $scale_id));
                     if ($code !== $oldcode) {
                         Conditions::model()->updateAll(array('value' => $code), 'cqid=:cqid AND value=:value', array(':cqid' => $qid, ':value' => $oldcode));
                     }
                 }
                 $assessmentvalue = (int) Yii::app()->request->getPost('assessment_' . $sortorderid . '_' . $scale_id);
                 foreach ($alllanguages as $language) {
                     $answer = Yii::app()->request->getPost('answer_' . $language . '_' . $sortorderid . '_' . $scale_id);
                     if ($xssfilter) {
                         $answer = $filter->purify($answer);
                     } else {
                         $answer = html_entity_decode($answer, ENT_QUOTES, "UTF-8");
                     }
                     // Fix bug with FCKEditor saving strange BR types
                     $answer = fixCKeditorText($answer);
                     // Now we insert the answers
                     $result = Answers::model()->insertRecords(array('code' => $code, 'answer' => $answer, 'qid' => $qid, 'sortorder' => $sortorderid, 'language' => $language, 'assessment_value' => $assessmentvalue, 'scale_id' => $scale_id));
                     if (!$result) {
                         $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"" . $clang->gT("Failed to update answers", "js") . "\")\n //-->\n</script>\n";
                     }
                 }
                 // foreach ($alllanguages as $language)
                 if (isset($oldcode) && $code !== $oldcode) {
                     Conditions::model()->updateAll(array('value' => $code), 'cqid=:cqid AND value=:value', array(':cqid' => $qid, ':value' => $oldcode));
                 }
             }
             // for ($sortorderid=0;$sortorderid<$maxcount;$sortorderid++)
         }
         //  for ($scale_id=0;
         LimeExpressionManager::UpgradeConditionsToRelevance($surveyid);
         if ($invalidCode == 1) {
             $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"" . $clang->gT("Answers with a code of 0 (zero) or blank code are not allowed, and will not be saved", "js") . "\")\n //-->\n</script>\n";
         }
         if ($duplicateCode == 1) {
             $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"" . $clang->gT("Duplicate codes found, these entries won't be updated", "js") . "\")\n //-->\n</script>\n";
         }
         Yii::app()->session['flashmessage'] = $clang->gT("Answer options were successfully saved.");
         LimeExpressionManager::SetDirtyFlag();
         if ($databaseoutput != '') {
             echo $databaseoutput;
         } else {
             $this->getController()->redirect($this->getController()->createUrl('/admin/question/sa/answeroptions/surveyid/' . $surveyid . '/gid/' . $gid . '/qid/' . $qid));
         }
         //$action='editansweroptions';
     }
     if ($action == "updatesubquestions" && hasSurveyPermission($surveyid, 'surveycontent', 'update')) {
         Yii::app()->loadHelper('database');
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:67,代码来源:database.php


示例7: index


//.........这里部分代码省略.........
     }
     if ($sAction == "updateansweroptions" && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'update')) {
         Yii::app()->loadHelper('database');
         $aSurveyLanguages = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
         $sBaseLanguage = Survey::model()->findByPk($iSurveyID)->language;
         array_unshift($aSurveyLanguages, $sBaseLanguage);
         $arQuestion = Question::model()->findByAttributes(array('qid' => $iQuestionID));
         $sQuestionType = $arQuestion['type'];
         // Checked)
         $aQuestionTypeList = getQuestionTypeList('', 'array');
         $iScaleCount = $aQuestionTypeList[$sQuestionType]['answerscales'];
         //First delete all answers
         Answer::model()->deleteAllByAttributes(array('qid' => $iQuestionID));
         LimeExpressionManager::RevertUpgradeConditionsToRelevance($iSurveyID);
         for ($iScaleID = 0; $iScaleID < $iScaleCount; $iScaleID++) {
             $iMaxCount = (int) Yii::app()->request->getPost('answercount_' . $iScaleID);
             for ($iSortOrderID = 1; $iSortOrderID < $iMaxCount; $iSortOrderID++) {
                 $sCode = sanitize_paranoid_string(Yii::app()->request->getPost('code_' . $iSortOrderID . '_' . $iScaleID));
                 if (Yii::app()->request->getPost('oldcode_' . $iSortOrderID . '_' . $iScaleID)) {
                     $sOldCode = sanitize_paranoid_string(Yii::app()->request->getPost('oldcode_' . $iSortOrderID . '_' . $iScaleID));
                     if ($sCode !== $sOldCode) {
                         Condition::model()->updateAll(array('value' => $sCode), 'cqid=:cqid AND value=:value', array(':cqid' => $iQuestionID, ':value' => $sOldCode));
                     }
                 }
                 $iAssessmentValue = (int) Yii::app()->request->getPost('assessment_' . $iSortOrderID . '_' . $iScaleID);
                 foreach ($aSurveyLanguages as $sLanguage) {
                     $sAnswerText = Yii::app()->request->getPost('answer_' . $sLanguage . '_' . $iSortOrderID . '_' . $iScaleID);
                     if ($bXSSFilter) {
                         $sAnswerText = $oPurifier->purify($sAnswerText);
                     } else {
                         $sAnswerText = html_entity_decode($sAnswerText, ENT_QUOTES, "UTF-8");
                     }
                     // Fix bug with FCKEditor saving strange BR types
                     $sAnswerText = fixCKeditorText($sAnswerText);
                     // Now we insert the answers
                     $iInsertCount = Answer::model()->insertRecords(array('code' => $sCode, 'answer' => $sAnswerText, 'qid' => $iQuestionID, 'sortorder' => $iSortOrderID, 'language' => $sLanguage, 'assessment_value' => $iAssessmentValue, 'scale_id' => $iScaleID));
                     if (!$iInsertCount) {
                         Yii::app()->setFlashMessage($clang->gT("Failed to update answers"), 'error');
                     }
                 }
                 // foreach ($alllanguages as $language)
                 if (isset($sOldCode) && $sCode !== $sOldCode) {
                     Condition::model()->updateAll(array('value' => $sCode), 'cqid=:cqid AND value=:value', array(':cqid' => $iQuestionID, ':value' => $sOldCode));
                 }
             }
             // for ($sortorderid=0;$sortorderid<$maxcount;$sortorderid++)
         }
         //  for ($scale_id=0;
         LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);
         if (!Yii::app()->request->getPost('bFullPOST')) {
             Yii::app()->setFlashMessage($clang->gT("Not all answer options were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator."));
         } else {
             Yii::app()->session['flashmessage'] = $clang->gT("Answer options were successfully saved.");
         }
         LimeExpressionManager::SetDirtyFlag();
         if ($sDBOutput != '') {
             echo $sDBOutput;
         } else {
             $this->getController()->redirect(array('/admin/questions/sa/answeroptions/surveyid/' . $iSurveyID . '/gid/' . $iQuestionGroupID . '/qid/' . $iQuestionID));
         }
     }
     if ($sAction == "updatesubquestions" && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'update')) {
         Yii::app()->loadHelper('database');
         $aSurveyLanguages = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
         $sBaseLanguage = Survey::model()->findByPk($iSurveyID)->language;
         array_unshift($aSurveyLanguages, $sBaseLanguage);
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:67,代码来源:database.php


示例8: modlabelsetanswers

function modlabelsetanswers($lid)
{
    //global  $labelsoutput;
    $clang = Yii::app()->lang;
    $ajax = false;
    if (isset($_POST['ajax']) && $_POST['ajax'] == "1") {
        $ajax = true;
    }
    if (!isset($_POST['method'])) {
        $_POST['method'] = $clang->gT("Save");
    }
    $sPostData = Yii::app()->getRequest()->getPost('dataToSend');
    $sPostData = str_replace("\t", '', $sPostData);
    if (get_magic_quotes_gpc()) {
        $data = json_decode(stripslashes($sPostData));
    } else {
        $data = json_decode($sPostData);
    }
    if ($ajax) {
        $lid = insertlabelset();
    }
    if (count(array_unique($data->{'codelist'})) == count($data->{'codelist'})) {
        $query = "DELETE FROM {{labels}} WHERE lid = '{$lid}'";
        $result = Yii::app()->db->createCommand($query)->execute();
        foreach ($data->{'codelist'} as $index => $codeid) {
            $codeObj = $data->{$codeid};
            $actualcode = $codeObj->{'code'};
            //$codeid = dbQuoteAll($codeid,true);
            $assessmentvalue = (int) $codeObj->{'assessmentvalue'};
            foreach ($data->{'langs'} as $lang) {
                $strTemp = 'text_' . $lang;
                $title = $codeObj->{$strTemp};
                $p = new CHtmlPurifier();
                if (Yii::app()->getConfig('filterxsshtml')) {
                    $title = $p->purify($title);
                } else {
                    $title = html_entity_decode($title, ENT_QUOTES, "UTF-8");
                }
                // Fix bug with FCKEditor saving strange BR types
                $title = fixCKeditorText($title);
                $sort_order = $index;
                $insertdata = array('lid' => $lid, 'code' => $actualcode, 'title' => $title, 'sortorder' => $sort_order, 'assessment_value' => $assessmentvalue, 'language' => $lang);
                //$query = "INSERT INTO ".db_table_name('labels')." (`lid`,`code`,`title`,`sortorder`, `assessment_value`, `language`)
                //    VALUES('$lid',$actualcode,$title,$sort_order,$assessmentvalue,$lang)";
                $result = Yii::app()->db->createCommand()->insert('{{labels}}', $insertdata);
            }
        }
        Yii::app()->session['flashmessage'] = $clang->gT("Labels sucessfully updated");
    } else {
        $labelsoutput = "<script type=\"text/javascript\">\n<!--\n alert(\"" . $clang->gT("Can't update labels because you are using duplicated codes", "js") . "\")\n //-->\n</script>\n";
    }
    if ($ajax) {
        die;
    }
    if (isset($labelsoutput)) {
        echo $labelsoutput;
        exit;
    }
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:59,代码来源:label_helper.php



注:本文中的fixCKeditorText函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fixDate函数代码示例发布时间:2022-05-15
下一篇:
PHP fix函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap