Example #1
0
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}", "&nbsp;");
                $weekday_offset--;
                continue;
            }
            if ($current_day > $last_day_of_month) {
                $html->setVariable("WD{$wd}", "&nbsp;");
                $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();
}
Example #2
0
$content->setVariable("LINK_MANAGE_SUBSCRPTIONS", PATH_URL . "user/" . h($user->get_name()) . "/groups/");
$content->setVariable("LINK_CREATE_NEW_GROUP", PATH_URL . "groups_create.php?parent=" . h($group->get_id()));
$content->setVariable("LABEL_CREATE_NEW_GROUP", gettext("Create new group"));
$content->setVariable("LABEL_SEARCH", gettext("Search"));
$content->setVariable("LABEL_GROUPNAME", gettext("Name"));
$content->setVariable("LABEL_GROUP_DESC", gettext("Description"));
$content->setVariable("LABEL_GROUP_MEMBERS", gettext("Members"));
$content->setVariable("LABEL_GROUP_SUBGROUPS", gettext("Subgroups"));
$no_subgroups = count($subgroups);
if ($no_subgroups > 0) {
    $start = $portal->set_paginator(20, $no_subgroups, "(" . str_replace("%NAME", h($group->get_name()), gettext("%TOTAL groups in %NAME")) . ")");
    $end = $start + 20 > $no_subgroups ? $no_subgroups : $start + 20;
    for ($i = $start; $i < $end; $i++) {
        $subgroup = $subgroups[$i];
        $content->setCurrentBlock("BLOCK_GROUP");
        $content->setVariable("GROUP_LINK", PATH_URL . "groups/" . h($subgroup["OBJ_ID"]) . "/");
        $content->setVariable("GROUP_NAME", h($subgroup["OBJ_NAME"]));
        $content->setVariable("GROUP_DESC", h($subgroup["OBJ_DESC"]));
        $content->setVariable("GROUP_MEMBERS_LINK", PATH_URL . "groups/" . h($subgroup["OBJ_ID"]) . "/members/");
        $content->setVariable("GROUP_MEMBERS", h($subgroup["NO_MEMBERS"]));
        if ($subgroup["NO_SUBGROUPS"] == 0) {
            $content->setVariable("GROUP_SUBGROUPS", "-");
        } else {
            $content->setVariable("GROUP_SUBGROUPS", "<a href=\"" . PATH_URL . "groups/?parent=" . h($subgroup["OBJ_ID"]) . "\">" . h($subgroup["NO_SUBGROUPS"]) . "</a>");
        }
        $content->parse("BLOCK_GROUP");
    }
}
$headline = !empty($_GET["parent"]) ? array(array("link" => PATH_URL . "groups/" . h($group->get_id()) . "/", "name" => h($group->get_name())), array("link" => "", "name" => gettext("Subgroups available"))) : gettext("Groups available");
$portal->set_page_main($headline, $content->get(), "");
$portal->show_html();
Example #3
0
         $portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here."));
     }
 } else {
     if ($group->get_attribute(KOALA_GROUP_ACCESS) == PERMISSION_GROUP_UNDEFINED) {
         $content->setCurrentBlock("BLOCK_FORM");
         if ($group->get_maxsize() > 0 && $group->get_maxsize() <= $group->count_members()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Group is full"));
             $content->setVariable("INFO_KIND_OF_GROUP", str_replace("%NUMBER", $group->get_maxsize(), gettext("The maximum number of %NUMBER participants has been reached.")) . " " . gettext("You are not be able to join this group at this time."));
             $content->setVariable("LABEL_SUBMIT", gettext("Unable to join group"));
             $content->setVariable("SUBMIT_EXTRA", "style=\"display:none\"");
         } elseif ($group->is_password_protected()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Password protected group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("The moderators of this group had set a password to avoid unauthorized access.") . " " . gettext("If you would like to join this group and don't know it, please ask the moderators."));
             $content->setCurrentBlock("BLOCK_GROUP_PASSWORD");
             $content->setVariable("LABEL_PASSWORD", gettext("Password"));
             $content->parse("BLOCK_GROUP_PASSWORD");
             $content->setVariable("LABEL_SUBMIT", gettext("Join this group"));
         } elseif ($group->is_moderated()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Moderated group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("To avoid unauthorized access, the moderators of this group have to approve your membership request first, before you can join the group.") . " " . gettext("Here, you can fill out a membership request and send it.") . " " . gettext("You will get automatically informed by mail if your request succeeds."));
             $content->setCurrentBlock("BLOCK_GROUP_MODERATED");
             $content->setVariable("LABEL_REASON_TO_JOIN", gettext("Please provide some information about the reason why you should join this group."));
             $content->parse("BLOCK_GROUP_MODERATED");
             $content->setVariable("LABEL_SUBMIT", gettext("Send membership request"));
         } else {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Public group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("This is a public group everyone can join.") . " " . gettext("Please confirm your intention."));
             $content->setVariable("LABEL_SUBMIT", gettext("Join this group"));
         }
         $content->setVariable("BACKLINK_FORM", $backlink);
         $content->setVariable("LABEL_RETURN", gettext("back"));
Example #4
0
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();
}
Example #5
0
$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();
        while ($i < $no_wiki_entries && $this_char == substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1)) {
            $char_articles[] = $wiki_entries[$i];
            if ($recently_changed->can_be_added($wiki_entries[$i]["DOC_LAST_MODIFIED"])) {
                $recently_changed->add_element($wiki_entries[$i]["DOC_LAST_MODIFIED"], $wiki_entries[$i]);
            }
            if (isset($wiki_entries[$i]["COMMENTS_NO"]) && $most_discussed->can_be_added($wiki_entries[$i]["COMMENTS_NO"]) && $wiki_entries[$i]["COMMENTS_NO"] > 1) {
                $most_discussed->add_element($wiki_entries[$i]["COMMENTS_NO"], $wiki_entries[$i]);
            }
            if (isset($wiki_entries[$i]["COMMENTS_LAST"]) && $latest_comments->can_be_added($wiki_entries[$i]["COMMENTS_LAST"]) && $wiki_entries[$i]["COMMENTS_LAST"] > 0) {
                $latest_comments->add_element($wiki_entries[$i]["COMMENTS_LAST"], $wiki_entries[$i]);
Example #6
0
 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;
 }
        //see if our candidate is already member in one of the other tutorials.
        $already_member_and_exclusive = false;
        if ($group instanceof koala_group_tutorial) {
            if ($group->get_course_group()->get_attribute("EXCLUSIVE_TUTORIAL_MEMBERSHIP") === "TRUE") {
                $course_learners_group = $group->steam_group_course_learners;
                $subgroups = $course_learners_group->get_subgroups();
                foreach ($subgroups as $sg) {
                    if (($sg->get_attribute("OBJ_TYPE") === "course_tutorial" || $sg->get_attribute("OBJ_TYPE") === "group_tutorial_koala") && $sg->is_member($candidate) && $sg != $steam_group) {
                        $already_member_and_exclusive = true;
                        $in_group = $sg;
                    }
                }
            }
        }
        if ($already_member_and_exclusive) {
            $html_people->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><small><b>" . gettext("Attention: User already in tutorial") . " " . $in_group->get_name() . "<p /></b></small><input type=\"hidden\" name=\"confirmed\" value=\"true\"/><input type=\"submit\"  name=\"affirm[" . $candidate->get_id() . "]\" value=\"" . gettext("Affirm anyhow") . "\"> " . gettext("or") . " <input type=\"submit\"  name=\"cancel[" . $candidate->get_id() . "]\" value=\"" . gettext("Decline") . "\"/></td>");
        } else {
            $html_people->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\"  name=\"affirm[" . $candidate->get_id() . "]\" value=\"" . gettext("Affirm") . "\"> " . gettext("or") . " <input type=\"submit\"  name=\"cancel[" . $candidate->get_id() . "]\" value=\"" . gettext("Decline") . "\"/></td>");
        }
        $html_people->setVariable("OBJ_DESC", h($person["OBJ_DESC"]));
        $html_people->parse("BLOCK_CONTACT");
    }
    $html_people->parse("BLOCK_CONTACT_LIST");
    $content->setVariable("HTML_USER_LIST", $html_people->get());
} else {
    $content->setVariable("LABEL_NO_REQUESTS", "<h3>" . gettext("No membership request found.") . "</h3>");
}
$portal->set_page_title(gettext("Membership Requests"));
//$portal->set_page_main( array( array( "link" => $backlink . "members/", "name" => $group->get_display_name() ), array( "link" => "", "name" => gettext( "Membership Requests" )) ), $content->get() , "" );
$portal->set_page_main(array($group->get_link(), array("name" => gettext("Membership Requests"))), $content->get(), "");
$portal->show_html();
Example #8
0
<?php

