public function processData(\IRequestObject $requestObject) { if ($requestObject instanceof \UrlRequestObject) { $this->params = $requestObject->getParams(); isset($this->params[0]) ? $this->id = $this->params[0] : ""; } else { if ($requestObject instanceof \IdRequestObject) { $this->id = $requestObject->getId(); } } $steam = $GLOBALS["STEAM"]; //get singleton and portlet path $portalInstance = \Portal::getInstance(); $portalPath = $portalInstance->getExtensionPath(); //template $templateFileName = $portalPath . "/ui/html/index.html"; $tmpl = new \HTML_TEMPLATE_IT(); $tmpl->loadTemplateFile($templateFileName); $this->getExtension()->addCSS(); $this->getExtension()->addJS(); $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $object = $currentUser->get_workroom(); $objectId = $this->id; //get the portal object $this->portalObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $type = getObjectType($this->portalObject); if (!($type === "portal")) { \ExtensionMaster::getInstance()->send404Error(); die; } \Portal::getInstance()->setPortalObject($this->portalObject); //get the content of the portal object $portalColumns = $this->portalObject->get_inventory(); $htmlBody = ""; $extensionMaster = \ExtensionMaster::getInstance(); $count = 0; $htmlCollectorColRow[][] = array(); $col = 0; $row = 0; $this->rawHtmlWidget = new \Widgets\RawHtml(); foreach ($portalColumns as $columnObject) { $columnObjectId = $columnObject->get_id(); $widgets = $extensionMaster->getWidgetsByObjectId($columnObjectId, "view"); $this->rawHtmlWidget->addWidgets($widgets); $data = \Widgets\Widget::getData($widgets); $htmlBody .= $data["html"]; $count++; } $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); if (isset($this->portalObject) && $this->portalObject->check_access_write($currentUser)) { $htmlBody .= "<script>if (readCookie(\"portalEditMode\") === \"{$objectId}\") {portalLockButton({$objectId})}</script>"; } $tmpl->setVariable("BODY", $htmlBody); $htmlBodyTemplated = $tmpl->get(); $this->rawHtmlWidget->setHtml($htmlBodyTemplated); }
function get_calendar_html($steam_calendar, $link, $timestamp = "") { if (empty($timestamp)) { $timestamp = time(); } $html = new HTML_TEMPLATE_IT(); $html->loadTemplateFile(PATH_TEMPLATES . "widget_calendar.template.html"); $html->setVariable("VALUE_MONTH", strftime("%b %G", $timestamp)); $html->setVariable("ABBR_SUNDAY", "S"); $html->setVariable("ABBR_MONDAY", "M"); $html->setVariable("ABBR_TUESDAY", "T"); $html->setVariable("ABBR_WEDNESDAY", "W"); $html->setVariable("ABBR_THURSDAY", "T"); $html->setVariable("ABBR_FRIDAY", "F"); $html->setVariable("ABBR_SATURDAY", "S"); $month = date("m", $timestamp); $year = date("Y", $timestamp); $next_month = $month == 12 ? 1 : $month + 1; $next_months_year = $month == 12 ? $year + 1 : $year; $first_day_of_month = strtotime("{$year}-{$month}-01"); $last_day_of_month = strtotime("-1 day", strtotime("{$next_months_year}-{$next_month}-01")); $calendar_entries = $steam_calendar->get_entries($first_day_of_month, $last_day_of_month); $weekday_offset = strftime("%w", $first_day_of_month); $current_day = $first_day_of_month; for ($w = 1; $w <= 6; $w++) { if ($current_day > $last_day_of_month) { break; } $html->setCurrentBlock("BLOCK_WEEK"); for ($wd = 0; $wd <= 6; $wd++) { if ($weekday_offset > 0) { $html->setVariable("WD{$wd}", " "); $weekday_offset--; continue; } if ($current_day > $last_day_of_month) { $html->setVariable("WD{$wd}", " "); $current_day = strtotime("+1 day", $current_day); continue; } $wdstr = strftime("%e", $current_day); $wdentries = $calendar_entries[$current_day]; $wdlabel = $wdentries > 0 ? "<b>{$wdstr}</b>" : $wdstr; $html->setVariable("WD{$wd}", $wdlabel); $current_day = strtotime("+1 day", $current_day); } $html->parse("BLOCK_WEEK"); } return $html->get(); }
function get_question_script_exam_html($pathprefix, $eid) { $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_ELEARNING . "elearning_question_multiplechoice.template.html"); $content->setCurrentBlock("BLOCK_CHECKBOX"); $content->setVariable("IMAGE_CHECKBOX_SELECTED_ENABLED", IMAGE_CHECKBOX_SELECTED_ENABLED); $content->setVariable("IMAGE_CHECKBOX_SELECTED_DISENABLED", IMAGE_CHECKBOX_SELECTED_DISABLED); $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_ENABLED", IMAGE_CHECKBOX_UNSELECTED_ENABLED); $content->setVariable("IMAGE_CHECKBOX_UNSELECTED_DISENABLED", IMAGE_CHECKBOX_UNSELECTED_DISABLED); $content->setVariable("IMAGE_CHECKBOX_LOADER", IMAGE_CHECKBOX_LOADER); $content->parseCurrentBlock(); $content->setCurrentBlock("BLOCK_EXAM_QUESTION_JAVASCRIPT"); $content->setVariable("PATHPREFIX", $pathprefix); $content->setVariable("EID", $eid); $content->parseCurrentBlock(); return $content->get(); }
public function set_content() { $template = new HTML_TEMPLATE_IT(); $template->loadTemplateFile(PORTFOLIO_PATH_TEMPLATES . "manage.template.html"); // Set content on right side $template->setCurrentBlock("BLOCK_DESKTOP_LEFT"); $template->setCurrentBlock("BLOCK_NEXTSTEPS"); $template->setVariable("LABEL_NEXTSTEPS", "Nächste Schritte"); $template->setCurrentBlock("BLOCK_NEXTSTEP"); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_NEXTSTEPS", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); $template->setCurrentBlock("BLOCK_VISIBLE_PORTFOLIOS"); $template->setVariable("LABEL_VISIBLE", "Sichtbare Portfolios"); $template->setCurrentBlock("BLOCK_VISIBLE_BOX"); $template->setVariable("CONTENT_VISIBLE", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_VISIBLE", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_VISIBLE", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); // Set content on left side $template->setCurrentBlock("BLOCK_DESKTOP_RIGHT"); $template->setCurrentBlock("BLOCK_COMMENTS"); $template->setVariable("LABEL_COMMENTS", "Kommentare"); $template->setCurrentBlock("BLOCK_COMMENTS_BOX"); $template->setVariable("CONTENT_COMMENTS", "Nummer 1"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_COMMENTS", "Nummer 2"); $template->parseCurrentBlock(); $template->setVariable("CONTENT_COMMENTS", "Nummer 3"); $template->parseCurrentBlock(); $template->parseCurrentBlock(); $this->template->setVariable("HTML_CODE_LEFT", $template->get()); }
$content->setVariable("CHECKBOX_SICK", '<input type="checkbox" onclick="updateTextfieldStatus(this.checked); updateCheckboxes(this);" name="checkbox" value="SICK" id="checkbox_sick" ' . $SICKchecked . ' /><label for="checkbox_sick">' . gettext('sick') . '</label>'); $content->setVariable("TOTAL_POINTS", "<b>" . gettext("total") . ": <span id='total_points'><b>" . $totalPoints . "</b></span>"); $content->setVariable("BUTTON_SAVE", '<input type="submit" onmousedown="updateFocus(0);" name="input_exam_results_save" value="' . gettext("Save result and enter next") . '"/>'); $content->setVariable("BACK_LINK", "<a href=" . $course->get_url() . "exam_organization/>" . gettext("back to exam organization") . "</a>"); $content->setVariable("HIDDEN_ACTION", '<input type="hidden" name="hidden_action" value=""/>'); $content->setVariable("HIDDEN_COUNTER", '<input type="hidden" name="hidden_counter" value="' . $numberOfAssignments . '"/>'); $content->setVariable("HIDDEN_MATNR", '<input type="hidden" name="hidden_matnr" value="' . $value_matnr . '"/>'); $content->setVariable("HIDDEN_STUDENT", '<input type="hidden" name="hidden_student" value="' . $value_student . '"/>'); $content->setVariable("HIDDEN_FOCUS", '<input type="hidden" name="hidden_focus" value="1"/>'); $content->setVariable("JS_SET_FOCUS", '<script type="text/javascript">' . $js_focus . '</script>'); $content->setVariable("TABLE_INPUT_POINTS", $table); } $content->setVariable("VALUE_CONTAINER_DESC", gettext("Enter exam results")); $content->setVariable("VALUE_CONTAINER_LONG_DESC", gettext("Enter exam results for a term")); //$content->setCurrentBlock("BLOCK_INFO"); //$content->parse("BLOCK_INFO"); $html_handler->set_html_left($content->get()); $portal->set_page_main($html_handler->get_headline(), $html_handler->get_html(), ""); $portal->show_html(); function buildChecksum($ean) { $s = preg_replace("/([^\\d])/", "", $ean); if (strlen($s) != 12) { return false; } $check = 0; for ($i = 0; $i < 12; $i++) { $check += ($i % 2 * 2 + 1) * $s[$i]; } return (10 - $check % 10) % 10; }
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();
$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()); $content->setVariable("EXTENSION_DESC", $extension->get_display_description()); if ($extension->is_enabled($group)) { $content->setVariable("EXTENSION_ENABLED", "checked='checked'");
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; }
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;
//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();
// handle attachments if (is_array($attachments) && count($attachments) > 0) { $content->setCurrentBlock("BLOCK_ATTACHMENTS"); foreach ($attachments as $attachment) { if ($attachment->get_id() != $active_message->get_id()) { $content->setCurrentBlock("BLOCK_ATTACHMENT"); $content->setVariable("LABEL_ATTACHMENT", gettext("Attachment")); $content->setVariable("VALUE_ATTACHMENT", "<a href=\"" . PATH_URL . "get_document.php?id=" . $attachment->get_id() . "\">" . $active_message->get_name() . "</a>"); $content->parse("BLOCK_ATTACHMENT"); } } $content->parse("BLOCK_ATTACHMENTS"); } $content->setVariable("LABEL_REPLY", gettext("Send a reply")); $timestamp = $message->get_attribute(OBJ_CREATION_TIME); $timestamp = strftime("%x", $timestamp) . ", " . strftime("%H:%M", $timestamp); $content->setVariable("LABEL_TIMESTAMP", gettext("Date")); $content->setVariable("VALUE_TIMESTAMP", $timestamp); $content->setVariable("LABEL_WINDOW_CONFIRM", gettext("Are you sure you want to delete this message?")); $content->setVariable("MESSAGE_ID", $message->get_id()); $content->setVariable("LABEL_DELETE", gettext("DELETE")); $backlink = PATH_URL . "messages.php" . ($is_sent ? "?sent=1" : ""); $content->setVariable("BACKLINK", $backlink); if ($is_sent) { $content->setVariable("LABEL_RETURN", gettext("return to your outbox")); $content->setVariable("HIDE_REPLY", 'display:none'); } else { $content->setVariable("LABEL_RETURN", gettext("return to your inbox")); } $portal->set_page_main(array(array("link" => PATH_URL . "messages.php", "name" => gettext("mailbox")), array("link" => $backlink, "name" => $is_sent ? gettext("Your Sent Mail") : gettext("Your Inbox")), array("link" => "", "name" => h($message->get_name()))), $content->get(), ""); $portal->show_html();
public function getHtml() { $content = new \HTML_TEMPLATE_IT(); $content->setTemplate($this->htmlTemplate); $content->setVariable("HEADER", $this->header); $content->setVariable("TITLE", $this->title); $content->setVariable("STYLE_VARIATIONS", $this->style_variations); $content->setVariable("USER_STYLES", $this->user_styles); $content->setVariable("USER_JAVASCRIPT", $this->user_javascript); $content->setVariable("PLUGIN_HEADER", $this->plugin_header); $content->setVariable("USER_HEADER", $this->user_header); $content->setVariable("TOOLBAR", $this->toolbar); $content->setVariable("LOGO", $this->logo); $content->setVariable("SITE_TITLE", $this->site_title); $content->setVariable("SITE_SLOGAN", $this->site_slogan); $content->setVariable("SIDEBAR_TITLE", $this->sidebar_title); $content->setVariable("SIDEBAR", $this->sidebar); $content->setVariable("PLUGIN_SIDEBAR", $this->plugin_sidebar); $content->setVariable("BREADCRUMB", $this->breadcrumb); $content->setVariable("CONTENT", $this->content); $content->setVariable("FOOTER", $this->footer); $content->setVariable("PREV_CHAPTER", $this->prev_chapter); $content->setVariable("CHAPTER_MENU", $this->chapter_menu); $content->setVariable("NEXT_CHAPTER", $this->next_chapter); return $content->get(); }
public function processData(\IRequestObject $requestObject) { $objectId = $requestObject->getId(); $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $portletName = $portlet->get_attribute(OBJ_DESC); //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; } $this->getExtension()->addCSS(); $this->getExtension()->addJS(); $htmlBody = ""; //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(); } //get singleton and portlet path $portletInstance = \PortletTermplan::getInstance(); $portletPath = $portletInstance->getExtensionPath(); //create template $portletFileName = $portletPath . "/ui/html/index.html"; $tmpl = new \HTML_TEMPLATE_IT(); $tmpl->loadTemplateFile($portletFileName); if (sizeof($content) > 0) { //popupmenu if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("PortletTermplan"); $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()); } $startDate = $content["start_date"]; $endDate = $content["end_date"]; if (time() > mktime(0, 0, 0, $startDate["month"], $startDate["day"], $startDate["year"]) && time() < mktime(24, 0, 0, $endDate["month"], $endDate["day"], $endDate["year"])) { $pollActive = true; } else { $pollActive = false; } $options = $content["options"]; $optionsVotecount = $content["options_votecount"]; $max_votecount = 1; foreach ($optionsVotecount as $option_votecount) { if ($option_votecount > $max_votecount) { $max_votecount = $option_votecount; } } $tmpl->setVariable("POLL_NAME", $portletName); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } $tmpl->setVariable("POLL_TOPIC", $content["poll_topic"]); //advanced result //decode content mapping $encodedVoteUserMapping = $portlet->get_attribute("termChoices"); if ($encodedVoteUserMapping == "0") { $mapping = array(); } else { $mapping = json_decode($encodedVoteUserMapping, true); } $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $currentUserName = $currentUser->get_full_name(); $currentUserLogin = $currentUser->get_name(); //fehler //create table $userTimeTable = "<br/><table border='0' style='margin:auto;border-color:#C0C0C0;width:98%'>"; //headline $userTimeTable .= "<tr>"; $userTimeTable .= "<th style='background-color:#E0E0E0;'>Name</th>"; $optionsCount = 0; foreach ($options as $option) { if ($option != "") { //show $optionsCount++; $optionText = $this->termplanCutItemLenght($option); $userTimeTable .= "<th style='background-color:#E0E0E0;'>{$optionText}</th>"; } } $userTimeTable .= "</tr>"; $userVoteArray = array(); foreach ($mapping as $username => $encodedTermChoices) { @($voteUserArray = explode("#", $voteXuser)); //TODO $votes = explode(":", substr($encodedTermChoices, 12)); $user = $username; foreach ($votes as $vote) { if (isset($userVoteArray[$user][$vote]) && $userVoteArray[$user][$vote] == "X") { //hier den umschalter $userVoteArray[$user][$vote] = "N"; } else { $userVoteArray[$user][$vote] = "X"; } } } //initialize votecount $voteCount = array(); $voteCount[0] = 0; $voteCount[1] = 0; $voteCount[2] = 0; $voteCount[3] = 0; $voteCount[4] = 0; $voteCount[5] = 0; if (!("guest" == $GLOBALS["STEAM"]->get_current_steam_user()->get_name())) { //its not allowed for guest to vote //create first line for current user $userTimeTable .= "<tr>"; $userTimeTable .= "<td style='font-weight: bold;'>{$currentUserName}</td>"; if (isset($userVoteArray[$currentUserLogin])) { $votingForCurrentUser = $userVoteArray[$currentUserLogin]; } else { $votingForCurrentUser = array(); } $backGroundGreen = "#99EE99"; for ($i = 0; $i < $optionsCount; $i++) { //$userTimeTable.= "<td>"; $portletId = $portlet->get_id(); if (isset($votingForCurrentUser[$i]) && $votingForCurrentUser[$i] == "X") { if (!$pollActive) { $userTimeTable .= "<td style='background-color:{$backGroundGreen};'>"; } if ($pollActive) { $userTimeTable .= "<td style='background-color:{$backGroundGreen};'>"; } $voteCommand = 'sendRequest("VoteTerm", {"portletObjectId": "' . $objectId . '", "termId": "' . $i . '"}, "", "popup", "","", "PortletTermplan");return false;'; if ($pollActive) { $userTimeTable .= "<input onclick='{$voteCommand};' type='checkbox' name='termitem' value='{$i}' checked='checked'>"; } if (!$pollActive) { $userTimeTable .= "X"; } $voteCount[$i]++; $userTimeTable .= "</td>"; } else { $userTimeTable .= "<td>"; $voteCommand = 'sendRequest("VoteTerm", {"portletObjectId": "' . $objectId . '", "termId": "' . $i . '"}, "", "popup", "","", "PortletTermplan");return false;'; if ($pollActive) { $userTimeTable .= "<input onclick='{$voteCommand};' type='checkbox' name='termitem' value='{$i}'>"; } if (!$pollActive) { $userTimeTable .= ""; } $userTimeTable .= "</td>"; } } $userTimeTable .= "</tr>"; } //sort the users //$userVoteArray $sortedNames = array(); foreach ($userVoteArray as $login => $userElement) { $userObject = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $login); $userRealName = $userObject->get_full_name(); $sortedNames[$login] = $userRealName; } asort($sortedNames, SORT_STRING); //resorting the other array foreach ($sortedNames as $userName => $realName) { $sortedNames[$userName] = $userVoteArray[$userName]; } $userVoteArraySorted = $sortedNames; //table for other users foreach ($userVoteArraySorted as $user => $userElement) { if ($user == $currentUserLogin) { continue; } //create row $userTimeTable .= "<tr>"; $userObject = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $user); $realName = $userObject->get_full_name(); //create other users if ($currentUserName == $realName) { //DO NOTHING } else { $userTimeTable .= "<td>{$realName}</td>"; } for ($i = 0; $i < $optionsCount; $i++) { //create field if (isset($userElement[$i]) && $userElement[$i] == "X") { if ($currentUserName == $realName) { $userTimeTable .= "<td></td>"; //DO NOTHING } else { $userTimeTable .= "<td style='background-color:{$backGroundGreen};'>X</td>"; } $voteCount[$i]++; } else { $userTimeTable .= "<td></td>"; if ($currentUserName == $realName) { //DO NOTHING } } } $userTimeTable .= "</tr>"; } //count and show results $userTimeTable .= "<tr>"; $userTimeTable .= "<td>Summe</td>"; $portletId = $portlet->get_id(); for ($i = 0; $i < $optionsCount; $i++) { $userTimeTable .= "<td id='" . $portletId . "TermSum{$i}'>{$voteCount[$i]}</td>"; } $userTimeTable .= "</tr>"; $userTimeTable .= "</table>"; //table created $tmpl->setVariable("USER_VOTE_TABLE", $userTimeTable); $htmlBody = $tmpl->get(); //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->setHtml($htmlBody); $this->rawHtmlWidget = $outputWidget; } }
$html_people->setVariable("CONTACT_NAME", h($person["USER_FIRSTNAME"]) . " " . h($person["USER_FULLNAME"])); $html_people->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . $person["OBJ_NAME"]); $html_people->setVariable("LABEL_MESSAGE", gettext("Message")); $html_people->setVariable("LABEL_SEND", gettext("Send")); $html_people->setVariable("OBJ_DESC", h($person["OBJ_DESC"])); if (!$is_member) { $html_people->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\" name=\"add[" . h($person["OBJ_NAME"]) . "]\" value=\"" . gettext("Add") . "\"/></td>"); } else { $html_people->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\">" . gettext("Already a member.") . "</td>"); } $html_people->parse("BLOCK_CONTACT"); } $html_people->setVariable('LABEL_ADD_SELECTED', gettext('Add selected')); $html_people->parse("BLOCK_CONTACT_LIST"); } else { $html_people->setVariable("LABEL_CONTACTS", gettext("No results.")); } $content->setVariable("HTML_USER_LIST", $html_people->get()); } else { $content->setVariable("CHECKED_NAME", 'checked="checked"'); } } $portal->set_page_title(gettext("Add member")); // give input focus to search field: $portal->add_javascript_onload("group_add_members", "document.getElementById('pattern').focus();"); if (!isset($html_content)) { $portal->set_page_main(array($group->get_link(), array("name" => gettext("Add member"))), $content->get(), ""); } else { $portal->set_page_main(array($group->get_link(), array("name" => gettext("Add member"))), $html_content, ""); } $portal->show_html();
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ö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 = " "; } $content->setVariable("PORTLET", $portlet_content); } } $content->parse("portal_column"); } /* set portal width */ $content->setVariable("PORTAL_WIDTH", $portal_width); /* return content */ return $content->get(); }
<?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 ""; }
$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"); $content->parse("BLOCK_CREATE_PRIVATE_GROUP"); $private_expl = array(gettext("Private groups cannot be made public later."), gettext("Private groups are <b>useful for smaller learning or working groups or groups of friends.</b>"), gettext("Private groups are completely hidden from group searches, and don't display on people's profiles amongst groups they belong to.")); $content->setCurrentBlock("BLOCK_EXPLAIN_PRIVATE_ALL"); foreach ($private_expl as $e) { $content->setCurrentBlock("BLOCK_EXPLAIN_PRIVATE"); $content->setVariable("EXPLAIN_PRIVATE_TEXT", $e); $content->parse("BLOCK_EXPLAIN_PRIVATE"); } $content->parse("BLOCK_EXPLAIN_PRIVATE_ALL"); } $portal->set_page_main(array(array("link" => PATH_URL . "user/" . lms_steam::get_current_user()->get_name() . "/groups/", "name" => gettext("Your groups")), array("link" => "", "name" => gettext("Create a new group"))), $content->get()); $portal->show_html();
<div style="margin-left:5%;"> <img src="/styles/koala-lernszenarien/images/elab_ePortfolio_Mockup.png" width="90%" alt="ePortfolio"> <p style="margin-left:40%;">Prototype eines ePortfolios</p> </div> END; include_once "../etc/koala.conf.php"; $portal = lms_portal::get_instance(); $portal->initialize(GUEST_ALLOWED); $portal->set_page_title(gettext("ELAB Projects")); $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "elab_projects.template.html"); $project = "none"; if (isset($_POST["project"]) && isset($elabProject[$_POST["project"]])) { $project = $_POST["project"]; } if (isset($_GET["project"]) && isset($elabProject[$_GET["project"]])) { $project = $_GET["project"]; } if ($project != "none") { $content->setVariable("PROJECT_DESCRIPTION_TEXT", $elabProject[$project]); } else { $output = "<h4>Bitte wählen Sie ein Projekt aus:</h4>"; foreach ($elabProject as $projectName => $projectDescription) { $output .= '<li><a href="/projects/?project=' . $projectName . '">' . $projectName . '</a></li>'; } $content->setVariable("PROJECT_DESCRIPTION_TEXT", $output); } $portal->set_page_main(array(array("link" => "elab_projects.php", "name" => gettext("E-LAB Projects"))), $content->get(), ""); $portal->show_html();
<?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();
} 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();
} $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); $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("name" => gettext("Delete wiki"), "link" => "")); $portal->set_page_main($headline, $content->get(), ""); $portal->show_html();
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; }
$content->setVariable("VALUE_NAME", h($values["name"])); } if (!empty($values["dsc"])) { $content->setVariable("VALUE_DESC", h($values["dsc"])); } if (!empty($values["url"])) { $content->setVariable("VALUE_URL", h($values["url"])); } else { $content->setVariable("VALUE_URL", "http://"); } if (!empty($values["return_to"])) { $backlink = $values["return_to"]; } else { $backlink = $_SERVER["HTTP_REFERER"]; } } else { $content->setVariable("VALUE_URL", "http://"); $backlink = $_SERVER["HTTP_REFERER"]; } $content->setVariable("BACK_LINK", $backlink); $content->setVariable("LABEL_RETURN", gettext("back")); $koala_env = koala_object::get_koala_object($env); if (is_object($env) && is_object($koala_env)) { $link_path = $koala_env->get_link_path(); } if (!is_array($link_path)) { $link_path = array(); } $link_path[] = array("name" => $pagetitle); $portal->set_page_main($link_path, $content->get(), ""); $portal->show_html();
// 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();
$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();
$content->setVariable("VALUE_IM_AIM", safe_string($user_profile["USER_PROFILE_IM_AIM"])); $content->setVariable("VALUE_IM_MSN", safe_string($user_profile["USER_PROFILE_IM_MSN"])); $content->setVariable("VALUE_IM_YAHOO", safe_string($user_profile["USER_PROFILE_IM_YAHOO"])); // LANGUAGE if (TRUE) { // && !empty($user_profile["USER_LANGUAGE"]) ) { $ulang = $user_profile["USER_LANGUAGE"]; if (!is_string($ulang) || $ulang === "0") { $ulang = LANGUAGE_DEFAULT_STEAM; } $languages = array("english" => array("name" => gettext("English"), "icon" => "flag_gb.gif", "lang_key" => "en_US"), "german" => array("name" => gettext("German"), "icon" => "flag_de.gif", "lang_key" => "de_DE")); if (!array_key_exists($ulang, $languages)) { $ulang = LANGUAGE_DEFAULT_STEAM; } $content->setCurrentBlock("USER_LANGUAGE"); $content->setVariable("LABEL_LANGUAGES", gettext("Language")); foreach ($languages as $key => $language) { $content->setCurrentBlock("LANGUAGE"); $content->setVariable("LABEL_LANGUAGE_LABEL", "profile_language_" . $key); $content->setVariable("LANGUAGE_ICON", PATH_STYLE . "/images/" . $language["icon"]); $content->setVariable("LABEL_LANGUAGE", $language["name"]); $content->setVariable("LANGUAGE_VALUE", $key); if ($ulang == $key) { $content->setVariable("LANGUAGE_CHECKED", "checked=\"checked\""); } $content->parse("LANGUAGE"); } $content->parse("USER_LANGUAGE"); } $portal->set_page_main(array(array("link" => PATH_URL . "user/" . $user->get_name() . "/", "name" => $user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME")), array("link" => "", "name" => gettext("Profile"))), $content->get(), ""); $portal->show_html();
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(); }
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST["id"] == $unit->get_id()) { try { $unit->delete(); $owner = koala_object::get_koala_object(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["owner"])); $backlink = $owner->get_url() . "units/"; } catch (Exception $exception) { $problems = $exception->get_message(); } } if (empty($problems)) { $_SESSION["confirmation"] = str_replace("%NAME", $unitname, gettext("The unit '%NAME' has been deleted.")); header("Location: " . $backlink); exit; } else { $portal->set_problem_description($problems, $hints); } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES_UNITS_POINTLIST . "units_pointlist_delete.template.html"); $content->setVariable("UNIT_ID", $unit->get_id()); $content->setVariable("OWNER_ID", $owner->get_id()); $content->setVariable("BACK_LINK", $backlink); $content->setVariable("INFO_TEXT", gettext("Do you really want to delete this pointlist ?")); $content->setVariable("LABEL_OK", gettext("Delete unit")); $content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>"); $semester = $course->get_semester()->get_name(); $breadcrumb = array(array("name" => $semester, "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/"), array("name" => $course->get_display_name(), "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/" . $course->get_name() . "/"), array("name" => gettext("Units"), "link" => PATH_URL . SEMESTER_URL . "/" . $semester . "/" . $course->get_name() . "/units/"), $unit->get_link(), array("name" => gettext("Delete this unit"))); $portal->set_page_main($breadcrumb, $content->get()); $portal->show_html(); exit;
} elseif ($group instanceof koala_group_default && !$group instanceof koala_group_course && $access == PERMISSION_GROUP_PUBLIC_CONFIRMATION || ($group instanceof koala_group_course || $group instanceof koala_group_tutorial) && $access == PERMISSION_COURSE_CONFIRMATION) { $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")); } elseif ($group instanceof koala_group_course && $access == PERMISSION_COURSE_PAUL_SYNC) { $content->setVariable("LABEL_KIND_OF_GROUP", gettext("PAUL Import")); $content->setVariable("INFO_KIND_OF_GROUP", gettext("The participants of this course are imported from the PAUL system. To join this course make sure to join the course in PAUL. After your Registration for this course in PAUL, the automatic synchronization will add you to this course in koaLA automatically.") . "<br />" . gettext("Please note that the synchronization may take up to one hour.") . "<br /><b>" . gettext("The Synchronisation will start if the registration period in PAUL ends at 30.04.2009.") . "</b>"); $content->setVariable("SUBMIT_EXTRA", "style='display: none;'"); $printor = FALSE; } 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); if (!isset($printor) || $printor) { $content->setVariable("LABEL_OR", gettext("Or,")); } $content->setVariable("LABEL_RETURN", gettext("Return to the group's page")); $content->setVariable("BACK_LINK", "javascript:history.back();"); $content->parse("BLOCK_FORM"); } } } } $koala_group = koala_object::get_koala_object($group); $portal->set_page_main(array(array("link" => $backlink, "name" => $koala_group->get_display_name()), array("link" => "", "name" => gettext("Subscribe"))), $content->get()); $portal->show_html();
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'?")); } $rootlink = lms_steam::get_link_to_root($wiki_container); $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" => $pagetitle)); $portal->set_page_main($headline, $content->get()); $portal->show_html();