function execute($request, $response) { $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(Explorer::getInstance()->getExtensionPath() . "ui/html/menu.template.html"); $response->setStatus("200 OK"); $response->write("Test"); return $response; }
public function processData(\IRequestObject $requestObject) { if ($requestObject instanceof \UrlRequestObject) { $this->params = $requestObject->getParams(); isset($this->params[0]) ? $this->id = $this->params[0] : ""; } else { if ($requestObject instanceof \IdRequestObject) { $this->id = $requestObject->getId(); } } $steam = $GLOBALS["STEAM"]; //get singleton and portlet path $portalInstance = \Portal::getInstance(); $portalPath = $portalInstance->getExtensionPath(); //template $templateFileName = $portalPath . "/ui/html/index.html"; $tmpl = new \HTML_TEMPLATE_IT(); $tmpl->loadTemplateFile($templateFileName); $this->getExtension()->addCSS(); $this->getExtension()->addJS(); $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $object = $currentUser->get_workroom(); $objectId = $this->id; //get the portal object $this->portalObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $type = getObjectType($this->portalObject); if (!($type === "portal")) { \ExtensionMaster::getInstance()->send404Error(); die; } \Portal::getInstance()->setPortalObject($this->portalObject); //get the content of the portal object $portalColumns = $this->portalObject->get_inventory(); $htmlBody = ""; $extensionMaster = \ExtensionMaster::getInstance(); $count = 0; $htmlCollectorColRow[][] = array(); $col = 0; $row = 0; $this->rawHtmlWidget = new \Widgets\RawHtml(); foreach ($portalColumns as $columnObject) { $columnObjectId = $columnObject->get_id(); $widgets = $extensionMaster->getWidgetsByObjectId($columnObjectId, "view"); $this->rawHtmlWidget->addWidgets($widgets); $data = \Widgets\Widget::getData($widgets); $htmlBody .= $data["html"]; $count++; } $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); if (isset($this->portalObject) && $this->portalObject->check_access_write($currentUser)) { $htmlBody .= "<script>if (readCookie(\"portalEditMode\") === \"{$objectId}\") {portalLockButton({$objectId})}</script>"; } $tmpl->setVariable("BODY", $htmlBody); $htmlBodyTemplated = $tmpl->get(); $this->rawHtmlWidget->setHtml($htmlBodyTemplated); }
function get_calendar_html($steam_calendar, $link, $timestamp = "") { if (empty($timestamp)) { $timestamp = time(); } $html = new HTML_TEMPLATE_IT(); $html->loadTemplateFile(PATH_TEMPLATES . "widget_calendar.template.html"); $html->setVariable("VALUE_MONTH", strftime("%b %G", $timestamp)); $html->setVariable("ABBR_SUNDAY", "S"); $html->setVariable("ABBR_MONDAY", "M"); $html->setVariable("ABBR_TUESDAY", "T"); $html->setVariable("ABBR_WEDNESDAY", "W"); $html->setVariable("ABBR_THURSDAY", "T"); $html->setVariable("ABBR_FRIDAY", "F"); $html->setVariable("ABBR_SATURDAY", "S"); $month = date("m", $timestamp); $year = date("Y", $timestamp); $next_month = $month == 12 ? 1 : $month + 1; $next_months_year = $month == 12 ? $year + 1 : $year; $first_day_of_month = strtotime("{$year}-{$month}-01"); $last_day_of_month = strtotime("-1 day", strtotime("{$next_months_year}-{$next_month}-01")); $calendar_entries = $steam_calendar->get_entries($first_day_of_month, $last_day_of_month); $weekday_offset = strftime("%w", $first_day_of_month); $current_day = $first_day_of_month; for ($w = 1; $w <= 6; $w++) { if ($current_day > $last_day_of_month) { break; } $html->setCurrentBlock("BLOCK_WEEK"); for ($wd = 0; $wd <= 6; $wd++) { if ($weekday_offset > 0) { $html->setVariable("WD{$wd}", " "); $weekday_offset--; continue; } if ($current_day > $last_day_of_month) { $html->setVariable("WD{$wd}", " "); $current_day = strtotime("+1 day", $current_day); continue; } $wdstr = strftime("%e", $current_day); $wdentries = $calendar_entries[$current_day]; $wdlabel = $wdentries > 0 ? "<b>{$wdstr}</b>" : $wdstr; $html->setVariable("WD{$wd}", $wdlabel); $current_day = strtotime("+1 day", $current_day); } $html->parse("BLOCK_WEEK"); } return $html->get(); }
function get_question_script_exam_html($pathprefix, $eid) { $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_ELEARNING . "elearning_question_multiplechoice.template.html"); $content->setCurrentBlock("BLOCK_CHECKBOX"); $content->setVariable("IMAGE_CHECKBOX_SELECTED_ENABLED", IMAGE_CHECKBOX_SELECTED_ENABLED); $content->setVariable("IMAGE_CHECKBOX_SELECTED_DISENABLED", IMAGE_CHECKBOX_SELECTED_DISABLED); $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_ENABLED", IMAGE_CHECKBOX_UNSELECTED_ENABLED); $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_DISENABLED", IMAGE_CHECKBOX_UNSELECTED_DISABLED); $content->setVariable("IMAGE_CHECKBOX_LOADER", IMAGE_CHECKBOX_LOADER); $content->parseCurrentBlock(); $content->setCurrentBlock("BLOCK_EXAM_QUESTION_JAVASCRIPT"); $content->setVariable("PATHPREFIX", $pathprefix); $content->setVariable("EID", $eid); $content->parseCurrentBlock(); return $content->get(); }
public function set_content() { $template = new HTML_TEMPLATE_IT(); $template->loadTemplateFile(PORTFOLIO_PATH_TEMPLATES . "manage.template.html"); // Set content on right side $template->setCurrentBlock("BLOCK_DESKTOP_LEFT"); $template->setCurrentBlock("BLOCK_NEXTSTEPS"); $template->setVariable("LABEL_NEXTSTEPS", "Nächste Schritte"); $template->setCurrentBlock("BLOCK_NEXTSTEP"); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); $template->setCurrentBlock("BLOCK_VISIBLE_PORTFOLIOS"); $template->setVariable("LABEL_VISIBLE", "Sichtbare Portfolios"); $template->setCurrentBlock("BLOCK_VISIBLE_BOX"); $template->setVariable("CONTENT_VISIBLE", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_VISIBLE", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_VISIBLE", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); // Set content on left side $template->setCurrentBlock("BLOCK_DESKTOP_RIGHT"); $template->setCurrentBlock("BLOCK_COMMENTS"); $template->setVariable("LABEL_COMMENTS", "Kommentare"); $template->setCurrentBlock("BLOCK_COMMENTS_BOX"); $template->setVariable("CONTENT_COMMENTS", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_COMMENTS", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_COMMENTS", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); $this->template->setVariable("HTML_CODE_LEFT", $template->get()); }
$cache->drop("lms_steam::user_get_profile", $user->get_name()); $cache->drop("lms_portal::get_menu_html", $user->get_name(), TRUE); if (!$group->is_member($user)) { $backlink = PATH_URL . 'desktop/'; } header('Location: ' . $backlink); } else { $portal->set_problem_description($result["problem"], $result["hint"]); } } else { $portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here.")); } } // GET $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "groups_join.template.html"); $content->setVariable("BACKLINK", $backlink); if ($group->requested_membership($user)) { if (empty($_SESSION['confirmation'])) { // don't warn if we came here on successful membership request... if ($group instanceof koala_group_course) { $portal->set_problem_description(gettext("You have already requested a membership for this course.")); } else { $portal->set_problem_description(gettext("You have already requested a membership for this group.")); } } } else { if ($group->is_member($user)) { if (empty($_SESSION['confirmation'])) { // don't warn if we came here on successful membership request... if ($group instanceof koala_group_course) {
function get_comment_html($document, $url) { $cache = get_cache_function($document->get_id(), 600); $user = lms_steam::get_current_user(); $write_access = $document->check_access(SANCTION_ANNOTATE, $user); $template = new HTML_TEMPLATE_IT(); $template->loadTemplateFile(PATH_TEMPLATES . "comments.template.html"); $headline = gettext("Add your comment"); if ($_SERVER["REQUEST_METHOD"] == "POST" && $write_access) { $values = $_POST["values"]; if (!empty($values["preview_comment"])) { $template->setCurrentBlock("BLOCK_PREVIEW_COMMENT"); $template->setVariable("TEXT_COMMENT", $values["comment"]); $template->setVariable("PREVIEW", gettext("Preview")); $template->setVariable("POST_COMMENT", gettext("Post comment")); $template->setVariable("LABEL_PREVIEW_YOUR_COMMENT", gettext("Preview your comment")); $template->setVariable("VALUE_PREVIEW_COMMENT", get_formatted_output($values["comment"])); $template->parse("BLOCK_PREVIEW_COMMENT"); $headline = gettext("Change it?"); } if (!empty($values["submit_comment"]) && !empty($values["comment"])) { $new_comment = steam_factory::create_textdoc($GLOBALS["STEAM"]->get_id(), $user->get_name() . "-" . time(), $values["comment"]); $all_user = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER); $new_comment->set_acquire($document); $new_comment->set_read_access($all_user); $document->add_annotation($new_comment); $cache->drop("lms_steam::get_annotations", $document->get_id()); } } $comments = $cache->call("lms_steam::get_annotations", $document->get_id()); if (count($comments) > 0) { $template->setVariable("LABEL_COMMENTS", gettext("comments")); } $comments = array_reverse($comments); //reverse comment order (oldest first) foreach ($comments as $comment) { $obj_comment = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $comment["OBJ_ID"]); $template->setCurrentBlock("BLOCK_ANNOTATION"); $template->setVariable("COMMENT_ID", $comment["OBJ_ID"]); $template->setVariable("AUTHOR_LINK", PATH_URL . "user/" . $comment["OBJ_CREATOR_LOGIN"] . "/"); $template->setVariable("AUTHOR_NAME", $comment["OBJ_CREATOR"]); $template->setVariable("IMAGE_LINK", PATH_URL . "get_document.php?id=" . $comment["OBJ_ICON"]); $template->setVariable("LABEL_SAYS", gettext("says")); $template->setVariable("ANNOTATION_COMMENT", get_formatted_output($comment["CONTENT"], 80, "\n")); $template->setVariable("HOW_LONG_AGO", how_long_ago($comment["OBJ_CREATION_TIME"])); $template->setVariable('LINK_PERMALINK', $url . '/#comment' . $comment['OBJ_ID']); $template->setVariable("LABEL_PERMALINK", gettext("permalink")); if ($obj_comment->check_access_write($user)) { $template->setCurrentBlock("BLOCK_OWN_COMMENT"); $template->setVariable("LINK_DELETE", $url . "/deletecomment" . $comment["OBJ_ID"] . "/"); $template->setVariable("LABEL_DELETE", gettext("delete")); $template->setVariable("LINK_EDIT", $url . "/editcomment" . $comment["OBJ_ID"] . "/"); $template->setVariable("LABEL_EDIT", gettext("edit")); $template->parse("BLOCK_OWN_COMMENT"); } $template->parse("BLOCK_ANNOTATION"); } if ($write_access) { $template->setCurrentBlock("BLOCK_ADD_COMMENT"); $template->setVariable("LABEL_ADD_YOUR_COMMENT", $headline); $template->setVariable("LABEL_PREVIEW", gettext("Preview")); $template->setVariable("LABEL_OR", gettext("or")); $template->setVariable("LABEL_COMMENT", gettext("Add comment")); $template->setVariable("LABEL_BB_BOLD", gettext("B")); $template->setVariable("HINT_BB_BOLD", gettext("boldface")); $template->setVariable("LABEL_BB_ITALIC", gettext("I")); $template->setVariable("HINT_BB_ITALIC", gettext("italic")); $template->setVariable("LABEL_BB_UNDERLINE", gettext("U")); $template->setVariable("HINT_BB_UNDERLINE", gettext("underline")); $template->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S")); $template->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough")); $template->setVariable("LABEL_BB_IMAGE", gettext("IMG")); $template->setVariable("HINT_BB_IMAGE", gettext("image")); $template->setVariable("LABEL_BB_URL", gettext("URL")); $template->setVariable("HINT_BB_URL", gettext("web link")); $template->setVariable("LABEL_BB_MAIL", gettext("MAIL")); $template->setVariable("HINT_BB_MAIL", gettext("email link")); $template->parse("BLOCK_ADD_COMMENT"); } return $template->get(); }
<?php $wiki_html_handler = new lms_wiki($wiki_container); $wiki_html_handler->set_admin_menu("mediathek", $wiki_container); $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "wiki_mediathek.template.html"); // get images $inventory = $wiki_container->get_inventory(); if (!is_array($inventory)) { $inventory = array(); } if (sizeof($inventory) > 0) { steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $inventory, array(OBJ_NAME, OBJ_DESC, DOC_MIME_TYPE)); $images = array(); foreach ($inventory as $object) { $mime = strtolower($object->get_attribute(DOC_MIME_TYPE)); if ($mime === "image/jpg" || $mime === "image/jpeg" || $mime === "image/gif" || $mime === "image/png") { $images[] = $object; } } foreach ($images as $image) { $actions = '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/">' . gettext("show properties") . '</a><br>'; $actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/edit/">' . gettext("edit properties") . '</a><br>'; $actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/deleteImage/" onclick="return confirmDeletion();">' . gettext("delete image") . '</a>'; $imageData = imagecreatefromstring($image->get_content()); $width = $newWidth = imagesx($imageData); $height = $newHeight = imagesy($imageData); if ($width > 160) { $newHeight = (int) ($height * 160 / $width); $newWidth = 160; }
$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 . "''"; 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();
$content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough")); $content->setVariable("LABEL_BB_IMAGE", gettext("IMG")); $content->setVariable("HINT_BB_IMAGE", gettext("image")); $content->setVariable("LABEL_BB_URL", gettext("URL")); $content->setVariable("HINT_BB_URL", gettext("web link")); $content->setVariable("LABEL_BB_MAIL", gettext("MAIL")); $content->setVariable("HINT_BB_MAIL", gettext("email link")); //hier Voreinstellung?! //$values[ "privacy_deny_participants" ] = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS; //TODO //$values[ "privacy_deny_documents" ] = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS; //$privacy_deny_participants_default = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS; //$privacy_deny_documents_default = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS; if ($create_new && $is_public || $grouptype !== "group_moderated" && $grouptype !== "group_private") { // Add group maxsize field $m = new HTML_TEMPLATE_IT(); $m->loadTemplateFile(PATH_TEMPLATES . "groups_maxsize_widget.template.html"); $m->setCurrentBlock("BLOCK_MAXSIZE"); $m->setVariable("LABEL_MAXSIZE", gettext("Max number of participants")); $m->setVariable("LABEL_MAXSIZE_DSC", gettext("To limit the max number of participants for your course enter a number greater than 0. Leave this field blank or enter a '0' for no limitation.")); isset($values["maxsize"]) ? $m->setVariable("VALUE_MAXSIZE", h($values["maxsize"])) : ""; $mhtml = $m->get(); } $content->setVariable("BACKLINK", "<a class=\"button\" href=\"{$backlink}\">" . gettext("back") . "</a>"); // extensions: if (count($extensions) > 0) { $content->setCurrentBlock("BLOCK_EXTENSIONS"); $content->setVariable("LABEL_EXTENSIONS", gettext("Extensions")); $extension_list = array(); foreach ($extensions as $extension) { $extension_name = $extension->get_name(); $content->setCurrentBlock("BLOCK_EXTENSION");
public function processData(\IRequestObject $requestObject) { $objectId = $requestObject->getId(); $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); //icon $referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png"; //reference handling $params = $requestObject->getParams(); if (isset($params["referenced"]) && $params["referenced"] == true) { $portletIsReference = true; $referenceId = $params["referenceId"]; } else { $portletIsReference = false; } $portletName = $portlet->get_attribute(OBJ_DESC); $this->getExtension()->addCSS(); $this->getExtension()->addJS(); //old bib include_once PATH_BASE . "koala-core/lib/bid/slashes.php"; //get content of portlet $content = $portlet->get_attribute("bid:portlet:content"); if (is_array($content) && count($content) > 0) { array_walk($content, "_stripslashes"); } else { $content = array(); } $portletInstance = \PortletRss::getInstance(); $portletPath = $portletInstance->getExtensionPath(); $num_items = isset($content["num_items"]) ? $content["num_items"] : 0; if (isset($content["address"])) { $feed = new \SimplePie(); $feed->set_cache_location(PATH_CACHE); $feed->set_feed_url(derive_url($content["address"])); $feed->init(); if ($num_items == 0) { $items = $feed->get_items(); } else { $items = array_slice($feed->get_items(), 0, $num_items); } } $desc_length = isset($content["desc_length"]) ? $content["desc_length"] : 0; if (isset($content["allow_html"])) { $allow_html = $content["allow_html"] == "checked" ? true : false; } else { $allow_html = false; } $UBB = new \UBBCode(); include_once PATH_BASE . "koala-core/lib/bid/derive_url.php"; $portletFileName = $portletPath . "/ui/html/index.html"; $tmpl = new \HTML_TEMPLATE_IT(); $tmpl->loadTemplateFile($portletFileName); $tmpl->setVariable("EDIT_BUTTON", ""); $tmpl->setVariable("PORTLET_ID", $portlet->get_id()); $tmpl->setVariable("RSS_NAME", $portletName); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } //popupmenu if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("PortletRss"); $popupmenu->setElementId("portal-overlay"); $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml()); } if ($portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("Portal"); $popupmenu->setElementId("portal-overlay"); $popupmenu->setParams(array(array("key" => "sourceObjectId", "value" => $portlet->get_id()), array("key" => "linkObjectId", "value" => $referenceId))); $popupmenu->setCommand("PortletGetPopupMenuReference"); $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml()); } if (sizeof($content) > 0) { if ($feed->error()) { $tmpl->setVariable("NOITEMSTEXT", "RSS-Ladefehler"); } else { if (count($items) == 0) { $tmpl->setVariable("NOITEMSTEXT", "RSS-Feed ist leer."); } else { foreach ($items as $item) { $tmpl->setCurrentBlock("BLOCK_RSS_ITEM"); if ($allow_html) { $itemtitle = $item->get_title(); $itemdesc = $item->get_description(); } else { $itemtitle = strip_tags($item->get_title()); $itemdesc = strip_tags($item->get_description()); } if ($desc_length == 0) { $itemdesc = ""; } else { if ($desc_length > 0 && strlen($itemdesc) > $desc_length) { $itemdesc = substr($itemdesc, 0, $desc_length) . "..."; } } $tmpl->setVariable("ITEMTITLE", $itemtitle); $tmpl->setVariable("ITEMDESC", $itemdesc); $tmpl->setVariable("ITEMURL", derive_url($item->get_permalink())); $tmpl->setVariable("LINK", ""); $tmpl->parse("BLOCK_RSS_ITEM"); } } } } else { $tmpl->setVariable("NOITEMSTEXT", "RSS-Feed nicht konfiguriert."); } $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->setHtml($htmlBody); $outputWidget->addWidget(new \Widgets\PopupMenu()); $this->rawHtmlWidget = $outputWidget; }
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST["id"] == $unit->get_id()) { try { $unit->delete(); $owner = koala_object::get_koala_object(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["owner"])); $backlink = $owner->get_url() . "units/"; } catch (Exception $exception) { $problems = $exception->get_message(); } } if (empty($problems)) { $_SESSION["confirmation"] = str_replace("%NAME", $unitname, gettext("The unit '%NAME' has been deleted.")); header("Location: " . $backlink); exit; } else { $portal->set_problem_description($problems, $hints); } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_POINTLIST . "units_pointlist_delete.template.html"); $content->setVariable("UNIT_ID", $unit->get_id()); $content->setVariable("OWNER_ID", $owner->get_id()); $content->setVariable("BACK_LINK", $backlink); $content->setVariable("INFO_TEXT", gettext("Do you really want to delete this pointlist ?")); $content->setVariable("LABEL_OK", gettext("Delete unit")); $content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>"); $semester = $course->get_semester()->get_name(); $breadcrumb = array(array("name" => $semester, "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/"), array("name" => $course->get_display_name(), "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/" . $course->get_name() . "/"), array("name" => gettext("Units"), "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/" . $course->get_name() . "/units/"), $unit->get_link(), array("name" => gettext("Delete this unit"))); $portal->set_page_main($breadcrumb, $content->get()); $portal->show_html(); exit;
//$participants = $eoDatabase->getParticipantsForTerm($examTerm); //better done below $current_user = lms_steam::get_current_user(); $examOffice = exam_office_file_handling::getInstance(); $showedParsedTable = false; //create portal if (!isset($portal)) { $portal = lms_portal::get_instance(); $portal->initialize(GUEST_ALLOWED); } else { $portal->set_guest_allowed(GUEST_ALLOWED); } $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_show_and_import_participants.template.html"); $container = $course->get_workroom(); $is_admin = $course->is_admin($current_user); //post data //save to database - case list loaded if (isset($_POST["import_participants_save"]) || isset($_POST["import_participants_save_replace"])) { if (isset($_POST["import_participants_save_replace"])) { $replace = true; $eoDatabase = exam_organization_database::getInstance(); $deleteCourseResult = $eoDatabase->deleteTerm($examTerm); } else { $replace = false; } //pre caching $ldapManager = exam_organization_ldap_manager::getInstance(); foreach ($_POST as $postKey => $postValue) {
<?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"));
/* require_once( "Cache/Lite.php" ); $cache = new Cache_Lite( array( "cacheDir" => PATH_CACHE ) ); $cache->clean( $user->get_name() ); $cache->clean( $user->get_id() );*/ $lang_index = language_support::get_language_index(); language_support::choose_language($lang_index[$values["USER_LANGUAGE"]]); $cache = get_cache_function(lms_steam::get_current_user()->get_name()); $cache->drop("lms_portal::get_menu_html", lms_steam::get_current_user()->get_name(), TRUE); $cache = get_cache_function($user->get_name()); $cache->drop("lms_steam::user_get_profile", $user->get_name()); $_SESSION["confirmation"] = gettext("Your profile data has been saved."); header("Location: " . PATH_URL . "profile_edit.php"); } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "profile_edit.template.html"); $content->setVariable("LABEL_INFO", gettext("Please complete your profile. None of the fields are mandatory. Some of the fields can not be changed due to central identity management at the IMT.<br/><b>Note: With the button <i>Profile Privacy</i> you can control which information can be seen by other users.</b>")); $content->setVariable("LABEL_PROFILE", gettext("General Information")); $content->setVariable("LABEL_LOOKING", gettext("Your buddy icon")); $content->setVariable("LABEL_MAIL_PREFS", gettext("Your mail preferences")); $content->setVariable("LABEL_PROFILE_PRIVACY", gettext("Profile Privacy")); $content->setVariable("LINK_BUDDY_ICON", PATH_URL . "profile_icon.php"); $content->setVariable("LINK_MAIL_PREFS", PATH_URL . "messages_prefs.php"); $content->setVariable("LINK_PROFILE_PRIVACY", PATH_URL . "profile_privacy.php"); $content->setVariable("LABEL_FIRST_NAME", gettext("First name")); $content->setVariable("LABEL_LAST_NAME", gettext("Last name")); $content->setVariable("LABEL_TITLE", gettext("Academic title")); $content->setVariable("LABEL_DEGREE", gettext("Academic degree")); $content->setVariable("LABEL_IF_AVAILABLE", gettext("only if available")); $content->setVariable("LABEL_STATUS", gettext("Status")); $content->setVariable("LABEL_GENDER", gettext("Gender"));
$cache->clean($wid); // clean wiki cache (not used by wiki) $fcache = get_cache_function($object->get_id(), 600); $fcache->drop("lms_wiki::get_items", $object->get_id()); // Clean communication summary cache für the group/course if (is_object($workroom)) { $cache = get_cache_function(lms_steam::get_current_user()->get_name(), 600); $cache->drop("lms_steam::get_inventory_recursive", $workroom->get_id(), CLASS_CONTAINER | CLASS_ROOM, array("OBJ_TYPE", "WIKI_LANGUAGE")); $cache->drop("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM); } header("Location: " . $values["return_to"]); exit; } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "object_delete.template.html"); if ($object->check_access_write($user)) { $content->setVariable("LABEL_ARE_YOU_SURE", str_replace("%NAME", h($object->get_name()), gettext("Are you sure you want to delete the wiki '%NAME' ?"))); $rootlink = lms_steam::get_link_to_root($object); $content->setVariable("DELETE_BACK_LINK", $rootlink[1]["link"] . "communication/"); $content->setCurrentBlock("BLOCK_DELETE"); $content->setVariable("FORM_ACTION", $_SERVER["REQUEST_URI"]); $content->setVariable("LABEL_DELETE_IT", gettext("yes, delete it")); $content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]); $content->setVariable("LABEL_RETURN", gettext("back")); $content->parse("BLOCK_DELETE"); } else { $content->setVariable("LABEL_ARE_YOU_SURE", gettext("You have no rights to delete this wiki!")); } $content->setVariable("TEXT_INFORMATION", gettext("The Wiki and all its entries will be deleted.")); $creator = $object->get_creator();
<?php $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "home.template.html"); $content->setVariable("LABEL_GREETING", gettext("Welcome") . " " . $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname()); $content->setVariable("INFO_TODO_MAILS", "<a href=\"" . PATH_SERVER . "/bid/journal/1599/\">zum Test Journal</a>");
$content->setVariable("LABEL_WIKI_NUMBERED_LIST", gettext("# list")); $content->setVariable("HINT_WIKI_NUMBERED_LIST", gettext("numbered list")); $content->setVariable("LABEL_WIKI_LINE", gettext("-----")); $content->setVariable("HINT_WIKI_LINE", gettext("horizontal line")); $content->setVariable("LABEL_WIKI_LINK", gettext("[[wiki]]")); $content->setVariable("HINT_WIKI_LINK", gettext("wiki link")); $content->setVariable("LABEL_WIKI_URL", gettext("[URL]")); $content->setVariable("HINT_WIKI_URL", gettext("web link")); //$content->setVariable( "LABEL_WIKI_IMAGE", gettext( "IMG" ) ); //$content->setVariable( "HINT_WIKI_IMAGE", gettext( "image" ) ); $content->setVariable("LABEL_PREVIEW", gettext("Preview")); $content->setVariable("LABEL_SAVE_CHANGES", gettext("Save changes")); $content->setVariable("LABEL_RETURN", gettext("back")); // widget: Images $widget = new HTML_TEMPLATE_IT(); $widget->loadTemplateFile(PATH_TEMPLATES . "widget_wiki_images.template.html"); $inventory = $wiki_container->get_inventory(); if (!is_array($inventory)) { $inventory = array(); } if (sizeof($inventory) > 0) { steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $inventory, array(OBJ_NAME, OBJ_DESC, DOC_MIME_TYPE)); $images = array(); foreach ($inventory as $object) { $mime = strtolower($object->get_attribute(DOC_MIME_TYPE)); if ($mime === "image/jpg" || $mime === "image/jpeg" || $mime === "image/gif" || $mime === "image/png") { $images[] = $object; } } foreach ($images as $image) { $widget->setCurrentBlock("BLOCK_IMAGE");
<?php $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "docextern_edit.template.html"); if ($_SERVER["REQUEST_METHOD"] == "POST") { $values = $_POST["values"]; $problem = ""; $hint = ""; if (!empty($values["save"])) { if (empty($values["url"])) { $problem = gettext("The URL is missing.") . " "; $hint = gettext("Please insert the URL, starting with 'http://'") . " "; } if (empty($values["name"])) { $problem .= gettext("The name is missing."); $hint .= gettext("How is the title of the webpage?"); } else { if (strpos($values["name"], "/")) { if (!isset($problem)) { $problem = ""; } $problem .= gettext("Please don't use the \"/\"-char in the name of the weblink."); } } if (empty($problem)) { if (!is_object($docextern)) { $docextern = steam_factory::create_docextern($GLOBALS["STEAM"]->get_id(), $values["name"], $values["url"], $env, $values["desc"]); } else { if (empty($values["desc"])) { $docextern->delete_attribute("OBJ_DESC"); } else {
<?php if (sizeof($portlet_content) > 0) { $template = new HTML_TEMPLATE_IT(); $template->loadTemplateFile(PATH_CURRENT_EXTENSION . "portlets/headline/templates/view.html"); $template->setVariable("ALIGNMENT", trim($portlet_content["alignment"])); $template->setVariable("SIZE", trim($portlet_content["size"])); $template->setVariable("HEADLINE", $portlet_content["headline"]); if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $template->setVariable("PORTLET_ID", $portlet->get_id()); $template->setVariable("PORTLET_ROOT", PATH_CURRENT_EXTENSION . "./portlets/headline"); } echo $template->get(); } else { echo ""; }
$user->get_attributes(array(OBJ_NAME, USER_FIRSTNAME, USER_FULLNAME)); foreach ($members as $member) { $cache = get_cache_function($member->get_name()); $cache->drop("lms_steam::user_get_groups", $member->get_name(), TRUE); $cache->drop("lms_steam::user_get_groups", $member->get_name(), FALSE); $cache->drop("lms_steam::user_get_profile", $member->get_name()); $cache->drop("lms_portal::get_menu_html", $member->get_name(), TRUE); } $cache = get_cache_function($steam_group->get_id()); $cache->drop("lms_steam::group_get_members", $steam_group->get_id()); foreach ($members as $member) { lms_steam::mail($member, $user, PLATFORM_NAME . ": " . str_replace("%NAME", h($group_name), gettext("Group %NAME has been deleted.")), str_replace("%USER", $user->get_name() . " (" . $user->get_attribute(USER_FIRSTNAME) . " " . $user->get_attribute(USER_FULLNAME) . ")", str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted from he koaLA System by %USER."))) . "\n\n-- \n" . str_replace("%NAME", h($group_name), gettext("This system generated notification message was sent to you as a former member of the deleted group \"%NAME\""))); } $_SESSION["confirmation"] = str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted. A notification has been sent to former members.")); header("Location: " . $upper_link); exit; } else { throw new Exception("Deletion of group failed"); } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "group_delete.template.html"); $content->setVariable("FORM_ACTION", ""); $content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?")); $content->setVariable("INFO_DELETE_GROUP", str_replace("%GROUP_NAME", h($group->get_name()), gettext("You are going to delete '%GROUP_NAME'.")) . "<br />" . gettext("All data of this group will be removed from the system including weblogs, wikis, forums and documents. All members of this group will be notified about the deletion automatically.") . "<br /><br /><strong>" . gettext("The deletion process may take several minutes.")) . "</strong>"; $content->setVariable("LABEL_DELETE_IT", gettext("Yes, delete this group")); $content->setVariable("DELETE_BACK_LINK", $_SERVER["HTTP_REFERER"]); $content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]); $content->setVariable("LABEL_RETURN", gettext("back")); $portal->set_page_main(array(lms_steam::get_link_to_root($steam_group), array("link" => "", "name" => gettext("Delete group"))), $content->get(), ""); $portal->show_html();
// check read permission: if (!$container->check_access_read(lms_steam::get_current_user())) { $portal->set_problem_description(gettext("You are not permitted to view this folder.'")); $portal->set_page_main($html_handler->get_headline(), $html_handler->get_html(), ""); $portal->show_html(); exit; } if (!isset($container_icons)) { $container_icons = TRUE; } if (!isset($path_offset)) { $path_offset = 1; } $portal->set_environment($container); $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_HOMEWORK . "units_homework_list_inventory.template.html"); if (isset($_REQUEST['nrshow'])) { $nr_show = (int) $_REQUEST['nrshow']; } else { $nr_show = 20; } $start = $portal->get_paginator_start($nr_show); if (isset($_REQUEST['sort'])) { $sort = $_REQUEST['sort']; } else { $sort = FALSE; } $pagination_info = $koala_container->get_inventory_paginated($start, $nr_show, $sort); $inventory = $pagination_info['objects']; if (!isset($link_path)) { $link_path = $koala_container->get_link_path();
<?php require_once PATH_LIB . "comments_handling.inc.php"; require_once PATH_LIB . "wiki_handling.inc.php"; $wiki_html_handler = new lms_wiki($wiki_container); $wiki_html_handler->set_admin_menu("index", $wiki_container); $grp = $wiki_container->get_environment()->get_creator(); if ($grp->get_name() == "learners" && $grp->get_attribute(OBJ_TYPE) == "course_learners") { $grp = $grp->get_parent_group(); } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "wiki_entries.template.html"); $cache = get_cache_function($wiki_container->get_id(), 600); $wiki_entries = $cache->call("lms_wiki::get_items", $wiki_container->get_id()); $recently_changed = new LinkedList(5); $most_discussed = new LinkedList(5); $latest_comments = new LinkedList(5); $no_wiki_entries = count($wiki_entries); if ($no_wiki_entries > 0) { $first_char = ""; for ($i = 0; $i < $no_wiki_entries; $i++) { $this_char = substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1); if ($this_char > $first_char) { $first_char = $this_char; if ($i > 1) { $content->parse("BLOCK_CHARACTER"); } $content->setCurrentBlock("BLOCK_CHARACTER"); $content->setVariable("FIRST_CHAR", h($this_char)); } $char_articles = array();
$cache->drop("lms_steam::user_get_profile", $candidate->get_name()); $cache->drop("lms_portal::get_menu_html", $candidate->get_name(), TRUE); } } elseif (isset($_POST['cancel']) && is_array($_POST['cancel'])) { $candidate = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), key($_POST["cancel"])); $group->remove_membership_request($candidate); $subject = str_replace("%GROUP", $group->get_name(), gettext("Your membership for '%GROUP' was rejected")); $message = gettext("Your membership was rejected."); $portal->set_confirmation(str_replace("%NAME", $candidate->get_attribute("USER_FIRSTNAME") . " " . $candidate->get_attribute("USER_FULLNAME"), gettext("Membership of %NAME rejected."))); } //$candidate->mail( $subject, $message, $user->get_attribute( "USER_EMAIL" )); lms_steam::mail($candidate, $user, $subject, $message); } $result = $group->get_membership_requests(); $html_people = new HTML_TEMPLATE_IT(); $html_people->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html"); $no_people = count($result); if ($no_people > 0) { $start = $portal->set_paginator(10, $no_people, "(" . gettext("%TOTAL membership requests") . ")"); $end = $start + 10 > $no_people ? $no_people : $start + 10; $html_people->setVariable("LABEL_CONTACTS", gettext("Membership requests") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_people), gettext("%a-%z out of %s")) . ")"); $html_people->setCurrentBlock("BLOCK_CONTACT_LIST"); $html_people->setVariable("LABEL_NAME_POSITION", gettext("Name, position")); $html_people->setVariable("LABEL_SUBJECT_AREA", gettext("Subject area")); $html_people->setVariable("LABEL_COMMUNICATION", gettext("Communication")); $html_people->setVariable("TH_MANAGE_CONTACT", gettext("Action")); foreach ($result as $candidate) { $person = $candidate->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_NAME", "OBJ_DESC")); $html_people->setCurrentBlock("BLOCK_CONTACT"); $html_people->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($person["OBJ_NAME"]) . "/"); if (is_object($person["OBJ_ICON"])) {
$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 "<p> Course not set </p>"; 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_setup_password.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")); if ($is_admin) { $content->setVariable("ROLE_STATUS", gettext("Your current role is admin/staff member")); }
<?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();
$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")); if ($is_admin) { $content->setVariable("ROLE_STATUS", gettext("Your current role is admin/staff member")); }
} 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); $tnr[$tutorials[$key]->get_id()]["has_password"] = $tutorials[$key]->has_password(TRUE); $tnr[$tutorials[$key]->get_id()]["membercount"] = $tutorials[$key]->count_members(TRUE);
// check read permission: if (!$container->check_access_read(lms_steam::get_current_user()) | $setHidden) { $portal->set_problem_description(gettext("You are not permitted to view this folder.'")); $portal->set_page_main($html_handler->get_headline(), $html_handler->get_html(), ""); $portal->show_html(); exit; } if (!isset($container_icons)) { $container_icons = TRUE; } if (!isset($path_offset)) { $path_offset = 1; } $portal->set_environment($container); $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "list_inventory.template.html"); if (isset($_REQUEST['nrshow'])) { $nr_show = (int) $_REQUEST['nrshow']; } else { $nr_show = 10; } $start = $portal->get_paginator_start($nr_show); if (isset($_REQUEST['sort'])) { $sort = $_REQUEST['sort']; } else { $sort = FALSE; } if (!isset($link_path)) { $link_path = $koala_container->get_link_path(); } $base_url = $link_path[0]["link"];
exit; } if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST["id"] == $unit->get_id()) { try { $unit->delete(); $owner = koala_object::get_koala_object(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["owner"])); $backlink = $owner->get_url() . "units/"; } catch (Exception $exception) { $problems = $exception->get_message(); } } if (empty($problems)) { $_SESSION["confirmation"] = str_replace("%NAME", $unitname, gettext("The unit '%NAME' has been deleted.")); header("Location: " . $backlink); exit; } else { $portal->set_problem_description($problems, $hints); } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_VILM . "units_vilm_delete.template.html"); $content->setVariable("UNIT_ID", $unit->get_id()); $content->setVariable("OWNER_ID", $owner->get_id()); $content->setVariable("BACK_LINK", $backlink); $content->setVariable("INFO_TEXT", gettext("Do you really want to delete this unit?")); $content->setVariable("LABEL_OK", gettext("Delete unit")); $content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>"); $portal->set_page_main(array($unit->get_link(), array("name" => gettext("Delete this unit"))), $content->get()); $portal->show_html(); exit;