$public = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP);
$user = lms_steam::get_current_user();
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "groups_public.template.html");
if (MANAGE_GROUPS_MEMBERSHIP || CREATE_GROUPS) {
    $content->setCurrentBlock("BLOCK_ACTION_BAR_GROUPS");
    if (MANAGE_GROUPS_MEMBERSHIP) {
        $content->setCurrentBlock("BLOCK_MANAGE_GROUPS_MEMBERSHIP");
        $content->setVariable("LINK_MANAGE_SUBSCRIPTIONS", PATH_URL . "user/" . $user->get_name() . "/groups/");
        $content->setVariable("LABEL_MANAGE_SUBSCRIPTIONS", gettext("Manage subscriptions"));
        $content->parse("BLOCK_MANAGE_GROUPS_MEMBERSHIP");
    }
    if (CREATE_GROUPS) {
        $content->setCurrentBlock("BLOCK_CREATE_GROUPS");
        $content->setVariable("LINK_CREATE_NEW_GROUP", PATH_URL . "groups_create_dsc.php?parent=" . (isset($_GET["cat"]) ? $_GET["cat"] : $public->get_id()));
        $content->setVariable("LABEL_CREATE_NEW_GROUP", gettext("Create new group"));
        $content->parse("BLOCK_CREATE_GROUPS");
    }
    $content->parse("BLOCK_ACTION_BAR_GROUPS");
}
$content->setVariable("LABEL_NAME", gettext("Name"));
$content->setVariable("LABEL_DESC", gettext("Description"));
if (!empty($_GET["cat"])) {
    // EINE KATEGORIE ANZEIGEN
    if (!($category = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["cat"]))) {
        include "bad_link.php";
        exit;
    }
    if (!$category instanceof steam_container) {
Example #9
0
<?php

// Deactivate HISLSF Support
//	include( "bad_link.php" );
//	exit;
require_once "../etc/koala.conf.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
$all_users = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
if (!lms_steam::is_steam_admin($user) && !lms_steam::is_semester_admin($current_semester, $user)) {
    include "bad_link.php";
    exit;
}
$lsf_client = new hislsf_soap();
$result = $lsf_client->get_available_courses(SYNC_HISLSF_SEMESTER, $path[1]);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "courses_create_hislsf.template.html");
$content->setVariable("FORM_ACTION", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/new/");
foreach ($result->veranstaltung as $course) {
    $content->setCurrentBlock("LSFCOURSE");
    $content->setVariable("LSF_COURSE_ID", (string) $course->Veranstaltungsschluessel);
    $content->setVariable("LSF_COURSE_NAME", (string) $course->Veranstaltungstyp . " " . (string) $course->Veranstaltungsname);
    $content->parse("LSFCOURSE");
}
$portal->set_page_main(array(array("link" => PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/", "name" => $current_semester->get_attribute("OBJ_DESC")), array("linK" => "", "name" => gettext("Create new Course via LSF"))), $content->get());
$portal->show_html();
Example #10
0
        $cache = get_cache_function(OBJ_ID, 600);
        $discussions = $cache->drop("lms_steam::get_annotations", OBJ_ID);
        // clean rsscache
        $rcache = get_cache_function("rss", 600);
        $feedlink = PATH_URL . "services/feeds/forum_public.php?id=" . OBJ_ID;
        $rcache->drop("lms_rss::get_items", $feedlink);
        $feedlink = PATH_URL . "services/feeds/weblog_public.php?id=" . OBJ_ID;
        $rcache->drop("lms_rss::get_items", $feedlink);
        header("Location: " . $values["return_to"]);
        exit;
    } else {
        // PREVIEW
        $content->setCurrentBlock("BLOCK_PREVIEW");
        $content->setVariable("LABEL_PREVIEW_EDIT", gettext("Preview the edit"));
        $content->setVariable("PREVIEW_EDIT", get_formatted_output($values["message"]));
        $content->parse("BLOCK_PREVIEW");
        $content->setVariable("LABEL_HERE_IT_IS", gettext("Change it?"));
        $content->setVariable("TEXT_COMMENT", h($values["message"]));
        $content->setVariable("BACK_LINK", $values["return_to"]);
    }
}
$content->setVariable("LABEL_BB_BOLD", gettext("B"));
$content->setVariable("HINT_BB_BOLD", gettext("boldface"));
$content->setVariable("LABEL_BB_ITALIC", gettext("I"));
$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
$content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough"));
$content->setVariable("LABEL_BB_IMAGE", gettext("IMG"));
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
Example #11
0
$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
$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"));
if ($accessmergel) {
    $mailto = "mailto:'.SUPPORT_EMAIL.'?subject=KoaLA:%20Invalid%20Access%20Rights&body=" . rawurlencode("\nLink: " . get_current_URL() . "\nCreator: " . $creator->get_identifier() . "\n");
    $content->setCurrentBlock("BLOCK_ACCESSMERGEL");
    $content->setVariable("LABEL_ACCESSMERGEL", str_replace("%MAILTO", $mailto, gettext("There is a problem with the access settings. Please <a href=\"%MAILTO\">contact the support team</a> to fix it by setting the access rights again.")));
    $content->parse("BLOCK_ACCESSMERGEL");
} else {
    $access = lms_wiki::get_access_descriptions($grp);
    if ((string) $grp->get_attribute("OBJ_TYPE") == "course") {
        $access_default = PERMISSION_PUBLIC;
    } else {
        $access_default = PERMISSION_PUBLIC_READONLY;
        if (isset($wiki_container) && is_object($wiki_container) && $creator->get_id() != lms_steam::get_current_user()->get_id()) {
            $access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", $creator->get_name(), $access[PERMISSION_PRIVATE_READONLY]);
        } else {
            $access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", "you", $access[PERMISSION_PRIVATE_READONLY]);
        }
    }
    if (is_array($access)) {
        $content->setCurrentBlock("BLOCK_ACCESS");
        foreach ($access as $key => $array) {
Example #12
0
    function get_html()
    {
        if (!$this->is_finished()) {
            // set onload js to portal
            $mediathek = elearning_mediathek::get_instance();
            /*
             * **********************************************
             * ********* CSS STYLE **************************
             * **********************************************
             */
            $css = <<<END
#loading_overlay {
\tdisplay:block;
\theight:100%;
\twidth:100%;
\tposition:absolute;
\ttop:0;
\tleft:0;
\tbackground-color:white;
\topacity:0.75;
\tfilter: alpha(opacity=75);
\tz-index: 300;
}

#loader img{
\tleft:50%;
\tmargin-left:-17px;
\tmargin-top:-17px;
    position:fixed;
    top:50%;
}
\t\t
.q {
\tdisplay:none;
\topacity: 0;
}

.q_right {
\tdisplay:none;
\topacity: 0;
}

.q_wrong {
\tdisplay:none;
\topacity: 0;
}

.q_active {
\tdisplay: block;
\topacity: 0; 
}

.green{
\tdisplay:block;
\tposition:absolute;
\ttop:0px;
\tleft:0px;
\tz-index:1;
\twidth:0px;
\theight:25px;
\tbackground-color:#A5A12B;
}

.progressbar{
\tfont-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
\tfont-size: 9px;
\tposition: relative;
\ttop:50px;
\tleft:210px;
}

.progressbar_left{
\tposition:absolute;
\ttop:0px;
\tleft:0px;
\theight:26px;
\twidth:13px;
\tz-index:2;
\tbackground-image:url(/styles/stahl-orange/images/pr_l.png);
}

.progressbar_middle{
\tposition:absolute;
\tpadding-top:5px;
\ttext-align:center;
\ttop:0px;
\tleft:13px;
\theight:21px;
\twidth:250px;
\tz-index:2;
\tbackground-image:url(/styles/stahl-orange/images/pr_m.png);
}

.progressbar_right{
\tposition:absolute;
\ttop:0px;
\tleft:263px;
\theight:26px;
\twidth:13px;
\tz-index:2;
\tbackground-image:url(/styles/stahl-orange/images/pr_r.png);
}
END;
            lms_portal::get_instance()->add_css_style($css);
            /*
             * **********************************************
             * ********* ONLOAD JAVASCRIPT ******************
             * **********************************************
             */
            $js_onload = <<<END
document.getElementById('loading_overlay').style.display = 'none';
showQuestion(1);
END;
            lms_portal::get_instance()->add_javascript_onload("elearning_exam", $js_onload);
            /*
             * **********************************************
             * ********* JAVASCRIPT *************************
             * **********************************************
             */
            $js_code = <<<END
function hide_all_questions() {
\tvar allElems = document.getElementsByTagName('div');
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && thisElem.className == 'q_active') {
\t\t\tthisElem.className = 'q';
\t\t\tthisElem.style.display = "none";
\t\t\tthisElem.style.opacity = 0;
\t\t}
\t} 
}

function showQuestion(qnr) {
\tsetprogress((qnr / 19)*100);
\thide_all_questions();
\tdocument.getElementById('q_'+qnr).className = 'q_active';
\tdocument.getElementById('q_'+qnr).style.display = "block";
\tEffect.Fade('q_'+qnr, { duration: 1.0, from: 0, to: 0.9 });
\tupdateButtons();
}

function actualQuestion() {
\tvar allElems = document.getElementsByTagName('div');
\tj = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && thisElem.className == 'q') {
\t\t\tj++;
\t\t} else if (thisElem.className && thisElem.className == 'q_active') {
\t\t\tj++;
\t\t\treturn j;
\t\t}
\t}
}

function countQuestions() {
\tvar allElems = document.getElementsByTagName('div');
\tj = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && (thisElem.className == 'q' || thisElem.className && thisElem.className == 'q_active')) {
\t\t\tj++;
\t\t}
\t}
\treturn j;
}

function showNextQuestion() {
\tshowQuestion(actualQuestion() + 1);
}

function showPrevQuestion() {
\tshowQuestion(actualQuestion() - 1);
}

function updateButtons() {
\tif (actualQuestion() == 1) {
\t\tdocument.images['img_prev'].style.display = 'none';
\t\tdocument.images['img_next'].style.display = 'block';
\t\tdocument.getElementById('finish_button').style.display = 'none';
\t\tdocument.getElementById('back_button').style.display = 'none';
\t} else if (actualQuestion() == countQuestions()) {
\t\tdocument.images['img_prev'].style.display = 'block';
\t\tdocument.images['img_next'].style.display = 'none';
\t\tdocument.getElementById('finish_button').style.display = 'block';
\t\tdocument.getElementById('back_button').style.display = 'block';
\t} else {
\t\tdocument.images['img_prev'].style.display = 'block';
\t\tdocument.images['img_next'].style.display = 'block';
\t\tdocument.getElementById('finish_button').style.display = 'none';
\t\tdocument.getElementById('back_button').style.display = 'none';
\t}
}

function setprogress(i) {
\ti = Math.round(i);
\tif (i > 100) {
\t\ti = 100;
\t}
\tif (i < 0) {
\t\ti = 0;
\t}
\tvar min = 4;
\tvar max = 277;
\tvar stepsize = (max - min) / 100;
\tdocument.getElementById("green").style.width = Math.round(i * stepsize) + "px";
\tdocument.getElementById("progressbar_middle").innerHTML = "Fortschritt " + i + "%";
}

