本文整理汇总了PHP中Setting::setLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::setLanguage方法的具体用法?PHP Setting::setLanguage怎么用?PHP Setting::setLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::setLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertSurveySettings
$user->setLanguages($this->suid, $m, $survey->getAllowedLanguages($m));
}
$user->saveChanges();
}
}
}
}
function convertSurveySettings($row)
{
$query = "replace into " . Config::dbSurvey() . "_surveys (suid, name, description) values (";
$query .= prepareDatabaseString($this->suid) . ",";
$query .= "'" . prepareDatabaseString($row["header"]) . "',";
$query .= "'')";
$this->db->executeQuery($query);
$query = "replace into " . Config::dbSurvey() . "_versions (suid, vnid, name, description) values (";
$query .= prepareDatabaseString($this->suid) . ",";
$query .= prepareDatabaseString(1) . ",";
$query .= "'Current',";
$query .= "'Current version')";
$this->db->executeQuery($query);
/* add default survey */
$setting = new Setting();
$setting->setSuid($this->suid);
$setting->setObject(USCIC_SURVEY);
$setting->setObjectType(OBJECT_SURVEY);
$setting->setName(SETTING_DEFAULT_SURVEY);
$setting->setValue($this->suid);
$setting->setMode(MODE_CASI);
// dummy
$setting->setLanguage(1);
// dummy
$setting->save();
/* add default mode */
$setting = new Setting();
$setting->setSuid($this->suid);
$setting->setObject(USCIC_SURVEY);
$setting->setObjectType(OBJECT_SURVEY);
$setting->setName(SETTING_DEFAULT_MODE);
$setting->setMode(MODE_CASI);
$setting->setLanguage(1);
// dummy
$setting->setValue(MODE_CASI);
$setting->save();
/* add default language */
$setting = new Setting();
$setting->setSuid($this->suid);
$setting->setObject(USCIC_SURVEY);
$setting->setObjectType(OBJECT_SURVEY);
$setting->setName(SETTING_DEFAULT_LANGUAGE);
示例2: setSettingDirectly
function setSettingDirectly($object, $objecttype, $name, $value, $mode = "", $language = "")
{
$setting = new Setting();
$setting->setSuid($this->getSuid());
$setting->setLanguage($language);
$setting->setMode($mode);
$setting->setName($name);
$setting->setObject($object);
$setting->setObjectType($objecttype);
$setting->setValue($value);
$setting->save();
}
示例3: Setting
require_once "../model/Query/Setting.php";
/**
* Validate data
*/
$set = new Setting();
$set->setClinicName($_POST["clinic_name"]);
$_POST["clinic_name"] = $set->getClinicName();
$set->setClinicHours($_POST["clinic_hours"]);
$_POST["clinic_hours"] = $set->getClinicHours();
$set->setClinicAddress($_POST["clinic_address"]);
$_POST["clinic_address"] = $set->getClinicAddress();
$set->setClinicPhone($_POST["clinic_phone"]);
$_POST["clinic_phone"] = $set->getClinicPhone();
$set->setClinicUrl($_POST["clinic_url"]);
$_POST["clinic_url"] = $set->getClinicUrl();
$set->setLanguage($_POST["language"]);
$_POST["language"] = $set->getLanguage();
$set->setSessionTimeout($_POST["session_timeout"]);
$_POST["session_timeout"] = $set->getSessionTimeout();
$set->setItemsPerPage($_POST["items_per_page"]);
$_POST["items_per_page"] = $set->getItemsPerPage();
if (!$set->validateData()) {
$formError["session_timeout"] = $set->getSessionTimeoutError();
$formError["items_per_page"] = $set->getItemsPerPageError();
Form::setSession($_POST, $formError);
header("Location: ../admin/setting_edit_form.php");
exit;
}
/**
* Destroy form values and errors
*/
示例4: getSettingValue
}
return "";
}
function getSettingValue($name, $default = true)
{
return $this->getSetting($name, $default)->getValue();
}
function setSettingValue($name, $value)
{
/* determine index */
$index = strtoupper($name . getSurveyMode() . getSurveyLanguage() . $this->getObjectType());
/* don't store if follow generic/follow type (these are implicitly derived,
* so no need to store them explicitly). Also don't store if empty (if something should be empty
* like a text, then enter for example as value).
* If we had a value stored before, then we remove it now.
*/
if (inArray($value, array("", SETTING_FOLLOW_GENERIC, SETTING_FOLLOW_TYPE))) {
if (isset($this->settings[$index])) {
$s = $this->settings[$index];
if ($s != null) {
$s->remove();
}
unset($this->settings[$index]);
}
return;
}
/* update */
if (isset($this->settings[$index])) {
$this->settings[$index]->setValue($value);
} else {
/* create new */