Esempio n. 1
0
 public function processData(\IRequestObject $requestObject)
 {
     if ($requestObject instanceof \UrlRequestObject) {
         $this->params = $requestObject->getParams();
         isset($this->params[0]) ? $this->id = $this->params[0] : "";
     } else {
         if ($requestObject instanceof \IdRequestObject) {
             $this->id = $requestObject->getId();
         }
     }
     $steam = $GLOBALS["STEAM"];
     //get singleton and portlet path
     $portalInstance = \Portal::getInstance();
     $portalPath = $portalInstance->getExtensionPath();
     //template
     $templateFileName = $portalPath . "/ui/html/index.html";
     $tmpl = new \HTML_TEMPLATE_IT();
     $tmpl->loadTemplateFile($templateFileName);
     $this->getExtension()->addCSS();
     $this->getExtension()->addJS();
     $currentUser = $GLOBALS["STEAM"]->get_current_steam_user();
     $object = $currentUser->get_workroom();
     $objectId = $this->id;
     //get the portal object
     $this->portalObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $type = getObjectType($this->portalObject);
     if (!($type === "portal")) {
         \ExtensionMaster::getInstance()->send404Error();
         die;
     }
     \Portal::getInstance()->setPortalObject($this->portalObject);
     //get the content of the portal object
     $portalColumns = $this->portalObject->get_inventory();
     $htmlBody = "";
     $extensionMaster = \ExtensionMaster::getInstance();
     $count = 0;
     $htmlCollectorColRow[][] = array();
     $col = 0;
     $row = 0;
     $this->rawHtmlWidget = new \Widgets\RawHtml();
     foreach ($portalColumns as $columnObject) {
         $columnObjectId = $columnObject->get_id();
         $widgets = $extensionMaster->getWidgetsByObjectId($columnObjectId, "view");
         $this->rawHtmlWidget->addWidgets($widgets);
         $data = \Widgets\Widget::getData($widgets);
         $htmlBody .= $data["html"];
         $count++;
     }
     $currentUser = $GLOBALS["STEAM"]->get_current_steam_user();
     if (isset($this->portalObject) && $this->portalObject->check_access_write($currentUser)) {
         $htmlBody .= "<script>if (readCookie(\"portalEditMode\") === \"{$objectId}\") {portalLockButton({$objectId})}</script>";
     }
     $tmpl->setVariable("BODY", $htmlBody);
     $htmlBodyTemplated = $tmpl->get();
     $this->rawHtmlWidget->setHtml($htmlBodyTemplated);
 }
 function get_question_script_exam_html($pathprefix, $eid)
 {
     $content = new HTML_TEMPLATE_IT();
     $content->loadTemplateFile(PATH_TEMPLATES_UNITS_ELEARNING . "elearning_question_multiplechoice.template.html");
     $content->setCurrentBlock("BLOCK_CHECKBOX");
     $content->setVariable("IMAGE_CHECKBOX_SELECTED_ENABLED", IMAGE_CHECKBOX_SELECTED_ENABLED);
     $content->setVariable("IMAGE_CHECKBOX_SELECTED_DISENABLED", IMAGE_CHECKBOX_SELECTED_DISABLED);
     $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_ENABLED", IMAGE_CHECKBOX_UNSELECTED_ENABLED);
     $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_DISENABLED", IMAGE_CHECKBOX_UNSELECTED_DISABLED);
     $content->setVariable("IMAGE_CHECKBOX_LOADER", IMAGE_CHECKBOX_LOADER);
     $content->parseCurrentBlock();
     $content->setCurrentBlock("BLOCK_EXAM_QUESTION_JAVASCRIPT");
     $content->setVariable("PATHPREFIX", $pathprefix);
     $content->setVariable("EID", $eid);
     $content->parseCurrentBlock();
     return $content->get();
 }