END;
            lms_portal::get_instance()->add_javascript_code("elearning_exam", $js_code);
            $html = "<div class=\"printonly\" id=\"noprint_exam\"><b>Die Prüfung kann nicht gedruckt werden.</b></div><div id=\"loading_overlay\"><div id=\"loader\"><img src=\"/styles/stahl-orange/images/loader_gr.gif\" /></div></div>";
            $html .= "<div class=\"noprint\" id=\"elearning_exam\">";
            $html .= "<h1>" . $this->get_name() . "</h1>";
            $html .= "<img style=\"float:right\" src=\"/styles/stahl-orange/images/exam.jpg\" />";
            $html .= "<p>" . $this->get_description() . "</p>";
            $html .= "<div class=\"progressbar\">\n\t\t\t\t\t<div class=\"green\" id=\"green\"/></div>\n\t\t\t\t\t<div class=\"progressbar_left\"></div>\n\t\t\t\t\t<div class=\"progressbar_middle\" id=\"progressbar_middle\">Fortschritt 0%</div>\n\t\t\t\t\t<div class=\"progressbar_right\"></div>\n\t\t\t</div><br clear=\"all\"/>";
            $html .= "<table style=\"width:100%;\"><tr><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;display:none;margin-top:50px;\" name=\"img_prev\" onclick=\"showPrevQuestion()\" onmouseover=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev.png';\" src=\"/styles/stahl-orange/images/prev.png\"></td><td style=\"width:100%;text-align:left\">";
            $html .= $this->get_questions_exam_html();
            $html .= "</td><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;margin-top:50px\" name=\"img_next\" onclick=\"showNextQuestion()\" onmouseover=\"document.images['img_next'].src='/styles/stahl-orange/images/next_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_next'].src='/styles/stahl-orange/images/next.png';\" src=\"/styles/stahl-orange/images/next.png\"></td></table>";
            $html .= "</div>";
            $html .= "\n\t\t\t<div id=\"overlay\"></div>\n\t\t\t<div id=\"message\">\n\t    \t\t<div id=\"messagetext\"></div>\n\t    \t\t<div id=\"messageCloseButton\" onclick=\"closeMessageWindow()\">[<a href=\"javascript:closeMessageWindow()\">Schließen</a>]</div>\n\t\t\t</div>\n\t\t\t";
            $pathprefix = "../units/" . elearning_mediathek::get_instance()->get_unit()->get_id() . "/";
            $html .= "<script type=\"text/javascript\">\n\t \t\tfunction finishexam() {\n\t\t\t\tapath = \"" . $pathprefix . "directaccess\";\n\t\t\t\tnew Ajax.Request(apath,\n\t\t\t\t\t  {\n\t\t\t\t\t    method:'post',\n\t\t\t\t\t    parameters: \"case=finishexam&&eid=" . $this->get_id() . "\",\n\t\t\t\t\t    onFailure: function(){ alert('Error while storing answer.'); },\n\t\t\t\t\t    onSuccess: function(response){window.location.reload();}\n\t\t\t\t\t  });\n\t\t\t\t}\n\t \t\t</script>";
            $html .= "<a style=\"display:none;\" class=\"back_button\" id=\"back_button\" href=\"javascript:showQuestion(1);\">Zur ersten Frage</a>";
            $html .= "<a style=\"display:none;\" class=\"finish_button\" id=\"finish_button\" href=\"javascript:if (confirm('Wollen Sie die Prüfung jetzt wirklich abschließen?')) {document.getElementById('loading_overlay').style.display = 'block';finishexam();}\">Prüfung abschließen</a>";
            return $html;
        } else {
            // set onload js to portal
            $mediathek = elearning_mediathek::get_instance();
            /*
             * **********************************************
             * ********* CSS STYLE **************************
             * **********************************************
             */
            $css = <<<END
#loading_overlay {
\tdisplay:block;
\theight:100%;
\twidth:100%;
\tposition:absolute;
\ttop:0;
\tleft:0;
\tbackground-color:white;
\topacity:0.75;
\tfilter: alpha(opacity=75);
\tz-index: 300;
}

#loader img{
\tleft:50%;
\tmargin-left:-17px;
\tmargin-top:-17px;
    position:fixed;
    top:50%;
}
\t\t
.q {
\tdisplay:none;
\topacity: 0;
}

.q_right {
\tdisplay:none;
\topacity: 0;
}

.q_wrong {
\tdisplay:none;
\topacity: 0;
}

.q_active {
\tdisplay: block;
\topacity: 0; 
}
END;
            lms_portal::get_instance()->add_css_style($css);
            /*
             * **********************************************
             * ********* ONLOAD JAVASCRIPT ******************
             * **********************************************
             */
            $js_onload = <<<END
showQuestion(1);
END;
            lms_portal::get_instance()->add_javascript_onload("elearning_exam", $js_onload);
            /*
             * **********************************************
             * ********* JAVASCRIPT *************************
             * **********************************************
             */
            $js_code = <<<END
function hide_all_questions() {
\tvar allElems = document.getElementsByTagName('div');
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && thisElem.className == 'q_right_active') {
\t\t\tthisElem.className = 'q_right';
\t\t\tthisElem.style.opacity = 0;
\t\t\t//Effect.Hide(thisElem.id);
\t\t} else if (thisElem.className && thisElem.className == 'q_wrong_active') {
\t\t\tthisElem.className = 'q_wrong';
\t\t\tthisElem.style.opacity = 0;
\t\t\t//Effect.Hide(thisElem.id);
\t\t}
\t} 
}

function showQuestion(qnr) {
\tif (countWorngQuestions() == 0) {
\t\thide_all_questions();
\t\tdocument.images['img_prev'].style.display = 'none';
\t\tdocument.images['img_next'].style.display = 'none';
\t\tdocument.getElementById('question_headline').innerHTML = 'Sie haben alle Fragen richtig beantwortet!';
\t\treturn;
\t}

\tif (countWorngQuestions() == 1) {
\t\tdocument.getElementById('question_headline').innerHTML = 'Nicht korrekt beantwortete Frage';
\t} else {
\t\tdocument.getElementById('question_headline').innerHTML = 'Nicht korrekt beantwortete Fragen';
\t}
\t
\tif (qnr > countQuestions()) {
\t\treturn;
\t}
\tif (document.getElementById('q_'+qnr).className == 'q_right') {
\t\tif (actualQuestion() > qnr) {
\t\t\tshowQuestion(qnr-1);
\t\t} else {
\t\t\tshowQuestion(qnr+1);
\t\t}
\t\treturn;
\t} 
\t
\thide_all_questions();
\tdocument.getElementById('q_'+qnr).className = document.getElementById('q_'+qnr).className + '_active';
\tEffect.Appear('q_'+qnr);
\tupdateButtons();
}

function actualQuestion() {
\tvar allElems = document.getElementsByTagName('div');
\tj = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && (thisElem.className == 'q_right' || thisElem.className == 'q_wrong')) {
\t\t\tj++;
\t\t} else if (thisElem.className && (thisElem.className == 'q_right_active' || thisElem.className == 'q_wrong_active')) {
\t\t\tj++;
\t\t\treturn j;
\t\t}
\t}
}

function countQuestions() {
\tvar allElems = document.getElementsByTagName('div');
\tj = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif (thisElem.className && (thisElem.className == 'q_right' || thisElem.className == 'q_wrong' || thisElem.className && thisElem.className == 'q_right_active' || thisElem.className && thisElem.className == 'q_wrong_active')) {
\t\t\tj++;
\t\t}
\t}
\treturn j;
}

function countWorngQuestions() {
\tvar allElems = document.getElementsByTagName('div');
\tj = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif ((thisElem.className && thisElem.className == 'q_wrong') || (thisElem.className && thisElem.className == 'q_wrong_active')) {
\t\t\tj++;
\t\t}
\t}
\treturn j;
}

function showNextQuestion() {
\tshowQuestion(actualQuestion() + 1);
}

function showPrevQuestion() {
\tshowQuestion(actualQuestion() - 1);
}

function updateButtons() {
\tif (hasPrevWrongQuestion()) {
\t\tdocument.images['img_prev'].style.display = 'block';
\t} else {
\t\tdocument.images['img_prev'].style.display = 'none';
\t}
\t
\tif (hasNextWrongQuestion()) {
\t\tdocument.images['img_next'].style.display = 'block';
\t} else {
\t\tdocument.images['img_next'].style.display = 'none';
\t}
}

