本文整理汇总了PHP中lms_steam::get_current_semester方法的典型用法代码示例。如果您正苦于以下问题:PHP lms_steam::get_current_semester方法的具体用法?PHP lms_steam::get_current_semester怎么用?PHP lms_steam::get_current_semester使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lms_steam
的用法示例。
在下文中一共展示了lms_steam::get_current_semester方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$path = $this->params;
$portal = \lms_portal::get_instance();
$user = \lms_steam::get_current_user();
if (isset($path[0])) {
if (\steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]) instanceof \steam_group) {
$current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]);
} else {
header("Location: " . PATH_URL . "404/");
die;
}
} else {
$current_semester = \lms_steam::get_current_semester();
}
$current_semester_name = $current_semester->get_name();
if (\lms_steam::is_steam_admin($user)) {
if (!$portal->get_user()->is_logged_in()) {
throw new Exception("Access denied. Please login.", E_USER_AUTHORIZATION);
}
$semester_admins = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $current_semester->get_groupname() . ".admins");
$admin_group = new \koala_group_default($semester_admins);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$delete = $_POST["delete"];
if (count($delete) == 1) {
$login = key($delete);
$admin = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $login);
$admin_group->remove_member($admin);
}
}
$content = \Semester::getInstance()->loadTemplate("semester_admins.template.html");
$content->setVariable("INFORMATION_ADMINS", str_replace("%SEMESTER", h($current_semester->get_attribute("OBJ_DESC")), gettext("These people are allowed to create courses for %SEMESTER.")) . " " . gettext("They can appoint other users as staff members/moderators for their own courses."));
$content->setVariable("LINK_ADD_ADMIN", PATH_URL . "semester/addAdmin/" . $current_semester_name . "/" . $admin_group->get_id());
$content->setVariable("LABEL_ADD_ADMIN", gettext("Add another admin"));
//TODO: Messages extension schreiben
// TODO: Passt der Link?
$content->setVariable("LINK_MESSAGE", PATH_URL . "mail/write/" . $admin_group->get_id());
$content->setVariable("LABEL_MESSAGE_ADMINS", gettext("Mail to admins"));
$admins = $admin_group->get_members();
$no_admins = count($admins);
if ($no_admins > 0) {
$content->setVariable("LABEL_ADMINS", gettext("Course admins"));
$content->setCurrentBlock("BLOCK_CONTACT_LIST");
$content->setVariable("LABEL_NAME_POSITION", gettext("Name") . "/" . gettext("Position"));
$content->setVariable("LABEL_SUBJECT_AREA", gettext("Subject area"));
$content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
$content->setVariable("LABEL_REMOVE_ADMIN", gettext("Action"));
foreach ($admins as $admin) {
$adm_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_DESC", "OBJ_ICON"));
$content->setCurrentBlock("BLOCK_CONTACT");
$content->setVariable("CONTACT_NAME", h($adm_attributes["USER_FIRSTNAME"]) . " " . h($adm_attributes["USER_FULLNAME"]));
// TODO: Profile Image einfügen
// TODO: Passt der Link?
$icon_link = \lms_user::get_user_image_url(30, 40);
$content->setVariable("CONTACT_IMAGE", $icon_link);
// TODO: Passt der Link?
$content->setVariable("CONTACT_LINK", PATH_URL . "user/" . $admin->get_name() . "/");
$content->setVariable("OBJ_DESC", h($adm_attributes["OBJ_DESC"]));
$content->setVariable("LABEL_MESSAGE", gettext("Message"));
// TODO: Passt der Link?
$content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "mail/write/" . $admin->get_name());
$content->setVariable("LABEL_SEND", gettext("Send"));
$content->setVariable("LABEL_REMOVE", gettext("Remove"));
$content->setVariable("CONTACT_ID", $admin->get_name());
$content->parse("BLOCK_CONTACT");
}
$content->parse("BLOCK_CONTACT_LIST");
} else {
$content->setVariable("LABEL_ADMINS", gettext("No admins found."));
}
/* TODO: Portal anpassen
$portal->set_page_title( h($current_semester->get_name()) . " Admins" );
$portal->set_page_main(
array(
array( "link" => PATH_URL . SEMESTER_URL . "/" . h($current_semester->get_name()) . "/", "name" => h($current_semester->get_attribute( "OBJ_DESC" ))), array( "link" => "", "name" => gettext( "Admins" ) )
),
$content->get(),
""
);
$portal->show_html( );
*/
} else {
header("Location: " . PATH_URL . "404/");
die;
}
$frameResponseObject->setTitle("Semester " . $current_semester_name);
$rawHtml = new \Widgets\RawHtml();
$rawHtml->setHtml($content->get());
$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例2: header
<?php
include_once "../../etc/koala.conf.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
if (!lms_steam::is_koala_admin($user)) {
header("location:/");
exit;
}
$search_extension = "exam_organization";
$result = array();
$courses = lms_steam::semester_get_courses(lms_steam::get_current_semester()->get_id());
foreach ($courses as $course) {
$koala_course = new koala_group_course(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $course["OBJ_ID"]));
$extensions = $koala_course->get_extensions();
foreach ($extensions as $extension) {
if ($extension->get_name() == $search_extension) {
$result[] = $course;
}
}
}
//var_dump($result);
$html = <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>koaLA Admin - find big files</title>
<style type="text/css">
* {margin:0; padding:0; outline:0}
示例3: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$path = $this->params;
$user = \lms_steam::get_current_user();
$content = \Semester::getInstance()->loadTemplate("courses_overview.template.html");
$content->setVariable("HELP_TEXT", "<b>" . gettext('Notice') . ':</b> ' . gettext('You can easily find courses by using the filter. Just type in a part of the course\'s title, it\'s ID or the name of the tutor.'));
$content->setVariable('LABEL_FILTER', gettext('Filter'));
/**
* Action Bar
*/
$content->setCurrentBlock("BLOCK_ACTIONBAR");
$isFiltered = false;
$isEditMode = false;
if (isset($path[0])) {
if (\steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]) instanceof \steam_group) {
$current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]);
} else {
ExtensionMaster::getInstance()->send404Error();
}
} else {
$current_semester = \lms_steam::get_current_semester();
}
$current_semester_name = $current_semester->get_name();
if (isset($path[1]) && $path[1] == "booked") {
$isFiltered = true;
}
if (isset($path[2]) && $path[2] == "edit") {
$isEditMode = true;
}
if ($isFiltered) {
if (ALL_COURSES) {
$content->setCurrentBlock("BLOCK_ALL_COURSES");
$content->setVariable("LABEL_MY_COURSES", gettext("All courses"));
$content->setVariable("LINK_MY_COURSES", PATH_URL . "semester/index/" . $current_semester_name . "/all" . ($isEditMode ? "/edit" : ""));
$content->parse("BLOCK_ALL_COURSES");
}
} else {
if (YOUR_COURSES) {
$content->setCurrentBlock("BLOCK_YOUR_COURSES");
$content->setVariable("LABEL_MY_COURSES", gettext("My courses"));
$content->setVariable("LINK_MY_COURSES", PATH_URL . "semester/index/" . $current_semester_name . "/booked" . ($isEditMode ? "/edit" : ""));
$content->parse("BLOCK_YOUR_COURSES");
}
}
if ($isEditMode) {
$content->setCurrentBlock("BLOCK_EDIT_MODE");
$content->setVariable("LABEL_EDIT_MODE", gettext("Disable edit mode"));
$content->setVariable("LINK_EDIT_MODE", PATH_URL . "semester/index/" . $current_semester_name . ($isFiltered ? "/booked" : "/all"));
$content->parse("BLOCK_EDIT_MODE");
} else {
$content->setCurrentBlock("BLOCK_EDIT_MODE");
$content->setVariable("LABEL_EDIT_MODE", gettext("Enable edit mode"));
$content->setVariable("LINK_EDIT_MODE", PATH_URL . "semester/index/" . $current_semester_name . ($isFiltered ? "/booked" : "/all") . "/edit");
$content->parse("BLOCK_EDIT_MODE");
}
$is_steam_admin = \lms_steam::is_steam_admin($user);
if ($is_steam_admin || \lms_steam::is_semester_admin($current_semester, $user)) {
$content->setCurrentBlock("BLOCK_SEMESTER_ADMIN");
if (ADD_COURSE) {
$content->setCurrentBlock("BLOCK_ADD_COURSE");
$content->setVariable("LINK_CREATE_COURSE", PATH_URL . "semester/addCourse" . "/" . $current_semester_name);
$content->setVariable("LABEL_CREATE_COURSE", gettext("Create new course"));
$content->parse("BLOCK_ADD_COURSE");
}
if (IMPORT_COURSE_FROM_PAUL) {
$content->setCurrentBlock("BLOCK_IMPORT_COURSE_FROM_PAUL");
$content->setVariable("LINK_CREATE_PAUL_COURSE", PATH_URL . "semester/importCourse" . "/" . $current_semester_name);
$content->setVariable("LABEL_CREATE_PAUL_COURSE", gettext("Create new course via PAUL"));
$content->parse("BLOCK_IMPORT_COURSE_FROM_PAUL");
}
if ($is_steam_admin) {
$content->setCurrentBlock("BLOCK_SERVER_ADMIN");
if (MANAGE_SEMESTER) {
$content->setCurrentBlock("BLOCK_MANAGE_SEMESTER");
$content->setVariable("LINK_MANAGE_SEMESTER", PATH_URL . "semester/manageSemester" . "/" . $current_semester_name);
$content->setVariable("LABEL_MANAGE_SEMESTER", gettext("Manage this semester"));
$content->parse("BLOCK_MANAGE_SEMESTER");
}
if (ADD_SEMESTER) {
$content->setCurrentBlock("BLOCK_ADD_SEMESTER");
$content->setVariable("LINK_CREATE_SEMESTER", PATH_URL . "semester/addSemester");
$content->setVariable("LABEL_CREATE_SEMESTER", gettext("Create new semester"));
$content->parse("BLOCK_ADD_SEMESTER");
}
$content->parse("BLOCK_SERVER_ADMIN");
}
$content->parse("BLOCK_SEMESTER_ADMIN");
}
$content->parse("BLOCK_ACTIONBAR");
// AUS DEM SYSTEM AUSLESEN
$cache = get_cache_function("ORGANIZATION", 600);
$semesters = $cache->call("lms_steam::get_semesters");
foreach ($semesters as $s) {
$content->setCurrentBlock("BLOCK_TABS");
if ($s["OBJ_NAME"] == $current_semester_name) {
$content->setVariable("TAB_STATE", "tabOut");
$content->setVariable("LINK_SEMESTER", $s["OBJ_NAME"]);
} else {
$content->setVariable("TAB_STATE", "tabIn");
$filter_part = "";
//.........这里部分代码省略.........