本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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");
}
示例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);
}
示例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() . "/";
}
}
示例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);
}
示例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"));
}
示例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;
}
示例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());
}
示例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();
}
}
示例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;
}
示例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;
}
示例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"];
}
示例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;
}