function hasPrevWrongQuestion() {
\tvar allElems = document.getElementsByTagName('div');
\tvar j = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif ((thisElem.className && thisElem.className == 'q_right') || (thisElem.className && thisElem.className == 'q_wrong') || (thisElem.className && thisElem.className == 'q_right_active') || (thisElem.className && thisElem.className == 'q_wrong_active')) {
\t\t\tj++;
\t\t\tif (j == actualQuestion()) {
\t\t\t\tfor (var k = i-1; k >= 0; k--) {
\t\t\t\t\tvar nthisElem = allElems[k];
\t\t\t\t\tif ((nthisElem.className && nthisElem.className == 'q_wrong') || (nthisElem.className && nthisElem.className == 'q_wrong_active')) {
\t\t\t\t\t\treturn true;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t}
\t\t}
\t}
\treturn false;
}

function hasNextWrongQuestion() {
\tvar allElems = document.getElementsByTagName('div');
\tvar j = 0;
\tfor (var i = 0; i < allElems.length; i++) {
\t\tvar thisElem = allElems[i];
\t\tif ((thisElem.className && thisElem.className == 'q_right') || (thisElem.className && thisElem.className == 'q_wrong') || (thisElem.className && thisElem.className == 'q_right_active') || (thisElem.className && thisElem.className == 'q_wrong_active')) {
\t\t\tj++;
\t\t\tif (j == actualQuestion()) {
\t\t\t\tfor (var k = i+1; k < allElems.length; k++) {
\t\t\t\t\tvar nthisElem = allElems[k];
\t\t\t\t\tif ((nthisElem.className && nthisElem.className == 'q_wrong') || (nthisElem.className && nthisElem.className == 'q_wrong_active')) {
\t\t\t\t\t\treturn true;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t}
\t\t}
\t}
\treturn false;
}

END;
            lms_portal::get_instance()->add_javascript_code("elearning_exam", $js_code);
            $html = "<div class=\"printonly\" id=\"noprint_exam\"><b>Die Prüfungsergbnisse können nicht gedruckt werden.</b></div><div class=\"noprint\" id=\"elearning_exam\">";
            $elearning_user = elearning_user::get_instance($this->myUser->get_name(), elearning_mediathek::get_instance()->get_course()->get_id());
            if ($elearning_user->has_exam_passed()) {
                $html .= "<h2>Herzlichen Glückwunsch!</h2>";
                $html .= "Sie haben bei der Prüfung zum Kurs »" . $this->get_parent()->get_name() . "« <b>" . $elearning_user->get_exam_sum_score() . " von " . $elearning_user->get_exam_sum_points() . "</b> möglichen Punkten erreicht. Dieses Prüfungsergebnis wird auch den Ansprechpartnern zu dem Kurs angezeigt.<br/><br/>";
                $html .= "Zur abgelegten Prüfung haben Sie ein Zertifikat erhalten, das Sie auch später noch auf Ihrer persönlichen Einstiegsseite abrufen können. Klicken Sie auf das Vorschaubild des Zertifikats bzw. auf »Herunterladen«, wenn Sie es auf Ihrem Computer speichern oder ausdrucken möchten.<br/><br/>";
                $html .= "Falls Sie nicht alle Fragen richtig beantwortet haben, sehen Sie im Folgenden die nicht vollständig korrekt beantworteten Fragen. Sie können auch später erneut auf »Prüfung« klicken, um sich die nicht vollständig korrekt beantworteten Fragen anzeigen zu lassen.<br/><br/>";
                $html .= "Wenn Sie zum Kurs oder zu der Prüfung eine Frage haben, können Sie auf den Namen eines Ansprechpartners für diesen Kurs klicken, um mit ihm bzw. ihr in Kontakt zu treten.";
                $html .= "<div style=\"float:right;margin-top:15px;text-align:center\"><a href=\"" . "/download/" . $elearning_user->get_exam_cert()->get_id() . "/" . $elearning_user->get_exam_cert()->get_name() . "\"><img src=\"" . "/download/" . $elearning_user->get_exam_cert_preview()->get_id() . "/" . $elearning_user->get_exam_cert_preview()->get_name() . "\" /><br /> <small>Herunterladen</a></small></div>";
            } else {
                $html .= "<h2>Leider hat es nicht gereicht!</h2>";
                $html .= "Sie haben bei der Prüfung zum Kurs »" . $this->get_parent()->get_name() . "« die benötigten Punkte nicht erreicht. Dieses Prüfungsergebnis wird auch den Ansprechpartnern zu dem Kurs angezeigt.<br/><br/>";
                $html .= "Im Folgenden können Sie sich die nicht vollständig korrekt beantworteten Fragen ansehen. Sie können auch später erneut auf »Prüfung« klicken, um sich die nicht vollständig korrekt beantworteten Fragen anzeigen zu lassen. Auch die Inhalte des Kurses können Sie jederzeit anschauen und sich mit den Inhalten noch einmal beschäftigen.<br/><br/>";
                $html .= "Wenn Sie zum Kurs oder zu der Prüfung eine Frage haben, können Sie auf den Namen eines Ansprechpartners für diesen Kurs klicken, um mit ihm bzw. ihr in Kontakt zu treten. Er bzw. sie wird Ihnen auch mitteilen, wie Sie die Prüfung zu gegebener Zeit noch einmal ablegen können.";
            }
            global $course;
            $content = new HTML_TEMPLATE_IT();
            $content->loadTemplateFile(PATH_EXTENSIONS . "units_elearning/templates/exam.staff.template.html");
            $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 . "cached/get_document.php?id=" . $admin_attributes["OBJ_ICON"]->get_id() . "&type=usericon&width=40&height=47" : PATH_STYLE . "images/anonymous.jpg";
                    $content->setVariable("ADMIN_ICON", $icon_link);
                    $adminDescription = $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($admin->get_attribute("USER_EMAIL")) && $admin->get_attribute("USER_EMAIL") != "" && $admin->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 .= $content->get();
            $html .= "<br clear=\"all\"><h3 id=\"question_headline\"></h3>";
            $html .= "<table style=\"width:100%;\"><tr><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;display:none;margin-top:50px;\" name=\"img_prev\" onclick=\"showPrevQuestion()\" onmouseover=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev.png';\" src=\"/styles/stahl-orange/images/prev.png\"></td><td style=\"width:100%;text-align:left\">";
            $html .= $this->get_questions_exam_result_html();
            $html .= "</td><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;margin-top:50px\" name=\"img_next\" onclick=\"showNextQuestion()\" onmouseover=\"document.images['img_next'].src='/styles/stahl-orange/images/next_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_next'].src='/styles/stahl-orange/images/next.png';\" src=\"/styles/stahl-orange/images/next.png\"></td></table>";
            $html .= "</div>";
            return $html;
        }
    }
Example #13
0
 $isFiltered = false;
 $isEditMode = false;
 $filter = "filter=booked";
 $mode = "mode=edit";
 if (isset($_GET["filter"]) && $_GET["filter"] == "booked") {
     $isFiltered = true;
 }
 if (isset($_GET["mode"]) && $_GET["mode"] == "edit") {
     $isEditMode = true;
 }
 if ($isFiltered) {
     if (ALL_COURSES) {
         $content->setCurrentBlock("BLOCK_ALL_COURSES");
         $content->setVariable("LABEL_MY_COURSES", gettext("All courses"));
         $content->setVariable("LINK_MY_COURSES", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . ($isEditMode ? "/?" . $mode : "/"));
         $content->parse("BLOCK_ALL_COURSES");
     }
 } else {
     if (YOUR_COURSES) {
         $content->setCurrentBlock("BLOCK_YOUR_COURSES");
         $content->setVariable("LABEL_MY_COURSES", gettext("My courses"));
         $content->setVariable("LINK_MY_COURSES", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/?filter=booked" . ($isEditMode ? "&" . $mode : ""));
         $content->parse("BLOCK_YOUR_COURSES");
     }
 }
 if ($isEditMode) {
     $content->setCurrentBlock("BLOCK_EDIT_MODE");
     $content->setVariable("LABEL_EDIT_MODE", gettext("Disable edit mode"));
     $content->setVariable("LINK_EDIT_MODE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . ($isFiltered ? "/?" . $filter : "/"));
     $content->parse("BLOCK_EDIT_MODE");
 } else {
Example #14
0
 public function processData(\IRequestObject $requestObject)
 {
     $htmlBody = "";
     $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();
     //hack
     //include_once("/Users/mjako/koala-development-workspace-next/koala-core/lib/bid/slashes.php");
     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();
     }
     $UBB = new \UBBCode();
     include_once PATH_BASE . "koala-core/lib/bid/derive_url.php";
     $portletInstance = \PortletTopic::getInstance();
     $portletPath = $portletInstance->getExtensionPath();
     $portletFileName = $portletPath . "/ui/html/index.html";
     $tmpl = new \HTML_TEMPLATE_IT();
     $tmpl->loadTemplateFile($portletFileName);
     $tmpl->setVariable("PORTLET_ID", $portlet->get_id());
     $tmpl->setVariable("PORTLET_NAME", $portletName);
     //refernce icon
     if ($portletIsReference) {
         $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
     }
     //popupmenu main
     if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("PortletTopic");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setCommand("GetPopupMenu");
         $popupmenu->setParams(array(array("key" => "menu", "value" => "nerd")));
         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
         $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     }
     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());
         $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     }
     if (sizeof($content) > 0) {
         $categoryCount = 0;
         foreach ($content as $category) {
             $tmpl->setCurrentBlock("category");
             //popupmenu category
             if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                 $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_CATEGORY");
                 $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                 $popupmenu = new \Widgets\PopupMenu();
                 $popupmenu->setData($portlet);
                 $popupmenu->setNamespace("PortletTopic");
                 $popupmenu->setElementId("portal-overlay");
                 $popupmenu->setCommand("GetPopupMenuCategory");
                 $popupmenu->setParams(array(array("key" => "category", "value" => $categoryCount)));
                 $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
                 $tmpl->parse("BLOCK_EDIT_BUTTON_CATEGORY");
             }
             $tmpl->setVariable("CATEGORY_TITLE", $UBB->encode($category["title"]));
             $tmpl->setVariable("TOPIC_ENTRY", "");
             if (isset($category["topics"])) {
                 $entryCount = 0;
                 foreach ($category["topics"] as $topic) {
                     $tmpl->setCurrentBlock("topic_entry");
                     //popupmenu topic
                     if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_TOPIC");
                         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                         $popupmenu = new \Widgets\PopupMenu();
                         $popupmenu->setData($portlet);
                         $popupmenu->setNamespace("PortletTopic");
                         $popupmenu->setElementId("portal-overlay");
                         $popupmenu->setCommand("GetPopupMenuEntry");
                         $popupmenu->setParams(array(array("key" => "category", "value" => $categoryCount), array("key" => "entry", "value" => $entryCount)));
                         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
                         $tmpl->parse("BLOCK_EDIT_BUTTON_TOPIC");
                     }
                     if (trim($topic["link_url"]) != "") {
                         $tmpl->setCurrentBlock("TOPIC_LINK");
                         $tmpl->setVariable("TOPIC_TITLE", $UBB->encode($topic["title"]));
                         $tmpl->setVariable("TOPIC_LINK_URL", revealPath($topic["link_url"], $portlet->get_path()));
                         $tmpl->setVariable("TOPIC_LINK_TARGET", $topic["link_target"] == "checked" ? "_blank" : "_top");
                         $tmpl->parse("TOPIC_LINK");
                     } else {
                         $tmpl->setCurrentBlock("TOPIC_NOLINK");
                         $tmpl->setVariable("TOPIC_TITLE", $UBB->encode($topic["title"]));
                         $tmpl->parse("TOPIC_NOLINK");
                     }
                     $tmpl->setVariable("TOPIC_DESCRIPTION", $UBB->encode($topic["description"]));
                     //if there is a url parse headline as link
                     if (trim($topic["link_url"]) == "") {
                         //$tmpl->parse("TOPIC_DISPLAY_TITLE", "topic_display_title");
                     } else {
                         //$tmpl->parse("TOPIC_DISPLAY_TITLE", "topic_display_title_link");
                     }
                     //if there is a description parse out
                     $tmpl->setCurrentBlock("topic_display_description");
                     if (trim($topic["description"]) == "") {
                         $tmpl->setVariable("TOPIC_DISPLAY_DESCRIPTION", "");
                     } else {
                         //$tmpl->parse("TOPIC_DISPLAY_DESCRIPTION", "topic_display_description");
                     }
                     $tmpl->parse("topic_display_description");
                     //parse out every topic
                     $tmpl->parse("topic_entry");
                     $entryCount++;
                 }
             }
             //parse out category
             $tmpl->parse("category");
             $categoryCount++;
         }
     } else {
         $tmpl->setVariable("CATEGORY", "");
     }
     $htmlBody = $tmpl->get();
     $this->content = $htmlBody;
     //widgets
     $outputWidget = new \Widgets\RawHtml();
     $outputWidget->setHtml($htmlBody);
     //popummenu
     $outputWidget->addWidget(new \Widgets\PopupMenu());
     $this->rawHtmlWidget = $outputWidget;
 }
