本文整理汇总了PHP中ilObjUser::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::getLanguage方法的具体用法?PHP ilObjUser::getLanguage怎么用?PHP ilObjUser::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::getLanguage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initForm
protected function initForm()
{
$this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
$this->setTitle($this->pl->txt('certificate_placeholders'));
// Each placeholder can define values for each language defined in the type
$languages = $this->definition->getType()->getLanguages();
$label_lang = in_array($this->user->getLanguage(), $languages) ? $this->user->getLanguage() : $this->definition->getDefaultLanguage();
/** @var $placeholder_value srCertificatePlaceholderValue */
foreach ($this->definition->getPlaceholderValues() as $placeholder_value) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($placeholder_value->getPlaceholder()->getLabel($label_lang));
$this->addItem($section);
foreach ($languages as $lang) {
$this->addItem($this->getInputField($placeholder_value, $lang));
}
}
if ($signatures = $this->definition->getType()->getSignatures()) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->pl->txt('signature'));
$this->addItem($section);
$select_input = new ilSelectInputGUI($this->pl->txt('signature'), 'signature');
$options = array(0 => '');
foreach ($signatures as $signature) {
$options[$signature->getId()] = $signature->getFirstName() . ' ' . $signature->getLastName();
}
$select_input->setOptions($options);
$select_input->setValue($this->definition->getSignatureId());
$this->addItem($select_input);
}
$this->addCommandButton('updatePlaceholders', $this->pl->txt('save'));
return;
}
开发者ID:studer-raimann,项目名称:Certificate,代码行数:32,代码来源:class.srCertificateDefinitionPlaceholdersFormGUI.php
示例2: confirmDeletePlaceholder
public function confirmDeletePlaceholder()
{
/** @var srCertificatePlaceholder $placeholder */
$placeholder = srCertificatePlaceholder::find((int) $_GET['placeholder_id']);
$gui = new ilConfirmationGUI();
$gui->setFormAction($this->ctrl->getFormAction($this));
$gui->setHeaderText($this->pl->txt('info_delete_custom_placeholder'));
$gui->addItem('placeholder_id', $placeholder->getId(), $placeholder->getLabel($this->user->getLanguage()));
$gui->setConfirm($this->lng->txt('confirm'), 'deletePlaceholder');
$gui->setCancel($this->lng->txt('cancel'), 'showPlaceholders');
$this->tpl->setContent($gui->getHTML());
}
示例3: updateTranslation
/**
* Update title and description for the default language of translation
*/
protected function updateTranslation()
{
$translations = $this->obj_orgu->getTranslations();
$lang_code_default = '';
$lang_codes = array();
foreach ($translations['Fobject'] as $translation) {
if ($translation['lang_default']) {
$lang_code_default = $translation['lang'];
}
$lang_codes[] = $translation['lang'];
}
$lang_code = in_array($this->user->getLanguage(), $lang_codes) ? $this->user->getLanguage() : $lang_code_default;
$this->obj_orgu->updateTranslation($this->getInput('title'), $this->getInput('description'), $lang_code, 0);
}
示例4: getTranslation
/**
* Helper method to return a translation for a given member and language
*
* @param $a_member
* @param $a_lang_code
*
* @return null|string
*/
protected function getTranslation($a_member, $a_lang_code)
{
$lang = $a_lang_code ? $a_lang_code : $this->user->getLanguage();
$trans_obj = $this->loadTranslation($lang);
if (!is_null($trans_obj)) {
$translation = $trans_obj->getMember($a_member);
// If the translation does exist but is an empty string and there was no lang code given,
// substitute default language anyway because an empty string provides no information
if (!$a_lang_code && !$translation) {
$trans_obj = $this->loadTranslation($this->getDefaultLang());
return $trans_obj->getMember($a_member);
}
return $translation;
} else {
// If no lang code was given and there was no translation found, return string in default language
if (!$a_lang_code) {
$trans_obj = $this->loadTranslation($this->getDefaultLang());
return $trans_obj->getMember($a_member);
}
return NULL;
}
}
示例5: getUserInstance
public function getUserInstance(ilObjUser $user, $languageVars, $defaultLanguage)
{
$notificationObject = new ilNotificationObject($this, $user);
$title = '';
$short = '';
$long = '';
if ($languageVars[$this->title->getName()]->lang[$user->getLanguage()]) {
$title = $languageVars[$this->title->getName()]->lang[$user->getLanguage()];
} else {
if ($languageVars[$this->title->getName()]->lang[$defaultLanguage]) {
$title = $languageVars[$this->title->getName()]->lang[$defaultLanguage];
} else {
$title = $this->title->getName();
}
}
if ($languageVars[$this->short_description->getName()]->lang[$user->getLanguage()]) {
$short = $languageVars[$this->short_description->getName()]->lang[$user->getLanguage()];
} else {
if ($languageVars[$this->short_description->getName()]->lang[$defaultLanguage]) {
$short = $languageVars[$this->short_description->getName()]->lang[$defaultLanguage];
} else {
$short = $this->short_description->getName();
}
}
if ($languageVars[$this->long_description->getName()]->lang[$user->getLanguage()]) {
$long = $languageVars[$this->long_description->getName()]->lang[$user->getLanguage()];
} else {
if ($languageVars[$this->long_description->getName()]->lang[$defaultLanguage]) {
$long = $languageVars[$this->long_description->getName()]->lang[$defaultLanguage];
} else {
$long = $this->long_description->getName();
}
}
$notificationObject->title = $title;
$notificationObject->shortDescription = $short;
$notificationObject->longDescription = $long;
$notificationObject->iconPath = $this->iconPath;
return $notificationObject;
}
示例6: importEndTag
//.........这里部分代码省略.........
if (!is_null($this->userObj->getComment())) {
$updateUser->setComment($this->userObj->getComment());
}
if (!is_null($this->userObj->getDepartment())) {
$updateUser->setDepartment($this->userObj->getDepartment());
}
if (!is_null($this->userObj->getMatriculation())) {
$updateUser->setMatriculation($this->userObj->getMatriculation());
}
if (!is_null($this->currActive)) {
$updateUser->setActive($this->currActive == "true", is_object($ilUser) ? $ilUser->getId() : 0);
}
if (!is_null($this->userObj->getClientIP())) {
$updateUser->setClientIP($this->userObj->getClientIP());
}
if (!is_null($this->userObj->getTimeLimitUnlimited())) {
$updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
}
if (!is_null($this->userObj->getTimeLimitFrom())) {
$updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
}
if (!is_null($this->userObj->getTimeLimitUntil())) {
$updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
}
if (!is_null($this->userObj->getTimeLimitMessage())) {
$updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
}
if (!is_null($this->userObj->getApproveDate())) {
$updateUser->setApproveDate($this->userObj->getApproveDate());
}
if (!is_null($this->userObj->getAgreeDate())) {
$updateUser->setAgreeDate($this->userObj->getAgreeDate());
}
if (!is_null($this->userObj->getLanguage())) {
$updateUser->setLanguage($this->userObj->getLanguage());
}
if (!is_null($this->userObj->getExternalAccount())) {
$updateUser->setExternalAccount($this->userObj->getExternalAccount());
}
// Fixed: if auth_mode is not set, it was always overwritten with auth_default
#if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode());
if ($this->auth_mode_set) {
$updateUser->setAuthMode($this->userObj->getAuthMode());
}
if (!is_null($this->userObj->getInstantMessengerId("aim"))) {
$updateUser->setInstantMessengerId("aim", $this->userObj->getInstantMessengerId("aim"));
}
if (!is_null($this->userObj->getInstantMessengerId("msn"))) {
$updateUser->setInstantMessengerId("msn", $this->userObj->getInstantMessengerId("msn"));
}
if (!is_null($this->userObj->getInstantMessengerId("icq"))) {
$updateUser->setInstantMessengerId("icq", $this->userObj->getInstantMessengerId("icq"));
}
if (!is_null($this->userObj->getInstantMessengerId("yahoo"))) {
$updateUser->setInstantMessengerId("yahoo", $this->userObj->getInstantMessengerId("yahoo"));
}
if (!is_null($this->userObj->getInstantMessengerId("skype"))) {
$updateUser->setInstantMessengerId("skype", $this->userObj->getInstantMessengerId("skype"));
}
if (!is_null($this->userObj->getInstantMessengerId("jabber"))) {
$updateUser->setInstantMessengerId("jabber", $this->userObj->getInstantMessengerId("jabber"));
}
if (!is_null($this->userObj->getInstantMessengerId("voip"))) {
$updateUser->setInstantMessengerId("voip", $this->userObj->getInstantMessengerId("voip"));
}
// Special handlin since it defaults to 7 (USER_FOLDER_ID)
示例7: sendAccountMail
/**
* send account mail
*/
function sendAccountMail()
{
if ($_POST["send_mail"] != "" || $this->isSendMail() && $this->userObj->getEmail() != "") {
$this->acc_mail->setUser($this->userObj);
$amail = $this->readAccountMailFromCache($this->userObj->getLanguage());
if ($amail["att_file"]) {
include_once "Services/User/classes/class.ilFSStorageUserFolder.php";
$fs = new ilFSStorageUserFolder(USER_FOLDER_ID);
$fs->create();
$path = $fs->getAbsolutePath() . "/";
$this->acc_mail->addAttachment($path . "/" . $amail["lang"], $amail["att_file"]);
}
$this->acc_mail->send();
}
}
示例8: loadFromUser
/**
* Load user data from ilias user object
* @param stdclass $user
* @param ilObjUser $iu
*/
private function loadFromUser($user, ilObjUser $iu)
{
$prefix = ilViteroSettings::getInstance()->getUserPrefix();
$user->username = $prefix . $iu->getLogin();
$user->surname = $iu->getLastname();
$user->firstname = $iu->getFirstname();
$user->email = $iu->getEmail();
$user->company = $iu->getInstitution();
$user->locale = in_array($iu->getLanguage(), $this->available_locales) ? $iu->getLanguage() : "en";
#$user->timezone = trim($iu->getTimeZone());
$GLOBALS['ilLog']->write(__METHOD__ . ': Time zone is ' . $iu->getTimeZone());
$user->phone = $iu->getPhoneOffice();
$user->fax = $iu->getFax();
$user->mobile = $iu->getPhoneMobile();
$user->country = $iu->getCountry();
$user->zip = $iu->getZipcode();
$user->city = $iu->getCity();
$user->street = $iu->getStreet();
}
示例9: initForm
/**
* Init form
*/
protected function initForm()
{
$this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
$title = $this->isNew ? $this->pl->txt('choose_cert_type') : $this->pl->txt('edit_settings');
// Certificate Type
$type = $this->getTypeInput();
$n_types = count($type->getOptions());
if ($this->isNew) {
if (!$n_types) {
ilUtil::sendInfo($this->pl->txt('msg_no_types_available'));
} else {
$this->setTitle($title);
$this->addItem($type);
$this->addCommandButton('createDefinition', $this->pl->txt('save'));
}
return;
} else {
if ($n_types > 1) {
$this->setTitle($title);
$checkbox = new ilCheckboxInputGUI($this->pl->txt('change_cert_type'), 'change_type');
$checkbox->addSubItem($type);
$checkbox->setInfo($this->pl->txt('current_type') . ' ' . $this->definition->getType()->getTitle());
$this->addItem($checkbox);
}
}
// Add all settings inputs
$settings_inputs = $this->getSettingsInputs();
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->pl->txt('certificate'));
$this->addItem($header);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_DEFAULT_LANG]);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_VALIDITY_TYPE]);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_GENERATION]);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_DOWNLOADABLE]);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_SCORM_TIMING]);
// Custom settings
/** @var srCertificateCustomDefinitionSetting $setting */
foreach ($this->definition->getCustomSettings() as $setting) {
switch ($setting->getSettingTypeId()) {
case srCertificateCustomTypeSetting::SETTING_TYPE_BOOLEAN:
$item = new ilCheckboxInputGUI($setting->getLabel($this->user->getLanguage()), 'custom_setting_' . $setting->getIdentifier());
if ($setting->getValue()) {
$item->setChecked(true);
}
break;
case srCertificateCustomTypeSetting::SETTING_TYPE_SELECT:
$item = new ilSelectInputGUI($setting->getLabel($this->user->getLanguage()), 'custom_setting_' . $setting->getIdentifier());
$item->setValue($setting->getValue());
$item->setOptions($setting->getCustomTypeSetting()->getData(true));
break;
}
$item->setDisabled(!$setting->isEditable());
$this->addItem($item);
}
// Notification
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->pl->txt('setting_id_notification'));
$this->addItem($header);
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_NOTIFICATION]);
if (isset($settings_inputs[srCertificateTypeSetting::IDENTIFIER_NOTIFICATION_USER])) {
$this->addItem($settings_inputs[srCertificateTypeSetting::IDENTIFIER_NOTIFICATION_USER]);
}
$this->addCommandButton("updateDefinition", "Save");
}