<?php

if (!defined("PATH_TEMPLATES_UNITS_PYRAMID")) {
    define("PATH_TEMPLATES_UNITS_PYRAMID", PATH_EXTENSIONS . "units_pyramiddiscussion/templates/");
}
//$portal = lms_portal::get_instance();
//$portal->initialize( GUEST_ALLOWED );
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units", array("subcontext" => "unit"));
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_PYRAMID . "units_pyramiddiscussion.template.html");
$content->setVariable("VALUE_DESC", $unit->get_attribute("OBJ_DESC"));
$content->setVariable("VALUE_LONG_DESC", get_formatted_output($unit->get_attribute("OBJ_LONG_DESC")));
$appearance = $unit->get_attribute("UNIT_PYRAMIDDISCUSSION_APPEARANCE");
if ($appearance === 0 || $appearance === "") {
    $appearance = "direct";
}
$unit_url = "https://" . $GLOBALS["STEAM"]->get_config_value("web_server") . ($GLOBALS["STEAM"]->get_config_value("web_port_http") != "443" ? ":" . $GLOBALS["STEAM"]->get_config_value("web_port_http") : "") . $unit->get_steam_object()->get_path() . "/";
$unit_url = str_replace("?", "%3f", $unit_url);
if ($appearance === "direct") {
    header("Location: " . $unit_url);
    exit;
} else {
    if ($appearance == "2") {
        $content->setCurrentBlock("BLOCK_IFRAME");
        $content->setVariable("VALUE_IFRAME_URL", $unit_url);
        $content->parse("BLOCK_IFRAME");
    } else {
        $content->setCurrentBlock("BLOCK_LINK");
        $content->setVariable("VALUE_LINK_URL", $unit_url);
        $content->setVariable("VALUE_LINK_TEXT", gettext("Show pyramiddiscussion"));
 function handle_path($path, $owner = FALSE, $portal = FALSE)
 {
     if (is_string($path)) {
         $path = url_parse_rewrite_path($path);
     }
     if (!isset($portal) || !is_object($portal)) {
         $portal = lms_portal::get_instance();
         $portal->initialize(GUEST_NOT_ALLOWED);
     }
     $action = '';
     if (isset($path[0]) && is_numeric($path[0])) {
         $steam_unit = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0]);
         if (is_object($steam_unit) && $steam_unit->get_attribute("UNIT_TYPE") !== "units_extern") {
             return;
         }
         $unit = new units_extern($owner->get_steam_object());
         $docextern = new koala_object_docextern($steam_unit, $unit);
         if (isset($path[1])) {
             $action = $path[1];
         }
     }
     $portal_user = $portal->get_user();
     $user = lms_steam::get_current_user();
     $scg = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     //$current_semester = steam_factory::groupname_to_object( $GLOBALS[ "STEAM" ]->get_id(), $scg->get_name() . "." . $path[0]);
     $current_semester = $owner->get_semester();
     $course = $owner;
     //$backlink = PATH_URL . "extensions/units/" . $path[0] ."/" . $path[1] . "/units/";
     $backlink = $owner->get_url() . $this->get_path_name() . "/";
     $html_handler = new koala_html_course($owner);
     $html_handler->set_context("units", array('subcontext' => 'unit', 'owner' => $owner, 'unit' => $docextern));
     switch ($action) {
         case 'edit':
             include self::$PATH . 'modules/units_extern_edit.php';
             exit;
             break;
         case 'delete':
             include self::$PATH . 'modules/units_extern_delete.php';
             exit;
             break;
     }
     include PATH_EXTENSIONS . 'units_extern/modules/units_extern.php';
 }
 function handle_path($path, $owner = FALSE, $portal = FALSE)
 {
     if (!isset($portal) || !is_object($portal)) {
         $portal = lms_portal::get_instance();
         $portal->initialize(GUEST_NOT_ALLOWED);
     }
     if (isset($path[0]) && is_numeric($path[0])) {
         $steam_unit = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0]);
         if (is_object($steam_unit) && $steam_unit->get_attribute("UNIT_TYPE") !== "units_pointlist") {
             return;
         }
         $koala_container = new koala_container_pointlist($steam_unit, new units_pointlist($owner->get_steam_object()));
         $unit = $koala_container;
     }
     $backlink = $owner->get_url() . $this->get_path_name() . "/";
     $html_handler = new koala_html_course($owner);
     $html_handler->set_context("units", array("subcontext" => "unit", "owner" => $owner, "unit" => $unit));
     $user = lms_steam::get_current_user();
     $course = $owner;
     if (is_string($path)) {
         $path = url_parse_rewrite_path($path);
     }
     if (!is_object($owner) || !$owner instanceof koala_group_course) {
         throw new Exception("No owner (course) provided.", E_PARAMETER);
     }
     switch (TRUE) {
         case isset($path[1]) && $path[1] == "sheets_edit":
             include PATH_EXTENSIONS . "units_pointlist/modules/units_pointlist_sheets_edit.php";
             break;
         case isset($path[1]) && $path[1] == "export_excel":
             include PATH_EXTENSIONS . "units_pointlist/modules/units_pointlist_excel.php";
             break;
         default:
             include PATH_EXTENSIONS . "units_pointlist/modules/units_pointlist.php";
             break;
     }
 }