Example #15
0
 public function processData(\IRequestObject $requestObject)
 {
     $objectId = $requestObject->getId();
     $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $portlet_name = $portlet->get_attribute(OBJ_DESC);
     $params = $requestObject->getParams();
     //icon
     $referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png";
     //reference handling
     if (isset($params["referenced"]) && $params["referenced"] == true) {
         $portletIsReference = true;
         $referenceId = $params["referenceId"];
     } else {
         $portletIsReference = false;
     }
     //hack
     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 = \PortletAppointment::getInstance();
     $portletPath = $portletInstance->getExtensionPath();
     $portletFileName = $portletPath . "/ui/html/index.html";
     $tmpl = new \HTML_TEMPLATE_IT();
     $tmpl->loadTemplateFile($portletFileName);
     $tmpl->setVariable("PORTLET_ID", $portlet->get_id());
     $tmpl->setVariable("APPOINTMENT_NAME", $portlet_name);
     $tmpl->setVariable("linkurl", "");
     //refernce icon
     if ($portletIsReference) {
         $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
     }
     //main popupmenu
     if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("PortletAppointment");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setCommand("GetPopupMenu");
         $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());
     }
     $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     $UBB = new \UBBCode();
     include_once PATH_BASE . "koala-core/lib/bid/derive_url.php";
     if (sizeof($content) > 0) {
         $indexCount = 0;
         foreach ($content as $appointment) {
             $tmpl->setCurrentBlock("BLOCK_TERM");
             //term popupmenu
             if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                 $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
                 $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                 $popupmenu = new \Widgets\PopupMenu();
                 $popupmenu->setCommand("GetPopupMenuTerm");
                 $popupmenu->setData($portlet);
                 $popupmenu->setNamespace("PortletAppointment");
                 $popupmenu->setElementId("portal-overlay");
                 $popupmenu->setParams(array(array("key" => "termIndex", "value" => $indexCount)));
                 $tmpl->setVariable("POPUPMENU_ENTRY", $popupmenu->getHtml());
                 $tmpl->parse("BLOCK_EDIT_BUTTON_TERM");
             }
             $indexCount++;
             $tmpl->setVariable("STARTDATE", $appointment["start_date"]["day"] . "." . $appointment["start_date"]["month"] . "." . $appointment["start_date"]["year"]);
             if (trim($appointment["location"]) != "" && trim($appointment["location"]) != "0") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_LOCATION");
                 $tmpl->setVariable("LOCATION", $UBB->encode($appointment["location"]));
                 $tmpl->setVariable("LOCATION_ROW", "");
                 $tmpl->parse("BLOCK_TERM_LOCATION");
             }
             if ($appointment["end_date"]["day"] != "") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_ENDDATE");
                 $tmpl->setVariable("ENDDATE", $appointment["end_date"]["day"] . "." . $appointment["end_date"]["month"] . "." . $appointment["end_date"]["year"]);
                 $tmpl->setVariable("ENDDATE_ROW", "");
                 $tmpl->parse("BLOCK_TERM_ENDDATE");
             }
             if ($appointment["start_time"]["hour"] != "") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_TIME");
                 $tmpl->setVariable("TIME", $appointment["start_time"]["hour"] . "." . $appointment["start_time"]["minutes"] . " Uhr");
                 $tmpl->setVariable("TIME_ROW", "");
                 $tmpl->parse("BLOCK_TERM_TIME");
             }
             if (trim($appointment["description"]) != "" && trim($appointment["description"]) != "0") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_DESCRIPTION");
                 $tmpl->setVariable("DESCRIPTION", $UBB->encode($appointment["description"]));
                 $tmpl->parse("BLOCK_TERM_DESCRIPTION");
             }
             if (trim($appointment["linkurl"]) != "" && trim($appointment["linkurl"]) != "0") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_LINK");
                 $tmpl->setVariable("LINKURL", derive_url($appointment["linkurl"]));
                 $tmpl->setVariable("TOPIC", $UBB->encode($appointment["topic"]));
                 $tmpl->parse("BLOCK_TERM_LINK");
             } else {
                 $tmpl->setCurrentBlock("BLOCK_TERM_NOLINK");
                 $tmpl->setVariable("TOPIC", $UBB->encode($appointment["topic"]));
                 $tmpl->parse("BLOCK_TERM_NOLINK");
             }
             $tmpl->parse("BLOCK_TERM");
         }
     }
     $htmlBody = $tmpl->get();
     $this->content = $htmlBody;
     //widgets
     $outputWidget = new \Widgets\RawHtml();
     $outputWidget->setHtml($htmlBody);
     //popummenu
     $outputWidget->addWidget(new \Widgets\PopupMenu());
     $this->rawHtmlWidget = $outputWidget;
 }
