本文整理汇总了PHP中ilObjUser::getCity方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::getCity方法的具体用法?PHP ilObjUser::getCity怎么用?PHP ilObjUser::getCity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::getCity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHtml
/**
* Get HTML
*/
function getHtml()
{
global $tpl, $lng, $https;
$this->tpl = new ilTemplate("tpl.openlayers_map.html", true, true, "Services/Maps");
$lng->loadLanguageModule("maps");
$tpl->addJavaScript("Services/Maps/js/OpenLayers.js");
$tpl->addJavaScript("Services/Maps/js/ServiceOpenLayers.js");
// add user markers
$cnt = 0;
foreach ($this->user_marker as $user_id) {
if (ilObject::_exists($user_id)) {
$user = new ilObjUser($user_id);
if ($user->getLatitude() != 0 && $user->getLongitude() != 0 && $user->getPref("public_location") == "y") {
$this->tpl->setCurrentBlock("user_marker");
$this->tpl->setVariable("UMAP_ID", $this->getMapId());
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->setVariable("ULAT", htmlspecialchars($user->getLatitude()));
$this->tpl->setVariable("ULONG", htmlspecialchars($user->getLongitude()));
$info = htmlspecialchars($user->getFirstName() . " " . $user->getLastName());
$delim = "<br \\/>";
if ($user->getPref("public_institution") == "y") {
$info .= $delim . htmlspecialchars($user->getInstitution());
$delim = ", ";
}
if ($user->getPref("public_department") == "y") {
$info .= $delim . htmlspecialchars($user->getDepartment());
}
$delim = "<br \\/>";
if ($user->getPref("public_street") == "y") {
$info .= $delim . htmlspecialchars($user->getStreet());
}
if ($user->getPref("public_zip") == "y") {
$info .= $delim . htmlspecialchars($user->getZipcode());
$delim = " ";
}
if ($user->getPref("public_city") == "y") {
$info .= $delim . htmlspecialchars($user->getCity());
}
$delim = "<br \\/>";
if ($user->getPref("public_country") == "y") {
$info .= $delim . htmlspecialchars($user->getCountry());
}
$this->tpl->setVariable("USER_INFO", $info);
$this->tpl->setVariable("IMG_USER", $user->getPersonalPicturePath("xsmall"));
$this->tpl->parseCurrentBlock();
$cnt++;
}
}
}
$this->tpl->setVariable("MAP_ID", $this->getMapId());
$this->tpl->setVariable("WIDTH", $this->getWidth());
$this->tpl->setVariable("HEIGHT", $this->getHeight());
$this->tpl->setVariable("LAT", $this->getLatitude());
$this->tpl->setVariable("LONG", $this->getLongitude());
$this->tpl->setVariable("ZOOM", (int) $this->getZoom());
$nav_control = $this->getEnableNavigationControl() ? "true" : "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$central_marker = $this->getEnableCentralMarker() ? "true" : "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
$replace_marker = $this->getEnableUpdateListener() ? "true" : "false";
$this->tpl->setVariable("REPLACE_MARKER", $replace_marker);
$this->tpl->setVariable("INVALID_ADDRESS_STRING", $lng->txt("invalid_address"));
return $this->tpl->get();
}
示例2: importEndTag
//.........这里部分代码省略.........
case "ILIAS3":
$updateUser->setPasswd($this->currPassword, IL_PASSWD_MD5);
break;
case "PLAIN":
$updateUser->setPasswd($this->currPassword, IL_PASSWD_PLAIN);
$this->acc_mail->setUserPassword($this->currPassword);
break;
}
}
if (!is_null($this->userObj->getFirstname())) {
$updateUser->setFirstname($this->userObj->getFirstname());
}
if (!is_null($this->userObj->getLastname())) {
$updateUser->setLastname($this->userObj->getLastname());
}
if (!is_null($this->userObj->getUTitle())) {
$updateUser->setUTitle($this->userObj->getUTitle());
}
if (!is_null($this->userObj->getGender())) {
$updateUser->setGender($this->userObj->getGender());
}
if (!is_null($this->userObj->getEmail())) {
$updateUser->setEmail($this->userObj->getEmail());
}
if (!is_null($this->userObj->getBirthday())) {
$updateUser->setBirthday($this->userObj->getBirthday());
}
if (!is_null($this->userObj->getInstitution())) {
$updateUser->setInstitution($this->userObj->getInstitution());
}
if (!is_null($this->userObj->getStreet())) {
$updateUser->setStreet($this->userObj->getStreet());
}
if (!is_null($this->userObj->getCity())) {
$updateUser->setCity($this->userObj->getCity());
}
if (!is_null($this->userObj->getZipCode())) {
$updateUser->setZipCode($this->userObj->getZipCode());
}
if (!is_null($this->userObj->getCountry())) {
$updateUser->setCountry($this->userObj->getCountry());
}
if (!is_null($this->userObj->getPhoneOffice())) {
$updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
}
if (!is_null($this->userObj->getPhoneHome())) {
$updateUser->setPhoneHome($this->userObj->getPhoneHome());
}
if (!is_null($this->userObj->getPhoneMobile())) {
$updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
}
if (!is_null($this->userObj->getFax())) {
$updateUser->setFax($this->userObj->getFax());
}
if (!is_null($this->userObj->getHobby())) {
$updateUser->setHobby($this->userObj->getHobby());
}
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());
}
示例3: addLocationToForm
/**
* Add location fields to form if activated
*
* @param ilPropertyFormGUI $a_form
* @param ilObjUser $a_user
*/
function addLocationToForm(ilPropertyFormGUI $a_form, ilObjUser $a_user)
{
global $ilCtrl;
// check map activation
include_once "./Services/Maps/classes/class.ilMapUtil.php";
if (!ilMapUtil::isActivated()) {
return;
}
// Don't really know if this is still necessary...
$this->lng->loadLanguageModule("maps");
// Get user settings
$latitude = $a_user->getLatitude();
$longitude = $a_user->getLongitude();
$zoom = $a_user->getLocationZoom();
// Get Default settings, when nothing is set
if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
$def = ilMapUtil::getDefaultSettings();
$latitude = $def["latitude"];
$longitude = $def["longitude"];
$zoom = $def["zoom"];
}
$street = $a_user->getStreet();
if (!$street) {
$street = $this->lng->txt("street");
}
$city = $a_user->getCity();
if (!$city) {
$city = $this->lng->txt("city");
}
$country = $a_user->getCountry();
if (!$country) {
$country = $this->lng->txt("country");
}
// location property
$loc_prop = new ilLocationInputGUI($this->lng->txt("location"), "location");
$loc_prop->setLatitude($latitude);
$loc_prop->setLongitude($longitude);
$loc_prop->setZoom($zoom);
$loc_prop->setAddress($street . "," . $city . "," . $country);
$a_form->addItem($loc_prop);
}
示例4: getHtml
/**
* Get HTML
*/
function getHtml()
{
global $tpl;
$this->tpl = new ilTemplate("tpl.google_map.html", true, true, "Services/GoogleMaps");
$tpl->addJavaScript("//maps.google.com/maps/api/js?sensor=false", false);
$tpl->addJavaScript("Services/GoogleMaps/js/ServiceGoogleMaps.js");
// add user markers
$cnt = 0;
foreach ($this->user_marker as $user_id) {
if (ilObject::_exists($user_id)) {
$user = new ilObjUser($user_id);
if ($user->getLatitude() != 0 && $user->getLongitude() != 0 && $user->getPref("public_location") == "y") {
$this->tpl->setCurrentBlock("user_marker");
$this->tpl->setVariable("UMAP_ID", $this->getMapId());
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->setVariable("ULAT", htmlspecialchars($user->getLatitude()));
$this->tpl->setVariable("ULONG", htmlspecialchars($user->getLongitude()));
$info = htmlspecialchars($user->getFirstName() . " " . $user->getLastName());
$delim = "<br \\/>";
if ($user->getPref("public_institution") == "y") {
$info .= $delim . htmlspecialchars($user->getInstitution());
$delim = ", ";
}
if ($user->getPref("public_department") == "y") {
$info .= $delim . htmlspecialchars($user->getDepartment());
}
$delim = "<br \\/>";
if ($user->getPref("public_street") == "y") {
$info .= $delim . htmlspecialchars($user->getStreet());
}
if ($user->getPref("public_zip") == "y") {
$info .= $delim . htmlspecialchars($user->getZipcode());
$delim = " ";
}
if ($user->getPref("public_city") == "y") {
$info .= $delim . htmlspecialchars($user->getCity());
}
$delim = "<br \\/>";
if ($user->getPref("public_country") == "y") {
$info .= $delim . htmlspecialchars($user->getCountry());
}
$this->tpl->setVariable("USER_INFO", $info);
$this->tpl->setVariable("IMG_USER", $user->getPersonalPicturePath("xsmall"));
$this->tpl->parseCurrentBlock();
$cnt++;
}
}
}
$this->tpl->setVariable("MAP_ID", $this->getMapId());
$this->tpl->setVariable("WIDTH", $this->getWidth());
$this->tpl->setVariable("HEIGHT", $this->getHeight());
$this->tpl->setVariable("LAT", $this->getLatitude());
$this->tpl->setVariable("LONG", $this->getLongitude());
$this->tpl->setVariable("ZOOM", (int) $this->getZoom());
$type_control = $this->getEnableTypeControl() ? "true" : "false";
$this->tpl->setVariable("TYPE_CONTROL", $type_control);
$nav_control = $this->getEnableNavigationControl() ? "true" : "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$update_listener = $this->getEnableUpdateListener() ? "true" : "false";
$this->tpl->setVariable("UPDATE_LISTENER", $update_listener);
$large_map_control = $this->getEnableLargeMapControl() ? "true" : "false";
$this->tpl->setVariable("LARGE_CONTROL", $large_map_control);
$central_marker = $this->getEnableCentralMarker() ? "true" : "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
return $this->tpl->get();
}
示例5: parseUserPlaceholders
/**
* Return all Placeholders of user data
*
* @param ilObjUser $user
* @return array
*/
protected function parseUserPlaceholders(ilObjUser $user)
{
return array('USER_LOGIN' => $this->anonymized ? 'johndoe' : $user->getLogin(), 'USER_TITLE' => $this->anonymized ? 'Mister' : $user->getUTitle(), 'USER_FULLNAME' => $this->anonymized ? 'John Doe' : $user->getFullname(), 'USER_FIRSTNAME' => $this->anonymized ? 'John' : $user->getFirstname(), 'USER_LASTNAME' => $this->anonymized ? 'Doe' : $user->getLastname(), 'USER_BIRTHDAY' => $user->getBirthday(), 'USER_INSTITUTION' => $user->getInstitution(), 'USER_DEPARTMENT' => $user->getDepartment(), 'USER_STREET' => $this->anonymized ? 'Manhattan Street' : $user->getStreet(), 'USER_CITY' => $this->anonymized ? 'New York' : $user->getCity(), 'USER_ZIPCODE' => $this->anonymized ? 10026 : $user->getZipcode(), 'USER_COUNTRY' => $this->anonymized ? 'USA' : $user->getCountry());
}
示例6: 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();
}