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


PHP lms_steam::get_current_user方法代码示例

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


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

示例1: recommend_contact

 function recommend_contact($receiver, $contact, $message)
 {
     $user = lms_steam::get_current_user();
     $subject = str_replace("%NAME", $contact->get_attribute("USER_FIRSTNAME") . " " . $contact->get_attribute("USER_FULLNAME"), gettext("Recommendation of %NAME as contact"));
     $message .= "\n\n--\n\n" . gettext("This message was created via the introduce contact function.") . " " . str_replace(array("%NAME1", "%NAME2"), array($user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME"), $contact->get_attribute("USER_FIRSTNAME") . " " . $contact->get_attribute("USER_FULLNAME")), gettext("%NAME1 wants to recommend %NAME2 to you.")) . "\n\n" . gettext("Name") . ": " . $contact->get_attribute("USER_FIRSTNAME") . " " . $contact->get_attribute("USER_FULLNAME") . "\n" . gettext("Contact page") . ": " . PATH_URL . "user/" . $contact->get_name() . "/\n";
     lms_steam::mail($receiver, $user, $subject, $message);
 }
开发者ID:rolwi,项目名称:koala,代码行数:7,代码来源:contact_introduction.php

示例2: createObject

 public static function createObject($name, $description = "", $content = "", $mimeType = "application/x-msdownload", $artefactClass, $user = null)
 {
     self::init();
     if ($user == null) {
         $user = lms_steam::get_current_user();
     }
     $newArtefact = steam_factory::create_room($GLOBALS["STEAM"]->get_id(), $name, Artefacts::getArtefactsContainer($user), "Artefact: " + $name);
     $newArtefact->set_attribute(PORTFOLIO_PREFIX . "TYPE", "ARTEFACT");
     $newArtefact->set_attribute(PORTFOLIO_PREFIX . "ARTEFACTCLASS", $artefactClass);
     $dataPresent = $content == "" ? false : true;
     $newArtefact->set_attribute(PORTFOLIO_PREFIX . "DATAPRESENT", $dataPresent);
     $newArtefact->set_attribute(PORTFOLIO_PREFIX . "LINKED_LOCATIONS", array());
     $newArtefact->set_attribute("OBJ_TYPE", PORTFOLIO_PREFIX . "ARTEFACT");
     if ($dataPresent) {
         $data = steam_factory::create_document($GLOBALS["STEAM"]->get_id(), "data", $content, $mimeType, $newArtefact);
     }
     $newArtefactObject = Artefacts::getArtefactByRoom($newArtefact);
     $newArtefactObject->checkActivity();
     $newArtefactObject->checkCompetence();
     //Create Forum
     $newArtefactObject->createForum();
     //create and assign groups
     //		$newArtefact->createGroups();
     return $newArtefactObject;
 }
开发者ID:rolwi,项目名称:koala,代码行数:25,代码来源:ArtefactModel.class.php

示例3: subscribe

 public function subscribe($password = "", $message = "")
 {
     $user = lms_steam::get_current_user();
     $group_name = $this->get_display_name();
     if ($this->is_password_protected()) {
         if ($this->check_group_pw($password)) {
             $this->add_member($user, $password);
             $result = array("succeeds" => TRUE, "confirmation" => str_replace("%GROUP", $group_name, str_replace("%GROUP", $this->get_name(), gettext("You have been added to '%GROUP'."))));
         } else {
             $result = array("succeeds" => FALSE, "problem" => gettext("Wrong password."), "hint" => gettext("If you want to join and do not know the password, please contact a group moderator."), "confirmation" => "");
         }
     } else {
         if ($this->is_moderated()) {
             $user = lms_steam::get_current_user();
             $username = $user->get_full_name();
             $this->add_membership_request($user);
             $admins = $this->get_admins();
             if (!is_array($admins)) {
                 $admins = array($admins);
             }
             $link = $this instanceof koala_group_course ? PATH_URL . SEMESTER_URL . "/" . $this->get_semester()->get_name() . "/" . $this->get_name() . "/requests/" : PATH_URL . "groups/" . $this->get_id() . "/requests/";
             foreach ($admins as $admin) {
                 $adminname = $admin->get_full_name();
                 $mailbody = str_replace("%NAME", $adminname, gettext("Dear %NAME,")) . "\n\n" . str_replace(array("%NAME", "%GROUP"), array($username, $group_name), gettext("The user %NAME has requested membership for '%GROUP':")) . "\n\n<b>{$message}</b>\n\n" . gettext("Since you are a moderator for this group, you can affirm the membership or decline.") . "\n\n" . str_replace("%PAGE", "<a href=\"{$link}\">" . gettext("open membership requests") . "</a>", gettext("Please see %PAGE for further instructions."));
                 //$admin->mail( "LLMS: Membership Request" , $message,  $user->get_attribute( "USER_EMAIL" ) );
                 lms_steam::mail($admin, $user, gettext("koaLA: Membership Request"), $mailbody);
             }
             $result = array("succeeds" => TRUE, "confirmation" => str_replace("%GROUP", $group_name, str_replace("%GROUP", $group_name, gettext("Membership request for '%GROUP' has been sent."))));
         } else {
             $this->add_member($user);
             $result = array("succeeds" => TRUE, "confirmation" => str_replace("%GROUP", $group_name, gettext("You have been added to '%GROUP'.")));
         }
     }
     return $result;
 }
开发者ID:rolwi,项目名称:koala,代码行数:35,代码来源:koala_group.class.php

示例4: init

 public static function init()
 {
     $user = lms_steam::get_current_user();
     $workroom = $user->get_workroom();
     $portfolio_main_room = steam_factory::create_room($GLOBALS["STEAM"]->get_id(), "portfolio", $workroom, "room for portfolio module");
     $artefacts_room = steam_factory::create_room($GLOBALS["STEAM"]->get_id(), "artefacts", $portfolio_main_room, "room for artefacts for portfolios");
     $portfolios_room = steam_factory::create_room($GLOBALS["STEAM"]->get_id(), "portfolios", $portfolio_main_room, "room for portfolios");
 }
开发者ID:rolwi,项目名称:koala,代码行数:8,代码来源:portfolio.class.php

示例5: is_moderated

 public function is_moderated()
 {
     if ($this->is_password_protected()) {
         return FALSE;
     }
     $user = lms_steam::get_current_user();
     return !$this->steam_object->check_access(SANCTION_INSERT, $user);
 }
开发者ID:rolwi,项目名称:koala,代码行数:8,代码来源:koala_group_default.class.php

示例6: get_url

 public function get_url()
 {
     if (lms_steam::get_current_user()->get_id() == $this->get_id()) {
         return PATH_URL . "desktop/";
     } else {
         return PATH_URL . "user/" . $this->get_name() . "/";
     }
 }
开发者ID:rolwi,项目名称:koala,代码行数:8,代码来源:koala_user.class.php

示例7: ajaxResponse

 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $user = \lms_steam::get_current_user();
     $description = strip_tags($this->params["desc"]);
     $name = strip_tags($this->params["name"]);
     $newArtefact = \ArtefactCertificate::create($name, $description);
     return parent::ajaxResponseNew($ajaxResponseObject, $newArtefact);
 }
开发者ID:rolwi,项目名称:koala,代码行数:9,代码来源:CreateArtefactCertificate.class.php

示例8: get_display_name

 function get_display_name()
 {
     $creator = $this->steam_object->get_creator();
     if ($creator instanceof steam_user && $creator->get_id() == lms_steam::get_current_user()->get_id()) {
         return gettext("Your workroom");
     }
     $koala_creator = koala_object::get_koala_object($creator);
     return str_replace("%NAME", $koala_creator->get_display_name(), gettext("%NAME's workroom"));
 }
开发者ID:rolwi,项目名称:koala,代码行数:9,代码来源:koala_container_workroom.class.php

示例9: __construct

 public function __construct($steam_user)
 {
     $this->steam_user = $steam_user;
     $profile_object = $steam_user->get_attribute("LLMS_NETWORKING_PROFILE");
     if (!$profile_object instanceof steam_object && lms_steam::get_current_user()->get_id() != $steam_user->get_id()) {
         throw new Exception("Networking profile not initialized", E_USER_NO_NETWORKINGPROFILE);
     }
     $this->profile_object = $profile_object;
 }
开发者ID:rolwi,项目名称:koala,代码行数:9,代码来源:lms_networking_profile.class.php

示例10: __construct

 function __construct($parent_tmp, $steamObject_tmp, $type)
 {
     $this->parent = $parent_tmp;
     $this->steamObject = $steamObject_tmp;
     $this->type = $type;
     $this->myUser = lms_steam::get_current_user();
     //get meta data
     $doc = steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $this->steamObject->get_path() . "/exam.xml");
     $this->xml = simplexml_load_string($doc->get_content());
 }