Example #16
0
$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"));
        $content->setVariable("VALUE_LINK_TARGET", "target='_blank'");
        $content->parse("BLOCK_LINK");
    }
}
$html_handler->set_html_left($content->get());
$portal->set_page_main($html_handler->get_headline(), $html_handler->get_html(), "");
$portal->show_html();
exit;
Example #17
0
        if ($mime === "image/jpg" || $mime === "image/jpeg" || $mime === "image/gif" || $mime === "image/png") {
            $images[] = $object;
        }
    }
    foreach ($images as $image) {
        $widget->setCurrentBlock("BLOCK_IMAGE");
        $widget->setVariable("WIKI_IMAGE_NAME", $image->get_name());
        $widget->setVariable("WIKI_IMAGE_ADD_LINK", "javascript:insert('[[Image:" . $image->get_identifier() . "]]', '', 'formular', 'values[body]')");
        $widget->setVariable("WIKI_IMAGE_VIEW_LINK", $image->get_name());
        $widget->setVariable("WIKI_IMAGE_TITLE", $image->get_name() . " ( " . $image->get_attribute(OBJ_DESC) . " )");
        $widget->setVariable("WIKI_IMAGE_LINK", PATH_URL . "get_document?id=" . $image->get_id() . "&width=40&height=80");
        $widget->setVariable("WIKI_IMAGE_VIEW_LINK", PATH_URL . "doc/" . $image->get_id() . "/");
        $widget->setVariable("WIKI_IMAGE_TITLE", $image->get_name());
        $widget->setVariable("WIKI_IMAGE_ADD", gettext("Insert"));
        $widget->setVariable("WIKI_IMAGE_VIEW", gettext("View"));
        $widget->parse("BLOCK_IMAGE");
    }
}
$widget->setVariable("UPLOAD_TEXT", gettext("Upload an image"));
$widget->setVariable("UPLOAD_LINK", PATH_URL . "upload?env=" . $wiki_container->get_id());
$widget->setVariable("WIKI_IMAGE_EXTERNAL", gettext("External image"));
$widget->setVariable("WIKI_IMAGE_EXTERNAL_LINK", "javascript:insert('[[Image:http://', ']]', 'formular', 'values[body]')");
$content->setCurrentBlock("BLOCK_WIDGET");
$content->setVariable("WIDGET_TITLE", gettext("Images"));
$content->setVariable("WIDGET_HTML_CODE", $widget->get());
$content->parse("BLOCK_WIDGET");
if ($create) {
    $pagetitle = gettext("New Article");
} else {
    $pagetitle = str_replace("%NAME", h(substr($wiki_doc->get_name(), 0, -5)), gettext("Edit '%NAME'?"));
}
Example #18
0
            $autor = $item->get_attribute("DOC_USER_MODIFIED");
            if (!is_object($autor)) {
                $autor = $item->get_creator();
            }
            $autorname = $autor->get_name();
            $autorstring = "<a href=\"" . PATH_URL . "user/" . $autorname . "/\">" . $autorname . "</a>";
            $modifiedstring = $autorstring . ",<br />" . "<small>" . strftime("%x", $last_modified) . strftime(", %R", $last_modified) . "</small>";
            $content->setVariable("MODIFIED_ITEM", $modifiedstring);
        }
        $content->setVariable("VALUE_VIEWS", str_replace("%NO_VIEWS", count(lms_steam::get_readers($doc)), gettext("%NO_VIEWS views")));
        $content->setVariable("VALUE_COMMENTS", str_replace("%NO_COMMENTS", count($doc->get_annotations()), gettext("%NO_COMMENTS comments")));
        $content->setVariable("LINK_COMMENTS", PATH_URL . "doc/" . $doc->get_id() . "/");
        $content->setVariable("NAME_ITEM", $doc->get_name());
        $desc = $doc->get_attribute("OBJ_DESC") === "" ? gettext("No description available") : $doc->get_attribute("OBJ_DESC");
        $content->setVariable("DESC_ITEM", $desc);
        $content->parse("BLOCK_ITEM");
        $item_ids[] = $doc->get_id();
    }
    $content->parse("BLOCK_INVENTORY");
} else {
    $content->setVariable("LABEL_NO_DOCUMENTS_FOUND", gettext("Sorry, no documents found."));
}
if ($unit->check_access_write(lms_steam::get_current_user())) {
    $content->setCurrentBlock('BLOCK_STAFF');
    $infotext = '';
    if (is_array($item_ids) && count($item_ids) > 0) {
        $content->setCurrentBlock('BLOCK_DRAG_DROP');
        $portal->add_javascript_code('units_docpool', 'containerStart=0; containerEnd=' . count($item_ids) . '; itemIds=Array(' . implode(',', $item_ids) . ');');
        $content->setVariable('CONTAINER_ID', $unit->get_id());
        $content->setVariable('KOALA_VERSION', KOALA_VERSION);
        $content->setVariable('PATH_JAVASCRIPT', PATH_JAVASCRIPT);
Example #19
0
$content->loadTemplateFile(PATH_TEMPLATES . "groups_create.template.html");
if (CREATE_PUBLIC_GROUP && CREATE_PRIVATE_GROUP) {
    $content->setVariable("INFO_TEXT", gettext("There are 2 types of groups on koaLA: <b>public</b> and <b>private</b>."));
    $content->setVariable("CHOOSE_TEXT", gettext("Choose which sort of group you'd like to start"));
    $content->setVariable("QUICK_SEARCH_TEXT_WIDTH", "200");
} else {
    $content->setVariable("QUICK_SEARCH_TEXT_WIDTH", "500");
}
$content->setVariable("QUICK_SEARCH_TEXT", str_replace("%l", "<a href=\"" . PATH_URL . "groups/\">" . gettext("quick search") . "</a>", gettext("There are some groups on koaLA yet. Would you like to do a %l to make sure someone hasn't already started the group you're about to make?")));
if (CREATE_PUBLIC_GROUP) {
    $content->setCurrentBlock("BLOCK_CREATE_PUBLIC_GROUP");
    $content->setVariable("VALUE_PARENT_PUBLIC_GROUP", STEAM_PUBLIC_GROUP);
    $content->setVariable("LABEL_PUBLIC", gettext("Public"));
    $content->setVariable("LABEL_CREATE_PUBLIC", gettext("Create"));
    $content->setVariable("FORM_ACTION_PUBLIC", PATH_URL . "groups_create_dsc.php");
    $content->parse("BLOCK_CREATE_PUBLIC_GROUP");
    $public_expl = array(gettext("Public groups are <b>useful for discussion and documents of general subjects</b>"), gettext("Admins can choose to show or hide discussions and/or group pools from non-members."), gettext("You can choose the participant management you like for your public group: Everybody can join the group freely, to join your group participants have to enter a secret password or you have to accept their application becoming a memebr of your group. Anyway, you are free to add members independently from the choosen participant management method."));
    $content->setCurrentBlock("BLOCK_EXPLAIN_PUBLIC_ALL");
    foreach ($public_expl as $e) {
        $content->setCurrentBlock("BLOCK_EXPLAIN_PUBLIC");
        $content->setVariable("EXPLAIN_PUBLIC_TEXT", $e);
        $content->parse("BLOCK_EXPLAIN_PUBLIC");
    }
    $content->parse("BLOCK_EXPLAIN_PUBLIC_ALL");
}
if (CREATE_PRIVATE_GROUP) {
    $content->setCurrentBlock("BLOCK_CREATE_PRIVATE_GROUP");
    $content->setVariable("VALUE_PARENT_PRIVATE_GROUP", STEAM_PRIVATE_GROUP);
    $content->setVariable("LABEL_PRIVATE", gettext("Private"));
    $content->setVariable("LABEL_CREATE_PRIVATE", gettext("Create"));
    $content->setVariable("FORM_ACTION_PRIVATE", PATH_URL . "groups_create_dsc.php");
Example #20
0
 public function getHtmlForUrl(UrlRequestObject $urlRequestObject)
 {
     $steam = $GLOBALS["STEAM"];
     //current room steam object
     if (isset($object) && (int) $object != 0) {
         $current_room = steam_factory::get_object($steam->get_id(), $object);
     } else {
         $current_room = $steam->get_current_steam_user()->get_workroom();
     }
     //current room steam object
     //$current_room = ($object != 0)?new steam_object($object):$steam->get_workroom_user($steam->login_user);
     $current_room_path = $current_room->get_path(1);
     $current_room_data = $current_room->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_LAST_CHANGED, "bid:tags", "bid:presentation", "bid:collectiontype", "bid:description"), 1);
     $current_room_creator = $current_room->get_creator(1);
     //check if user may write in this folder
     $write_allowed = $current_room->check_access_write($steam->get_current_steam_user(), 1);
     //get inventory and inventorys attributes if allowed to
     $allowed = $current_room->check_access_read($steam->get_current_steam_user(), 1);
     $result = $steam->buffer_flush();
     $write_allowed = $result[$write_allowed];
     $allowed = $result[$allowed];
     $current_room_path = $result[$current_room_path];
     $current_room_data = $result[$current_room_data];
     $current_room_creator = $result[$current_room_creator];
     $current_room_creator_name = $current_room_creator->get_name();
     $current_room_display_name = str_replace("'s workarea", "", stripslashes($current_room_data[OBJ_NAME]));
     if (isset($current_room_data[OBJ_DESC]) && $current_room_data[OBJ_DESC] != "") {
         $current_room_display_name = $current_room_data[OBJ_DESC];
     }
     $current_room_display_name = str_replace("s workroom.", "", $current_room_display_name);
     $current_room_display_name = str_replace("s workroom", "", $current_room_display_name);
     $current_room_display_name = preg_replace("/.*'s bookmarks/", "Lesezeichen", $current_room_display_name);
     if ($allowed && $current_room instanceof steam_container) {
         $inventory = $current_room->get_inventory("", array("DOC_MIME_TYPE", "DOC_LAST_MODIFIED", "CONT_LAST_MODIFIED", "OBJ_LAST_CHANGED", "bid:tags", "bid:presentation", "bid:collectiontype", "bid:hidden", "bid:doctype", "bid:description", "DOC_EXTERN_URL", "OBJ_CREATION_TIME"));
     } else {
         $inventory = array();
     }
     if (sizeof($inventory) > 0) {
         $hascontent = true;
     } else {
         $hascontent = false;
     }
     //get head mounted content if needed
     $head_mounted = $current_room_data["bid:presentation"] === "head" && is_array($inventory) && isset($inventory[0]) && $inventory[0] instanceof steam_document;
     if ($head_mounted) {
         $tmp_content = new doc_content($steam, $inventory[0]);
         $head_mounted_content = $tmp_content->get_content($config_webserver_ip);
     }
     //******************************************************
     //** Display Stuff
     //******************************************************
     //template stuff
     $contenttemplate = new HTML_TEMPLATE_IT();
     $contenttemplate->loadTemplateFile($this->getExtensionPath() . "ui/taggedfolder.template.html");
     $contenttemplate->setVariable("FOLDER_ID", $current_room->get_id());
     $contenttemplate->setVariable("FOLDER_NAME", $current_room_display_name);
     //$contenttemplate->setVariable("FOLDER_PATH", PATH_URL . $current_room_path . "/");
     //$contenttemplate->setVariable("FOLDER_ICON", (($current_room_data["bid:presentation"] === "index")?"$config_webserver_ip/icons/mimetype/folder_closed_index.gif":"$config_webserver_ip/icons/mimetype/folder_closed.gif"));
     $contenttemplate->setVariable("FOLDER_LAST_CHANGED", date("d.m.Y H:i", $current_room_data[OBJ_LAST_CHANGED]));
     if (sizeof($inventory) == 0) {
         $contenttemplate->setCurrentBlock("no_content");
         $contenttemplate->setVariable("LANGUAGE_NO_CONTENT", gettext("LANGUAGE_NO_CONTENT"));
         $contenttemplate->parse("no_content");
     }
     return $contenttemplate->get();
     //set menu to write mode, if the user's access rights allow so and the user is not the guest user
     if ($write_allowed && $steam->get_login_user()->get_name() != "guest") {
         //$tpl->set_var("MENU",derive_menu("contentframe", $current_room, $current_room_path, 2));
     }
     //display directory
     //$content = false;
     $tnr = array();
     foreach ($inventory as $item) {
         $tnr[$item->get_id()] = array();
         $tnr[$item->get_id()]["creator"] = $item->get_creator(1);
         $tnr[$item->get_id()]["writeaccess"] = $item->check_access_write($steam->get_login_user(), 1);
         if ($item instanceof steam_document) {
             $tnr[$item->get_id()]["contentsize"] = $item->get_content_size(1);
         }
         if ($item instanceof steam_link) {
             $tnr[$item->get_id()]["link_object"] = $item->get_link_object(1);
         }
     }
     $result = $steam->buffer_flush();
     $creators = array();
     $linktargets = array();
     $accessresult = array();
     $sizeresult = array();
     foreach ($inventory as $item) {
         $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
         $accessresult[$item->get_id()] = $result[$tnr[$item->get_id()]["writeaccess"]];
         if ($item instanceof steam_document) {
             $sizeresult[$item->get_id()] = $result[$tnr[$item->get_id()]["contentsize"]];
         }
         if ($item instanceof steam_link) {
             $linktargets[$item->get_id()] = $result[$tnr[$item->get_id()]["link_object"]];
         }
     }
     steam_factory::load_attributes($steam, $creators, array(OBJ_NAME));
     // If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
     // insert caching mechanisms in here...
     // below this, the steam connector is no longer used...
     $tags = array();
     foreach ($inventory as $item) {
         if (!$item instanceof steam_trashbin) {
             $itemname = $item->get_attribute(OBJ_NAME);
             $itemdescription = $item->get_attribute(OBJ_DESC);
             $itemmimetype = $item->get_attribute(DOC_MIME_TYPE);
             $lastchanged = $item->get_attribute(DOC_LAST_MODIFIED);
             if ($lastchanged === 0) {
                 $lastchanged = $item->get_attribute(OBJ_CREATION_TIME);
             }
             // set display name
             if ($itemdescription != "") {
                 $object_display_name = $itemdescription;
             } else {
                 $object_display_name = stripslashes($itemname);
             }
             $owner = $creators[$item->get_id()]->get_name();
             $bidDescription = $item->get_attribute("bid:description");
             $bidTags = $item->get_attribute("bid:tags");
             if (!$bidDescription) {
                 $bidDescription = "";
             }
             if (!$bidTags) {
                 $bidTags = "";
             }
             foreach (explode(" ", $bidTags) as $tag) {
                 $tag = trim($tag);
                 if (strlen($tag) > 0) {
                     if (!in_array($tag, $tags)) {
                         array_push($tags, $tag);
                     }
                 }
             }
             $tpl->set_var(array("OBJECT_ID" => $item->get_id(), "OBJECT_NAME" => $object_display_name, "OBJECT_NAME_GREY" => $object_display_name, "OBJECT_FILENAME" => stripslashes($itemname), "OBJECT_LAST_CHANGED" => date("d.m.Y H:i", $lastchanged), "bid:description" => $bidDescription, "bid:tags" => $bidTags, "OBJECT_OWNER" => $owner));
             if ($show_hidden) {
                 if ($content == false && $head_mounted) {
                     $tpl->parse("OBJECT_NAME", "head_mounted_name");
                 } else {
                     if ($item->get_attribute("bid:hidden")) {
                         $tpl->parse("OBJECT_NAME", "grey_name");
                     }
                 }
             } else {
                 if ($item->get_attribute("bid:hidden")) {
                     continue;
                 }
             }
             //parse correct Properties symbol
             $access = $accessresult[$item->get_id()];
             $tpl->parse("ITEM_PROPERTIES", $access ? "item_properties_on" : "item_properties_off");
             $visible = false;
             // render a steam_document
             if ($item instanceof steam_document) {
                 //derive mimetype
                 $mimetype = derive_icon(array("object" => $item, "name" => $itemname, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:doctype" => $item->get_attribute("bid:doctype"), "mimetype" => $itemmimetype));
                 //derive size
                 $size = $sizeresult[$item->get_id()];
                 $tpl->set_var(array("OBJECT_SIZE" => $size > 1048576 ? round($size / 1048576 + 0.05, 1) . " MB" : round($size / 1024 + 0.5) . " kB", "OBJECT_ICON" => $mimetype));
                 //care for documents not to be displayed in the browser
                 if ($itemmimetype === "text/html" || $itemmimetype === "text/plain" || $itemmimetype === "text/css" || $itemmimetype === "text/xml" || $itemmimetype === "application/vnd.google-earth.kml+xml" || $itemmimetype === "image/gif" || $itemmimetype === "image/jpg" || $itemmimetype === "image/jpeg" || $itemmimetype === "image/png") {
                     $tpl->parse("ITEM_LINK", "document");
                     $tpl->parse("DOCUMENTS", "item", true);
                 } else {
                     $tpl->parse("ITEM_LINK", "nb_document");
                     $tpl->parse("DOCUMENTS", "item", true);
                 }
                 $visible = true;
             } else {
                 if ($item instanceof steam_link || $item instanceof steam_exit) {
                     $linked_object = $linktargets[$item->get_id()];
                     if ($item instanceof steam_link) {
                         if ($itemdescription != "") {
                             $name = $itemdescription;
                         } else {
                             $name = $itemname;
                         }
                         if ($linked_object instanceof steam_document) {
                             $size = $linked_object->get_content_size();
                             $tpl->set_var(array("OBJECT_SIZE" => $size > 1048576 ? round($size / 1048576 + 0.05, 1) . " MB" : round($size / 1024 + 0.5) . " kB"));
                         } else {
                             $tpl->set_var(array("OBJECT_SIZE" => ""));
                         }
                     }
                     if ($item instanceof steam_exit) {
                         if ($itemdescription != "") {
                             $name = str_replace("s workroom.", "", stripslashes($itemdescription));
                         } else {
                             $name = str_replace("'s workarea", "", stripslashes($itemname));
                         }
                     }
                     //derive mimetype
                     $mimetype = derive_icon(array("object" => $item, "name" => $itemname, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:doctype" => $item->get_attribute("bid:doctype"), "mimetype" => $itemmimetype));
                     $tpl->set_var(array("LINK_OBJECT_ID" => is_object($linked_object) ? $linked_object->get_id() : -1, "OBJECT_NAME" => $name, "OBJECT_ICON" => $mimetype));
                     $tpl->parse("ITEM_LINK", "link");
                     $tpl->parse("DOCUMENTS", "item", true);
                     $visible = true;
                 } else {
                     if ($item instanceof steam_docextern) {
                         $url = derive_url($item->get_attribute(DOC_EXTERN_URL));
                         $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_LINK" => $url, "OBJECT_ICON" => "./icons/mimetype/www.gif"));
                         $tpl->parse("ITEM_LINK", "www-link");
                         $tpl->parse("DOCUMENTS", "item", true);
                         $visible = true;
                     } else {
                         if ($item->get_attribute("bid:doctype") != "") {
                             $icon = array("bid:doctype" => $item->get_attribute("bid:doctype"));
                             $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon)));
                             $tpl->parse("ITEM_LINK", "folder");
                             $tpl->parse("DOCUMENTS", "item", true);
                             $visible = true;
                         } else {
                             if ($item instanceof steam_messageboard) {
                                 $icon = array("object" => $item);
                                 $tpl->set_var(array("OBJECT_NAME" => stripslashes($itemname), "OBJECT_NAME_GREY" => stripslashes($itemname), "OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon)));
                                 $tpl->parse("ITEM_LINK", "folder");
                                 $tpl->parse("DOCUMENTS", "item", true);
                                 $visible = true;
                             } else {
                                 if ($item instanceof steam_container && !$item instanceof steam_user) {
                                     $icon = array("object" => $item, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:presentation" => $item->get_attribute("bid:presentation"));
                                     $icon = derive_icon($icon);
                                     $lastchanged = $item->get_attribute("CONT_LAST_MODIFIED");
                                     if ($lastchanged === 0) {
                                         $lastchanged = $item->get_attribute(OBJ_CREATION_TIME);
                                     }
                                     $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_ICON" => $icon, "OBJECT_LAST_CHANGED" => date("d.m.Y H:i", $lastchanged)));
                                     $tpl->parse("ITEM_LINK", "folder");
                                     $tpl->parse("DOCUMENTS", "item", true);
                                     $visible = true;
                                 }
                             }
                         }
                     }
                 }
             }
             //parse javascript mark/unmark
             if ($visible) {
                 $tpl->parse("MARK", "mark", 1);
                 $tpl->parse("UNMARK", "unmark", 1);
             }
             $content = $content || $visible;
         }
     }
     //  if(!$content) $tpl->parse("DOCUMENTS", "no_content");
     natsort($tags);
     $tagString = implode(" ", $tags);
     $tpl->set_var(array("TAGS" => $tagString));
     $_SESSION["tags"] = $tagString;
     out();
     //Logout & Disconnect
     $steam->disconnect();
     function out()
     {
         //parse all out
         global $tpl;
         $tpl->parse("OUT", "content");
         $tpl->p("OUT");
     }
 }
Example #21
0
        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();
$creator_data = $creator->get_attributes(array("USER_FULLNAME", "USER_FIRSTNAME", "OBJ_ICON"));
$content->setVariable("LABEL_FROM_AND_AGO", str_replace("%N", "<a href=\"" . PATH_URL . "/user/" . $creator->get_name() . "/\">" . h($creator_data["USER_FIRSTNAME"]) . " " . h($creator_data["USER_FULLNAME"]) . "</a>", gettext("by %N")) . "," . how_long_ago($object->get_attribute("OBJ_CREATION_TIME")));
$icon = $creator_data["OBJ_ICON"];
if ($icon instanceof steam_object) {
    $icon_id = $icon->get_id();
} else {
    $icon_id = 0;
}
$content->setVariable("ICON_SRC", PATH_URL . "get_document.php?id=" . $icon_id);
$rootlink = lms_steam::get_link_to_root($wiki_container);
Example #22
0
 function get_content($id)
 {
     define("PATH_CURRENT_EXTENSION", PATH_PUBLIC . "bid/extension/journal/");
     global $portal;
     $journal = steam_factory::get_object($GLOBALS['STEAM']->get_id(), $id);
     /* get permissions */
     $readable = $journal->check_access_read($GLOBALS['STEAM']->get_current_steam_user(), 1);
     $writeable = $journal->check_access_write($GLOBALS['STEAM']->get_current_steam_user(), 1);
     $result = $GLOBALS['STEAM']->buffer_flush();
     $readable = $result[$readable];
     $writeable = $result[$writeable];
     /* fetch columns */
     $columns = $journal->get_inventory(CLASS_CONTAINER, array(OBJ_TYPE, "bid:journal:column:width"));
     $columnPortlets = array();
     /* now fetch portlets in all columns; buffering to be done */
     foreach ($columns as $column) {
         if ($column->get_attribute(OBJ_TYPE) != "container_portalColumn_bid") {
             continue;
         }
         $columnPortlets[$column->get_id()] = $column->get_inventory("", array(OBJ_NAME, OBJ_DESC, "bid:portlet", "bid:portlet:content"));
     }
     /*
      * Fill template and display
      */
     if (!$readable) {
         die("Ansicht nicht m&ouml;glich!<br>");
     }
     $content = new HTML_TEMPLATE_IT();
     $content->loadTemplateFile(PATH_CURRENT_EXTENSION . "templates/journal.index.template.html");
     $portal->set_page_title($journal->get_name());
     $portal->add_css_style_link(PATH_CURRENT_EXTENSION . "css/journal.css");
     $portal_width = 0;
     foreach ($columns as $column) {
         /* begin new column */
         $content->setCurrentBlock("portal_column");
         /* set column width */
         $column_width = $column->get_attribute("bid:portal:column:width");
         $portal_width += $column_width;
         $content->setVariable("PORTAL_COLUMN_WIDTH", $column_width);
         /* render editing area for column */
         if ($writeable && $GLOBALS["STEAM"]->get_current_steam_user()->get_name() != "guest") {
             $content->setVariable("PORTAL_COLUMN_ID", $column->get_id());
         }
         /* render portlets */
         if (sizeof($columnPortlets[$column->get_id()]) > 0) {
             foreach ($columnPortlets[$column->get_id()] as $portlet) {
                 if ($portlet->get_attribute("bid:portlet")) {
                     /* get the linked portlet if neccessary */
                     if ($portlet instanceof steam_link) {
                         $portlet = $portlet->get_link_object();
                     }
                     /* get content of portlet */
                     $portlet_content = $portlet->get_attribute("bid:portlet:content");
                     if (is_array($portlet_content) && count($portlet_content) > 0) {
                         array_walk($portlet_content, "_stripslashes");
                     } else {
                         $portlet_content = array();
                     }
                     /* get portlet data in handy format */
                     $portlet_name = $portlet->get_attribute(OBJ_DESC);
                     if (trim($portlet_name) == "") {
                         $portlet_name = $portlet->get_attribute(OBJ_NAME);
                     }
                     $portlet_type = $portlet->get_attribute("bid:portlet");
                     /* produce portlet output and store in output buffer =>
                      * $portlet_content */
                     ob_start();
                     include PATH_CURRENT_EXTENSION . "portlets/{$portlet_type}/view.php";
                     $portlet_content = ob_get_contents();
                     ob_end_clean();
                 } else {
                     $portlet_content = "&nbsp;";
                 }
                 $content->setVariable("PORTLET", $portlet_content);
             }
         }
         $content->parse("portal_column");
     }
     /* set portal width */
     $content->setVariable("PORTAL_WIDTH", $portal_width);
     /* return content */
     return $content->get();
 }
Example #23
0
$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");
        $content->setVariable("EXTENSION_ID", $extension_name);
        $content->setVariable("EXTENSION_NAME", $extension->get_display_name());
        $content->setVariable("EXTENSION_DESC", $extension->get_display_description());
        if ($extension->is_enabled($group)) {
            $content->setVariable("EXTENSION_ENABLED", "checked='checked'");
        }
        $content->parse("BLOCK_EXTENSION");
        $extension_list[] = $extension_name;
    }
    $content->setVariable("VALUE_EXTENSIONS", implode("/", $extension_list));
    $content->parse("BLOCK_EXTENSIONS");
}
if ($is_public) {
    // PUBLIC GROUP
    if ($create_new) {
        $privacy_deny_participants_default = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS;
        //TODO //Voreinstellung?!
        $privacy_deny_documents_default = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS;
        $values["privacy_deny_participants"] = $privacy_deny_participants_default;
        $values["privacy_deny_documents"] = $privacy_deny_documents_default;
        $content->setCurrentBlock("BLOCK_CATEGORIES");
        $content->setVariable("LABEL_CATEGORIES", gettext("Categories"));
Example #24
0
<p>
  {LABEL_POINTLIST_INFO}
  {LABEL_POINTLIST_DATA}
</p>
<!-- END BLOCK_POINTLIST -->
*/
$pointlist_object = $tutorial->get_attribute("UNIT_POINTLIST");
if (is_object($pointlist_object)) {
    include_once PATH_EXTENSIONS . "units_pointlist/classes/units_pointlist.extension.class.php";
    $proxy = $pointlist_object->get_attribute("UNIT_POINTLIST_PROXY");
    if (is_object($proxy)) {
        $content->setCurrentBlock("BLOCK_POINTLIST");
        $content->setVariable("LABEL_POINTLIST_HEADER", gettext("Pointlist"));
        $content->setVariable("LABEL_POINTLIST_INFO", str_replace("%LINK", "<a href='" . $course->get_url() . "units/" . $pointlist_object->get_id() . "/'>" . $pointlist_object->get_name() . "</a>", gettext("View the pointlist '%LINK'")));
        $content->setVariable("LABEL_POINTLIST_DATA", $plc);
        $content->parse("BLOCK_POINTLIST");
    }
}
//////////////////////////////////////////////////////////////////
// Documents
$attributes = array(DOC_LAST_MODIFIED, DOC_USER_MODIFIED);
$docs = $tutorial->get_workroom()->get_inventory(0, $attributes);
if (count($docs) > 0) {
    $content->setCurrentBlock("BLOCK_INVENTORY");
    $content->setVariable("LABEL_DOCNAME_DESCRIPTION", gettext("Name/Description"));
    $content->setVariable("LABEL_SIZE", gettext("File size"));
    $content->setVariable("LABEL_MODIFIED", gettext("Last modified"));
    $content->setVariable("LABEL_INFO", gettext("Info"));
    $content->setVariable("LABEL_ACTIONS", gettext("Actions"));
    $creator_tnr = array();
    foreach ($docs as $doc) {
Example #25
0
        if ($width > 160) {
            $newHeight = (int) ($height * 160 / $width);
            $newWidth = 160;
        }
        if ($newHeight > 80) {
            $newWidth = (int) ($newWidth * 80 / $newHeight);
            $newHeight = 80;
        }
        $content->setCurrentBlock("BLOCK_IMAGE");
        $content->setVariable("IMAGE_NAME", $image->get_name());
        $content->setVariable("IMAGE_ID", $image->get_id());
        $content->setVariable("IMAGE_DESCRIPTION", $image->get_attribute('OBJ_DESC'));
        $content->setVariable("IMAGE_LINK", PATH_URL . "get_document.php?id=" . $image->get_id() . "&width=" . $newWidth . "&height=" . $newHeight);
        $content->setVariable("PREVIEW_LINK", "javascript:showBox(" . $image->get_id() . "," . $width . "," . $height . ");");
        $content->setVariable("IMAGE_ACTIONS", $actions);
        $content->parse("BLOCK_IMAGE");
    }
}
$question = gettext("Do you really want to delete this image?");
$note = gettext("NOTE: All wiki-entries containing this image have to be updated manually!");
$content->setVariable("QUESTION", $question);
$content->setVariable("NOTE", $note);
$content->setVariable("LABEL_CLOSE", gettext("close"));
$content->setVariable("BACK_LINK", PATH_URL . "wiki/" . $wiki_container->get_id() . "/");
$content->setVariable("BACK_LABEL", gettext("back"));
$wiki_html_handler->set_main_html($content->get());
// breadcrumbs
$rootlink = lms_steam::get_link_to_root($wiki_container);
WIKI_FULL_HEADLINE ? $headline = array($rootlink[0], $rootlink[1], array("link" => $rootlink[1]["link"] . "communication/", "name" => gettext("Communication")), array("name" => h($wiki_container->get_name()), "link" => PATH_URL . "wiki/" . $wiki_container->get_id() . "/"), array("link" => "", "name" => gettext("Mediathek"))) : ($headline = array(array("name" => h($wiki_container->get_name()), "link" => PATH_URL . "wiki/" . $wiki_container->get_id() . "/"), array("link" => "", "name" => gettext("Mediathek"))));
$portal->set_page_main($headline, $wiki_html_handler->get_html());
$portal->show_html();
Example #26
0
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "messages_read.template.html");
$mail_headers = $message->get_attribute("MAIL_MIMEHEADERS");
if (!is_array($mail_headers)) {
    $mail_headers = array();
}
if (array_key_exists("X-Steam-Group", $mail_headers)) {
    $groupname = $mail_headers["X-Steam-Group"];
    $content->setCurrentBlock("BLOCK_GROUP");
    $content->setVariable("LABEL_TO", gettext("To"));
    if ($group = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $groupname)) {
        $content->setVariable("VALUE_GROUP", "<a href=\"" . PATH_URL . "groups/" . $group->get_id() . "/members/\">" . $group->get_name() . "</a>");
    } else {
        $content->setVariable("VALUE_GROUP", h($groupname));
    }
    $content->parse("BLOCK_GROUP");
}
$message_sender_html = "";
if ($is_sent) {
    $content->setVariable("LABEL_FROM", gettext("To"));
    // construct the HTML output for the field "receiver"
    $mailto = $message->get_attribute("mailto");
    if (!is_array($mailto)) {
        $mailto = array($mailto);
    }
    $message_sender_html_buffer = "";
    $multiple = FALSE;
    foreach ($mailto as $receiver) {
        if (is_object($receiver)) {
            $senderlogin = $receiver->get_name();
            $display_withlink = FALSE;
Example #27
0
    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"));
}
if ($is_admin) {
    $examChoosen = 0;
    if (isset($examTerm)) {
        $examChoosen = $examTerm;
    }
    $content->setVariable("INFO_EXAM_NUMBER", "Viewing page for Exam term " . $examChoosen);
    if ($examChoosen == 0) {
        $content->setVariable("INFO_EXAM_NUMBER", gettext("Please choose an exam term"));
    }
Example #28
0
 public function processData(\IRequestObject $requestObject)
 {
     $objectId = $requestObject->getId();
     $portletInstance = \PortletMedia::getInstance();
     $portletPath = $portletInstance->getExtensionPath();
     $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;
     }
     //hack
     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();
     }
     if (sizeof($content) > 0) {
         $portletFileName = $portletPath . "/ui/html/index.html";
         $tmpl = new \HTML_TEMPLATE_IT();
         $tmpl->loadTemplateFile($portletFileName);
         //popupmenu
         if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
             $popupmenu = new \Widgets\PopupMenu();
             $popupmenu->setData($portlet);
             $popupmenu->setNamespace("PortletMedia");
             $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());
         }
         $tmpl->setVariable("EDIT_BUTTON", "");
         $tmpl->setVariable("PORTLET_ID", $portlet->get_id());
         $tmpl->setVariable("HEADLINE", $content["headline"]);
         //refernce icon
         if ($portletIsReference) {
             $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
         }
         $tmpl->setVariable("URL", $content["url"]);
         $tmpl->setVariable("DESCRIPTION", $content["description"]);
         $media_type = $content["media_type"];
         if ($media_type == "image") {
             $tmpl->setCurrentBlock("image");
             $tmpl->parse("MEDIA_ELEMENT", "image");
             $tmpl->parse("image");
         } else {
             if ($media_type == "movie") {
                 $tmpl->setCurrentBlock("movie");
                 $width = str_replace(array("px", "%"), "", $portlet->get_environment()->get_attribute("bid:portal:column:width")) - 10;
                 $media_player = $portletInstance->getAssetUrl() . 'mediaplayer.swf';
                 $tmpl->setVariable("MEDIA_PLAYER", $media_player);
                 $tmpl->setVariable("MEDIA_PLAYER_WIDTH", $width);
                 $tmpl->setVariable("MEDIA_PLAYER_HEIGHT", round($width * 3 / 4));
                 $tmpl->parse("movie");
             } else {
                 if ($media_type == "audio") {
                     $tmpl->setCurrentBlock("audio");
                     $width = str_replace(array("px", "%"), "", $portlet->get_environment()->get_attribute("bid:portal:column:width")) - 10;
                     $media_player = $portletInstance->getAssetUrl() . 'emff_lila_info.swf';
                     $tmpl->setVariable("MEDIA_PLAYER", $media_player);
                     $tmpl->setVariable("MEDIA_PLAYER_WIDTH", $width);
                     $tmpl->setVariable("MEDIA_PLAYER_HEIGHT", round($width * 11 / 40));
                     $tmpl->parse("audio");
                 }
             }
         }
         if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
             $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON");
             $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
             $tmpl->parse("BLOCK_EDIT_BUTTON");
         }
         //output
         $htmlBody = $tmpl->get();
     } else {
         //output for no content
         $htmlBody = "";
     }
     $this->content = $htmlBody;
     //widgets
     $outputWidget = new \Widgets\RawHtml();
     $outputWidget->setHtml($htmlBody);
     //popummenu
     $popupmenu = new \Widgets\PopupMenu();
     $popupmenu->setData($portlet);
     $popupmenu->setNamespace("PortletMedia");
     $popupmenu->setElementId("portal-overlay");
     $outputWidget->addWidget($popupmenu);
     $this->rawHtmlWidget = $outputWidget;
 }
Example #29
0
    $content->setVariable("VALUE_CONTAINER_DESC", h($desc));
}
$long_desc = $main_result[$main_tnr["OBJ_LONG_DESC"]];
if (is_string($long_desc)) {
    $content->setVariable("VALUE_CONTAINER_LONG_DESC", get_formatted_output($long_desc));
}
$can_write = $main_result[$main_tnr["can_write"]];
// don't show clipboard when viewing clipboard contents as a folder:
if (!$container->get_root_environment() instanceof steam_user) {
    //clipboard:
    $koala_user = new koala_html_user($user);
    $clipboard_menu = $koala_user->get_clipboard_menu($koala_container);
    if (CLIPBOARD) {
        $content->setCurrentBlock("BLOCK_CLIPBOARD");
        $content->setVariable("CLIPBOARD_HTML", $clipboard_menu->get_html());
        $content->parse("BLOCK_CLIPBOARD");
    }
}
if (!is_array($inventory) || count($inventory) == 0) {
    $content->setCurrentBlock("BLOCK_EMPTY_INVENTORY");
    $content->setVariable("LABEL_NO_DOCUMENTS_FOUND", gettext("There are no documents available yet.") . "<br /><br />");
    $content->parse("BLOCK_EMPTY_INVENTORY");
} else {
    // Prefetch needed data
    $attributes = array(OBJ_CREATION_TIME, DOC_LAST_MODIFIED, DOC_USER_MODIFIED, OBJ_DESC, DOC_EXTERN_URL, OBJ_ICON, OBJ_NAME);
    $data_tnr = array();
    $only_containers = TRUE;
    foreach ($inventory as $item) {
        $data_tnr[$item->get_id()] = array();
        $data_tnr[$item->get_id()]["attributes"] = $item->get_attributes($attributes, TRUE);
        if ($item instanceof steam_document) {
Example #30
0
/*
 *  Assure translations for statuses are available via gettext
 */
gettext("student");
gettext("staff member");
gettext("guest");
gettext("alumni");
$stati = array("student", "staff member", "guest", "alumni");
foreach ($stati as $status) {
    $content->setCurrentBlock("BLOCK_STATUS");
    $content->setVariable("VALUE_STATUS", $status);
    if ($status === $user_profile["OBJ_DESC"]) {
        $content->setVariable("STATUS_SELECTED", 'selected="selected"');
    }
    $content->setVariable("VALUE_STATUS_TRANSLATED", secure_gettext($status));
    $content->parse("BLOCK_STATUS");
}
$academicTitle = (string) $user_profile["USER_ACADEMIC_TITLE"];
switch ($academicTitle) {
    case "Dr.":
        $content->setVariable("TITLE_DR_SELECTED", 'selected="selected"');
        break;
    case "PD Dr.":
        $content->setVariable("TITLE_PRIVDOZDR_SELECTED", 'selected="selected"');
        break;
    case "Prof.":
        $content->setVariable("TITLE_PROF_SELECTED", 'selected="selected"');
        break;
    case "Prof. Dr.":
        $content->setVariable("TITLE_PROFDR_SELECTED", 'selected="selected"');
        break;