本文整理汇总了PHP中ilObjUser::_getPersonalPicturePath方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::_getPersonalPicturePath方法的具体用法?PHP ilObjUser::_getPersonalPicturePath怎么用?PHP ilObjUser::_getPersonalPicturePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::_getPersonalPicturePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildExportFile
/**
* Build export file
*
* @param
* @return
*/
function buildExportFile()
{
global $ilias;
// create export file
include_once "./Services/Export/classes/class.ilExport.php";
ilExport::_createExportDirectory($this->object->getId(), "html", "prtf");
$exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf");
$this->subdir = $this->object->getType() . "_" . $this->object->getId();
$this->export_dir = $exp_dir . "/" . $this->subdir;
// initialize temporary target directory
ilUtil::delDir($this->export_dir);
ilUtil::makeDir($this->export_dir);
// system style html exporter
include_once "./Services/Style/classes/class.ilSystemStyleHTMLExport.php";
$this->sys_style_html_export = new ilSystemStyleHTMLExport($this->export_dir);
// $this->sys_style_html_export->addImage("icon_prtf_b.png");
$this->sys_style_html_export->export();
// init co page html exporter
include_once "./Services/COPage/classes/class.ilCOPageHTMLExport.php";
$this->co_page_html_export = new ilCOPageHTMLExport($this->export_dir);
/* $this->co_page_html_export->setContentStyleId(
$this->object->getStyleSheetId()); */
$this->co_page_html_export->createDirectories();
$this->co_page_html_export->exportStyles();
$this->co_page_html_export->exportSupportScripts();
// banner / profile picture
$prfa_set = new ilSetting("prfa");
if ($prfa_set->get("banner")) {
$banner = $this->object->getImageFullPath();
copy($banner, $this->export_dir . "/" . basename($banner));
}
$ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "big");
if ($ppic) {
$ppic = array_shift(explode("?", $ppic));
copy($ppic, $this->export_dir . "/" . basename($ppic));
}
// export pages
$this->exportHTMLPages();
// zip everything
if (true) {
// zip it all
$date = time();
$zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf") . "/" . $date . "__" . IL_INST_ID . "__" . $this->object->getType() . "_" . $this->object->getId() . ".zip";
ilUtil::zip($this->export_dir, $zip_file);
ilUtil::delDir($this->export_dir);
}
return $zip_file;
}
示例2: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $ilAccess;
// rollback command
if ($a_set["nr"] > 0) {
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$this->tpl->setCurrentBlock("command");
$this->tpl->setVariable("TXT_COMMAND", $lng->txt("cont_rollback"));
$this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTarget($this->getParentObject(), "rollbackConfirmation"));
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
if (!$this->rselect) {
$this->tpl->setVariable("RSELECT", 'checked="checked"');
$this->rselect = true;
} else {
if (!$this->lselect) {
$this->tpl->setVariable("LSELECT", 'checked="checked"');
$this->lselect = true;
}
}
$this->tpl->setVariable("NR", $a_set["nr"]);
$this->tpl->setVariable("TXT_HDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["hdate"], IL_CAL_DATETIME)));
$ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]);
$this->tpl->setVariable("HREF_OLD_PAGE", $ilCtrl->getLinkTarget($this->getParentObject(), "preview"));
if (ilObject::_exists($a_set["user"])) {
// user name
$user = ilObjUser::_lookupName($a_set["user"]);
$login = ilObjUser::_lookupLogin($a_set["user"]);
$this->tpl->setVariable("TXT_LINKED_USER", $user["lastname"] . ", " . $user["firstname"] . " [" . $login . "]");
// profile link
$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]);
$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url", rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())));
$this->tpl->setVariable("USER_LINK", $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
$img = ilObjUser::_getPersonalPicturePath($a_set["user"], "xxsmall", true);
$this->tpl->setVariable("IMG_USER", $img);
}
$ilCtrl->setParameter($this->getParentObject(), "old_nr", "");
}
示例3: addStandardFieldsToForm
//.........这里部分代码省略.........
$bi->setStartYear(1900);
$bi->setRequired($ilSetting->get("require_" . $f));
if (!$bi->getRequired() || $date) {
$bi->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($bi);
}
break;
case "radio":
if (ilUserProfile::userSettingVisible($f)) {
$rg = new ilRadioGroupInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$rg->setValue($a_user->{$m}());
}
foreach ($p["values"] as $k => $v) {
$op = new ilRadioOption($lng->txt($v), $k);
$rg->addOption($op);
}
$rg->setRequired($ilSetting->get("require_" . $f));
if (!$rg->getRequired() || $rg->getValue()) {
$rg->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($rg);
}
break;
case "picture":
if (ilUserProfile::userSettingVisible("upload") && $a_user) {
$ii = new ilImageFileInputGUI($lng->txt("personal_picture"), "userfile");
$ii->setDisabled($ilSetting->get("usr_settings_disable_upload"));
$upload = $a_form->getFileUpload("userfile");
if ($upload["name"]) {
$ii->setPending($upload["name"]);
} else {
$im = ilObjUser::_getPersonalPicturePath($a_user->getId(), "small", true, true);
if ($im != "") {
$ii->setImage($im);
$ii->setAlt($lng->txt("personal_picture"));
}
}
// ilinc link as info
if (ilUserProfile::userSettingVisible("upload") and $ilSetting->get("ilinc_active")) {
include_once './Modules/ILinc/classes/class.ilObjiLincUser.php';
$ilinc_user = new ilObjiLincUser($a_user);
if ($ilinc_user->id) {
include_once './Modules/ILinc/classes/class.ilnetucateXMLAPI.php';
$ilincAPI = new ilnetucateXMLAPI();
$ilincAPI->uploadPicture($ilinc_user);
$response = $ilincAPI->sendRequest("uploadPicture");
// return URL to user's personal page
$url = trim($response->data['url']['cdata']);
$desc = $lng->txt("ilinc_upload_pic_text") . " " . '<a href="' . $url . '">' . $lng->txt("ilinc_upload_pic_linktext") . '</a>';
$ii->setInfo($desc);
}
}
$a_form->addItem($ii);
}
break;
case "roles":
if (self::$mode == self::MODE_DESKTOP) {
if (ilUserProfile::userSettingVisible("roles")) {
$global_roles = $rbacreview->getGlobalRoles();
foreach ($global_roles as $role_id) {
if (in_array($role_id, $rbacreview->assignedRoles($a_user->getId()))) {
$roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
$role_names .= $roleObj->getTitle() . ", ";
unset($roleObj);
示例4: renderTitle
function renderTitle()
{
global $tpl;
$tpl->resetHeaderBlock();
include_once "./Services/User/classes/class.ilUserUtil.php";
$tpl->setTitle(ilUserUtil::getNamePresentation($this->getUserId()));
$tpl->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->getUserId(), "xxsmall"));
$this->handleBackUrl();
}
示例5: showPublicProfileFields
/**
* Add fields to form
*
* @param ilPropertyformGUI $form
* @param array $prefs
* @param object $parent
* @param bool $a_anonymized
*/
public function showPublicProfileFields(ilPropertyformGUI $form, array $prefs, $parent = null, $anonymized = false)
{
global $ilUser;
$birthday = $ilUser->getBirthday();
if ($birthday) {
$birthday = ilDatePresentation::formatDate(new ilDate($birthday, IL_CAL_DATE));
}
$gender = $ilUser->getGender();
if ($gender) {
$gender = $this->lng->txt("gender_" . $gender);
}
if ($ilUser->getSelectedCountry() != "") {
$this->lng->loadLanguageModule("meta");
$txt_sel_country = $this->lng->txt("meta_c_" . $ilUser->getSelectedCountry());
}
// profile picture
$pic = ilObjUser::_getPersonalPicturePath($ilUser->getId(), "xsmall", true, true);
if ($pic) {
$pic = "<img src=\"" . $pic . "\" />";
}
// personal data
$val_array = array("title" => $ilUser->getUTitle(), "birthday" => $birthday, "gender" => $gender, "upload" => $pic, "interests_general" => $ilUser->getGeneralInterestsAsText(), "interests_help_offered" => $ilUser->getOfferingHelpAsText(), "interests_help_looking" => $ilUser->getLookingForHelpAsText(), "institution" => $ilUser->getInstitution(), "department" => $ilUser->getDepartment(), "street" => $ilUser->getStreet(), "zipcode" => $ilUser->getZipcode(), "city" => $ilUser->getCity(), "country" => $ilUser->getCountry(), "sel_country" => $txt_sel_country, "phone_office" => $ilUser->getPhoneOffice(), "phone_home" => $ilUser->getPhoneHome(), "phone_mobile" => $ilUser->getPhoneMobile(), "fax" => $ilUser->getFax(), "email" => $ilUser->getEmail(), "hobby" => $ilUser->getHobby(), "matriculation" => $ilUser->getMatriculation(), "delicious" => $ilUser->getDelicious());
// location
include_once "./Services/Maps/classes/class.ilMapUtil.php";
if (ilMapUtil::isActivated()) {
$val_array["location"] = "";
}
foreach ($val_array as $key => $value) {
if ($anonymized) {
$value = null;
}
if ($this->userSettingVisible($key)) {
// public setting
if ($key == "upload") {
$cb = new ilCheckboxInputGUI($this->lng->txt("personal_picture"), "chk_" . $key);
} else {
$cb = new ilCheckboxInputGUI($this->lng->txt($key), "chk_" . $key);
}
if ($prefs["public_" . $key] == "y") {
$cb->setChecked(true);
}
//$cb->setInfo($value);
$cb->setOptionTitle($value);
if (!$parent) {
$form->addItem($cb);
} else {
$parent->addSubItem($cb);
}
}
}
$im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
if ($this->userSettingVisible("instant_messengers")) {
foreach ($im_arr as $im) {
// public setting
$cb = new ilCheckboxInputGUI($this->lng->txt("im_" . $im), "chk_im_" . $im);
//$cb->setInfo($ilUser->getInstantMessengerId($im));
$cb->setOptionTitle($ilUser->getInstantMessengerId($im));
if ($prefs["public_im_" . $im] != "n") {
$cb->setChecked(true);
}
if (!$parent) {
$form->addItem($cb);
} else {
$parent->addSubItem($cb);
}
}
}
// additional defined user data fields
$user_defined_data = array();
if (!$anonymized) {
$user_defined_data = $ilUser->getUserDefinedData();
}
foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
// public setting
$cb = new ilCheckboxInputGUI($definition["field_name"], "chk_udf_" . $definition["field_id"]);
$cb->setOptionTitle($user_defined_data["f_" . $definition["field_id"]]);
if ($prefs["public_udf_" . $definition["field_id"]] == "y") {
$cb->setChecked(true);
}
if (!$parent) {
$form->addItem($cb);
} else {
$parent->addSubItem($cb);
}
}
}
示例6: getNamePresentation
/**
* Default behaviour is:
* - lastname, firstname if public profile enabled
* - [loginname] (always)
* modifications by jposselt at databay . de :
* if $a_user_id is an array of user ids the method returns an array of
* "id" => "NamePresentation" pairs.
*
* ...
* @param boolean sortable should be used in table presentions. output is "Doe, John" title is ommited
*/
static function getNamePresentation($a_user_id, $a_user_image = false, $a_profile_link = false, $a_profile_back_link = "", $a_force_first_lastname = false, $a_omit_login = false, $a_sortable = true)
{
global $lng, $ilCtrl, $ilDB;
if (!($return_as_array = is_array($a_user_id))) {
$a_user_id = array($a_user_id);
}
$sql = 'SELECT
a.usr_id,
firstname,
lastname,
title,
login,
b.value public_profile,
c.value public_title
FROM
usr_data a
LEFT JOIN
usr_pref b ON
(a.usr_id = b.usr_id AND
b.keyword = %s)
LEFT JOIN
usr_pref c ON
(a.usr_id = c.usr_id AND
c.keyword = %s)
WHERE ' . $ilDB->in('a.usr_id', $a_user_id, false, 'integer');
$userrow = $ilDB->queryF($sql, array('text', 'text'), array('public_profile', 'public_title'));
$names = array();
while ($row = $ilDB->fetchObject($userrow)) {
if ($a_force_first_lastname || ($has_public_profile = in_array($row->public_profile, array("y", "g")))) {
$title = "";
if ($row->public_title == "y" && $row->title) {
$title = $row->title . " ";
}
if ($a_sortable) {
$pres = $row->lastname;
if (strlen($row->firstname)) {
$pres .= ', ' . $row->firstname . ' ';
}
} else {
$pres = $title;
if (strlen($row->firstname)) {
$pres .= $row->firstname . ' ';
}
$pres .= $row->lastname . ' ';
}
}
if (!$a_omit_login) {
$pres .= "[" . $row->login . "]";
}
if ($a_profile_link && $has_public_profile) {
$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $row->usr_id);
if ($a_profile_back_link != "") {
$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url", rawurlencode($a_profile_back_link));
}
$pres = '<a href="' . $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML") . '">' . $pres . '</a>';
}
if ($a_user_image) {
$img = ilObjUser::_getPersonalPicturePath($row->usr_id, "xxsmall");
$pres = '<img border="0" src="' . $img . '" alt="' . $lng->txt("icon") . " " . $lng->txt("user_picture") . '" /> ' . $pres;
}
$names[$row->usr_id] = $pres;
}
foreach ($a_user_id as $id) {
if (!$names[$id]) {
$names[$id] = "unknown";
}
}
return $return_as_array ? $names : $names[$a_user_id[0]];
}
示例7: getPersonalPicturePath
/**
* Get path to personal picture. The result will be cached.
* The result will be cached.
*
* @param string $a_size "small", "xsmall" or "xxsmall"
* @param bool $a_force_pic
* @return mixed
*/
public function getPersonalPicturePath($a_size = "small", $a_force_pic = false)
{
if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
}
self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = ilObjUser::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
}
示例8: __showEditUser
function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id = false)
{
global $ilObjDataCache, $lng, $ilCtrl;
include_once 'Services/Tracking/classes/class.ilLPMarks.php';
if (!$a_sub_id) {
$obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
} else {
$ilCtrl->setParameter($this, 'userdetails_id', $a_sub_id);
$obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
}
$marks = new ilLPMarks($obj_id, $a_user_id);
$tpl = new ilTemplate('tpl.lp_edit_user.html', true, true, 'Services/Tracking');
$tpl->setVariable("OBJ_TITLE", $lng->txt("edit") . ": " . $ilObjDataCache->lookupTitle($obj_id));
$tpl->setVariable("OBJ_SUBTITLE", $this->lng->txt('trac_mode') . ": " . ilLPObjSettings::_mode2Text(ilLPObjSettings::_lookupMode($obj_id)));
$ilCtrl->setParameter($this, 'user_id', $a_user_id);
$ilCtrl->setParameter($this, 'details_id', $a_ref_id);
$tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
$tpl->setVariable("TYPE_IMG", ilObjUser::_getPersonalPicturePath($a_user_id, 'xxsmall'));
$tpl->setVariable("ALT_IMG", $ilObjDataCache->lookupTitle($a_user_id));
$tpl->setVariable("TXT_LP", $lng->txt('trac_learning_progress_tbl_header'));
$tpl->setVariable("COMMENT", ilUtil::prepareFormOutput($marks->getComment(), false));
$type = $ilObjDataCache->lookupType($obj_id);
if ($type != 'lm') {
$tpl->setVariable("TXT_MARK", $lng->txt('trac_mark'));
$tpl->setVariable("MARK", ilUtil::prepareFormOutput($marks->getMark(), false));
}
$tpl->setVariable("TXT_COMMENT", $lng->txt('trac_comment'));
$mode = ilLPObjSettings::_lookupMode($obj_id);
if ($mode == LP_MODE_MANUAL or $mode == LP_MODE_MANUAL_BY_TUTOR) {
include_once "./Services/Tracking/classes/class.ilLPStatus.php";
$completed = ilLPStatus::_lookupStatus($obj_id, $a_user_id);
$tpl->setVariable("mode_manual");
$tpl->setVariable("TXT_COMPLETED", $lng->txt('trac_completed'));
$tpl->setVariable("CHECK_COMPLETED", ilUtil::formCheckbox($completed == LP_STATUS_COMPLETED_NUM, 'completed', '1'));
}
$tpl->setVariable("TXT_CANCEL", $lng->txt('cancel'));
$tpl->setVariable("TXT_SAVE", $lng->txt('save'));
$tpl->setVariable("CMD_CANCEL", $a_cancel);
return $tpl->get();
}
示例9: initForm
//.........这里部分代码省略.........
$this->form_gui->addItem($disk_usage);
}
// personal data
if ($this->isSettingChangeable('gender') or $this->isSettingChangeable('firstname') or $this->isSettingChangeable('lastname') or $this->isSettingChangeable('title') or $this->isSettingChangeable('personal_image') or $this->isSettingChangeable('birhtday')) {
$sec_pd = new ilFormSectionHeaderGUI();
$sec_pd->setTitle($this->lng->txt("personal_data"));
$this->form_gui->addItem($sec_pd);
}
// gender
if ($this->isSettingChangeable('gender')) {
$gndr = new ilRadioGroupInputGUI($lng->txt("gender"), "gender");
$gndr->setRequired(isset($settings["require_gender"]) && $settings["require_gender"]);
$female = new ilRadioOption($lng->txt("gender_f"), "f");
$gndr->addOption($female);
$male = new ilRadioOption($lng->txt("gender_m"), "m");
$gndr->addOption($male);
$this->form_gui->addItem($gndr);
}
// firstname, lastname, title
$fields = array("firstname" => true, "lastname" => true, "title" => isset($settings["require_title"]) && $settings["require_title"]);
foreach ($fields as $field => $req) {
if ($this->isSettingChangeable($field)) {
$inp = new ilTextInputGUI($lng->txt($field), $field);
$inp->setSize(32);
$inp->setMaxLength(32);
$inp->setRequired($req);
$this->form_gui->addItem($inp);
}
}
// personal image
if ($this->isSettingChangeable('upload')) {
$pi = new ilImageFileInputGUI($lng->txt("personal_picture"), "userfile");
if ($a_mode == "edit" || $a_mode == "upload") {
$pi->setImage(ilObjUser::_getPersonalPicturePath($this->object->getId(), "small", true, true));
}
$this->form_gui->addItem($pi);
}
if ($this->isSettingChangeable('birthday')) {
$birthday = new ilBirthdayInputGUI($lng->txt('birthday'), 'birthday');
$birthday->setRequired(isset($settings["require_birthday"]) && $settings["require_birthday"]);
$birthday->setShowEmpty(true);
$birthday->setStartYear(1900);
$this->form_gui->addItem($birthday);
}
// institution, department, street, city, zip code, country, phone office
// phone home, phone mobile, fax, e-mail
$fields = array(array("institution", 40, 80), array("department", 40, 80), array("street", 40, 40), array("city", 40, 40), array("zipcode", 10, 10), array("country", 40, 40), array("sel_country"), array("phone_office", 30, 30), array("phone_home", 30, 30), array("phone_mobile", 30, 30), array("fax", 30, 30));
$counter = 0;
foreach ($fields as $field) {
if (!$counter++ and $this->isSettingChangeable($field[0])) {
// contact data
$sec_cd = new ilFormSectionHeaderGUI();
$sec_cd->setTitle($this->lng->txt("contact_data"));
$this->form_gui->addItem($sec_cd);
}
if ($this->isSettingChangeable($field[0])) {
if ($field[0] != "sel_country") {
$inp = new ilTextInputGUI($lng->txt($field[0]), $field[0]);
$inp->setSize($field[1]);
$inp->setMaxLength($field[2]);
$inp->setRequired(isset($settings["require_" . $field[0]]) && $settings["require_" . $field[0]]);
$this->form_gui->addItem($inp);
} else {
// country selection
include_once "./Services/Form/classes/class.ilCountrySelectInputGUI.php";
$cs = new ilCountrySelectInputGUI($lng->txt($field[0]), $field[0]);
示例10: getNoteListHTML
//.........这里部分代码省略.........
$tpl->setCurrentBlock("edit_note_form");
// $tpl->setVariable("EDIT_FORM", $this->form->getHTML());
$tpl->setVariable("EDIT_FORM", $this->form_tpl->get());
$tpl->parseCurrentBlock();
} else {
$cnt_col = 2;
// delete note stuff for all private notes
if ($this->checkDeletion($note) && !$this->delete_note && !$this->export_html && !$this->print && !$this->edit_note_form && !$this->add_note_form) {
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $note->getId());
$this->renderLink($tpl, "delete_note", $lng->txt("delete"), "deleteNote", "note_" . $note->getId());
}
// checkboxes in multiselection mode
if ($this->multi_selection && !$this->delete_note) {
$tpl->setCurrentBlock("checkbox_col");
$tpl->setVariable("CHK_NOTE", "note[]");
$tpl->setVariable("CHK_NOTE_ID", $note->getId());
$tpl->parseCurrentBlock();
$cnt_col = 1;
}
// edit note stuff for all private notes
if ($this->checkEdit($note)) {
if (!$this->delete_note && !$this->export_html && !$this->print && !$this->edit_note_form && !$this->add_note_form) {
$ilCtrl->setParameterByClass("ilnotegui", "note_id", $note->getId());
$this->renderLink($tpl, "edit_note", $lng->txt("edit"), "editNoteForm", "note_edit");
}
}
$tpl->setVariable("CNT_COL", $cnt_col);
// output author account
if ($a_type == IL_NOTE_PUBLIC && ilObject::_exists($note->getAuthor())) {
//$tpl->setCurrentBlock("author");
//$tpl->setVariable("VAL_AUTHOR", ilObjUser::_lookupLogin($note->getAuthor()));
//$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("user_img");
$tpl->setVariable("USR_IMG", ilObjUser::_getPersonalPicturePath($note->getAuthor(), "xxsmall"));
$tpl->setVariable("USR_ALT", $lng->txt("user_image") . ": " . ilObjUser::_lookupLogin($note->getAuthor()));
$tpl->parseCurrentBlock();
$tpl->setVariable("TXT_USR", ilUserUtil::getNamePresentation($note->getAuthor(), false, false) . " - ");
}
// last edited
if ($note->getUpdateDate() != null) {
$tpl->setVariable("TXT_LAST_EDIT", $lng->txt("last_edited_on"));
$tpl->setVariable("DATE_LAST_EDIT", ilDatePresentation::formatDate(new ilDate($note->getUpdateDate(), IL_CAL_DATETIME)));
} else {
$tpl->setVariable("VAL_DATE", ilDatePresentation::formatDate(new ilDate($note->getCreationDate(), IL_CAL_DATETIME)));
}
// hidden note ids for deletion
if ($this->delete_note) {
$tpl->setCurrentBlock("delete_ids");
$tpl->setVariable("HID_NOTE", "note[]");
$tpl->setVariable("HID_NOTE_ID", $note->getId());
$tpl->parseCurrentBlock();
}
$target = $note->getObject();
// target objects
$this->showTargets($tpl, $this->rep_obj_id, $note->getId(), $target["obj_type"], $target["obj_id"]);
$rowclass = $rowclass != "tblrow1" ? "tblrow1" : "tblrow2";
if (!$this->export_html && !$this->print) {
$tpl->setCurrentBlock("note_img");
if ($a_type == IL_NOTE_PUBLIC) {
$tpl->setVariable("IMG_NOTE", $this->comment_img[$note->getLabel()]["img"]);
$tpl->setVariable("ALT_NOTE", $this->comment_img[$note->getLabel()]["alt"]);
} else {
$tpl->setVariable("IMG_NOTE", $this->note_img[$note->getLabel()]["img"]);
$tpl->setVariable("ALT_NOTE", $this->note_img[$note->getLabel()]["alt"]);
}
$tpl->parseCurrentBlock();
示例11: buildExportFile
/**
* Build export file
*
* @param
* @return
*/
function buildExportFile()
{
global $ilias;
// create export file
include_once "./Services/Export/classes/class.ilExport.php";
ilExport::_createExportDirectory($this->object->getId(), "html", "prtf");
$exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf");
$this->subdir = $this->object->getType() . "_" . $this->object->getId();
$this->export_dir = $exp_dir . "/" . $this->subdir;
// initialize temporary target directory
ilUtil::delDir($this->export_dir);
ilUtil::makeDir($this->export_dir);
// system style html exporter
include_once "./Services/Style/classes/class.ilSystemStyleHTMLExport.php";
$this->sys_style_html_export = new ilSystemStyleHTMLExport($this->export_dir);
// $this->sys_style_html_export->addImage("icon_prtf.svg");
$this->sys_style_html_export->export();
// init co page html exporter
include_once "./Services/COPage/classes/class.ilCOPageHTMLExport.php";
$this->co_page_html_export = new ilCOPageHTMLExport($this->export_dir);
$this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId());
$this->co_page_html_export->createDirectories();
$this->co_page_html_export->exportStyles();
$this->co_page_html_export->exportSupportScripts();
// banner
$prfa_set = new ilSetting("prfa");
if ($prfa_set->get("banner")) {
$banner = $this->object->getImageFullPath();
if ($banner) {
copy($banner, $this->export_dir . "/" . basename($banner));
}
}
// page element: profile picture
$ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "big", true, true);
if ($ppic) {
$ppic = array_shift(explode("?", $ppic));
copy($ppic, $this->export_dir . "/" . basename($ppic));
}
// header image: profile picture
$ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "xsmall", true, true);
if ($ppic) {
$ppic = array_shift(explode("?", $ppic));
copy($ppic, $this->export_dir . "/" . basename($ppic));
}
// export pages
$this->exportHTMLPages();
// add js/images/file to zip
$images = $files = $js_files = array();
foreach ($this->export_material as $items) {
$images = array_merge($images, $items["images"]);
$files = array_merge($files, $items["files"]);
$js_files = array_merge($js_files, $items["js"]);
}
foreach (array_unique($images) as $image) {
if (is_file($image)) {
copy($image, $this->export_dir . "/images/" . basename($image));
}
}
foreach (array_unique($js_files) as $js_file) {
if (is_file($js_file)) {
copy($js_file, $this->export_dir . "/js/" . basename($js_file));
}
}
foreach (array_unique($files) as $file) {
if (is_file($file)) {
copy($file, $this->export_dir . "/files/" . basename($file));
}
}
// zip everything
if (true) {
// zip it all
$date = time();
$zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "prtf") . "/" . $date . "__" . IL_INST_ID . "__" . $this->object->getType() . "_" . $this->object->getId() . ".zip";
ilUtil::zip($this->export_dir, $zip_file);
ilUtil::delDir($this->export_dir);
}
return $zip_file;
}
示例12: fillRow
/**
* get flat bookmark list for personal desktop
*/
function fillRow($a_set)
{
global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
// mail link
$a_set["mail_to"] = "";
if ($this->mail_allowed && $rbacsystem->checkAccessOfUser($a_set['id'], 'internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
$a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
}
// check for profile
$a_set["profile"] = in_array(ilObjUser::_lookupPref($a_set["id"], "public_profile"), array("y", "g"));
// user image
if ($this->getCurrentDetailLevel() > 2) {
if ($a_set["mail_url"] != "") {
$this->tpl->setCurrentBlock("mailto_link");
$this->tpl->setVariable("TXT_MAIL", $lng->txt("mail"));
$this->tpl->setVariable("MAIL_URL", $a_set["mail_url"]);
$this->tpl->parseCurrentBlock();
}
$chatSettings = new ilSetting('chatroom');
if ($chatSettings->get('chat_enabled')) {
if (!$this->__showActiveChatsOfUser($a_set["id"])) {
// Show invite to chat
$this->__showChatInvitation($a_set["id"]);
}
global $rbacsystem;
include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
if ($a_set["id"] == $ilUser->getId() && $rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId())) {
$this->tpl->setCurrentBlock('chat_link');
$this->tpl->setVariable('TXT_CHAT_INVITE', $lng->txt('chat_enter_public_room'));
$this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_enter_public_room_tooltip'));
// $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
$this->tpl->setVariable('CHAT_LINK', './ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id=' . ilObjChatroom::_getPublicRefId());
$this->tpl->parseCurrentBlock();
}
}
// user image
$this->tpl->setCurrentBlock("usr_image");
$this->tpl->setVariable("USR_IMAGE", ilObjUser::_getPersonalPicturePath($a_set["id"], "xxsmall"));
$this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("usr_image_space");
$pd_set = new ilSetting("pd");
$osi_server = $pd_set->get("osi_host");
// if (trim($osi_server) != "")
// {
// instant messengers
// 1 indicates to use online status check
$im_arr = array("icq" => 0, "yahoo" => 1, "msn" => 0, "aim" => 0, "skype" => 1, "jabber" => 0, "voip" => 0);
// use onlinestatus.org
// when enabled all instant messengers are checked online and ignores settings above
if (trim($osi_server) != "") {
$osi_enable = true;
}
// removed calls to external servers due to
// bug 10583, alex 8 Mar 2013
foreach ($im_arr as $im_name => $im_check) {
if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name)) {
$im_url = "";
switch ($im_name) {
case "icq":
$im_url = "http://http://www.icq.com/people/" . $im_id;
break;
case "yahoo":
$im_url = "http://edit.yahoo.com/config/send_webmesg?target=" . $im_id . "&src=pg";
break;
case "msn":
$im_url = "http://messenger.live.com";
break;
case "aim":
//$im_url = "aim:GoIM?screenname=".$im_id;
$im_url = "http://aimexpress.aim.com";
break;
case "skype":
$im_url = "skype:" . $im_id . "?call";
break;
}
$im_img = ilUtil::getImagePath($im_name . 'online.png');
if ($im_url != "") {
$this->tpl->setCurrentBlock("im_link_start");
$this->tpl->setVariable("URL_IM", $im_url);
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("im_link_end");
}
$this->tpl->setCurrentBlock("instant_messengers");
$this->tpl->setVariable("IMG_IM_ICON", $im_img);
$this->tpl->setVariable("TXT_IM_ICON", $lng->txt("im_" . $im_name));
$icon_id = "im_" . $im_name . "_usr_" . $a_set["id"];
$this->tpl->setVariable("ICON_ID", $icon_id);
include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_" . $im_name) . ": " . $im_id, "", "top center", "bottom center");
$this->tpl->parseCurrentBlock();
}
}
// }
}
// username
if (!$a_set["profile"]) {
//.........这里部分代码省略.........
示例13: fillRow
/**
* Standard Version of Fill Row. Most likely to
* be overwritten by derived class.
*/
protected function fillRow($a_set)
{
global $lng, $ilCtrl, $lng;
include_once "./Services/Tracking/classes/class.ilLPMarks.php";
include_once "./Modules/Wiki/classes/class.ilWikiContributor.php";
if (ilObject::_exists($a_set["user_id"])) {
arsort($a_set["pages"]);
// pages
foreach ($a_set["pages"] as $page_id => $cnt) {
if ($page_id > 0) {
include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
$title = ilWikiPage::lookupTitle($page_id);
$this->tpl->setCurrentBlock("page");
$this->tpl->setVariable("PAGE", $title);
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setVariable("TXT_LINKED_USER", $user["lastname"] . ", " . $user["firstname"] . " [" . $login . "]");
// profile link
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]);
//$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url",
// rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())));
//$this->tpl->setVariable("USER_LINK",
// $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
$img = ilObjUser::_getPersonalPicturePath($a_set["user_id"], "xsmall");
$this->tpl->setVariable("IMG_USER", $img);
$this->tpl->setVariable("TXT_NAME", $a_set["lastname"] . ", " . $a_set["firstname"]);
$this->tpl->setVariable("USER_ID", $a_set["user_id"]);
// comment for learner
$this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("wiki_comment_for_learner"));
$this->tpl->setVariable("NAME_LCOMMENT", "lcomment[" . $a_set["user_id"] . "]");
$lpcomment = ilLPMarks::_lookupComment($a_set["user_id"], $this->parent_obj->object->getId());
$this->tpl->setVariable("VAL_LCOMMENT", ilUtil::prepareFormOutput($lpcomment));
// status
//$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $member_id);
$status = ilWikiContributor::_lookupStatus($this->parent_obj->object->getId(), $a_set["user_id"]);
$this->tpl->setVariable("SEL_" . $status, ' selected="selected" ');
$this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("wiki_notgraded"));
$this->tpl->setVariable("TXT_PASSED", $lng->txt("wiki_passed"));
$this->tpl->setVariable("TXT_FAILED", $lng->txt("wiki_failed"));
$this->tpl->setVariable("VAL_NOTGRADED", ilWikiContributor::STATUS_NOT_GRADED);
$this->tpl->setVariable("VAL_PASSED", ilWikiContributor::STATUS_PASSED);
$this->tpl->setVariable("VAL_FAILED", ilWikiContributor::STATUS_FAILED);
if (($sd = ilWikiContributor::_lookupStatusTime($this->parent_obj->object->getId(), $a_set["user_id"])) > 0) {
$this->tpl->setCurrentBlock("status_date");
$this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
$this->tpl->setVariable("VAL_STATUS_DATE", ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
$this->tpl->parseCurrentBlock();
}
switch ($status) {
case ilWikiContributor::STATUS_PASSED:
$pic = "scorm/passed.png";
break;
case ilWikiContributor::STATUS_FAILED:
$pic = "scorm/failed.png";
break;
default:
$pic = "scorm/not_attempted.png";
break;
}
$this->tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
$this->tpl->setVariable("ALT_STATUS", $lng->txt("wiki_" . $status));
// mark
$this->tpl->setVariable("TXT_MARK", $lng->txt("wiki_mark"));
$this->tpl->setVariable("NAME_MARK", "mark[" . $a_set["user_id"] . "]");
$mark = ilLPMarks::_lookupMark($a_set["user_id"], $this->parent_obj->object->getId());
$this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));
}
}
示例14: fillRow
/**
* Fill table row
*/
protected function fillRow($a_set)
{
global $ilCtrl, $lng;
$this->tpl->setVariable("VAL_ID", $a_set["usr_id"]);
if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
include_once './Services/User/classes/class.ilUserUtil.php';
$link = ilUserUtil::getProfileLink($a_set['usr_id']);
if ($link) {
$this->tpl->setVariable('IMG_LINKED_TO_PROFILE', $link);
$this->tpl->setVariable('USR_IMG_SRC_LINKED', ilObjUser::_getPersonalPicturePath($a_set['usr_id'], 'xsmall'));
} else {
$this->tpl->setVariable('USR_IMG_SRC', ilObjUser::_getPersonalPicturePath($a_set['usr_id'], 'xsmall'));
}
}
foreach ($this->getSelectedColumns() as $field) {
switch ($field) {
case 'gender':
$a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'birthday':
$a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date');
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'access_until':
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('CUST_CLASS', ' ' . $a_set['access_class']);
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'last_login':
$a_set['last_login'] = $a_set['last_login'] ? ilDatePresentation::formatDate(new ilDateTime($a_set['last_login'], IL_CAL_DATETIME)) : $this->lng->txt('no_date');
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', $a_set[$field]);
$this->tpl->parseCurrentBlock();
break;
case 'login':
if ($this->admin_mode) {
$ilCtrl->setParameterByClass("ilobjusergui", "ref_id", "7");
$ilCtrl->setParameterByClass("ilobjusergui", "obj_id", $a_set["usr_id"]);
$ilCtrl->setParameterByClass("ilobjusergui", "search", "1");
$link = $ilCtrl->getLinkTargetByClass(array("iladministrationgui", "ilobjusergui"), "view");
$a_set[$field] = "<a href=\"" . $link . "\">" . $a_set[$field] . "</a>";
}
// fallthrough
// fallthrough
default:
$this->tpl->setCurrentBlock('custom_fields');
$this->tpl->setVariable('VAL_CUST', (string) ($a_set[$field] ? $a_set[$field] : ''));
$this->tpl->parseCurrentBlock();
break;
}
}
if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
$this->tpl->setVariable('SEARCH_RELEVANCE', $this->getRelevanceHTML($a_set['relevance']));
}
}
示例15: renderTitle
function renderTitle()
{
global $tpl, $ilTabs, $lng;
$tpl->resetHeaderBlock();
include_once "./Services/User/classes/class.ilUserUtil.php";
$tpl->setTitle(ilUserUtil::getNamePresentation($this->getUserId()));
$tpl->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->getUserId(), "xxsmall"));
$back = $this->getBackUrl() != "" ? $this->getBackUrl() : $_GET["back_url"];
if ($back != "") {
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"), $back);
}
}