开发者ID:rolwi,项目名称:koala,代码行数:10,代码来源:elearning_exam.class.php

示例11: processData

 public function processData(\IRequestObject $requestObject)
 {
     $params = $requestObject->getParams();
     if (isset($params) && isset($params[0])) {
         $this->user = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $params[0]);
     }
     if (!isset($this->user) || !$this->user instanceof \steam_user) {
         $this->user = \lms_steam::get_current_user();
     }
 }
开发者ID:rolwi,项目名称:koala,代码行数:10,代码来源:Index.class.php

示例12: get_context_menu

 public function get_context_menu($context, $params = array())
 {
     $user = lms_steam::get_current_user();
     $menu = array();
     if ($this->steam_object->check_access_insert($user)) {
         $menu[] = array("name" => gettext("Create folder"), "link" => $this->get_link_base() . "new-folder");
         $menu[] = array("name" => gettext("Upload document"), "link" => PATH_URL . "upload.php?env=" . $this->get_id());
         $menu[] = array("name" => gettext("Create Weblink"), "link" => PATH_URL . "docextern_create.php?env=" . $this->get_id());
     }
     return $menu;
 }
开发者ID:rolwi,项目名称:koala,代码行数:11,代码来源:koala_container_clipboard.class.php

示例13: get_context_menu

 public function get_context_menu($context, $params = array())
 {
     if ($context !== 'units') {
         return array();
     }
     $user = lms_steam::get_current_user();
     $menu = array();
     if ($this->steam_object->check_access_insert($user)) {
         $menu[] = array('name' => gettext('Create new unit'), 'link' => $this->get_url() . 'new');
     }
     return $menu;
 }