Beispiel #4
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $path = $this->params;
     $user = \lms_steam::get_current_user();
     $public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP);
     $id = $path[0];
     try {
         $steam_group = !empty($id) ? \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id) : FALSE;
     } catch (\Exception $ex) {
         include "bad_link.php";
         exit;
     }
     $group_is_private = FALSE;
     if ($steam_group && is_object($steam_group)) {
         switch ((string) $steam_group->get_attribute("OBJ_TYPE")) {
             case "course":
                 $group = new \koala_group_course($steam_group);
                 // TODO: Passt der backlink?
                 $backlink = PATH_URL . SEMESTER_URL . "/" . $group->get_semester()->get_name() . "/" . h($group->get_name()) . "/";
                 break;
             default:
                 $group = new \koala_group_default($steam_group);
                 // TODO: Passt der backlink?
                 $backlink = PATH_URL . "groups/" . $group->get_id() . "/";
                 // Determine if group is public or private
                 $parent = $group->get_parent_group();
                 if ($parent->get_id() == STEAM_PRIVATE_GROUP) {
                     $group_is_private = TRUE;
                 }
                 break;
         }
     }
     if ($group_is_private) {
         if (!$steam_group->is_member($user) && !\lms_steam::is_koala_admin($user)) {
             throw new \Exception(gettext("You have no rights to access this group"), E_USER_RIGHTS);
         }
     }
     if (!$group instanceof \koala_group) {
         throw new \Exception("Is not a koala_group: " . $group_id, E_PARAMETER);
     }
     switch (get_class($group)) {
         case "koala_group_course":
             $html_handler_group = new \koala_html_course($group);
             $html_handler_group->set_context("communication");
             break;
         default:
             $html_handler_group = new \koala_html_group($group);
             $html_handler_group->set_context("communication");
             break;
     }
     $content = \Group::getInstance()->loadTemplate("groups_communication.template.html");
     $workroom = $group->get_workroom();
     $read_access = $workroom->check_access_read($user);
     if (!$read_access) {
         throw new \Exception("No read access on container: id=" . $workroom->get_id(), E_USER_RIGHTS);
     }
     $cache = get_cache_function(\lms_steam::get_current_user()->get_name(), 600);
     $communication_objects = $cache->call("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
     $forums = array();
     $weblogs = array();
     $wikis = array();
     foreach ($communication_objects as $object) {
         if ($object["OBJ_CLASS"] === "steam_messageboard") {
             $forums[] = $object;
         } else {
             if ($object["OBJ_CLASS"] === "steam_calendar") {
                 $weblogs[] = $object;
             } else {
                 if (($object["OBJ_CLASS"] === "steam_container" || $object["OBJ_CLASS"] === "steam_room") && ($object["OBJ_TYPE"] != null && ($object["OBJ_TYPE"] == "KOALA_WIKI" || $object["OBJ_TYPE"] == "container_wiki_koala"))) {
                     $wikis[] = $object;
                 }
             }
         }
     }
     $content->setVariable("LABEL_FORUMS", gettext("Discussion Boards"));
     if (count($forums) > 0) {
         $content->setCurrentBlock("BLOCK_FORUMS");
         $content->setVariable("LABEL_FORUM_DESCRIPTION", gettext("Forum / description"));
         $content->setVariable("LABEL_ARTICLES", gettext("Articles"));
         $content->setVariable("LABEL_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_LAST_COMMENT", gettext("Last comment"));
         $access_descriptions = \lms_forum::get_access_descriptions($group);
         foreach ($forums as $forum) {
             $cache = get_cache_function($forum["OBJ_ID"], 600);
             $discussions = $cache->call("lms_forum::get_discussions", $forum["OBJ_ID"]);
             $latest_post = isset($discussions[0]) ? $discussions[0] : FALSE;
             $content->setCurrentBlock("BLOCK_FORUM");
             $content->setVariable("NAME_FORUM", h($forum["OBJ_NAME"]));
             $content->setVariable("LINK_FORUM", PATH_URL . "messageboard/index/" . $forum["OBJ_ID"]);
             $content->setVariable("OBJ_DESC", get_formatted_output($forum["OBJ_DESC"]));
             $language = !empty($forum["FORUM_LANGUAGE"]) ? $forum["FORUM_LANGUAGE"] : "German";
             $content->setVariable("VALUE_LANGUAGE", $language);
             $access = "<span title=\"" . $access_descriptions[$forum["KOALA_ACCESS"]]["label"] . "\">" . $access_descriptions[$forum["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_ACCESS", $access);
             $content->setVariable("VALUE_ARTICLES", count($discussions));
             if ($latest_post) {
                 $content->setVariable("SUBJECT_LAST_COMMENT", h($latest_post["LATEST_POST_TITLE"]));
                 $content->setVariable("LINK_LAST_COMMENT", PATH_URL . "forums/" . $latest_post["OBJ_ID"] . "/");
                 $content->setVariable("POSTED_BY_LABEL", "(" . h($latest_post["LATEST_POST_AUTHOR"]) . ", " . how_long_ago($latest_post["LATEST_POST_TS"]) . ")");
             } else {
                 $content->setVariable("POSTED_BY_LABEL", gettext("-"));
             }
             $content->parse("BLOCK_FORUM");
         }
         $content->parse("BLOCK_FORUMS");
     } else {
         $content->setVariable("LABEL_NO_FORUMS_FOUND", "<b>" . gettext("No forums available. Either no forums are created in this context, or you have no rights to read them.") . "</b>");
     }
     $content->setVariable("LABEL_WEBLOGS", gettext("Weblogs"));
     if (count($weblogs) > 0) {
         $content->setCurrentBlock("BLOCK_WEBLOGS");
         $content->setVariable("LABEL_WEBLOG_DESCRIPTION", gettext("Weblog / description"));
         $content->setVariable("LABEL_WEBLOG_ENTRIES", gettext("Entries"));
         $content->setVariable("LABEL_WEBLOG_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_WEBLOG_LAST_ENTRY", gettext("Last entry"));
         $access_descriptions = \lms_weblog::get_access_descriptions($group);
         foreach ($weblogs as $weblog) {
             $cache = get_cache_function($weblog["OBJ_ID"], 600);
             $entries = $cache->call("lms_weblog::get_items", $weblog["OBJ_ID"]);
             $last_entry = isset($entries[0]) ? $entries[0] : FALSE;
             $content->setCurrentBlock("BLOCK_WEBLOG");
             $content->setVariable("NAME_WEBLOG", h($weblog["OBJ_NAME"]));
             $content->setVariable("LINK_WEBLOG", PATH_URL . "weblog/" . $weblog["OBJ_ID"] . "/");
             $content->setVariable("WEBLOG_OBJ_DESC", get_formatted_output($weblog["OBJ_DESC"]));
             $title = $access_descriptions[$weblog["KOALA_ACCESS"]]["label"];
             if ($weblog["KOALA_ACCESS"] == PERMISSION_PRIVATE_READONLY && !$group instanceof \koala_html_course) {
                 $obj = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $weblog["OBJ_ID"], CLASS_CALENDAR);
                 $creator = $obj->get_creator();
                 if ($creator->get_id() != \lms_steam::get_current_user()->get_id()) {
                     $title = str_replace("%NAME", $creator->get_name(), $title);
                 } else {
                     $title = str_replace("%NAME", "you", $title);
                 }
             }
             $content->setVariable("VALUE_WEBLOG_LANGUAGE", "German");
             $access = "<span title=\"" . $title . "\">" . $access_descriptions[$weblog["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_WEBLOG_ACCESS", $access);
             $content->setVariable("VALUE_WEBLOG_ARTICLES", count($entries));
             $content->setVariable("LINK_WEBLOG_LAST_ENTRY", PATH_URL . "weblog/" . $last_entry["OBJ_ID"] . "/");
             if ($last_entry) {
                 $content->setVariable("SUBJECT_WEBLOG_LAST_ENTRY", h($last_entry["DATE_TITLE"]));
                 $content->setVariable("WEBLOG_POSTED_BY_LABEL", "(" . h($last_entry["AUTHOR"]) . ", " . how_long_ago($last_entry["DATE_START_DATE"]) . ")");
             } else {
                 $content->setVariable("WEBLOG_POSTED_BY_LABEL", gettext("-"));
             }
             $content->parse("BLOCK_WEBLOG");
         }
         $content->parse("BLOCK_WEBLOGS");
     } else {
         $content->setVariable("LABEL_NO_WEBLOGS_FOUND", "<b>" . gettext("No weblogs available. Either no weblogs are created in this context, or you have no rights to read them.") . "</b>");
     }
     $content->setVariable("LABEL_WIKIS", gettext("Wikis"));
     if (count($wikis) > 0) {
         $content->setCurrentBlock("BLOCK_WIKIS");
         $content->setVariable("LABEL_WIKI_DESCRIPTION", gettext("Wiki / description"));
         $content->setVariable("LABEL_WIKI_ENTRIES", gettext("Entries"));
         $content->setVariable("LABEL_WIKI_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_WIKI_LAST_ENTRY", gettext("Last entry"));
         $access_descriptions = \lms_wiki::get_access_descriptions($group);
         foreach ($wikis as $wiki) {
             $cache = get_cache_function($wiki["OBJ_ID"], 600);
             $entries = $cache->call("lms_wiki::get_items", $wiki["OBJ_ID"]);
             $last_entry = isset($entries[0]) ? $entries[0] : FALSE;
             $content->setCurrentBlock("BLOCK_WIKI");
             $content->setVariable("NAME_WIKI", h($wiki["OBJ_NAME"]));
             $content->setVariable("LINK_WIKI", PATH_URL . "wiki/index/" . $wiki["OBJ_ID"] . "/");
             $content->setVariable("WIKI_OBJ_DESC", get_formatted_output($wiki["OBJ_DESC"]));
             $title = $access_descriptions[$wiki["KOALA_ACCESS"]]["label"];
             if ($wiki["KOALA_ACCESS"] == PERMISSION_PRIVATE_READONLY && !$group instanceof \koala_html_course) {
                 $obj = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $wiki["OBJ_ID"], CLASS_CONTAINER);
                 $creator = $obj->get_creator();
                 if ($creator->get_id() != \lms_steam::get_current_user()->get_id()) {
                     $title = str_replace("%NAME", $creator->get_name(), $title);
                 } else {
                     $title = str_replace("%NAME", "you", $title);
                 }
             }
             $access = "<span title=\"" . $title . "\">" . $access_descriptions[$wiki["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_WIKI_ACCESS", $access);
             $content->setVariable("VALUE_WIKI_ARTICLES", count($entries));
             $content->setVariable("LINK_WIKI_LAST_ENTRY", PATH_URL . "wiki/" . $last_entry["OBJ_ID"] . "/");
             $content->setVariable("SUBJECT_WIKI_LAST_ENTRY", str_replace(".wiki", "", h($last_entry["OBJ_NAME"])));
             $content->setVariable("WIKI_POSTED_BY_LABEL", $last_entry["DOC_LAST_MODIFIED"] != null ? "(" . h($last_entry["DOC_USER_MODIFIED"]) . ", " . how_long_ago($last_entry["DOC_LAST_MODIFIED"]) . ")" : "-");
             $content->parse("BLOCK_WIKI");
         }
         $content->parse("BLOCK_WIKIS");
     } else {
         $content->setVariable("LABEL_NO_WIKIS_FOUND", "<b>" . gettext("No wikis available. Either no wikis are created in this context, or you have no rights to read them.") . "</b>");
     }
     $html_handler_group->set_html_left($content->get());
     $frameResponseObject->setTitle("Group");
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($html_handler_group->get_html());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Beispiel #5
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //$portal = \lms_portal::get_instance();
     //$portal->initialize( GUEST_NOT_ALLOWED );
     //$portal->set_guest_allowed( GUEST_NOT_ALLOWED );
     $user = \lms_steam::get_current_user();
     //$portal_user = $portal->get_user();
     //$path = $request->getPath();
     $current_semester = $this->params[1];
     $group_course = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "Courses." . $this->params[0] . "." . $this->params[1]);
     $group = new \koala_group_course($group_course);
     //$html_handler_course = new \koala_html_course($course);
     if (!$group instanceof \koala_group) {
         throw new \Exception("Variable group not set.");
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         if (isset($_POST["remove"]) && is_array($_POST["remove"])) {
             $id = key($_POST["remove"]);
             $member_to_kick = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id);
             $group->remove_member($member_to_kick);
             $frameResponseObject->setConfirmText(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members.")));
             //$portal->set_confirmation( str_replace( "%NAME", h($member_to_kick->get_attribute( "USER_FIRSTNAME" ))." " . h($member_to_kick->get_attribute( "USER_FULLNAME" )), gettext( "User %NAME successfully removed from group members." ) ) );
             // clear caches:
             $cache = get_cache_function($member_to_kick->get_name());
             $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE);
             $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE);
             $cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name());
             $cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE);
             $cache = get_cache_function($group->get_id());
             $cache->drop("lms_steam::group_get_members", $group->get_id());
         } else {
             if (isset($_POST["hide"]) && is_array($_POST["hide"])) {
                 $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
                 if (!is_array($hidden_members)) {
                     $hidden_members = array();
                 }
                 $users_to_hide = array_keys($_POST["hide"]);
                 $displayed_staff_members = array();
                 $displayed_staff_members = array_keys($_POST["displayed_staff_member"]);
                 $tmp1_users_to_hide = array_unique(array_merge($hidden_members, $users_to_hide));
                 $tmp2_users_to_hide = array_diff($tmp1_users_to_hide, $displayed_staff_members);
                 $final_users_to_hide = array_unique(array_merge($tmp2_users_to_hide, $users_to_hide));
                 $group->get_steam_group()->set_attribute("COURSE_HIDDEN_STAFF", $final_users_to_hide);
             } else {
                 $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
                 if (!is_array($hidden_members)) {
                     $hidden_members = array();
                 }
                 $displayed_staff_members = array();
                 $displayed_staff_members = array_keys($_POST["displayed_staff_member"]);
                 $users_to_hide = array();
                 $users_to_hide = array_diff($hidden_members, $displayed_staff_members);
                 $group->get_steam_group()->set_attribute("COURSE_HIDDEN_STAFF", $users_to_hide);
             }
             $frameResponseObject->setConfirmText("Sucessfully updated the visibility of course staff");
             //$portal->set_confirmation( "Sucessfully updated the visibility of course staff" );
         }
     }
     $cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC);
     switch (get_class($group)) {
         case "koala_group_course":
             $html_handler_group = new \koala_html_course($group);
             $html_handler_group->set_context("staff");
             //$members = $cache->call( "lms_steam::group_get_members", $group->steam_group_staff->get_id() );
             $members = \lms_steam::group_get_members($group->steam_group_staff->get_id());
             break;
         default:
             $html_handler_group = new \koala_html_group($group);
             $html_handler_group->set_context("staff");
             //$members = $cache->call( "lms_steam::group_get_members", $group->get_id() );
             $members = \lms_steam::group_get_members($group->get_id());
             break;
     }
     $is_admin = $group->is_admin($user);
     $content = \Course::getInstance()->loadTemplate("list_staff.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "list_staff.template.html" );
     $no_members = count($members);
     //DONE
     if ($no_members > 0) {
         $pageIterator = \lms_portal::get_paginator(10, $no_members, "(" . str_replace("%NAME", h($group->get_name()), gettext("%TOTAL members in %NAME")) . ")");
         $content->setVariable("PAGEITERATOR", $pageIterator["html"]);
         $start = $pageIterator["startIndex"];
         //$start = $portal->set_paginator( $content, 10, $no_members, "(" . str_replace( "%NAME", h($group->get_name()), gettext( "%TOTAL members in %NAME" ) ) . ")" );
         $end = $start + 10 > $no_members ? $no_members : $start + 10;
         $content->setVariable("LABEL_CONTACTS", gettext("staff member") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_members), gettext("%a-%z out of %s")) . ")");
         $content->setCurrentBlock("BLOCK_CONTACT_LIST");
         $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position"));
         !COURSE_STAFF_FACULTY_AND_FOCUS or $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus"));
         $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
         if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
             !COURSE_STAFFLIST_MANAGE or $content->setVariable("TH_MANAGE_CONTACT", gettext("Action"));
             !COURSE_STAFFLIST_HIDE or $content->setVariable("TH_STAFF_MEMBER_VISIBILITY", gettext("hidden"));
             !COURSE_STAFFLIST_HIDE or $content->setVariable("STAFF_MEMBER_VISIBILITY_TITLE", gettext("Selected staff members will not be visible on the course start page."));
         }
         !COURSE_STAFF_EXTENSIONS or $content->setVariable("TH_MANAGE_EXTENSIONS", "Status");
         $content->setVariable("BEGIN_HTML_FORM", "<form method=\"POST\" action=\"\">");
         $content->setVariable("END_HTML_FORM", "</form>");
         $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
         if (!is_array($hidden_members)) {
             $hidden_members = array();
         }
         for ($i = $start; $i < $end; $i++) {
             $member = $members[$i];
             if ($member["USER_TRASHED"] === 1) {
                 continue;
             }
             $content->setCurrentBlock("BLOCK_CONTACT");
             $content->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($member["OBJ_NAME"]) . "/");
             $icon_link = $member["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "download/image/" . h($member["OBJ_ICON"]) . "/26/35";
             $content->setVariable("CONTACT_IMAGE", $icon_link);
             $title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : "";
             $content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"]));
             if (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string(\steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_EMAIL")) && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_EMAIL") != "" && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_FORWARD_MSG") === 1) {
                 $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"]));
                 $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                 $content->setVariable("LABEL_SEND", gettext("Send"));
             }
             !COURSE_STAFF_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"]));
             if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
                 !COURSE_STAFFLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\"  name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>");
                 if (in_array($member["OBJ_ID"], $hidden_members)) {
                     !COURSE_STAFFLIST_HIDE or $content->setVariable("TD_STAFF_MEMBER_VISIBILITY", "<td align=\"center\"><input type=\"checkbox\" name=\"hide[" . $member["OBJ_ID"] . "]\" checked=\"checked\"/>" . "\n\t\t\t<input type=\"hidden\" name=\"displayed_staff_member[" . $member["OBJ_ID"] . "]\" />" . "</td>");
                 } else {
                     !COURSE_STAFFLIST_HIDE or $content->setVariable("TD_STAFF_MEMBER_VISIBILITY", "<td align=\"center\"><input type=\"checkbox\" name=\"hide[" . $member["OBJ_ID"] . "]\" />" . "\n\t\t\t<input type=\"hidden\" name=\"displayed_staff_member[" . $member["OBJ_ID"] . "]\" />" . "</td>");
                 }
             }
             $member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"];
             $status = secure_gettext($member_desc);
             $content->setVariable("OBJ_DESC", h($status));
             if (COURSE_STAFF_EXTENSIONS) {
                 $extensions = $group->get_extensions();
                 $result = "";
                 foreach ($extensions as $extension) {
                     $result .= $extension->get_member_info(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group);
                 }
                 $content->setVariable("EXTENSIONS_DATA", $result);
             }
             $content->parse("BLOCK_CONTACT");
         }
         if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
             !COURSE_STAFFLIST_HIDE or $content->setVariable("LABEL_SUBMIT_BUTTON", gettext("Save"));
         }
         $content->parse("BLOCK_CONTACT_LIST");
     } else {
         $content->setVariable("LABEL_NO_MEMBERS", gettext("No staff found."));
     }
     $html_handler_group->set_html_left($content->get());
     //$portal->set_page_main( $html_handler_group->get_headline(), $html_handler_group->get_html() , "" );
     $frameResponseObject->setHeadline($html_handler_group->get_headline());
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($html_handler_group->get_html());
     $frameResponseObject->addWidget($widget);
     return $frameResponseObject;
 }
