当前位置: 首页>>代码示例>>PHP>>正文


PHP Survey::setAllowedLanguages方法代码示例

本文整理汇总了PHP中Survey::setAllowedLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::setAllowedLanguages方法的具体用法?PHP Survey::setAllowedLanguages怎么用?PHP Survey::setAllowedLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Survey的用法示例。


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

示例1: convertSurveys

         }
     }
     /* convert */
     $this->convertSurveys();
     // return result
     return "";
 }
 function convertSurveys()
 {
     $query = "select * from " . $this->sourcetable . "_surveys order by syid";
     if (!($res = $this->importdb->selectQuery($query))) {
         $query = "select * from " . $this->sourcetable . "_survey order by syid";
         $res = $this->importdb->selectQuery($query);
     }
     if ($res) {
         if ($this->importdb->getNumberOfRows($res) > 0) {
             $user = new User($_SESSION['URID']);
             while ($row = $this->importdb->getRow($res)) {
                 $this->suid = $row["syid"] + $this->addtosuid;
                 $this->syid = $row["syid"];
                 $this->convertSurveySettings($row);
                 // get languages
                 $survey = new Survey($this->suid);
                 $this->languages = explode("~", $survey->getAllowedLanguages(MODE_CASI));
                 $this->convertSections();
                 $this->convertVariables();
                 $this->convertTemplates();
                 $this->convertTypes();
                 $this->convertRouting();
                 // if first survey in project, then set as default survey
                 $surveys = new Surveys();
                 $surveys = $surveys->getSurveys();
                 if (sizeof($surveys) == 1) {
                     $survey->setDefaultSurvey(DEFAULT_SURVEY_YES);
                 }
                 // update allowed modes
                 $survey->setAllowedModes(MODE_CASI);
                 // update allowed languages
                 $survey->setAllowedLanguages(implode("~", $this->languages));
                 // update access of user doing the import
                 $mods = explode("~", $survey->getAllowedModes());
                 foreach ($mods as $m) {
开发者ID:nubissurveying,项目名称:nubis,代码行数:42,代码来源:importer.php

示例2: showEditSettingsLanguageRes

 function showEditSettingsLanguageRes()
 {
     $_SESSION['EDITSURVEY'] = 1;
     $displaySysAdmin = new DisplaySysAdmin();
     $survey = new Survey($_SESSION['SUID']);
     $ans = loadvar(SETTING_ALLOWED_LANGUAGES);
     if (!is_array($ans)) {
         $ans = array($ans);
     }
     if (!inArray(loadvar(SETTING_DEFAULT_LANGUAGE), $ans)) {
         $content = $displaySysAdmin->displayError(Language::messageLanguageSettingsNotChanged());
     } else {
         $current = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
         $survey->setDefaultLanguage(loadvar(SETTING_DEFAULT_LANGUAGE));
         $survey->setChangeLanguage(loadvar(SETTING_CHANGE_LANGUAGE));
         $survey->setReentryLanguage(loadvar(SETTING_REENTRY_LANGUAGE));
         $survey->setBackLanguage(loadvar(SETTING_BACK_LANGUAGE));
         $survey->setAllowedLanguages(implode("~", $ans));
         $users = new Users();
         $users = $users->getUsers();
         $update = loadvar("uridsel");
         foreach ($users as $u) {
             foreach ($current as $c) {
                 if (!inArray($c, $ans)) {
                     $u->removeLanguage($_SESSION['SUID'], getSurveyMode(), $c);
                 }
             }
             foreach ($ans as $a) {
                 if (!inArray($a, $current)) {
                     if (inArray($u->getUrid(), $update) || inArray(-1, $update)) {
                         $u->addLanguage($_SESSION['SUID'], getSurveyMode(), $a);
                     }
                 }
             }
             $u->saveChanges();
         }
         $content = $displaySysAdmin->displaySuccess(Language::messageLanguageSettingsChanged());
         if (!inArray(getSurveyLanguage(), $ans)) {
             $_SESSION['SURVEY_LANGUAGE'] = $ans[0];
         }
     }
     /* update last page */
     $_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
     return $displaySysAdmin->showEditSettingsLanguage($content);
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:45,代码来源:sysadmin.php


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