Esempio n. 3
0
            $cache->drop("lms_portal::get_menu_html", $user->get_name(), TRUE);
            if (!$group->is_member($user)) {
                $backlink = PATH_URL . 'desktop/';
            }
            header('Location: ' . $backlink);
        } else {
            $portal->set_problem_description($result["problem"], $result["hint"]);
        }
    } else {
        $portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here."));
    }
}
// GET
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "groups_join.template.html");
$content->setVariable("BACKLINK", $backlink);
if ($group->requested_membership($user)) {
    if (empty($_SESSION['confirmation'])) {
        // don't warn if we came here on successful membership request...
        if ($group instanceof koala_group_course) {
            $portal->set_problem_description(gettext("You have already requested a membership for this course."));
        } else {
            $portal->set_problem_description(gettext("You have already requested a membership for this group."));
        }
    }
} else {
    if ($group->is_member($user)) {
        if (empty($_SESSION['confirmation'])) {
            // don't warn if we came here on successful membership request...
            if ($group instanceof koala_group_course) {
                $portal->set_problem_description(gettext("You are already member of this course."));
Esempio n. 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();
}
Esempio n. 5
0
        $actions = '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/">' . gettext("show properties") . '</a><br>';
        $actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/edit/">' . gettext("edit properties") . '</a><br>';
        $actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/deleteImage/" onclick="return confirmDeletion();">' . gettext("delete image") . '</a>';
        $imageData = imagecreatefromstring($image->get_content());
        $width = $newWidth = imagesx($imageData);
        $height = $newHeight = imagesy($imageData);
        if ($width > 160) {
            $newHeight = (int) ($height * 160 / $width);
            $newWidth = 160;
        }
        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"));
Esempio n. 6
0
        $html_handler_group = new koala_html_group($group);
        $html_handler_group->set_context("members");
        $members = $cache->call("lms_steam::group_get_members", $group->get_id());
        break;
}
$is_admin = $group->is_admin($user);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html");
$is_member = $group->is_member($user);
//echo "is_member? " . $is_member;
$privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY");
//echo "attribute: ''" . $privacy_deny_participants . "''";
if ($privacy_deny_participants == PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS && !$is_member) {
    //echo "*** deny ***";
    //TODO
    $content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", gettext("Participants are hidden."));
} else {
    //echo "*** permit ***";
    $no_members = count($members);
    if ($no_members > 0) {
        switch (get_class($group)) {
            case "koala_group_course":
                $groupname = $group->get_course_id();
                break;
            default:
                $groupname = $group->get_name();
                break;
        }
        if (!USER_LIST_NO_PAGEING) {
            $start = $portal->set_paginator($content, 10, $no_members, "(" . str_replace("%NAME", h($groupname), gettext("%TOTAL members in %NAME")) . ")");
            $end = $start + 10 > $no_members ? $no_members : $start + 10;
Esempio n. 7
0
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
$content->setVariable("LABEL_BB_URL", gettext("URL"));
$content->setVariable("HINT_BB_URL", gettext("web link"));
$content->setVariable("LABEL_BB_MAIL", gettext("MAIL"));
$content->setVariable("HINT_BB_MAIL", gettext("email link"));
//hier Voreinstellung?!
//$values[ "privacy_deny_participants" ] = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS; //TODO
//$values[ "privacy_deny_documents" ] = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS;
//$privacy_deny_participants_default = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS;
//$privacy_deny_documents_default = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS;
if ($create_new && $is_public || $grouptype !== "group_moderated" && $grouptype !== "group_private") {
    // Add group maxsize field
    $m = new HTML_TEMPLATE_IT();
    $m->loadTemplateFile(PATH_TEMPLATES . "groups_maxsize_widget.template.html");
    $m->setCurrentBlock("BLOCK_MAXSIZE");
    $m->setVariable("LABEL_MAXSIZE", gettext("Max number of participants"));
    $m->setVariable("LABEL_MAXSIZE_DSC", gettext("To limit the max number of participants for your course enter a number greater than 0. Leave this field blank or enter a '0' for no limitation."));
    isset($values["maxsize"]) ? $m->setVariable("VALUE_MAXSIZE", h($values["maxsize"])) : "";
    $mhtml = $m->get();
}
$content->setVariable("BACKLINK", "<a class=\"button\" href=\"{$backlink}\">" . gettext("back") . "</a>");
// extensions:
if (count($extensions) > 0) {
    $content->setCurrentBlock("BLOCK_EXTENSIONS");
    $content->setVariable("LABEL_EXTENSIONS", gettext("Extensions"));
    $extension_list = array();
    foreach ($extensions as $extension) {
        $extension_name = $extension->get_name();
        $content->setCurrentBlock("BLOCK_EXTENSION");
        $content->setVariable("EXTENSION_ID", $extension_name);
        $content->setVariable("EXTENSION_NAME", $extension->get_display_name());
Esempio n. 8
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;
 }
Esempio n. 9
0
$inventory = $wiki_container->get_inventory();
if (!is_array($inventory)) {
    $inventory = array();
}
if (sizeof($inventory) > 0) {
    steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $inventory, array(OBJ_NAME, OBJ_DESC, DOC_MIME_TYPE));
    $images = array();
    foreach ($inventory as $object) {
        $mime = strtolower($object->get_attribute(DOC_MIME_TYPE));
        if ($mime === "image/jpg" || $mime === "image/jpeg" || $mime === "image/gif" || $mime === "image/png") {
            $images[] = $object;
        }
    }
    foreach ($images as $image) {
        $widget->setCurrentBlock("BLOCK_IMAGE");
        $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]')");
Esempio n. 10
0
            //$excelRowArray[$matriculationNumber]=$examOffice->getExcelRowString($tmpFileDestination, $matriculationNumber); //HIS excel
            $firstName = $ldapManager->matriculationNumber2firstName($matriculationNumber);
            $lastName = $ldapManager->matriculationNumber2lastName($matriculationNumber);
            //$imtLogin = $ldapManager->matriculationNumber2imtLogin($matriculationNumber);  //removed for speed
            $matriculationNumbersTable .= "<tr>";
            $matriculationNumbersTable .= "<td>" . $lastName . "</td>";
            $matriculationNumbersTable .= "<td>" . $firstName . "</td>";
            $matriculationNumbersTable .= "<td>" . $matriculationNumber . "</td>";
            $matriculationNumbersTable .= "<td> <input type='checkbox' name='PARTICIPANT_" . $matriculationNumber . "' checked='checked'> </input> </td>";
            $matriculationNumbersTable .= "</tr>";
        }
        $excelRowArray = $examOffice->parseFullExcel2rowStringArray($tmpFileDestination);
        $_SESSION["exam_organization_excelRowArray"] = $excelRowArray;
        //HIS excel
        $matriculationNumbersTable .= "</table>";
        $content->setVariable("MATRICULATION_NUMBERS_TABLE", $matriculationNumbersTable);
        $content->setVariable("INFO_MATRICULATION_NUMBERS_TABLE", gettext("The following matriculation numbers will be added to the exam organization database"));
        $content->setVariable("BUTTON_SAVE_LIST", '<input type="submit" name="import_participants_save" value="' . gettext('Add choosen participants to exam') . '"/>');
        $content->setVariable("BUTTON_SAVE_LIST_REPLACE", '<input type="submit" name="import_participants_save_replace" value="' . gettext('Replace participants for this exam with choosen participants') . '"/>');
        unlink($tmpFileDestination);
        //delete temp file
        $showedParsedTable = true;
    }
}
//end post data
//create site
//some page content
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
Esempio n. 11
0
<?php

if (!defined("PATH_TEMPLATES_UNITS_PYRAMID")) {
    define("PATH_TEMPLATES_UNITS_PYRAMID", PATH_EXTENSIONS . "units_pyramiddiscussion/templates/");
}
//$portal = lms_portal::get_instance();
//$portal->initialize( GUEST_ALLOWED );
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units", array("subcontext" => "unit"));
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_PYRAMID . "units_pyramiddiscussion.template.html");
$content->setVariable("VALUE_DESC", $unit->get_attribute("OBJ_DESC"));
$content->setVariable("VALUE_LONG_DESC", get_formatted_output($unit->get_attribute("OBJ_LONG_DESC")));
$appearance = $unit->get_attribute("UNIT_PYRAMIDDISCUSSION_APPEARANCE");
if ($appearance === 0 || $appearance === "") {
    $appearance = "direct";
}
$unit_url = "https://" . $GLOBALS["STEAM"]->get_config_value("web_server") . ($GLOBALS["STEAM"]->get_config_value("web_port_http") != "443" ? ":" . $GLOBALS["STEAM"]->get_config_value("web_port_http") : "") . $unit->get_steam_object()->get_path() . "/";
$unit_url = str_replace("?", "%3f", $unit_url);
if ($appearance === "direct") {
    header("Location: " . $unit_url);
    exit;
} else {
    if ($appearance == "2") {
        $content->setCurrentBlock("BLOCK_IFRAME");
        $content->setVariable("VALUE_IFRAME_URL", $unit_url);
        $content->parse("BLOCK_IFRAME");
    } else {
        $content->setCurrentBlock("BLOCK_LINK");
        $content->setVariable("VALUE_LINK_URL", $unit_url);
        $content->setVariable("VALUE_LINK_TEXT", gettext("Show pyramiddiscussion"));
Esempio n. 12
0
    	require_once( "Cache/Lite.php" );
    	$cache = new Cache_Lite( array( "cacheDir" => PATH_CACHE ) );
    	$cache->clean( $user->get_name() );
    	$cache->clean( $user->get_id() );*/
    $lang_index = language_support::get_language_index();
    language_support::choose_language($lang_index[$values["USER_LANGUAGE"]]);
    $cache = get_cache_function(lms_steam::get_current_user()->get_name());
    $cache->drop("lms_portal::get_menu_html", lms_steam::get_current_user()->get_name(), TRUE);
    $cache = get_cache_function($user->get_name());
    $cache->drop("lms_steam::user_get_profile", $user->get_name());
    $_SESSION["confirmation"] = gettext("Your profile data has been saved.");
    header("Location: " . PATH_URL . "profile_edit.php");
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "profile_edit.template.html");
$content->setVariable("LABEL_INFO", gettext("Please complete your profile. None of the fields are mandatory. Some of the fields can not be changed due to central identity management at the IMT.<br/><b>Note: With the button <i>Profile Privacy</i> you can control which information can be seen by other users.</b>"));
$content->setVariable("LABEL_PROFILE", gettext("General Information"));
$content->setVariable("LABEL_LOOKING", gettext("Your buddy icon"));
$content->setVariable("LABEL_MAIL_PREFS", gettext("Your mail preferences"));
$content->setVariable("LABEL_PROFILE_PRIVACY", gettext("Profile Privacy"));
$content->setVariable("LINK_BUDDY_ICON", PATH_URL . "profile_icon.php");
$content->setVariable("LINK_MAIL_PREFS", PATH_URL . "messages_prefs.php");
$content->setVariable("LINK_PROFILE_PRIVACY", PATH_URL . "profile_privacy.php");
$content->setVariable("LABEL_FIRST_NAME", gettext("First name"));
$content->setVariable("LABEL_LAST_NAME", gettext("Last name"));
$content->setVariable("LABEL_TITLE", gettext("Academic title"));
$content->setVariable("LABEL_DEGREE", gettext("Academic degree"));
$content->setVariable("LABEL_IF_AVAILABLE", gettext("only if available"));
$content->setVariable("LABEL_STATUS", gettext("Status"));
$content->setVariable("LABEL_GENDER", gettext("Gender"));
$content->setVariable("LABEL_FEMALE", gettext("female"));
Esempio n. 13
0
    // UND EINLOGGE
    // 2 FAELLE: ENTWEDER SERVICE IST BEANTRAGT => FREISCHALTEN
    // SERVICE IST NICHT BEANTRAGT, DANN BEANTRAGEN UND DANN FREISCHALTEN
    echo "Antragsstatus: " . $result . "\n";
    if (!strcmp($result, "NONE") || !strcmp($result, "WANTED")) {
        if (!strcmp($result, "NONE")) {
            // Antrag stellen
            $result = $client->__soapCall('request', $parameter);
            echo "Antragsstatus: " . $result . "\n";
        }
        // Antragstatus bestimmen
        $result = $client->__soapCall('getState', $parameter);
        echo "Antragsstatus: " . $result . "\n";
        // Antrag genehmigen
        $result = $client->__soapCall('approve', $parameter);
        echo "Antragsstatus: " . $result . "\n";
        // Antragstatus bestimmen
        $result = $client->__soapCall('getState', $parameter);
        echo "Antragsstatus: " . $result . "\n";
    }
} elseif (!empty($_SESSION["LDAP_LOGIN"]) && !empty($_SESSION["LDAP_PASSWORD_ENCR"])) {
    $content = new HTML_TEMPLATE_IT(PATH_TEMPLATES);
    $content->loadTemplateFile("disclaimer.de_DE.html");
    $content->setVariable("PATH_IMAGES", PATH_STYLE . "images/");
    $content->setVariable("LDAP_UID", $_SESSION["LDAP_LOGIN"]);
    $portal->set_page_title(gettext("Disclaimer"));
    $portal->set_page_main(gettext("Disclaimer"), $content->get());
} else {
    print "FALSCH AUFGERUFEN";
}
$portal->show_html();
Esempio n. 14
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;
 }
Esempio n. 15
0
    }
    if (!isset($backlink) || empty($backlink)) {
        $upper_link = lms_steam::get_link_to_root($document);
        $backlink = $upper_link["link"];
    }
    if (lms_steam::delete($document)) {
        $_SESSION["confirmation"] = str_replace("%DOC_NAME", $doc_name, gettext("%DOC_NAME successfully deleted."));
        // DASS DAS DOKUMENT IRGENDWO IM CACHE LIEGT, IST MIR ZZT NICHT BEKANNT.
        // FALLS CACHE-BEREINIGUNG NOTWENDIG IST, DANN HIER.
        header("Location: " . $backlink);
        exit;
    } else {
        throw new Exception("Cannot delete document");
    }
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "document_delete.template.html");
$content->setVariable("FORM_ACTION", "");
$content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?"));
$content->setVariable("INFO_DELETE_DOCUMENT", str_replace("%DOCNAME", h($document->get_name()), gettext("You are going to delete %DOCNAME.")));
$content->setVariable("LABEL_DELETE_IT", gettext("YES, DELETE THIS DOCUMENT"));
$content->setVariable("DELETE_BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("LABEL_RETURN", gettext("back"));
// TEST
//				$env = $document->get_environment();
//				if ( is_object( $env ) && is_object( $koala_container = koala_object::get_koala_object( $env ) ) )
//					$backlink = $koala_container->get_url();
//error_log("backlink=" . $backlink);
$portal->set_page_main(array(lms_steam::get_link_to_root($env), array("link" => "", "name" => h($document->get_name()))), $content->get(), "");
$portal->show_html();
Esempio n. 16
0
        $fcache = get_cache_function($object->get_id(), 600);
        $fcache->drop("lms_wiki::get_items", $object->get_id());
        // Clean communication summary cache für the group/course
        if (is_object($workroom)) {
            $cache = get_cache_function(lms_steam::get_current_user()->get_name(), 600);
            $cache->drop("lms_steam::get_inventory_recursive", $workroom->get_id(), CLASS_CONTAINER | CLASS_ROOM, array("OBJ_TYPE", "WIKI_LANGUAGE"));
            $cache->drop("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
        }
        header("Location: " . $values["return_to"]);
        exit;
    }
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "object_delete.template.html");
if ($object->check_access_write($user)) {
    $content->setVariable("LABEL_ARE_YOU_SURE", str_replace("%NAME", h($object->get_name()), gettext("Are you sure you want to delete the wiki '%NAME' ?")));
    $rootlink = lms_steam::get_link_to_root($object);
    $content->setVariable("DELETE_BACK_LINK", $rootlink[1]["link"] . "communication/");
    $content->setCurrentBlock("BLOCK_DELETE");
    $content->setVariable("FORM_ACTION", $_SERVER["REQUEST_URI"]);
    $content->setVariable("LABEL_DELETE_IT", gettext("yes, delete it"));
    $content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]);
    $content->setVariable("LABEL_RETURN", gettext("back"));
    $content->parse("BLOCK_DELETE");
} else {
    $content->setVariable("LABEL_ARE_YOU_SURE", gettext("You have no rights to delete this wiki!"));
}
$content->setVariable("TEXT_INFORMATION", gettext("The Wiki and all its entries will be deleted."));
$creator = $object->get_creator();
$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")));
Esempio n. 17
0
File: home.php Progetto: rolwi/koala
<?php