Beispiel #6
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //$portal = \lms_portal::get_instance();
     //$portal->initialize( GUEST_NOT_ALLOWED );
     //$portal->set_guest_allowed( GUEST_NOT_ALLOWED );
     $user = \lms_steam::get_current_user();
     //$portal_user = $portal->get_user();
     //$path = $request->getPath();
     $scg = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     $current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $scg->get_groupname() . "." . STEAM_CURRENT_SEMESTER);
     //$current_semester = $path[3];
     //Vorher
     $group_course = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "Courses." . $this->params[0] . "." . $this->params[1]);
     $course = new \koala_group_course($group_course);
     $html_handler_course = new \koala_html_course($course);
     $html_handler_course->set_context("start");
     $content = \Course::getInstance()->loadTemplate("courses_start.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "courses_start.template.html" );
     $content->setVariable("LABEL_DESCRIPTION", gettext("Description"));
     // Pre-load Course Attributes
     $course->get_steam_object()->get_attributes(array("COURSE_SHORT_DSC", OBJ_DESC, "COURSE_LONG_DSC"));
     $desc = $course->get_attribute("COURSE_SHORT_DSC");
     if (empty($desc)) {
         $content->setVariable("OBJ_DESC", gettext("No description available."));
     } else {
         $content->setVariable("OBJ_DESC", get_formatted_output($desc));
     }
     $about = $course->get_attribute("COURSE_LONG_DSC");
     if (!empty($about)) {
         $content->setCurrentBlock("BLOCK_ABOUT");
         $content->setVariable("LABEL_ABOUT", gettext("About"));
         $content->setVariable("VALUE_ABOUT", get_formatted_output($about));
         $content->parse("BLOCK_ABOUT");
     }
     if (COURSE_SHOW_MAXSIZE) {
         if ($course->get_maxsize() > 0) {
             $content->setCurrentBlock("BLOCK_GROUPSIZE");
             $content->setVariable("LABEL_MAXSIZE_HEADER", gettext("The number of participants of this course is limited."));
             $content->setVariable("LABEL_MAXSIZE_DESCRIPTION", str_replace("%MAX", $course->get_maxsize(), str_replace("%ACTUAL", $course->count_members(), gettext("The actual participant count is %ACTUAL of %MAX."))));
             $content->parse("BLOCK_GROUPSIZE");
         }
     }
     $admins = $course->get_staff();
     $hidden_members = $course->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
     if (!is_array($hidden_members)) {
         $hidden_members = array();
     }
     $visible_staff = 0;
     foreach ($admins as $admin) {
         if (!in_array($admin->get_id(), $hidden_members)) {
             $content->setCurrentBlock("BLOCK_ADMIN");
             if (COURSE_START_ADMIN_PROFILE_ANKER) {
                 $content->setCurrentBlock("PROFILE_ANKER");
             } else {
                 $content->setCurrentBlock("PROFILE_NO_ANKER");
             }
             $admin_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_DESC", "OBJ_NAME"));
             if ($admin instanceof \steam_user) {
                 $content->setVariable("ADMIN_NAME", $admin_attributes["USER_FIRSTNAME"] . " " . $admin_attributes["USER_FULLNAME"]);
                 !COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "user/" . $admin->get_name() . "/");
             } else {
                 $content->setVariable("ADMIN_NAME", $admin_attributes["OBJ_NAME"]);
                 !COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "groups/" . $admin->get_id() . "/");
             }
             $icon_link = is_object($admin_attributes["OBJ_ICON"]) ? PATH_URL . "download/image/" . $admin_attributes["OBJ_ICON"]->get_id() . "/40/47" : PATH_STYLE . "images/anonymous.jpg";
             $content->setVariable("ADMIN_ICON", $icon_link);
             $adminDescription = h($admin_attributes["OBJ_DESC"]);
             switch ($adminDescription) {
                 case "student":
                     $adminDescription = gettext("student");
                     break;
                 case "staff member":
                     $adminDescription = gettext("staff member");
                     break;
                 case "alumni":
                     $adminDescription = gettext("alumni");
                     break;
                 case "guest":
                     $adminDescription = gettext("guest");
                     break;
                 case "":
                     $adminDescription = gettext("student");
                     break;
                 default:
                     break;
             }
             if (COURSE_START_SEND_MESSAGE && (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string(steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL")) && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL") != "" && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_FORWARD_MSG") === 1)) {
                 $adminDescription = $adminDescription . " - <a href=\"/messages_write.php?to=" . $admin->get_name() . "\">" . gettext("Nachricht senden") . "</a>";
             }
             $content->setVariable("ADMIN_DESC", $adminDescription);
             if (COURSE_START_ADMIN_PROFILE_ANKER) {
                 $content->parse("PROFILE_ANKER");
             } else {
                 $content->parse("PROFILE_NO_ANKER");
             }
             $content->parse("BLOCK_ADMIN");
             $visible_staff++;
         }
     }
     if ($visible_staff > 0) {
         $content->setCurrentBlock("BLOCK_ADMIN_HEADER");
         $content->setVariable("LABEL_ADMINS", gettext("Staff members"));
         $content->parse("BLOCK_ADMIN_HEADER");
     }
     $html_handler_course->set_html_left($content->get());
     $frameResponseObject->setHeadline($html_handler_course->get_headline());
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($html_handler_course->get_html());
     $frameResponseObject->addWidget($widget);
     //$portal->set_page_main( $html_handler_course->get_headline(), $html_handler_course->get_html() , "" );
     return $frameResponseObject;
 }
