本文整理汇总了PHP中jsonRPCClient::add_survey_language方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::add_survey_language方法的具体用法?PHP jsonRPCClient::add_survey_language怎么用?PHP jsonRPCClient::add_survey_language使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonRPCClient
的用法示例。
在下文中一共展示了jsonRPCClient::add_survey_language方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
/**
* Simple procedure to test most RPC functions
*
*/
public function test()
{
$sFileToImport = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . 'docs' . DIRECTORY_SEPARATOR . 'demosurveys' . DIRECTORY_SEPARATOR . 'limesurvey2_sample_survey_english.lss';
// $sFileToImport=dirname(Yii::app()->basePath).DIRECTORY_SEPARATOR.'docs'.DIRECTORY_SEPARATOR.'demosurveys'.DIRECTORY_SEPARATOR.'survey_archive_example_feedback_survey.zip';
Yii::app()->loadLibrary('jsonRPCClient');
$myJSONRPCClient = new jsonRPCClient(Yii::app()->getBaseUrl(true) . '/' . dirname(Yii::app()->request->getPathInfo()));
$sSessionKey = $myJSONRPCClient->get_session_key('admin', 'password');
if (is_array($sSessionKey)) {
echo $sSessionKey['status'];
die;
} else {
echo 'Retrieved session key' . '<br>';
}
$sLSSData = base64_encode(file_get_contents($sFileToImport));
$iSurveyID = $myJSONRPCClient->import_survey($sSessionKey, $sLSSData, 'zip', 'Test import by JSON_RPC', 1000);
echo 'Created new survey SID:' . $iSurveyID . '<br>';
/*
Very simple example to export responses as Excel file
$aResult=$myJSONRPCClient->export_reponses($sSessionKey,$iSurveyID,'xls');
file_put_contents('d:\test.xls',base64_decode(chunk_split($aResult)));
*/
$aResult = $myJSONRPCClient->activate_survey($sSessionKey, $iSurveyID);
if ($aResult['status'] == 'OK') {
echo 'Survey ' . $iSurveyID . ' successfully activated.<br>';
}
$aResult = $myJSONRPCClient->activate_participant_tokens($sSessionKey, $iSurveyID, array(1, 2));
if ($aResult['status'] == 'OK') {
echo 'Tokens for Survey ID ' . $iSurveyID . ' successfully activated.<br>';
}
$aResult = $myJSONRPCClient->set_survey_properties($sSessionKey, $iSurveyID, array('faxto' => '0800-LIMESURVEY'));
if ($aResult['status'] == 'OK') {
echo 'Modified survey settings for survey ' . $iSurveyID . '<br>';
}
$aResult = $myJSONRPCClient->add_survey_language($sSessionKey, $iSurveyID, 'ar');
if ($aResult['status'] == 'OK') {
echo 'Added Arabian as additional language' . '<br>';
}
$aResult = $myJSONRPCClient->set_survey_language_properties($sSessionKey, $iSurveyID, array('surveyls_welcometext' => 'An Arabian welcome text!'), 'ar');
if ($aResult['status'] == 'OK') {
echo 'Modified survey locale setting welcometext for Arabian in survey ID ' . $iSurveyID . '<br>';
}
$aResult = $myJSONRPCClient->delete_survey_language($sSessionKey, $iSurveyID, 'ar');
if ($aResult['status'] == 'OK') {
echo 'Removed Arabian as additional language' . '<br>';
}
die;
$aResult = $myJSONRPCClient->delete_survey($sSessionKey, $iSurveyID);
echo 'Deleted survey SID:' . $iSurveyID . '-' . $aResult['status'] . '<br>';
// Release the session key - close the session
$Result = $myJSONRPCClient->release_session_key($sSessionKey);
echo 'Closed the session' . '<br>';
}