$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "home.template.html");
$content->setVariable("LABEL_GREETING", gettext("Welcome") . " " . $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname());
$content->setVariable("INFO_TODO_MAILS", "<a href=\"" . PATH_SERVER . "/bid/journal/1599/\">zum Test Journal</a>");
Esempio n. 18
0
File: view.php Progetto: rolwi/koala
<?php

if (sizeof($portlet_content) > 0) {
    $template = new HTML_TEMPLATE_IT();
    $template->loadTemplateFile(PATH_CURRENT_EXTENSION . "portlets/headline/templates/view.html");
    $template->setVariable("ALIGNMENT", trim($portlet_content["alignment"]));
    $template->setVariable("SIZE", trim($portlet_content["size"]));
    $template->setVariable("HEADLINE", $portlet_content["headline"]);
    if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
        $template->setVariable("PORTLET_ID", $portlet->get_id());
        $template->setVariable("PORTLET_ROOT", PATH_CURRENT_EXTENSION . "./portlets/headline");
    }
    echo $template->get();
} else {
    echo "";
}
Esempio n. 19
0
            if (!is_object($docextern)) {
                $docextern = steam_factory::create_docextern($GLOBALS["STEAM"]->get_id(), $values["name"], $values["url"], $env, $values["desc"]);
            } else {
                if (empty($values["desc"])) {
                    $docextern->delete_attribute("OBJ_DESC");
                } else {
                    $docextern->set_attribute("OBJ_DESC", $values["desc"]);
                }
                $docextern->set_name($values["name"]);
                $docextern->set_url($values["url"]);
            }
            header("Location: " . $values["return_to"]);
            exit;
        } else {
            $portal->set_problem_description($problem, $hint);
            $content->setVariable("VALUE_NAME", h($values["name"]));
            $content->setVariable("VALUE_URL", h($values["url"]));
            $content->setVariable("VALUE_DESC", h($values["desc"]));
        }
    }
}
if (isset($docextern) && is_object($docextern)) {
    $content->setVariable("INFO_TEXT", str_replace("%NAME", h($docextern->get_name()), gettext("You are going to edit the weblink '<b>%NAME</b>'.")));
    $content->setVariable("LABEL_SAVE_CHANGES", gettext("Save changes"));
    $pagetitle = gettext("Edit a Weblink");
    if (empty($values)) {
        $values = array();
        $values["name"] = $docextern->get_name();
        $values["dsc"] = $docextern->get_attribute(OBJ_DESC);
        $values["url"] = $docextern->get_attribute(DOC_EXTERN_URL);
    }
Esempio n. 20
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) {
Esempio n. 21
0
        $user->get_attributes(array(OBJ_NAME, USER_FIRSTNAME, USER_FULLNAME));
        foreach ($members as $member) {
            $cache = get_cache_function($member->get_name());
            $cache->drop("lms_steam::user_get_groups", $member->get_name(), TRUE);
            $cache->drop("lms_steam::user_get_groups", $member->get_name(), FALSE);
            $cache->drop("lms_steam::user_get_profile", $member->get_name());
            $cache->drop("lms_portal::get_menu_html", $member->get_name(), TRUE);
        }
        $cache = get_cache_function($steam_group->get_id());
        $cache->drop("lms_steam::group_get_members", $steam_group->get_id());
        foreach ($members as $member) {
            lms_steam::mail($member, $user, PLATFORM_NAME . ": " . str_replace("%NAME", h($group_name), gettext("Group %NAME has been deleted.")), str_replace("%USER", $user->get_name() . " (" . $user->get_attribute(USER_FIRSTNAME) . " " . $user->get_attribute(USER_FULLNAME) . ")", str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted from he koaLA System by %USER."))) . "\n\n-- \n" . str_replace("%NAME", h($group_name), gettext("This system generated notification message was sent to you as a former member of the deleted group \"%NAME\"")));
        }
        $_SESSION["confirmation"] = str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted. A notification has been sent to former members."));
        header("Location: " . $upper_link);
        exit;
    } else {
        throw new Exception("Deletion of group failed");
    }
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "group_delete.template.html");
$content->setVariable("FORM_ACTION", "");
$content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?"));
$content->setVariable("INFO_DELETE_GROUP", str_replace("%GROUP_NAME", h($group->get_name()), gettext("You are going to delete '%GROUP_NAME'.")) . "<br />" . gettext("All data of this group will be removed from the system including weblogs, wikis, forums and documents. All members of this group will be notified about the deletion automatically.") . "<br /><br /><strong>" . gettext("The deletion process may take several minutes.")) . "</strong>";
$content->setVariable("LABEL_DELETE_IT", gettext("Yes, delete this group"));
$content->setVariable("DELETE_BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("LABEL_RETURN", gettext("back"));
$portal->set_page_main(array(lms_steam::get_link_to_root($steam_group), array("link" => "", "name" => gettext("Delete group"))), $content->get(), "");
$portal->show_html();
Esempio n. 22
0
<?php

require_once "../etc/koala.conf.php";
include_once PATH_LIB . "format_handling.inc.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$content = new HTML_TEMPLATE_IT();
$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");
Esempio n. 23
0
$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]);
            }
            $i++;
        }