Beispiel #7
0
<?php

include_once "../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
if (!$group instanceof koala_group) {
    throw new Exception("Is not a koala_group: " . $group_id, E_PARAMETER);
}
switch (get_class($group)) {
    case "koala_group_course":
        $html_handler_group = new koala_html_course($group);
        $html_handler_group->set_context("communication");
        break;
    default:
        $html_handler_group = new koala_html_group($group);
        $html_handler_group->set_context("communication");
        break;
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "groups_communication.template.html");
$workroom = $group->get_workroom();
$read_access = $workroom->check_access_read($user);
if (!$read_access) {
    throw new Exception("No read access on container: id=" . $workroom->get_id(), E_USER_RIGHTS);
}
$cache = get_cache_function(lms_steam::get_current_user()->get_name(), 600);
$communication_objects = $cache->call("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
$forums = array();
$weblogs = array();
$wikis = array();
foreach ($communication_objects as $object) {
    if ($object["OBJ_CLASS"] === "steam_messageboard") {
 function handle_path($path, $owner = FALSE, $portal = FALSE)
 {
     if (is_string($path)) {
         $path = url_parse_rewrite_path($path);
     }
     if (!isset($portal) || !is_object($portal)) {
         $portal = lms_portal::get_instance();
         $portal->initialize(GUEST_NOT_ALLOWED);
     }
     if (isset($path[0]) && is_numeric($path[0])) {
         $steam_unit = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0]);
         if (is_object($steam_unit) && $steam_unit->get_attribute("UNIT_TYPE") !== "units_pyramiddiscussion") {
             return;
         }
         $koala_container = new koala_container_pyramiddiscussion($steam_unit, new units_pyramiddiscussion($owner->get_steam_object()));
         $unit = $koala_container;
     }
     $portal_user = $portal->get_user();
     $user = lms_steam::get_current_user();
     $scg = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     //$current_semester = steam_factory::groupname_to_object( $GLOBALS[ "STEAM" ]->get_id(), $scg->get_name() . "." . $path[0]);
     $current_semester = $owner->get_semester();
     //$backlink = PATH_URL . "extensions/units/" . $path[0] ."/" . $path[1] . "/units/";
     $backlink = $owner->get_url() . $this->get_path_name() . "/";
     $html_handler = new koala_html_course($owner);
     $html_handler->set_context("units", array("subcontext" => "unit", "owner" => $owner, "unit" => $unit));
     $course = $owner;
     include PATH_EXTENSIONS . "units_pyramiddiscussion/modules/units_pyramiddiscussion.php";
 }
Beispiel #9
0
<?php

if (!defined("PATH_TEMPLATES_UNITS_VILM")) {
    define("PATH_TEMPLATES_UNITS_VILM", PATH_EXTENSIONS . "units_vilm/templates/");
}
if (!isset($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_NOT_ALLOWED);
}
//if ( !isset( $html_handler_course ) ) {
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units_vilm", array("subcontext" => $action));
//}
// add swfobject.js to html head
$portal->add_javascript_src("ViLM", PATH_SERVER . "/styles/koala-lernszenarien/assets/units_vilm/swfobject.js");
$portal->add_javascript_onload("ViLM", '
	var so = new SWFObject("' . PATH_SERVER . '/styles/koala-lernszenarien/assets/units_vilm/Launch_VCC.swf", "badge", "250", "75", "9.0.115", "#FFFFFF");
	so.addVariable( "applicationID", "de.upb.ddi.vilm.ControlCenter" );
	so.addVariable( "publisherID", "8B8F7C2CC76B094E5EC8F97033257635443FD8AA.1" );
	so.addVariable( "arguments", "Application Launched from Browser" );
	so.write("launch-VCC-Container");
');
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_VILM . "units_vilm.template.html");
$content->setVariable("VALUE_DESC", $steam_unit->get_attribute("OBJ_DESC"));
$content->setVariable("hello_world", "HALLO WELT");
// get projects from steam (steam_room = project)
$projects = $steam_unit->get_inventory(get_class("steam_room"));
// are there any projects?
if (count($projects)) {
    // display projects
Beispiel #10
0
<?php

if (!defined("PATH_TEMPLATES_UNITS_MEDIATHING")) {
    define("PATH_TEMPLATES_UNITS_MEDIATHING", PATH_EXTENSIONS . "units_mediathing/templates/");
}
if (!isset($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_NOT_ALLOWED);
}
//if ( !isset( $html_handler_course ) ) {
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units_mediathing", array("subcontext" => $action));
//}
if ($action == "create_exit") {
    $steam_exit = steam_factory::create_exit($GLOBALS["STEAM"]->get_id(), $steam_unit);
    $steam_exit->move($GLOBALS["STEAM"]->get_current_steam_user()->get_attribute("USER_WORKROOM"));
    $steam_exit->set_attribute("OBJ_POSITION_X", 150.1);
    $steam_exit->set_attribute("OBJ_POSITION_Y", 100.1);
    $portal->set_confirmation("Die Verknüpfung wurde erstellt. Du kannst jetzt mit dem Mediarena Composer arbeiten.");
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_MEDIATHING . "units_mediathing.template.html");
$content->setVariable("VALUE_DESC", $steam_unit->get_attribute("OBJ_DESC"));
$html_handler_course->set_html_left($content->get());
$portal->set_page_main($html_handler_course->get_headline(), $html_handler_course->get_html(), "");
$portal->show_html();
exit;
Beispiel #11
0
<?php

$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("start");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "courses_start.template.html");
$content->setVariable("LABEL_DESCRIPTION", gettext("Description"));
// Pre-load Course Attributes
$course->get_steam_object()->get_attributes(array("COURSE_SHORT_DSC", OBJ_DESC, "COURSE_LONG_DSC"));
$desc = $course->get_attribute("COURSE_SHORT_DSC");
if (empty($desc)) {
    $content->setVariable("OBJ_DESC", gettext("No description available."));
} else {
    $content->setVariable("OBJ_DESC", get_formatted_output($desc));
}
$about = $course->get_attribute("COURSE_LONG_DSC");
if (!empty($about)) {
    $content->setCurrentBlock("BLOCK_ABOUT");
    $content->setVariable("LABEL_ABOUT", gettext("About"));
    $content->setVariable("VALUE_ABOUT", get_formatted_output($about));
    $content->parse("BLOCK_ABOUT");
}
if (COURSE_SHOW_MAXSIZE) {
    if ($course->get_maxsize() > 0) {
        $content->setCurrentBlock("BLOCK_GROUPSIZE");
        $content->setVariable("LABEL_MAXSIZE_HEADER", gettext("The number of participants of this course is limited."));
        $content->setVariable("LABEL_MAXSIZE_DESCRIPTION", str_replace("%MAX", $course->get_maxsize(), str_replace("%ACTUAL", $course->count_members(), gettext("The actual participant count is %ACTUAL of %MAX."))));
        $content->parse("BLOCK_GROUPSIZE");
    }
}
$admins = $course->get_staff();
Beispiel #12
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $path = $this->params;
     $user = \lms_steam::get_current_user();
     $public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP);
     $id = $path[0];
     $portal = \lms_portal::get_instance();
     $portal_user = $portal->get_user();
     try {
         $steam_group = !empty($id) ? \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id) : FALSE;
     } catch (\Exception $ex) {
         include "bad_link.php";
         exit;
     }
     $group_is_private = FALSE;
     if ($steam_group && is_object($steam_group)) {
         switch ((string) $steam_group->get_attribute("OBJ_TYPE")) {
             case "course":
                 $group = new \koala_group_course($steam_group);
                 // TODO: Passt der backlink?
                 $backlink = PATH_URL . SEMESTER_URL . "/" . $group->get_semester()->get_name() . "/" . h($group->get_name()) . "/";
                 break;
             default:
                 $group = new \koala_group_default($steam_group);
                 // TODO: Passt der backlink?
                 $backlink = PATH_URL . "groups/" . $group->get_id() . "/";
                 // Determine if group is public or private
                 $parent = $group->get_parent_group();
                 if ($parent->get_id() == STEAM_PRIVATE_GROUP) {
                     $group_is_private = TRUE;
                 }
                 break;
         }
     }
     if ($group_is_private) {
         if (!$steam_group->is_member($user) && !\lms_steam::is_koala_admin($user)) {
             throw new \Exception(gettext("You have no rights to access this group"), E_USER_RIGHTS);
         }
     }
     if (!$group instanceof \koala_group) {
         throw new \Exception("Variable group not set.");
     }
     if (COURSE_PARTICIPANTS_STAFF_ONLY && !$group->is_admin($user)) {
         header("location:../");
         exit;
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         if (is_array($_POST["remove"])) {
             $id = key($_POST["remove"]);
             $member_to_kick = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id);
             $group->remove_member($member_to_kick);
             $portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members.")));
             // clear caches:
             $cache = get_cache_function($member_to_kick->get_name());
             $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE);
             $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE);
             $cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name());
             $cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE);
             $cache = get_cache_function($group->get_id());
             $cache->drop("lms_steam::group_get_members", $group->get_id());
         }
     }
     $cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC);
     switch (get_class($group)) {
         case "koala_group_course":
             $html_handler_group = new \koala_html_course($group);
             $html_handler_group->set_context("members");
             $members = $cache->call("lms_steam::group_get_members", $group->steam_group_learners->get_id());
             break;
         default:
             $html_handler_group = new \koala_html_group($group);
             $html_handler_group->set_context("members");
             $members = $cache->call("lms_steam::group_get_members", $group->get_id());
             break;
     }
     $is_admin = $group->is_admin($user);
     $content = \Group::getInstance()->loadTemplate("list_users.template.html");
     $is_member = $group->is_member($user);
     //echo "is_member? " . $is_member;
     $privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY");
     //echo "attribute: ''" . $privacy_deny_participants . "''";
     if ($privacy_deny_participants == PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS && !$is_member) {
         //echo "*** deny ***";
         //TODO
         $content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", gettext("Participants are hidden."));
     } else {
         //echo "*** permit ***";
         $no_members = count($members);
         if ($no_members > 0) {
             switch (get_class($group)) {
                 case "koala_group_course":
                     $groupname = $group->get_course_id();
                     break;
                 default:
                     $groupname = $group->get_name();
                     break;
             }
             if (!USER_LIST_NO_PAGEING) {
                 $paginator = \lms_portal::get_paginator(10, $no_members, "(" . str_replace("%NAME", h($groupname), gettext("%TOTAL members in %NAME")) . ")");
                 $start = $paginator["startIndex"];
                 $end = $start + 10 > $no_members ? $no_members : $start + 10;
                 $content->setVariable("PAGINATOR", $paginator["html"]);
                 $content->setVariable("LABEL_CONTACTS", gettext("Members") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_members), gettext("%a-%z out of %s")) . ")");
             } else {
                 //if (count($members) > 10) {
                 $content->setVariable("LABEL_CONTACTS", gettext("Members") . " (Anzahl " . count($members) . ")");
                 $content->setCurrentBlock("BLOCK_FILTER");
                 $content->setVariable("HELP_TEXT", "Benutzer lassen sich einfacher finden, indem Sie den Filter verwenden. Tippen Sie einfach einen Teil des Benutzernamen oder der Benutzerkennung in das Textfeld.");
                 $content->setVariable('LABEL_FILTER', "<b>" . gettext('Filter') . "</b>");
                 $start = 0;
                 $end = count($members);
                 if (COURSE_PARTICIPANTS_EXTENSIONS) {
                     $extensions = $group->get_extensions();
                     $html = "";
                     foreach ($extensions as $extension) {
                         $html .= $extension->get_filter_html($portal, "filter_user", "extension_data");
                     }
                     $content->setCurrentBlock("BLOCK_EXTENSION_FILTER");
                     $content->setVariable("EXTENSION_FILTER", $html);
                     $content->parse("BLOCK_EXTENSION_FILTER");
                 }
                 $content->parse("BLOCK_FILTER");
                 //}
             }
             $content->setCurrentBlock("BLOCK_CONTACT_LIST");
             $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position"));
             !COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus"));
             !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
             if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
                 !COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TH_MANAGE_CONTACT", gettext("Action"));
             }
             !COURSE_PARTICIPANTS_EXTENSIONS or $content->setVariable("TH_MANAGE_EXTENSIONS", "Status");
             $content->setVariable("BEGIN_HTML_FORM", "<form method=\"POST\" action=\"\">");
             $content->setVariable("END_HTML_FORM", "</form>");
             for ($i = $start; $i < $end; $i++) {
                 $member = $members[$i];
                 if ($member["USER_TRASHED"] === 1) {
                     continue;
                 }
                 $content->setCurrentBlock("BLOCK_CONTACT");
                 $content->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($member["OBJ_NAME"]) . "/");
                 // TODO: Passt der link?
                 $icon_link = $member["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . h($member["OBJ_ICON"]) . "&type=usericon&width=30&height=40";
                 $content->setVariable("CONTACT_IMAGE", $icon_link);
                 $title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : "";
                 $content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"]));
                 !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"]));
                 !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                 !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_SEND", gettext("Send"));
                 !COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"]));
                 if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
                     !COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\"  name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>");
                 }
                 if (COURSE_PARTICIPANTS_EXTENSIONS) {
                     $extensions = $group->get_extensions();
                     $result = "";
                     foreach ($extensions as $extension) {
                         $result .= $extension->get_member_info(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group);
                     }
                     $content->setVariable("EXTENSIONS_DATA", $result);
                 }
                 $member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"];
                 $status = secure_gettext($member_desc);
                 $content->setVariable("OBJ_DESC", h($status) . " " . ($i + 1));
                 $content->parse("BLOCK_CONTACT");
             }
             $content->parse("BLOCK_CONTACT_LIST");
         } else {
             $content->setVariable("LABEL_NO_MEMBERS", gettext("No members found."));
         }
     }
     $html_handler_group->set_html_left($content->get());
     $frameResponseObject->setTitle("Group");
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($html_handler_group->get_html());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Beispiel #13
0
<?php