开发者ID:rolwi,项目名称:koala,代码行数:12,代码来源:koala_container_units.class.php

示例14: getArtefactsContainer

 public static function getArtefactsContainer($user = null)
 {
     self::init();
     if ($user == null) {
         $user = lms_steam::get_current_user();
     }
     if (!array_key_exists(PORTFOLIO_PREFIX . "ArtefactsContainer", $_SESSION)) {
         //$user = lms_steam::get_current_user();
         $_SESSION[PORTFOLIO_PREFIX . "ArtefactsContainer"] = $user->get_workroom()->get_object_by_name("portfolio")->get_object_by_name("artefacts");
     }
     return $_SESSION[PORTFOLIO_PREFIX . "ArtefactsContainer"];
 }
开发者ID:rolwi,项目名称:koala,代码行数:12,代码来源:Artefacts.class.php

示例15: get_context_menu

 public function get_context_menu($context, $params = array())
 {
     if ($context !== 'units') {
         return array();
     }
     $user = lms_steam::get_current_user();
     $menu = array();
     if ($this->steam_object->check_access_write($user)) {
         $menu[] = array("name" => gettext("Preferences"), "link" => $this->get_link_base() . "edit");
         $menu[] = array("name" => gettext("Delete unit"), "link" => $this->get_link_base() . "delete");
     }
     return $menu;
 }
开发者ID:rolwi,项目名称:koala,代码行数:13,代码来源:koala_container_routeplaner.class.php


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