$start = $portal->get_paginator_start($nr_show);
if (isset($_REQUEST['sort'])) {
    $sort = $_REQUEST['sort'];
} else {
    $sort = FALSE;
}
$pagination_info = $koala_container->get_inventory_paginated($start, $nr_show, $sort);
$inventory = $pagination_info['objects'];
if (!isset($link_path)) {
    $link_path = $koala_container->get_link_path();
}
$base_url = $link_path[0]["link"];
$link_path_index = array_search($path_offset, array_keys($link_path));
if ($link_path_index !== FALSE) {
    $link_path = array_slice($link_path, $link_path_index);
    $content->setVariable("CONTAINER_PATH", $koala_container->get_link_path_html($link_path));
}
$desc = $container->get_attribute("OBJ_DESC");
// don't show description for user clipboards (which would be the user description) or workrooms:
if (is_string($desc) && ($container instanceof steam_user || is_object($creator = $container->get_creator()) && $creator->get_name() . "s workroom" == $desc)) {
    $desc = FALSE;
}
if (is_string($desc)) {
    $content->setVariable("VALUE_CONTAINER_DESC", h($desc));
}
$long_desc = $container->get_attribute("OBJ_LONG_DESC");
if (is_string($long_desc)) {
    $content->setVariable("VALUE_CONTAINER_LONG_DESC", get_formatted_output($long_desc));
}
$can_write = $container->check_access_write($user);
// don't show clipboard when viewing clipboard contents as a folder:
Esempio n. 25
0
$html_handler->set_context("exam_organization");
//set context for context menu
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_EXTENSIONS . PATH_TEMPLATES_EXAM_ORGANIZATION . "exam_organization_setup_password.template.html");
$container = $course->get_workroom();
$is_admin = $course->is_admin($current_user);
if ($is_admin) {
    //clipboard:
    $koala_user = new koala_html_user(new koala_user($current_user));
    //$clipboard_menu = $koala_user->get_clipboard_menu( $koala_container ); //error
    $content->setCurrentBlock("BLOCK_CLIPBOARD");
    //$content->setVariable( "CLIPBOARD_HTML", $clipboard_menu->get_html() );
    $content->parse("BLOCK_CLIPBOARD");
}
//get role
$content->setVariable("ROLE_STATUS", gettext("Your current role is student"));
if ($is_admin) {
    $content->setVariable("ROLE_STATUS", gettext("Your current role is admin/staff member"));
}
//evaluate exam term
$examChoosen = 0;
if (isset($examTerm) && $examTerm == 1) {
    $examChoosen = 1;
}
if (isset($examTerm) && $examTerm == 2) {
    $examChoosen = 2;
}
if (isset($examTerm) && $examTerm == 3) {
    $examChoosen = 3;
}
$content->setVariable("INFO_EXAM_NUMBER", gettext("Viewing page for Exam term") . " " . $examChoosen);
Esempio n. 26
0
        $group->remove_membership_request($candidate);
        $subject = str_replace("%GROUP", $group->get_name(), gettext("Your membership for '%GROUP' was rejected"));
        $message = gettext("Your membership was rejected.");
        $portal->set_confirmation(str_replace("%NAME", $candidate->get_attribute("USER_FIRSTNAME") . " " . $candidate->get_attribute("USER_FULLNAME"), gettext("Membership of %NAME rejected.")));
    }
    //$candidate->mail( $subject, $message, $user->get_attribute( "USER_EMAIL" ));
    lms_steam::mail($candidate, $user, $subject, $message);
}
$result = $group->get_membership_requests();
$html_people = new HTML_TEMPLATE_IT();
$html_people->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html");
$no_people = count($result);
if ($no_people > 0) {
    $start = $portal->set_paginator(10, $no_people, "(" . gettext("%TOTAL membership requests") . ")");
    $end = $start + 10 > $no_people ? $no_people : $start + 10;
    $html_people->setVariable("LABEL_CONTACTS", gettext("Membership requests") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_people), gettext("%a-%z out of %s")) . ")");
    $html_people->setCurrentBlock("BLOCK_CONTACT_LIST");
    $html_people->setVariable("LABEL_NAME_POSITION", gettext("Name, position"));
    $html_people->setVariable("LABEL_SUBJECT_AREA", gettext("Subject area"));
    $html_people->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
    $html_people->setVariable("TH_MANAGE_CONTACT", gettext("Action"));
    foreach ($result as $candidate) {
        $person = $candidate->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_NAME", "OBJ_DESC"));
        $html_people->setCurrentBlock("BLOCK_CONTACT");
        $html_people->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($person["OBJ_NAME"]) . "/");
        if (is_object($person["OBJ_ICON"])) {
            $icon_link = PATH_URL . "cached/get_document.php?id=" . $person["OBJ_ICON"]->get_id() . "&type=usericon";
        } else {
            $icon_link = PATH_STYLE . "images/anonymous.jpg";
        }
        $html_people->setVariable("CONTACT_IMAGE", $icon_link);