define("PATH_TEMPLATES_UNITS_BASE", PATH_EXTENSIONS . "units_base/templates/");
require_once 'classes/unitmanager.class.php';
require_once 'classes/koala_container_units.class.php';
if (!isset($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_ALLOWED);
} else {
    $portal->set_guest_allowed(GUEST_ALLOWED);
}
$current_user = lms_steam::get_current_user();
$um = unitmanager::create_unitmanager($course);
$html_handler = new koala_html_course($course);
$html_handler->set_context("units");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_BASE . "units.template.html");
$container = $course->get_workroom();
$koala_container = new koala_container_units($container, $course->get_url() . 'units/');
$koala_container->set_owner($course);
$is_admin = $course->is_admin($current_user);
$units = array();
$units_tmp = $koala_container->get_inventory();
// Pre-load Atributes for all units to optimize requests
steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $units_tmp, array(OBJ_TYPE, OBJ_NAME, OBJ_ICON, OBJ_DESC, "UNIT_TYPE", "UNIT_DISPLAY_TYPE"));
foreach ($units_tmp as $unit) {
    $koala_unit = koala_object::get_koala_object($unit);
    if (is_object($koala_unit) && method_exists($koala_unit, 'get_unit')) {
        $unit_class = $koala_unit->get_unit();
        if (is_object($unit_class) && method_exists($unit_class, 'is_enabled_for') && !$unit_class->is_enabled_for($owner)) {
            continue;
Beispiel #14
0
<?php

$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("reserve_list");
$content = new HTML_TEMPLATE_IT(PATH_TEMPLATES);
$content->loadTemplateFile("list_reserve_list.template.html");
$rl = $course->get_attributes(array("SEM_APP_ID", "SEM_APP_TOKEN"));
$content->setVariable("SEM_APP_BASE_URL", SEM_APP_BASE_URL);
// Global config
$content->setVariable("SEM_APP_ID", $rl["SEM_APP_ID"]);
// sTeam attribute
$content->setVariable("SEM_APP_TOKEN", $rl["SEM_APP_TOKEN"]);
// sTeam attribute
$html_handler_course->set_html_left($content->get());
$portal->set_page_main($html_handler_course->get_headline(), $html_handler_course->get_html(), "");
$portal->show_html();
 function handle_path($path, $owner = FALSE, $portal = FALSE)
 {
     if (is_string($path)) {
         $path = url_parse_rewrite_path($path);
     }
     if (!isset($portal) || !is_object($portal)) {
         $portal = lms_portal::get_instance();
         $portal->initialize(GUEST_NOT_ALLOWED);
     }
     $portal_user = $portal->get_user();
     $user = lms_steam::get_current_user();
     $scg = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     //$current_semester = steam_factory::groupname_to_object( $GLOBALS[ "STEAM" ]->get_id(), $scg->get_name() . "." . $path[0]);
     $current_semester = $owner->get_semester();
     //$backlink = PATH_URL . "extensions/units/" . $path[0] ."/" . $path[1] . "/units/";
     $backlink = $owner->get_url() . $this->get_path_name() . "/";
     $action = "";
     if (isset($path[0]) && is_numeric($path[0])) {
         if (isset($path[1]) && is_numeric($path[1])) {
             $backlink .= $path[0] . "/";
             $container = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[1], CLASS_CONTAINER);
             $koala_container = new koala_container($container, $backlink);
             $backlink .= $path[1] . "/";
             $unit = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0]);
             if (isset($path[2])) {
                 $action = $path[2];
             }
         } else {
             $backlink .= $path[0] . "/";
             $container = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0], CLASS_CONTAINER);
             $koala_container = new koala_container_homework($container, new units_homework($owner->get_steam_object()));
             $unit = $koala_container;
             if (isset($path[1])) {
                 $action = $path[1];
             }
         }
     } else {
         $container = $owner->get_workroom();
         $koala_container = new koala_container_workroom($container, $backlink);
         $unit = $koala_container;
         if (isset($path[0])) {
             $action = $path[0];
         }
     }
     if (is_object($unit) && $unit->get_attribute("UNIT_TYPE") !== "container_homework_unit_koala" && $unit->get_attribute("UNIT_TYPE") !== "units_homework") {
         if (!$unit instanceof koala_container_homework && !$this->get_koala_object_for($unit->get_steam_object(), $unit->get_steam_object()->get_type(), $unit->get_attribute(OBJ_TYPE)) instanceof koala_container_homework) {
             return FALSE;
         }
     }
     $koala_container->set_obj_types_invisible(array("container_wiki_koala", "room_wiki_koala", "KOALA_WIKI"));
     $html_handler = new koala_html_course($owner);
     $html_handler->set_context("units", array("subcontext" => "unit", "owner" => $owner, "unit" => $unit, "container" => $container));
     switch ($action) {
         case "new-folder":
             $environment = $container;
             unset($container);
             unset($koala_container);
             include "container_new.php";
             exit;
             break;
         case "edit":
             if ($container->get_id() == $unit->get_id()) {
                 include self::$PATH . "modules/units_homework_edit.php";
             } else {
                 include "container_edit.php";
             }
             exit;
             break;
         case "delete":
             include "container_delete.php";
             exit;
             break;
         case "new_homework":
             include self::$PATH . "modules/units_homework_upload.php";
             exit;
             break;
         case "feedback":
             include self::$PATH . "modules/units_homework_feedback.php";
             exit;
             break;
         case "points_tab":
             include self::$PATH . "modules/units_homework_pointslist.php";
             exit;
             break;
     }
     include self::$PATH . "modules/units_homework.php";
     return TRUE;
 }
