diff --git a/application/controllers/admin/export.php b/application/controllers/admin/export.php index a08ec45bd41..1589ced64f1 100644 --- a/application/controllers/admin/export.php +++ b/application/controllers/admin/export.php @@ -1085,12 +1085,12 @@ public function resources() switch ( Yii::app()->request->getParam('export') ) { case 'survey' : - $iSurveyID = sanitize_int(CHttpRequest::getParam('surveyid')); + $iSurveyID = sanitize_int(Yii::app()->getRequest()->getParam('surveyid')); $resourcesdir = 'surveys/' . $iSurveyID; $zipfilename = "resources-survey-$iSurveyID.zip"; break; case 'label' : - $lid = sanitize_int(CHttpRequest::getParam('lid')); + $lid = sanitize_int(Yii::app()->getRequest()->getParam('lid')); $resourcesdir = 'labels/' . $lid; $zipfilename = "resources-labelset-$lid.zip"; break; diff --git a/application/controllers/admin/globalsettings.php b/application/controllers/admin/globalsettings.php index 5c5ecfff28b..618ba26d35f 100644 --- a/application/controllers/admin/globalsettings.php +++ b/application/controllers/admin/globalsettings.php @@ -58,7 +58,7 @@ private function _displaySettings() Yii::app()->loadHelper('surveytranslator'); //save refurl from where global settings screen is called! - $refurl = CHttpRequest::getUrlReferrer(); + $refurl = Yii::app()->getRequest()->getUrlReferrer(); Yii::app()->session['refurl'] = htmlspecialchars($refurl); //just to be safe! $data['clang'] = $this->getController()->lang; @@ -174,7 +174,7 @@ private function _saveSettings() Yii::app()->session['flashmessage'] = $clang->gT("Global settings were saved."); $url = htmlspecialchars_decode(Yii::app()->session['refurl']); - if($url){CController::redirect($url);} + if($url){Yii::app()->getController()->redirect($url);} } private function _checkSettings() diff --git a/application/controllers/admin/labels.php b/application/controllers/admin/labels.php index 7150deac61d..e3d60343cb3 100644 --- a/application/controllers/admin/labels.php +++ b/application/controllers/admin/labels.php @@ -384,9 +384,9 @@ public function getAllSets() public function ajaxSets() { - $lid = CHttpRequest::getPost('lid'); - $answers = CHttpRequest::getPost('answers'); - $code = CHttpRequest::getPost('code'); + $lid = Yii::app()->getRequest()->getPost('lid'); + $answers = Yii::app()->getRequest()->getPost('answers'); + $code = Yii::app()->getRequest()->getPost('code'); //Create new label set $language = ""; foreach ($answers as $lang => $answer) { @@ -396,7 +396,7 @@ public function ajaxSets() if ($lid == 0) { $lset = new Labelsets; - $lset->label_name = sanitize_xss_string(CHttpRequest::getPost('laname')); + $lset->label_name = sanitize_xss_string(Yii::app()->getRequest()->getPost('laname')); $lset->languages = sanitize_xss_string($language); $lset->save(); diff --git a/application/controllers/admin/participantsaction.php b/application/controllers/admin/participantsaction.php index 61b7ba1ecbd..ff6a6ef9992 100644 --- a/application/controllers/admin/participantsaction.php +++ b/application/controllers/admin/participantsaction.php @@ -447,7 +447,7 @@ function storeUserControlValues() $stg ->stg_value=Yii::app()->request->getPost('userideditable'); $stg->save(); } - CController::redirect(Yii::app()->getController()->createUrl('admin/participants/userControl')); + Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl('admin/participants/userControl')); } /** @@ -470,7 +470,7 @@ function storeBlacklistValues() $stg->save(); } } - CController::redirect(Yii::app()->getController()->createUrl('admin/participants/blacklistControl')); + Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl('admin/participants/blacklistControl')); } /** @@ -1315,7 +1315,7 @@ function saveAttribute() ); ParticipantAttributeNames::saveAttributeValue($editattvalue); } - CController::redirect(Yii::app()->getController()->createUrl('admin/participants/attributeControl')); + Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl('admin/participants/attributeControl')); } /* @@ -1326,7 +1326,7 @@ function delAttributeValues() $iAttributeId = Yii::app()->request->getQuery('aid'); $iValueId = Yii::app()->request->getQuery('vid'); ParticipantAttributeNames::delAttributeValues($iAttributeId, $iValueId); - CController::redirect(Yii::app()->getController()->createUrl('/admin/participants/viewAttribute/aid/' . $iAttributeId)); + Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl('/admin/participants/viewAttribute/aid/' . $iAttributeId)); } /* diff --git a/application/controllers/admin/tokens.php b/application/controllers/admin/tokens.php index 635c729d5ce..79c4804031d 100644 --- a/application/controllers/admin/tokens.php +++ b/application/controllers/admin/tokens.php @@ -592,7 +592,7 @@ function editToken($iSurveyId) $this->getController()->error(sprintf($this->controller->lang->gT('%s cannot be empty'), $desc['description'])); $aData[$attr_name] = Yii::app()->request->getPost($attr_name); } - $token = Tokens_dynamic::model()->find('tid=' . CHttpRequest::getPost('id')); + $token = Tokens_dynamic::model()->find('tid=' . Yii::app()->getRequest()->getPost('id')); foreach ($aData as $k => $v) $token->$k = $v; @@ -724,10 +724,10 @@ function addnew($iSurveyId) $attrfieldnames = Survey::model()->findByPk($iSurveyId)->tokenAttributes; foreach ($attrfieldnames as $attr_name => $desc) { - $value = CHttpRequest::getPost($attr_name); + $value = Yii::app()->getRequest()->getPost($attr_name); if ($desc['mandatory'] == 'Y' && trim($value) == '') $this->getController()->error(sprintf($clang->gT('%s cannot be empty'), $desc['description'])); - $aData[$attr_name] = CHttpRequest::getPost($attr_name); + $aData[$attr_name] = Yii::app()->getRequest()->getPost($attr_name); } $udresult = Tokens_dynamic::model($iSurveyId)->findAll("token <> '' and token = '$sanitizedtoken'"); diff --git a/application/controllers/admin/translate.php b/application/controllers/admin/translate.php index e01c614329e..8ca6477a21b 100644 --- a/application/controllers/admin/translate.php +++ b/application/controllers/admin/translate.php @@ -25,9 +25,9 @@ class translate extends Survey_Common_Action { public function index() { $iSurveyID = sanitize_int($_REQUEST['surveyid']); - $tolang = CHttpRequest::getParam('lang'); - $action = CHttpRequest::getParam('action'); - $actionvalue = CHttpRequest::getPost('actionvalue'); + $tolang = Yii::app()->getRequest()->getParam('lang'); + $action = Yii::app()->getRequest()->getParam('action'); + $actionvalue = Yii::app()->getRequest()->getPost('actionvalue'); //echo $this->query('title','querybase'); //die(); @@ -103,22 +103,22 @@ private function _translateSave($iSurveyID, $tolang, $baselang, $tab_names) foreach( $tab_names_full as $type ) { - $size = (int) CHttpRequest::getPost("{$type}_size"); + $size = (int) Yii::app()->getRequest()->getPost("{$type}_size"); // start a loop in order to update each record $i = 0; while ($i <= $size) { // define each variable - if ( CHttpRequest::getPost("{$type}_newvalue_{$i}") ) + if ( Yii::app()->getRequest()->getPost("{$type}_newvalue_{$i}") ) { - $old = CHttpRequest::getPost("{$type}_oldvalue_{$i}"); - $new = CHttpRequest::getPost("{$type}_newvalue_{$i}"); + $old = Yii::app()->getRequest()->getPost("{$type}_oldvalue_{$i}"); + $new = Yii::app()->getRequest()->getPost("{$type}_newvalue_{$i}"); // check if the new value is different from old, and then update database if ( $new != $old ) { - $id1 = CHttpRequest::getPost("{$type}_id1_{$i}"); - $id2 = CHttpRequest::getPost("{$type}_id2_{$i}"); + $id1 = Yii::app()->getRequest()->getPost("{$type}_id1_{$i}"); + $id2 = Yii::app()->getRequest()->getPost("{$type}_id2_{$i}"); $this->query($type, 'queryupdate', $iSurveyID, $tolang, $baselang, $id1, $id2, $new); } @@ -1023,9 +1023,9 @@ private function translate_google_api() { header('Content-type: application/json'); - $sBaselang = CHttpRequest::getPost('baselang'); - $sTolang = CHttpRequest::getPost('tolang'); - $sToconvert = CHttpRequest::getPost('text'); + $sBaselang = Yii::app()->getRequest()->getPost('baselang'); + $sTolang = Yii::app()->getRequest()->getPost('tolang'); + $sToconvert = Yii::app()->getRequest()->getPost('text'); $aSearch = array('zh-Hans','zh-Hant-HK','zh-Hant-TW', 'nl-informal','de-informal','it-formal','pt-BR','es-MX','nb','nn'); diff --git a/application/helpers/admin/label_helper.php b/application/helpers/admin/label_helper.php index d294c2fc50e..3d47ea1a314 100644 --- a/application/helpers/admin/label_helper.php +++ b/application/helpers/admin/label_helper.php @@ -139,7 +139,7 @@ function modlabelsetanswers($lid) } //unescape single quotes - $labeldata = CHttpRequest::getPost('dataToSend'); + $labeldata = Yii::app()->getRequest()->getPost('dataToSend'); $labeldata = str_replace("\'","'",$labeldata);