Esempio n. 27
0
$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"));
    }
    $numberOfAssignments = $course->get_attribute("EXAM" . $examChoosen . "_number_of_assignments");
    //create table
    $table = "<table>";
Esempio n. 28
0
<?php

$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("reserve_list");
$content = new HTML_TEMPLATE_IT(PATH_TEMPLATES);
$content->loadTemplateFile("list_reserve_list.template.html");
$rl = $course->get_attributes(array("SEM_APP_ID", "SEM_APP_TOKEN"));
$content->setVariable("SEM_APP_BASE_URL", SEM_APP_BASE_URL);
// Global config
$content->setVariable("SEM_APP_ID", $rl["SEM_APP_ID"]);
// sTeam attribute
$content->setVariable("SEM_APP_TOKEN", $rl["SEM_APP_TOKEN"]);
// sTeam attribute
$html_handler_course->set_html_left($content->get());
$portal->set_page_main($html_handler_course->get_headline(), $html_handler_course->get_html(), "");
$portal->show_html();
Esempio n. 29
0
    $nr_show = 10;
}
$start = $portal->get_paginator_start($nr_show);
if (isset($_REQUEST['sort'])) {
    $sort = $_REQUEST['sort'];
} else {
    $sort = FALSE;
}
if (!isset($link_path)) {
    $link_path = $koala_container->get_link_path();
}
$base_url = $link_path[0]["link"];
$link_path_index = array_search($path_offset, array_keys($link_path));
if ($link_path_index !== FALSE) {
    $link_path = array_slice($link_path, $link_path_index);
    $content->setVariable("CONTAINER_PATH", $koala_container->get_link_path_html($link_path));
}
$main_tnr = array();
$main_tnr[OBJ_DESC] = $container->get_attribute(OBJ_DESC, TRUE);
$main_tnr["OBJ_LONG_DESC"] = $container->get_attribute("OBJ_LONG_DESC", TRUE);
$main_tnr["creator"] = $container->get_creator(TRUE);
$main_tnr["can_write"] = $container->check_access_write($user, TRUE);
$main_tnr["inventory"] = $koala_container->get_inventory_paginated($start, $nr_show, $sort, TRUE);
$main_result = $GLOBALS["STEAM"]->buffer_flush();
$pagination_info = $main_result[$main_tnr["inventory"]];
$inventory = $pagination_info['objects'];
$desc = $main_result[$main_tnr[OBJ_DESC]];
// don't show description for user clipboards (which would be the user description) or workrooms:
if (is_string($desc) && ($container instanceof steam_user || is_object($creator = $main_result[$main_tnr["creator"]]) && $creator->get_name() . "s workroom" == $desc)) {
    $desc = FALSE;
}
Esempio n. 30
0
    exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if ($_POST["id"] == $unit->get_id()) {
        try {
            $unit->delete();
            $owner = koala_object::get_koala_object(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["owner"]));
            $backlink = $owner->get_url() . "units/";
        } catch (Exception $exception) {
            $problems = $exception->get_message();
        }
    }
    if (empty($problems)) {
        $_SESSION["confirmation"] = str_replace("%NAME", $unitname, gettext("The unit '%NAME' has been deleted."));
        header("Location: " . $backlink);
        exit;
    } else {
        $portal->set_problem_description($problems, $hints);
    }
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_VILM . "units_vilm_delete.template.html");
$content->setVariable("UNIT_ID", $unit->get_id());
$content->setVariable("OWNER_ID", $owner->get_id());
$content->setVariable("BACK_LINK", $backlink);
$content->setVariable("INFO_TEXT", gettext("Do you really want to delete this unit?"));
$content->setVariable("LABEL_OK", gettext("Delete unit"));
$content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>");
$portal->set_page_main(array($unit->get_link(), array("name" => gettext("Delete this unit"))), $content->get());
$portal->show_html();
exit;