本文整理汇总了PHP中HTML_TEMPLATE_IT::setCurrentBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_TEMPLATE_IT::setCurrentBlock方法的具体用法?PHP HTML_TEMPLATE_IT::setCurrentBlock怎么用?PHP HTML_TEMPLATE_IT::setCurrentBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_TEMPLATE_IT
的用法示例。
在下文中一共展示了HTML_TEMPLATE_IT::setCurrentBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
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();
}
示例2: get_calendar_html
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();
}
示例3: set_content
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());
}
示例4: gettext
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."));
} else {
$portal->set_problem_description(gettext("You are already member of this group."));
}
}
} else {
if ($already_member_and_exclusive) {
if (empty($_SESSION['confirmation'])) {
$portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here."));
}
} else {
if ($group->get_attribute(KOALA_GROUP_ACCESS) == PERMISSION_GROUP_UNDEFINED) {
$content->setCurrentBlock("BLOCK_FORM");
if ($group->get_maxsize() > 0 && $group->get_maxsize() <= $group->count_members()) {
$content->setVariable("LABEL_KIND_OF_GROUP", gettext("Group is full"));
$content->setVariable("INFO_KIND_OF_GROUP", str_replace("%NUMBER", $group->get_maxsize(), gettext("The maximum number of %NUMBER participants has been reached.")) . " " . gettext("You are not be able to join this group at this time."));
$content->setVariable("LABEL_SUBMIT", gettext("Unable to join group"));
$content->setVariable("SUBMIT_EXTRA", "style=\"display:none\"");
} elseif ($group->is_password_protected()) {
$content->setVariable("LABEL_KIND_OF_GROUP", gettext("Password protected group"));
$content->setVariable("INFO_KIND_OF_GROUP", gettext("The moderators of this group had set a password to avoid unauthorized access.") . " " . gettext("If you would like to join this group and don't know it, please ask the moderators."));
$content->setCurrentBlock("BLOCK_GROUP_PASSWORD");
$content->setVariable("LABEL_PASSWORD", gettext("Password"));
$content->parse("BLOCK_GROUP_PASSWORD");
$content->setVariable("LABEL_SUBMIT", gettext("Join this group"));
} elseif ($group->is_moderated()) {
$content->setVariable("LABEL_KIND_OF_GROUP", gettext("Moderated group"));
$content->setVariable("INFO_KIND_OF_GROUP", gettext("To avoid unauthorized access, the moderators of this group have to approve your membership request first, before you can join the group.") . " " . gettext("Here, you can fill out a membership request and send it.") . " " . gettext("You will get automatically informed by mail if your request succeeds."));
示例5: get_comment_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();
}
示例6: LinkedList
$cache = get_cache_function($wiki_container->get_id(), 600);
$wiki_entries = $cache->call("lms_wiki::get_items", $wiki_container->get_id());
$recently_changed = new LinkedList(5);
$most_discussed = new LinkedList(5);
$latest_comments = new LinkedList(5);
$no_wiki_entries = count($wiki_entries);
if ($no_wiki_entries > 0) {
$first_char = "";
for ($i = 0; $i < $no_wiki_entries; $i++) {
$this_char = substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1);
if ($this_char > $first_char) {
$first_char = $this_char;
if ($i > 1) {
$content->parse("BLOCK_CHARACTER");
}
$content->setCurrentBlock("BLOCK_CHARACTER");
$content->setVariable("FIRST_CHAR", h($this_char));
}
$char_articles = array();
while ($i < $no_wiki_entries && $this_char == substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1)) {
$char_articles[] = $wiki_entries[$i];
if ($recently_changed->can_be_added($wiki_entries[$i]["DOC_LAST_MODIFIED"])) {
$recently_changed->add_element($wiki_entries[$i]["DOC_LAST_MODIFIED"], $wiki_entries[$i]);
}
if (isset($wiki_entries[$i]["COMMENTS_NO"]) && $most_discussed->can_be_added($wiki_entries[$i]["COMMENTS_NO"]) && $wiki_entries[$i]["COMMENTS_NO"] > 1) {
$most_discussed->add_element($wiki_entries[$i]["COMMENTS_NO"], $wiki_entries[$i]);
}
if (isset($wiki_entries[$i]["COMMENTS_LAST"]) && $latest_comments->can_be_added($wiki_entries[$i]["COMMENTS_LAST"]) && $wiki_entries[$i]["COMMENTS_LAST"] > 0) {
$latest_comments->add_element($wiki_entries[$i]["COMMENTS_LAST"], $wiki_entries[$i]);
}
$i++;
示例7: processData
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);
//.........这里部分代码省略.........
示例8: unset
}
if ($result[$tnr[$tutorials[$key]->get_id()]["attributes"]][OBJ_TYPE] == "0") {
unset($tutorials[$key]);
continue;
}
if ($result[$tnr[$tutorials[$key]->get_id()]["attributes"]][OBJ_TYPE] != "course_tutorial" && $result[$tnr[$tutorials[$key]->get_id()]["attributes"]][OBJ_TYPE] != "group_tutorial_koala") {
unset($tutorials[$key]);
continue;
}
}
$tutorials = array_values($tutorials);
usort($tutorials, "sort_objects_new");
$no_tutorials = count($tutorials);
// $GLOBALS["STEAM"]->disconnect();
if ($no_tutorials > 0) {
$content->setCurrentBlock("BLOCK_GROUP_LIST");
if (isset($_GET['nrshow'])) {
$nr_show = (int) $_GET['nrshow'];
} else {
$nr_show = 10;
}
if (isset($_REQUEST['sort'])) {
$sort = $_REQUEST['sort'];
} else {
$sort = FALSE;
}
$paginator_text = gettext('%START - %END of %TOTAL');
if ($nr_show > 0) {
$paginator_text .= ', <a href="?nrshow=0' . (is_string($sort) ? '&sort=' . $sort : '') . '">' . gettext('show all') . '</a>';
} else {
$nr_show = $no_tutorials;
示例9: gettext
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");
}
if (CREATE_PRIVATE_GROUP) {
示例10: getHtmlForUrl
public function getHtmlForUrl(UrlRequestObject $urlRequestObject)
{
$steam = $GLOBALS["STEAM"];
//current room steam object
if (isset($object) && (int) $object != 0) {
$current_room = steam_factory::get_object($steam->get_id(), $object);
} else {
$current_room = $steam->get_current_steam_user()->get_workroom();
}
//current room steam object
//$current_room = ($object != 0)?new steam_object($object):$steam->get_workroom_user($steam->login_user);
$current_room_path = $current_room->get_path(1);
$current_room_data = $current_room->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_LAST_CHANGED, "bid:tags", "bid:presentation", "bid:collectiontype", "bid:description"), 1);
$current_room_creator = $current_room->get_creator(1);
//check if user may write in this folder
$write_allowed = $current_room->check_access_write($steam->get_current_steam_user(), 1);
//get inventory and inventorys attributes if allowed to
$allowed = $current_room->check_access_read($steam->get_current_steam_user(), 1);
$result = $steam->buffer_flush();
$write_allowed = $result[$write_allowed];
$allowed = $result[$allowed];
$current_room_path = $result[$current_room_path];
$current_room_data = $result[$current_room_data];
$current_room_creator = $result[$current_room_creator];
$current_room_creator_name = $current_room_creator->get_name();
$current_room_display_name = str_replace("'s workarea", "", stripslashes($current_room_data[OBJ_NAME]));
if (isset($current_room_data[OBJ_DESC]) && $current_room_data[OBJ_DESC] != "") {
$current_room_display_name = $current_room_data[OBJ_DESC];
}
$current_room_display_name = str_replace("s workroom.", "", $current_room_display_name);
$current_room_display_name = str_replace("s workroom", "", $current_room_display_name);
$current_room_display_name = preg_replace("/.*'s bookmarks/", "Lesezeichen", $current_room_display_name);
if ($allowed && $current_room instanceof steam_container) {
$inventory = $current_room->get_inventory("", array("DOC_MIME_TYPE", "DOC_LAST_MODIFIED", "CONT_LAST_MODIFIED", "OBJ_LAST_CHANGED", "bid:tags", "bid:presentation", "bid:collectiontype", "bid:hidden", "bid:doctype", "bid:description", "DOC_EXTERN_URL", "OBJ_CREATION_TIME"));
} else {
$inventory = array();
}
if (sizeof($inventory) > 0) {
$hascontent = true;
} else {
$hascontent = false;
}
//get head mounted content if needed
$head_mounted = $current_room_data["bid:presentation"] === "head" && is_array($inventory) && isset($inventory[0]) && $inventory[0] instanceof steam_document;
if ($head_mounted) {
$tmp_content = new doc_content($steam, $inventory[0]);
$head_mounted_content = $tmp_content->get_content($config_webserver_ip);
}
//******************************************************
//** Display Stuff
//******************************************************
//template stuff
$contenttemplate = new HTML_TEMPLATE_IT();
$contenttemplate->loadTemplateFile($this->getExtensionPath() . "ui/taggedfolder.template.html");
$contenttemplate->setVariable("FOLDER_ID", $current_room->get_id());
$contenttemplate->setVariable("FOLDER_NAME", $current_room_display_name);
//$contenttemplate->setVariable("FOLDER_PATH", PATH_URL . $current_room_path . "/");
//$contenttemplate->setVariable("FOLDER_ICON", (($current_room_data["bid:presentation"] === "index")?"$config_webserver_ip/icons/mimetype/folder_closed_index.gif":"$config_webserver_ip/icons/mimetype/folder_closed.gif"));
$contenttemplate->setVariable("FOLDER_LAST_CHANGED", date("d.m.Y H:i", $current_room_data[OBJ_LAST_CHANGED]));
if (sizeof($inventory) == 0) {
$contenttemplate->setCurrentBlock("no_content");
$contenttemplate->setVariable("LANGUAGE_NO_CONTENT", gettext("LANGUAGE_NO_CONTENT"));
$contenttemplate->parse("no_content");
}
return $contenttemplate->get();
//set menu to write mode, if the user's access rights allow so and the user is not the guest user
if ($write_allowed && $steam->get_login_user()->get_name() != "guest") {
//$tpl->set_var("MENU",derive_menu("contentframe", $current_room, $current_room_path, 2));
}
//display directory
//$content = false;
$tnr = array();
foreach ($inventory as $item) {
$tnr[$item->get_id()] = array();
$tnr[$item->get_id()]["creator"] = $item->get_creator(1);
$tnr[$item->get_id()]["writeaccess"] = $item->check_access_write($steam->get_login_user(), 1);
if ($item instanceof steam_document) {
$tnr[$item->get_id()]["contentsize"] = $item->get_content_size(1);
}
if ($item instanceof steam_link) {
$tnr[$item->get_id()]["link_object"] = $item->get_link_object(1);
}
}
$result = $steam->buffer_flush();
$creators = array();
$linktargets = array();
$accessresult = array();
$sizeresult = array();
foreach ($inventory as $item) {
$creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
$accessresult[$item->get_id()] = $result[$tnr[$item->get_id()]["writeaccess"]];
if ($item instanceof steam_document) {
$sizeresult[$item->get_id()] = $result[$tnr[$item->get_id()]["contentsize"]];
}
if ($item instanceof steam_link) {
$linktargets[$item->get_id()] = $result[$tnr[$item->get_id()]["link_object"]];
}
}
steam_factory::load_attributes($steam, $creators, array(OBJ_NAME));
// If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
//.........这里部分代码省略.........
示例11: array
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
}
if (!isset($html_handler_course)) {
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units", array("subcontext" => "unit"));
}
$content = new HTML_TEMPLATE_IT();
//$content->loadTemplateFile( PATH_TEMPLATES_UNITS_DOCPOOL . "units_docpool.template.html" );
$content->loadTemplateFile(PATH_TEMPLATES . "list_inventory.template.html");
$content->setVariable("VALUE_CONTAINER_DESC", h($unit->get_attribute("OBJ_DESC")));
$content->setVariable("VALUE_CONTAINER_LONG_DESC", get_formatted_output($unit->get_attribute("OBJ_LONG_DESC")));
$docs = $unit->get_inventory();
$item_ids = array();
if (count($docs > 0)) {
$content->setCurrentBlock("BLOCK_INVENTORY");
$content->setVariable("LABEL_DOCNAME_DESCRIPTION", gettext("Name/Description"));
$content->setVariable("LABEL_SIZE", gettext("File size"));
$content->setVariable("LABEL_MODIFIED", gettext("Last modified"));
$content->setVariable("LABEL_ACTIONS", gettext("Actions"));
foreach ($docs as $doc) {
// Ignore hidden files starting with '.'
if (substr($doc->get_name(), 0, 1) == '.') {
continue;
}
$content->setCurrentBlock("BLOCK_ITEM");
$size = $doc instanceof steam_document ? $doc->get_content_size() : 0;
$content->setVariable("LINK_ITEM", PATH_URL . "doc/" . $doc->get_id() . "/");
$content->setVariable("LINK_DOWNLOAD", PATH_URL . "get_document.php?id=" . $doc->get_id());
$content->setVariable("LABEL_DOWNLOAD", gettext("download"));
$content->setVariable("SIZE_ITEM", get_formatted_filesize($size));
示例12: array
<?php
// Deactivate HISLSF Support
// include( "bad_link.php" );
// exit;
require_once "../etc/koala.conf.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
$all_users = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
if (!lms_steam::is_steam_admin($user) && !lms_steam::is_semester_admin($current_semester, $user)) {
include "bad_link.php";
exit;
}
$lsf_client = new hislsf_soap();
$result = $lsf_client->get_available_courses(SYNC_HISLSF_SEMESTER, $path[1]);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "courses_create_hislsf.template.html");
$content->setVariable("FORM_ACTION", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/new/");
foreach ($result->veranstaltung as $course) {
$content->setCurrentBlock("LSFCOURSE");
$content->setVariable("LSF_COURSE_ID", (string) $course->Veranstaltungsschluessel);
$content->setVariable("LSF_COURSE_NAME", (string) $course->Veranstaltungstyp . " " . (string) $course->Veranstaltungsname);
$content->parse("LSFCOURSE");
}
$portal->set_page_main(array(array("link" => PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/", "name" => $current_semester->get_attribute("OBJ_DESC")), array("linK" => "", "name" => gettext("Create new Course via LSF"))), $content->get());
$portal->show_html();
示例13: header
$fcache = get_cache_function(OBJ_ID, 600);
$fcache->drop("lms_forum::get_discussions", OBJ_ID);
// clean cache for Weblog RSS Feed for the Comments
$cache = get_cache_function(OBJ_ID, 600);
$discussions = $cache->drop("lms_steam::get_annotations", OBJ_ID);
// clean rsscache
$rcache = get_cache_function("rss", 600);
$feedlink = PATH_URL . "services/feeds/forum_public.php?id=" . OBJ_ID;
$rcache->drop("lms_rss::get_items", $feedlink);
$feedlink = PATH_URL . "services/feeds/weblog_public.php?id=" . OBJ_ID;
$rcache->drop("lms_rss::get_items", $feedlink);
header("Location: " . $values["return_to"]);
exit;
} else {
// PREVIEW
$content->setCurrentBlock("BLOCK_PREVIEW");
$content->setVariable("LABEL_PREVIEW_EDIT", gettext("Preview the edit"));
$content->setVariable("PREVIEW_EDIT", get_formatted_output($values["message"]));
$content->parse("BLOCK_PREVIEW");
$content->setVariable("LABEL_HERE_IT_IS", gettext("Change it?"));
$content->setVariable("TEXT_COMMENT", h($values["message"]));
$content->setVariable("BACK_LINK", $values["return_to"]);
}
}
$content->setVariable("LABEL_BB_BOLD", gettext("B"));
$content->setVariable("HINT_BB_BOLD", gettext("boldface"));
$content->setVariable("LABEL_BB_ITALIC", gettext("I"));
$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
示例14: gettext
$content->setVariable("HINT_BB_BOLD", gettext("boldface"));
$content->setVariable("LABEL_BB_ITALIC", gettext("I"));
$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
$content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough"));
$content->setVariable("LABEL_BB_IMAGE", gettext("IMG"));
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
$content->setVariable("LABEL_BB_URL", gettext("URL"));
$content->setVariable("HINT_BB_URL", gettext("web link"));
$content->setVariable("LABEL_BB_MAIL", gettext("MAIL"));
$content->setVariable("HINT_BB_MAIL", gettext("email link"));
if ($accessmergel) {
$mailto = "mailto:'.SUPPORT_EMAIL.'?subject=KoaLA:%20Invalid%20Access%20Rights&body=" . rawurlencode("\nLink: " . get_current_URL() . "\nCreator: " . $creator->get_identifier() . "\n");
$content->setCurrentBlock("BLOCK_ACCESSMERGEL");
$content->setVariable("LABEL_ACCESSMERGEL", str_replace("%MAILTO", $mailto, gettext("There is a problem with the access settings. Please <a href=\"%MAILTO\">contact the support team</a> to fix it by setting the access rights again.")));
$content->parse("BLOCK_ACCESSMERGEL");
} else {
$access = lms_wiki::get_access_descriptions($grp);
if ((string) $grp->get_attribute("OBJ_TYPE") == "course") {
$access_default = PERMISSION_PUBLIC;
} else {
$access_default = PERMISSION_PUBLIC_READONLY;
if (isset($wiki_container) && is_object($wiki_container) && $creator->get_id() != lms_steam::get_current_user()->get_id()) {
$access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", $creator->get_name(), $access[PERMISSION_PRIVATE_READONLY]);
} else {
$access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", "you", $access[PERMISSION_PRIVATE_READONLY]);
}
}
if (is_array($access)) {
示例15: hide_all_questions
//.........这里部分代码省略.........
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t}
\t\t}
\t}
\treturn false;
}
END;
lms_portal::get_instance()->add_javascript_code("elearning_exam", $js_code);
$html = "<div class=\"printonly\" id=\"noprint_exam\"><b>Die Prüfungsergbnisse können nicht gedruckt werden.</b></div><div class=\"noprint\" id=\"elearning_exam\">";
$elearning_user = elearning_user::get_instance($this->myUser->get_name(), elearning_mediathek::get_instance()->get_course()->get_id());
if ($elearning_user->has_exam_passed()) {
$html .= "<h2>Herzlichen Glückwunsch!</h2>";
$html .= "Sie haben bei der Prüfung zum Kurs »" . $this->get_parent()->get_name() . "« <b>" . $elearning_user->get_exam_sum_score() . " von " . $elearning_user->get_exam_sum_points() . "</b> möglichen Punkten erreicht. Dieses Prüfungsergebnis wird auch den Ansprechpartnern zu dem Kurs angezeigt.<br/><br/>";
$html .= "Zur abgelegten Prüfung haben Sie ein Zertifikat erhalten, das Sie auch später noch auf Ihrer persönlichen Einstiegsseite abrufen können. Klicken Sie auf das Vorschaubild des Zertifikats bzw. auf »Herunterladen«, wenn Sie es auf Ihrem Computer speichern oder ausdrucken möchten.<br/><br/>";
$html .= "Falls Sie nicht alle Fragen richtig beantwortet haben, sehen Sie im Folgenden die nicht vollständig korrekt beantworteten Fragen. Sie können auch später erneut auf »Prüfung« klicken, um sich die nicht vollständig korrekt beantworteten Fragen anzeigen zu lassen.<br/><br/>";
$html .= "Wenn Sie zum Kurs oder zu der Prüfung eine Frage haben, können Sie auf den Namen eines Ansprechpartners für diesen Kurs klicken, um mit ihm bzw. ihr in Kontakt zu treten.";
$html .= "<div style=\"float:right;margin-top:15px;text-align:center\"><a href=\"" . "/download/" . $elearning_user->get_exam_cert()->get_id() . "/" . $elearning_user->get_exam_cert()->get_name() . "\"><img src=\"" . "/download/" . $elearning_user->get_exam_cert_preview()->get_id() . "/" . $elearning_user->get_exam_cert_preview()->get_name() . "\" /><br /> <small>Herunterladen</a></small></div>";
} else {
$html .= "<h2>Leider hat es nicht gereicht!</h2>";
$html .= "Sie haben bei der Prüfung zum Kurs »" . $this->get_parent()->get_name() . "« die benötigten Punkte nicht erreicht. Dieses Prüfungsergebnis wird auch den Ansprechpartnern zu dem Kurs angezeigt.<br/><br/>";
$html .= "Im Folgenden können Sie sich die nicht vollständig korrekt beantworteten Fragen ansehen. Sie können auch später erneut auf »Prüfung« klicken, um sich die nicht vollständig korrekt beantworteten Fragen anzeigen zu lassen. Auch die Inhalte des Kurses können Sie jederzeit anschauen und sich mit den Inhalten noch einmal beschäftigen.<br/><br/>";
$html .= "Wenn Sie zum Kurs oder zu der Prüfung eine Frage haben, können Sie auf den Namen eines Ansprechpartners für diesen Kurs klicken, um mit ihm bzw. ihr in Kontakt zu treten. Er bzw. sie wird Ihnen auch mitteilen, wie Sie die Prüfung zu gegebener Zeit noch einmal ablegen können.";
}
global $course;
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_EXTENSIONS . "units_elearning/templates/exam.staff.template.html");
$admins = $course->get_staff();
$hidden_members = $course->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
if (!is_array($hidden_members)) {
$hidden_members = array();
}
$visible_staff = 0;
foreach ($admins as $admin) {
if (!in_array($admin->get_id(), $hidden_members)) {
$content->setCurrentBlock("BLOCK_ADMIN");
if (COURSE_START_ADMIN_PROFILE_ANKER) {
$content->setCurrentBlock("PROFILE_ANKER");
} else {
$content->setCurrentBlock("PROFILE_NO_ANKER");
}
$admin_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_DESC", "OBJ_NAME"));
if ($admin instanceof steam_user) {
$content->setVariable("ADMIN_NAME", $admin_attributes["USER_FIRSTNAME"] . " " . $admin_attributes["USER_FULLNAME"]);
!COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "user/" . $admin->get_name() . "/");
} else {
$content->setVariable("ADMIN_NAME", $admin_attributes["OBJ_NAME"]);
!COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "groups/" . $admin->get_id() . "/");
}
$icon_link = is_object($admin_attributes["OBJ_ICON"]) ? PATH_URL . "cached/get_document.php?id=" . $admin_attributes["OBJ_ICON"]->get_id() . "&type=usericon&width=40&height=47" : PATH_STYLE . "images/anonymous.jpg";
$content->setVariable("ADMIN_ICON", $icon_link);
$adminDescription = $admin_attributes["OBJ_DESC"];
switch ($adminDescription) {
case "student":
$adminDescription = gettext("student");
break;
case "staff member":
$adminDescription = gettext("staff member");
break;
case "alumni":
$adminDescription = gettext("alumni");
break;
case "guest":
$adminDescription = gettext("guest");
break;
case "":
$adminDescription = gettext("student");
break;
default:
break;
}
if (COURSE_START_SEND_MESSAGE && (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string($admin->get_attribute("USER_EMAIL")) && $admin->get_attribute("USER_EMAIL") != "" && $admin->get_attribute("USER_FORWARD_MSG") === 1)) {
$adminDescription = $adminDescription . " - <a href=\"/messages_write.php?to=" . $admin->get_name() . "\">" . gettext("Nachricht senden") . "</a>";
}
$content->setVariable("ADMIN_DESC", $adminDescription);
if (COURSE_START_ADMIN_PROFILE_ANKER) {
$content->parse("PROFILE_ANKER");
} else {
$content->parse("PROFILE_NO_ANKER");
}
$content->parse("BLOCK_ADMIN");
$visible_staff++;
}
}
if ($visible_staff > 0) {
$content->setCurrentBlock("BLOCK_ADMIN_HEADER");
$content->setVariable("LABEL_ADMINS", gettext("Staff members"));
$content->parse("BLOCK_ADMIN_HEADER");
}
$html .= $content->get();
$html .= "<br clear=\"all\"><h3 id=\"question_headline\"></h3>";
$html .= "<table style=\"width:100%;\"><tr><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;display:none;margin-top:50px;\" name=\"img_prev\" onclick=\"showPrevQuestion()\" onmouseover=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_prev'].src='/styles/stahl-orange/images/prev.png';\" src=\"/styles/stahl-orange/images/prev.png\"></td><td style=\"width:100%;text-align:left\">";
$html .= $this->get_questions_exam_result_html();
$html .= "</td><td style=\"width:0%;vertical-align:top\"><img style=\"width:44px;height:44px;margin-top:50px\" name=\"img_next\" onclick=\"showNextQuestion()\" onmouseover=\"document.images['img_next'].src='/styles/stahl-orange/images/next_hover.png';style.cursor='pointer'\" onmouseout=\"document.images['img_next'].src='/styles/stahl-orange/images/next.png';\" src=\"/styles/stahl-orange/images/next.png\"></td></table>";
$html .= "</div>";
return $html;
}
}