Beispiel #16
0
if (!defined("PATH_TUTORIALS")) {
    define("PATH_TUTORIALS", PATH_EXTENSIONS . "tutorials/");
}
require_once PATH_TUTORIALS . "classes/koala_group_tutorial.class.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (isset($_POST["subscribe"]) && is_array($_POST["subscribe"])) {
        header("Location: " . PATH_URL . "group_subscribe.php?group=" . key($_POST["subscribe"]));
        exit;
    }
    if (isset($_POST["resign"]) && is_array($_POST["resign"])) {
        header("Location: " . PATH_URL . "group_cancel.php?group=" . key($_POST["resign"]));
        exit;
    }
}
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("tutorials");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TUTORIALS . "templates/tutorials.template.html");
$current_user = lms_steam::get_current_user();
$cu_has_membership = FALSE;
$csg = $course->get_steam_group();
$excl_memb_used = $csg->get_attribute("EXCLUSIVE_TUTORIAL_MEMBERSHIP") == "FALSE" || $csg->get_attribute("EXCLUSIVE_TUTORIAL_MEMBERSHIP") == "0" ? FALSE : TRUE;
$extra_info = "";
$tutorials = $course->steam_group_learners->get_subgroups();
$a_Keys = array_keys($tutorials);
$attributes = array(OBJ_DESC, OBJ_TYPE, OBJ_NAME, "TUTORIAL_LONG_DESC", "TUTORIAL_PRIVATE", "TUTORIAL_MAX_LEARNERS");
$tnr = array();
foreach ($a_Keys as $key) {
    $tnr[$tutorials[$key]->get_id()] = array();
    $tnr[$tutorials[$key]->get_id()]["is_member"] = $tutorials[$key]->is_member($current_user, TRUE);
    $tnr[$tutorials[$key]->get_id()]["attributes"] = $tutorials[$key]->get_attributes($attributes, TRUE);
Beispiel #17
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //$portal = \lms_portal::get_instance();
     //$portal->initialize( GUEST_NOT_ALLOWED );
     //$portal->set_guest_allowed( GUEST_NOT_ALLOWED );
     $user = \lms_steam::get_current_user();
     //$portal_user = $portal->get_user();
     //$path = $request->getPath();
     $group_course = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "Courses." . $this->params[0] . "." . $this->params[1]);
     $group = new \koala_group_course($group_course);
     if (!$group instanceof \koala_group) {
         throw new \Exception("Is not a koala_group: " . $group_id, E_PARAMETER);
     }
     switch (get_class($group)) {
         case "koala_group_course":
             $html_handler_group = new \koala_html_course($group);
             $html_handler_group->set_context("communication");
             break;
         default:
             $html_handler_group = new \koala_html_group($group);
             $html_handler_group->set_context("communication");
             break;
     }
     $content = \Course::getInstance()->loadTemplate("groups_communication.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "groups_communication.template.html" );
     $workroom = $group->get_workroom();
     $read_access = $workroom->check_access_read($user);
     if (!$read_access) {
         throw new Exception("No read access on container: id=" . $workroom->get_id(), E_USER_RIGHTS);
     }
     $cache = get_cache_function(\lms_steam::get_current_user()->get_name(), 600);
     $communication_objects = $cache->call("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
     $forums = array();
     $weblogs = array();
     $wikis = array();
     foreach ($communication_objects as $object) {
         if ($object["OBJ_CLASS"] === "steam_messageboard") {
             $forums[] = $object;
         } else {
             if ($object["OBJ_CLASS"] === "steam_calendar") {
                 $weblogs[] = $object;
             } else {
                 if (($object["OBJ_CLASS"] === "steam_container" || $object["OBJ_CLASS"] === "steam_room") && ($object["OBJ_TYPE"] != null && ($object["OBJ_TYPE"] == "KOALA_WIKI" || $object["OBJ_TYPE"] == "container_wiki_koala"))) {
                     $wikis[] = $object;
                 }
             }
         }
     }
     $content->setVariable("LABEL_FORUMS", gettext("Discussion Boards"));
     if (count($forums) > 0) {
         $content->setCurrentBlock("BLOCK_FORUMS");
         $content->setVariable("LABEL_FORUM_DESCRIPTION", gettext("Forum / description"));
         $content->setVariable("LABEL_ARTICLES", gettext("Articles"));
         $content->setVariable("LABEL_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_LAST_COMMENT", gettext("Last comment"));
         $access_descriptions = \lms_forum::get_access_descriptions($group);
         foreach ($forums as $forum) {
             $cache = get_cache_function($forum["OBJ_ID"], 600);
             $discussions = $cache->call("lms_forum::get_discussions", $forum["OBJ_ID"]);
             $latest_post = isset($discussions[0]) ? $discussions[0] : FALSE;
             $content->setCurrentBlock("BLOCK_FORUM");
             $content->setVariable("NAME_FORUM", h($forum["OBJ_NAME"]));
             $content->setVariable("LINK_FORUM", PATH_URL . "forums/" . $forum["OBJ_ID"] . "/");
             $content->setVariable("OBJ_DESC", get_formatted_output($forum["OBJ_DESC"]));
             $language = !empty($forum["FORUM_LANGUAGE"]) ? $forum["FORUM_LANGUAGE"] : "German";
             $content->setVariable("VALUE_LANGUAGE", $language);
             $access = "<span title=\"" . $access_descriptions[$forum["KOALA_ACCESS"]]["label"] . "\">" . $access_descriptions[$forum["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_ACCESS", $access);
             $content->setVariable("VALUE_ARTICLES", count($discussions));
             if ($latest_post) {
                 $content->setVariable("SUBJECT_LAST_COMMENT", h($latest_post["LATEST_POST_TITLE"]));
                 $content->setVariable("LINK_LAST_COMMENT", PATH_URL . "forums/" . $latest_post["OBJ_ID"] . "/");
                 $content->setVariable("POSTED_BY_LABEL", "(" . h($latest_post["LATEST_POST_AUTHOR"]) . ", " . how_long_ago($latest_post["LATEST_POST_TS"]) . ")");
             } else {
                 $content->setVariable("POSTED_BY_LABEL", gettext("-"));
             }
             $content->parse("BLOCK_FORUM");
         }
         $content->parse("BLOCK_FORUMS");
     } else {
         $content->setVariable("LABEL_NO_FORUMS_FOUND", "<b>" . gettext("No forums available. Either no forums are created in this context, or you have no rights to read them.") . "</b>");
     }
     $content->setVariable("LABEL_WEBLOGS", gettext("Weblogs"));
     if (count($weblogs) > 0) {
         $content->setCurrentBlock("BLOCK_WEBLOGS");
         $content->setVariable("LABEL_WEBLOG_DESCRIPTION", gettext("Weblog / description"));
         $content->setVariable("LABEL_WEBLOG_ENTRIES", gettext("Entries"));
         $content->setVariable("LABEL_WEBLOG_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_WEBLOG_LAST_ENTRY", gettext("Last entry"));
         $access_descriptions = \lms_weblog::get_access_descriptions($group);
         foreach ($weblogs as $weblog) {
             $cache = get_cache_function($weblog["OBJ_ID"], 600);
             $entries = $cache->call("lms_weblog::get_items", $weblog["OBJ_ID"]);
             $last_entry = isset($entries[0]) ? $entries[0] : FALSE;
             $content->setCurrentBlock("BLOCK_WEBLOG");
             $content->setVariable("NAME_WEBLOG", h($weblog["OBJ_NAME"]));
             $content->setVariable("LINK_WEBLOG", PATH_URL . "weblog/" . $weblog["OBJ_ID"] . "/");
             $content->setVariable("WEBLOG_OBJ_DESC", get_formatted_output($weblog["OBJ_DESC"]));
             $title = $access_descriptions[$weblog["KOALA_ACCESS"]]["label"];
             if ($weblog["KOALA_ACCESS"] == PERMISSION_PRIVATE_READONLY && !$group instanceof koala_html_course) {
                 $obj = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $weblog["OBJ_ID"], CLASS_CALENDAR);
                 $creator = $obj->get_creator();
                 if ($creator->get_id() != \lms_steam::get_current_user()->get_id()) {
                     $title = str_replace("%NAME", $creator->get_name(), $title);
                 } else {
                     $title = str_replace("%NAME", "you", $title);
                 }
             }
             $content->setVariable("VALUE_WEBLOG_LANGUAGE", "German");
             $access = "<span title=\"" . $title . "\">" . $access_descriptions[$weblog["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_WEBLOG_ACCESS", $access);
             $content->setVariable("VALUE_WEBLOG_ARTICLES", count($entries));
             $content->setVariable("LINK_WEBLOG_LAST_ENTRY", PATH_URL . "weblog/" . $last_entry["OBJ_ID"] . "/");
             if ($last_entry) {
                 $content->setVariable("SUBJECT_WEBLOG_LAST_ENTRY", h($last_entry["DATE_TITLE"]));
                 $content->setVariable("WEBLOG_POSTED_BY_LABEL", "(" . h($last_entry["AUTHOR"]) . ", " . how_long_ago($last_entry["DATE_START_DATE"]) . ")");
             } else {
                 $content->setVariable("WEBLOG_POSTED_BY_LABEL", gettext("-"));
             }
             $content->parse("BLOCK_WEBLOG");
         }
         $content->parse("BLOCK_WEBLOGS");
     } else {
         $content->setVariable("LABEL_NO_WEBLOGS_FOUND", "<b>" . gettext("No weblogs available. Either no weblogs are created in this context, or you have no rights to read them.") . "</b>");
     }
     $content->setVariable("LABEL_WIKIS", gettext("Wikis"));
     if (count($wikis) > 0) {
         $content->setCurrentBlock("BLOCK_WIKIS");
         $content->setVariable("LABEL_WIKI_DESCRIPTION", gettext("Wiki / description"));
         $content->setVariable("LABEL_WIKI_ENTRIES", gettext("Entries"));
         $content->setVariable("LABEL_WIKI_ACCESS", gettext("Access"));
         $content->setVariable("LABEL_WIKI_LAST_ENTRY", gettext("Last entry"));
         $access_descriptions = lms_wiki::get_access_descriptions($group);
         foreach ($wikis as $wiki) {
             $cache = get_cache_function($wiki["OBJ_ID"], 600);
             $entries = $cache->call("lms_wiki::get_items", $wiki["OBJ_ID"]);
             $last_entry = isset($entries[0]) ? $entries[0] : FALSE;
             $content->setCurrentBlock("BLOCK_WIKI");
             $content->setVariable("NAME_WIKI", h($wiki["OBJ_NAME"]));
             $content->setVariable("LINK_WIKI", PATH_URL . "wiki/" . $wiki["OBJ_ID"] . "/");
             $content->setVariable("WIKI_OBJ_DESC", get_formatted_output($wiki["OBJ_DESC"]));
             $title = $access_descriptions[$wiki["KOALA_ACCESS"]]["label"];
             if ($wiki["KOALA_ACCESS"] == PERMISSION_PRIVATE_READONLY && !$group instanceof koala_html_course) {
                 $obj = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $wiki["OBJ_ID"], CLASS_CONTAINER);
                 $creator = $obj->get_creator();
                 if ($creator->get_id() != lms_steam::get_current_user()->get_id()) {
                     $title = str_replace("%NAME", $creator->get_name(), $title);
                 } else {
                     $title = str_replace("%NAME", "you", $title);
                 }
             }
             $access = "<span title=\"" . $title . "\">" . $access_descriptions[$wiki["KOALA_ACCESS"]]["summary_short"] . "</span>";
             $content->setVariable("VALUE_WIKI_ACCESS", $access);
             $content->setVariable("VALUE_WIKI_ARTICLES", count($entries));
             $content->setVariable("LINK_WIKI_LAST_ENTRY", PATH_URL . "wiki/" . $last_entry["OBJ_ID"] . "/");
             $content->setVariable("SUBJECT_WIKI_LAST_ENTRY", str_replace(".wiki", "", h($last_entry["OBJ_NAME"])));
             $content->setVariable("WIKI_POSTED_BY_LABEL", $last_entry["DOC_LAST_MODIFIED"] != null ? "(" . h($last_entry["DOC_USER_MODIFIED"]) . ", " . how_long_ago($last_entry["DOC_LAST_MODIFIED"]) . ")" : "-");
             $content->parse("BLOCK_WIKI");
         }
         $content->parse("BLOCK_WIKIS");
     } else {
         $content->setVariable("LABEL_NO_WIKIS_FOUND", "<b>" . gettext("No wikis available. Either no wikis are created in this context, or you have no rights to read them.") . "</b>");
     }
     $html_handler_group->set_html_left($content->get());
     //$portal->set_page_main( $html_handler_group->get_headline(), $html_handler_group->get_html(), "");
     $frameResponseObject->setHeadline($html_handler_group->get_headline());
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($html_handler_group->get_html());
     $frameResponseObject->addWidget($widget);
     return $frameResponseObject;
 }
Beispiel #18
0
        $portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members.")));
        // clear caches:
        $cache = get_cache_function($member_to_kick->get_name());
        $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE);
        $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE);
        $cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name());
        $cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE);
        $cache = get_cache_function($group->get_id());
        $cache->drop("lms_steam::group_get_members", $group->get_id());
    }
}
$cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC);
switch (get_class($group)) {
    case "koala_group_course":
        $html_handler_group = new koala_html_course($group);
        $html_handler_group->set_context("members");
        $members = $cache->call("lms_steam::group_get_members", $group->steam_group_learners->get_id());
        break;
    default:
        $html_handler_group = new koala_html_group($group);
        $html_handler_group->set_context("members");
        $members = $cache->call("lms_steam::group_get_members", $group->get_id());
        break;
}
$is_admin = $group->is_admin($user);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html");
$is_member = $group->is_member($user);
//echo "is_member? " . $is_member;
$privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY");
//echo "attribute: ''" . $privacy_deny_participants . "''";
Beispiel #19
0
require_once PATH_EXTENSIONS . "tutorials/classes/koala_group_tutorial.class.php";
include_once PATH_LIB . "format_handling.inc.php";
if (!isset($portal) || !is_object($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_NOT_ALLOWED);
}
$current_user = $user = lms_steam::get_current_user();
$lms_tutorial = new koala_group_tutorial($tutorial);
if (!$tutorial->get_workroom()->check_access_read($current_user)) {
    $headline = $lms_tutorial->get_link_path();
    include 'no_access.php';
    exit;
}
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("tutorials", array('subcontext' => 'tutorial', 'tutorial' => $lms_tutorial));
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (is_array($_POST["remove"])) {
        $id = key($_POST["remove"]);
        $member_to_kick = steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id);
        $tutorial->remove_member($member_to_kick);
        $portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_full_name()), gettext("User %NAME successfully removed from tutorial members.")));
        $cache = get_cache_function($tutorial->get_id(), CACHE_LIFETIME_STATIC);
        $cache->drop("lms_steam::group_get_members", $tutorial->get_id());
    }
}
if ($lms_tutorial->is_password_protected()) {
    $participant_mgmnt = gettext("password protected tutorial");
} else {
    if ($lms_tutorial->is_moderated() && !$lms_tutorial->is_password_protected()) {
        $participant_mgmnt = gettext("moderated tutorial");
Beispiel #20
0
//create site
//create portal
if (!isset($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_ALLOWED);
} else {
    $portal->set_guest_allowed(GUEST_ALLOWED);
}
//get the user object
$current_user = lms_steam::get_current_user();
if (!isset($course)) {
    echo "<br /> Course not set";
    exit;
}
$html_handler = new koala_html_course($course);
$html_handler->set_context("exam_organization");
//set context for context menu
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_EXTENSIONS . PATH_TEMPLATES_EXAM_ORGANIZATION . "exam_organization_input_exam_results.template.html");
$container = $course->get_workroom();
$is_admin = $course->is_admin($current_user);
if ($is_admin) {
    //clipboard:
    $koala_user = new koala_html_user(new koala_user($current_user));
    //$clipboard_menu = $koala_user->get_clipboard_menu( $koala_container ); //error
    $content->setCurrentBlock("BLOCK_CLIPBOARD");
    //$content->setVariable( "CLIPBOARD_HTML", $clipboard_menu->get_html() );
    $content->parse("BLOCK_CLIPBOARD");
}
//get role
$content->setVariable("ROLE_STATUS", gettext("Your current role is student"));
Beispiel #21
0
                $hidden_members = array();
            }
            $displayed_staff_members = array();
            $displayed_staff_members = array_keys($_POST["displayed_staff_member"]);
            $users_to_hide = array();
            $users_to_hide = array_diff($hidden_members, $displayed_staff_members);
            $group->get_steam_group()->set_attribute("COURSE_HIDDEN_STAFF", $users_to_hide);
        }
        $portal->set_confirmation("Sucessfully updated the visibility of course staff");
    }
}
$cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC);
switch (get_class($group)) {
    case "koala_group_course":
        $html_handler_group = new koala_html_course($group);
        $html_handler_group->set_context("staff");
        //$members = $cache->call( "lms_steam::group_get_members", $group->steam_group_staff->get_id() );
        $members = lms_steam::group_get_members($group->steam_group_staff->get_id());
        break;
    default:
        $html_handler_group = new koala_html_group($group);
        $html_handler_group->set_context("staff");
        //$members = $cache->call( "lms_steam::group_get_members", $group->get_id() );
        $members = lms_steam::group_get_members($group->get_id());
        break;
}
$is_admin = $group->is_admin($user);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_staff.template.html");
$no_members = count($members);
//DONE