当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_TEMPLATE_IT::parse方法代码示例

本文整理汇总了PHP中HTML_TEMPLATE_IT::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_TEMPLATE_IT::parse方法的具体用法?PHP HTML_TEMPLATE_IT::parse怎么用?PHP HTML_TEMPLATE_IT::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML_TEMPLATE_IT的用法示例。


在下文中一共展示了HTML_TEMPLATE_IT::parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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}", "&nbsp;");
                $weekday_offset--;
                continue;
            }
            if ($current_day > $last_day_of_month) {
                $html->setVariable("WD{$wd}", "&nbsp;");
                $current_day = strtotime("+1 day", $current_day);
                continue;
            }
            $wdstr = strftime("%e", $current_day);
            $wdentries = $calendar_entries[$current_day];
            $wdlabel = $wdentries > 0 ? "<b>{$wdstr}</b>" : $wdstr;
            $html->setVariable("WD{$wd}", $wdlabel);
            $current_day = strtotime("+1 day", $current_day);
        }
        $html->parse("BLOCK_WEEK");
    }
    return $html->get();
}
开发者ID:rolwi,项目名称:koala,代码行数:50,代码来源:widget_calendar.inc.php

示例2: h

$content->setVariable("LINK_MANAGE_SUBSCRPTIONS", PATH_URL . "user/" . h($user->get_name()) . "/groups/");
$content->setVariable("LINK_CREATE_NEW_GROUP", PATH_URL . "groups_create.php?parent=" . h($group->get_id()));
$content->setVariable("LABEL_CREATE_NEW_GROUP", gettext("Create new group"));
$content->setVariable("LABEL_SEARCH", gettext("Search"));
$content->setVariable("LABEL_GROUPNAME", gettext("Name"));
$content->setVariable("LABEL_GROUP_DESC", gettext("Description"));
$content->setVariable("LABEL_GROUP_MEMBERS", gettext("Members"));
$content->setVariable("LABEL_GROUP_SUBGROUPS", gettext("Subgroups"));
$no_subgroups = count($subgroups);
if ($no_subgroups > 0) {
    $start = $portal->set_paginator(20, $no_subgroups, "(" . str_replace("%NAME", h($group->get_name()), gettext("%TOTAL groups in %NAME")) . ")");
    $end = $start + 20 > $no_subgroups ? $no_subgroups : $start + 20;
    for ($i = $start; $i < $end; $i++) {
        $subgroup = $subgroups[$i];
        $content->setCurrentBlock("BLOCK_GROUP");
        $content->setVariable("GROUP_LINK", PATH_URL . "groups/" . h($subgroup["OBJ_ID"]) . "/");
        $content->setVariable("GROUP_NAME", h($subgroup["OBJ_NAME"]));
        $content->setVariable("GROUP_DESC", h($subgroup["OBJ_DESC"]));
        $content->setVariable("GROUP_MEMBERS_LINK", PATH_URL . "groups/" . h($subgroup["OBJ_ID"]) . "/members/");
        $content->setVariable("GROUP_MEMBERS", h($subgroup["NO_MEMBERS"]));
        if ($subgroup["NO_SUBGROUPS"] == 0) {
            $content->setVariable("GROUP_SUBGROUPS", "-");
        } else {
            $content->setVariable("GROUP_SUBGROUPS", "<a href=\"" . PATH_URL . "groups/?parent=" . h($subgroup["OBJ_ID"]) . "\">" . h($subgroup["NO_SUBGROUPS"]) . "</a>");
        }
        $content->parse("BLOCK_GROUP");
    }
}
$headline = !empty($_GET["parent"]) ? array(array("link" => PATH_URL . "groups/" . h($group->get_id()) . "/", "name" => h($group->get_name())), array("link" => "", "name" => gettext("Subgroups available"))) : gettext("Groups available");
$portal->set_page_main($headline, $content->get(), "");
$portal->show_html();
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:groups_all.php

示例3: gettext

         $portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here."));
     }
 } else {
     if ($group->get_attribute(KOALA_GROUP_ACCESS) == PERMISSION_GROUP_UNDEFINED) {
         $content->setCurrentBlock("BLOCK_FORM");
         if ($group->get_maxsize() > 0 && $group->get_maxsize() <= $group->count_members()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Group is full"));
             $content->setVariable("INFO_KIND_OF_GROUP", str_replace("%NUMBER", $group->get_maxsize(), gettext("The maximum number of %NUMBER participants has been reached.")) . " " . gettext("You are not be able to join this group at this time."));
             $content->setVariable("LABEL_SUBMIT", gettext("Unable to join group"));
             $content->setVariable("SUBMIT_EXTRA", "style=\"display:none\"");
         } elseif ($group->is_password_protected()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Password protected group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("The moderators of this group had set a password to avoid unauthorized access.") . " " . gettext("If you would like to join this group and don't know it, please ask the moderators."));
             $content->setCurrentBlock("BLOCK_GROUP_PASSWORD");
             $content->setVariable("LABEL_PASSWORD", gettext("Password"));
             $content->parse("BLOCK_GROUP_PASSWORD");
             $content->setVariable("LABEL_SUBMIT", gettext("Join this group"));
         } elseif ($group->is_moderated()) {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Moderated group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("To avoid unauthorized access, the moderators of this group have to approve your membership request first, before you can join the group.") . " " . gettext("Here, you can fill out a membership request and send it.") . " " . gettext("You will get automatically informed by mail if your request succeeds."));
             $content->setCurrentBlock("BLOCK_GROUP_MODERATED");
             $content->setVariable("LABEL_REASON_TO_JOIN", gettext("Please provide some information about the reason why you should join this group."));
             $content->parse("BLOCK_GROUP_MODERATED");
             $content->setVariable("LABEL_SUBMIT", gettext("Send membership request"));
         } else {
             $content->setVariable("LABEL_KIND_OF_GROUP", gettext("Public group"));
             $content->setVariable("INFO_KIND_OF_GROUP", gettext("This is a public group everyone can join.") . " " . gettext("Please confirm your intention."));
             $content->setVariable("LABEL_SUBMIT", gettext("Join this group"));
         }
         $content->setVariable("BACKLINK_FORM", $backlink);
         $content->setVariable("LABEL_RETURN", gettext("back"));
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:group_subscribe.php

示例4: 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();
}
开发者ID:rolwi,项目名称:koala,代码行数:81,代码来源:comments_handling.inc.php

示例5: LinkedList

$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "wiki_entries.template.html");
$cache = get_cache_function($wiki_container->get_id(), 600);
$wiki_entries = $cache->call("lms_wiki::get_items", $wiki_container->get_id());
$recently_changed = new LinkedList(5);
$most_discussed = new LinkedList(5);
$latest_comments = new LinkedList(5);
$no_wiki_entries = count($wiki_entries);
if ($no_wiki_entries > 0) {
    $first_char = "";
    for ($i = 0; $i < $no_wiki_entries; $i++) {
        $this_char = substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1);
        if ($this_char > $first_char) {
            $first_char = $this_char;
            if ($i > 1) {
                $content->parse("BLOCK_CHARACTER");
            }
            $content->setCurrentBlock("BLOCK_CHARACTER");
            $content->setVariable("FIRST_CHAR", h($this_char));
        }
        $char_articles = array();
        while ($i < $no_wiki_entries && $this_char == substr(strtoupper($wiki_entries[$i]["OBJ_NAME"]), 0, 1)) {
            $char_articles[] = $wiki_entries[$i];
            if ($recently_changed->can_be_added($wiki_entries[$i]["DOC_LAST_MODIFIED"])) {
                $recently_changed->add_element($wiki_entries[$i]["DOC_LAST_MODIFIED"], $wiki_entries[$i]);
            }
            if (isset($wiki_entries[$i]["COMMENTS_NO"]) && $most_discussed->can_be_added($wiki_entries[$i]["COMMENTS_NO"]) && $wiki_entries[$i]["COMMENTS_NO"] > 1) {
                $most_discussed->add_element($wiki_entries[$i]["COMMENTS_NO"], $wiki_entries[$i]);
            }
            if (isset($wiki_entries[$i]["COMMENTS_LAST"]) && $latest_comments->can_be_added($wiki_entries[$i]["COMMENTS_LAST"]) && $wiki_entries[$i]["COMMENTS_LAST"] > 0) {
                $latest_comments->add_element($wiki_entries[$i]["COMMENTS_LAST"], $wiki_entries[$i]);
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:wiki_entries.php

示例6: processData


//.........这里部分代码省略.........
     //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;
 }
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Index.class.php

示例7: foreach

        //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();
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:group_membership_requests.php

示例8: gettext

<?php

$public = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP);
$user = lms_steam::get_current_user();
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "groups_public.template.html");
if (MANAGE_GROUPS_MEMBERSHIP || CREATE_GROUPS) {
    $content->setCurrentBlock("BLOCK_ACTION_BAR_GROUPS");
    if (MANAGE_GROUPS_MEMBERSHIP) {
        $content->setCurrentBlock("BLOCK_MANAGE_GROUPS_MEMBERSHIP");
        $content->setVariable("LINK_MANAGE_SUBSCRIPTIONS", PATH_URL . "user/" . $user->get_name() . "/groups/");
        $content->setVariable("LABEL_MANAGE_SUBSCRIPTIONS", gettext("Manage subscriptions"));
        $content->parse("BLOCK_MANAGE_GROUPS_MEMBERSHIP");
    }
    if (CREATE_GROUPS) {
        $content->setCurrentBlock("BLOCK_CREATE_GROUPS");
        $content->setVariable("LINK_CREATE_NEW_GROUP", PATH_URL . "groups_create_dsc.php?parent=" . (isset($_GET["cat"]) ? $_GET["cat"] : $public->get_id()));
        $content->setVariable("LABEL_CREATE_NEW_GROUP", gettext("Create new group"));
        $content->parse("BLOCK_CREATE_GROUPS");
    }
    $content->parse("BLOCK_ACTION_BAR_GROUPS");
}
$content->setVariable("LABEL_NAME", gettext("Name"));
$content->setVariable("LABEL_DESC", gettext("Description"));
if (!empty($_GET["cat"])) {
    // EINE KATEGORIE ANZEIGEN
    if (!($category = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["cat"]))) {
        include "bad_link.php";
        exit;
    }
    if (!$category instanceof steam_container) {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:groups_public.php

示例9: 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();
开发者ID:rolwi,项目名称:koala,代码行数:27,代码来源:courses_create_hislsf.php

示例10: header

        $cache = get_cache_function(OBJ_ID, 600);
        $discussions = $cache->drop("lms_steam::get_annotations", OBJ_ID);
        // clean rsscache
        $rcache = get_cache_function("rss", 600);
        $feedlink = PATH_URL . "services/feeds/forum_public.php?id=" . OBJ_ID;
        $rcache->drop("lms_rss::get_items", $feedlink);
        $feedlink = PATH_URL . "services/feeds/weblog_public.php?id=" . OBJ_ID;
        $rcache->drop("lms_rss::get_items", $feedlink);
        header("Location: " . $values["return_to"]);
        exit;
    } else {
        // PREVIEW
        $content->setCurrentBlock("BLOCK_PREVIEW");
        $content->setVariable("LABEL_PREVIEW_EDIT", gettext("Preview the edit"));
        $content->setVariable("PREVIEW_EDIT", get_formatted_output($values["message"]));
        $content->parse("BLOCK_PREVIEW");
        $content->setVariable("LABEL_HERE_IT_IS", gettext("Change it?"));
        $content->setVariable("TEXT_COMMENT", h($values["message"]));
        $content->setVariable("BACK_LINK", $values["return_to"]);
    }
}
$content->setVariable("LABEL_BB_BOLD", gettext("B"));
$content->setVariable("HINT_BB_BOLD", gettext("boldface"));
$content->setVariable("LABEL_BB_ITALIC", gettext("I"));
$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
$content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough"));
$content->setVariable("LABEL_BB_IMAGE", gettext("IMG"));
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:comment_edit.php

示例11: gettext

$content->setVariable("HINT_BB_ITALIC", gettext("italic"));
$content->setVariable("LABEL_BB_UNDERLINE", gettext("U"));
$content->setVariable("HINT_BB_UNDERLINE", gettext("underline"));
$content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S"));
$content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough"));
$content->setVariable("LABEL_BB_IMAGE", gettext("IMG"));
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
$content->setVariable("LABEL_BB_URL", gettext("URL"));
$content->setVariable("HINT_BB_URL", gettext("web link"));
$content->setVariable("LABEL_BB_MAIL", gettext("MAIL"));
$content->setVariable("HINT_BB_MAIL", gettext("email link"));
if ($accessmergel) {
    $mailto = "mailto:'.SUPPORT_EMAIL.'?subject=KoaLA:%20Invalid%20Access%20Rights&body=" . rawurlencode("\nLink: " . get_current_URL() . "\nCreator: " . $creator->get_identifier() . "\n");
    $content->setCurrentBlock("BLOCK_ACCESSMERGEL");
    $content->setVariable("LABEL_ACCESSMERGEL", str_replace("%MAILTO", $mailto, gettext("There is a problem with the access settings. Please <a href=\"%MAILTO\">contact the support team</a> to fix it by setting the access rights again.")));
    $content->parse("BLOCK_ACCESSMERGEL");
} else {
    $access = lms_wiki::get_access_descriptions($grp);
    if ((string) $grp->get_attribute("OBJ_TYPE") == "course") {
        $access_default = PERMISSION_PUBLIC;
    } else {
        $access_default = PERMISSION_PUBLIC_READONLY;
        if (isset($wiki_container) && is_object($wiki_container) && $creator->get_id() != lms_steam::get_current_user()->get_id()) {
            $access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", $creator->get_name(), $access[PERMISSION_PRIVATE_READONLY]);
        } else {
            $access[PERMISSION_PRIVATE_READONLY] = str_replace("%NAME", "you", $access[PERMISSION_PRIVATE_READONLY]);
        }
    }
    if (is_array($access)) {
        $content->setCurrentBlock("BLOCK_ACCESS");
        foreach ($access as $key => $array) {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:wiki_new.php

示例12: 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;
        }
    }
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:elearning_exam.class.php

示例13: gettext

 $isFiltered = false;
 $isEditMode = false;
 $filter = "filter=booked";
 $mode = "mode=edit";
 if (isset($_GET["filter"]) && $_GET["filter"] == "booked") {
     $isFiltered = true;
 }
 if (isset($_GET["mode"]) && $_GET["mode"] == "edit") {
     $isEditMode = true;
 }
 if ($isFiltered) {
     if (ALL_COURSES) {
         $content->setCurrentBlock("BLOCK_ALL_COURSES");
         $content->setVariable("LABEL_MY_COURSES", gettext("All courses"));
         $content->setVariable("LINK_MY_COURSES", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . ($isEditMode ? "/?" . $mode : "/"));
         $content->parse("BLOCK_ALL_COURSES");
     }
 } else {
     if (YOUR_COURSES) {
         $content->setCurrentBlock("BLOCK_YOUR_COURSES");
         $content->setVariable("LABEL_MY_COURSES", gettext("My courses"));
         $content->setVariable("LINK_MY_COURSES", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/?filter=booked" . ($isEditMode ? "&" . $mode : ""));
         $content->parse("BLOCK_YOUR_COURSES");
     }
 }
 if ($isEditMode) {
     $content->setCurrentBlock("BLOCK_EDIT_MODE");
     $content->setVariable("LABEL_EDIT_MODE", gettext("Disable edit mode"));
     $content->setVariable("LINK_EDIT_MODE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . ($isFiltered ? "/?" . $filter : "/"));
     $content->parse("BLOCK_EDIT_MODE");
 } else {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:courses_overview.php

示例14: processData

 public function processData(\IRequestObject $requestObject)
 {
     $htmlBody = "";
     $objectId = $requestObject->getId();
     $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     //icon
     $referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png";
     //reference handling
     $params = $requestObject->getParams();
     if (isset($params["referenced"]) && $params["referenced"] == true) {
         $portletIsReference = true;
         $referenceId = $params["referenceId"];
     } else {
         $portletIsReference = false;
     }
     $portletName = $portlet->get_attribute(OBJ_DESC);
     $this->getExtension()->addCSS();
     $this->getExtension()->addJS();
     //hack
     //include_once("/Users/mjako/koala-development-workspace-next/koala-core/lib/bid/slashes.php");
     include_once PATH_BASE . "/koala-core/lib/bid/slashes.php";
     //get content of portlet
     $content = $portlet->get_attribute("bid:portlet:content");
     if (is_array($content) && count($content) > 0) {
         array_walk($content, "_stripslashes");
     } else {
         $content = array();
     }
     $UBB = new \UBBCode();
     include_once PATH_BASE . "koala-core/lib/bid/derive_url.php";
     $portletInstance = \PortletTopic::getInstance();
     $portletPath = $portletInstance->getExtensionPath();
     $portletFileName = $portletPath . "/ui/html/index.html";
     $tmpl = new \HTML_TEMPLATE_IT();
     $tmpl->loadTemplateFile($portletFileName);
     $tmpl->setVariable("PORTLET_ID", $portlet->get_id());
     $tmpl->setVariable("PORTLET_NAME", $portletName);
     //refernce icon
     if ($portletIsReference) {
         $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
     }
     //popupmenu main
     if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("PortletTopic");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setCommand("GetPopupMenu");
         $popupmenu->setParams(array(array("key" => "menu", "value" => "nerd")));
         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
         $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     }
     if ($portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("Portal");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setParams(array(array("key" => "sourceObjectId", "value" => $portlet->get_id()), array("key" => "linkObjectId", "value" => $referenceId)));
         $popupmenu->setCommand("PortletGetPopupMenuReference");
         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
         $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     }
     if (sizeof($content) > 0) {
         $categoryCount = 0;
         foreach ($content as $category) {
             $tmpl->setCurrentBlock("category");
             //popupmenu category
             if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                 $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_CATEGORY");
                 $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                 $popupmenu = new \Widgets\PopupMenu();
                 $popupmenu->setData($portlet);
                 $popupmenu->setNamespace("PortletTopic");
                 $popupmenu->setElementId("portal-overlay");
                 $popupmenu->setCommand("GetPopupMenuCategory");
                 $popupmenu->setParams(array(array("key" => "category", "value" => $categoryCount)));
                 $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
                 $tmpl->parse("BLOCK_EDIT_BUTTON_CATEGORY");
             }
             $tmpl->setVariable("CATEGORY_TITLE", $UBB->encode($category["title"]));
             $tmpl->setVariable("TOPIC_ENTRY", "");
             if (isset($category["topics"])) {
                 $entryCount = 0;
                 foreach ($category["topics"] as $topic) {
                     $tmpl->setCurrentBlock("topic_entry");
                     //popupmenu topic
                     if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_TOPIC");
                         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                         $popupmenu = new \Widgets\PopupMenu();
                         $popupmenu->setData($portlet);
                         $popupmenu->setNamespace("PortletTopic");
                         $popupmenu->setElementId("portal-overlay");
                         $popupmenu->setCommand("GetPopupMenuEntry");
                         $popupmenu->setParams(array(array("key" => "category", "value" => $categoryCount), array("key" => "entry", "value" => $entryCount)));
                         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
                         $tmpl->parse("BLOCK_EDIT_BUTTON_TOPIC");
                     }
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Index.class.php

示例15: processData

 public function processData(\IRequestObject $requestObject)
 {
     $objectId = $requestObject->getId();
     $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $portlet_name = $portlet->get_attribute(OBJ_DESC);
     $params = $requestObject->getParams();
     //icon
     $referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png";
     //reference handling
     if (isset($params["referenced"]) && $params["referenced"] == true) {
         $portletIsReference = true;
         $referenceId = $params["referenceId"];
     } else {
         $portletIsReference = false;
     }
     //hack
     include_once PATH_BASE . "koala-core/lib/bid/slashes.php";
     //get content of portlet
     $content = $portlet->get_attribute("bid:portlet:content");
     if (is_array($content) && count($content) > 0) {
         array_walk($content, "_stripslashes");
     } else {
         $content = array();
     }
     $portletInstance = \PortletAppointment::getInstance();
     $portletPath = $portletInstance->getExtensionPath();
     $portletFileName = $portletPath . "/ui/html/index.html";
     $tmpl = new \HTML_TEMPLATE_IT();
     $tmpl->loadTemplateFile($portletFileName);
     $tmpl->setVariable("PORTLET_ID", $portlet->get_id());
     $tmpl->setVariable("APPOINTMENT_NAME", $portlet_name);
     $tmpl->setVariable("linkurl", "");
     //refernce icon
     if ($portletIsReference) {
         $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
     }
     //main popupmenu
     if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
         $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("PortletAppointment");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setCommand("GetPopupMenu");
         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
     }
     if ($portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
         $popupmenu = new \Widgets\PopupMenu();
         $popupmenu->setData($portlet);
         $popupmenu->setNamespace("Portal");
         $popupmenu->setElementId("portal-overlay");
         $popupmenu->setParams(array(array("key" => "sourceObjectId", "value" => $portlet->get_id()), array("key" => "linkObjectId", "value" => $referenceId)));
         $popupmenu->setCommand("PortletGetPopupMenuReference");
         $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
     }
     $tmpl->parse("BLOCK_EDIT_BUTTON_MAIN");
     $UBB = new \UBBCode();
     include_once PATH_BASE . "koala-core/lib/bid/derive_url.php";
     if (sizeof($content) > 0) {
         $indexCount = 0;
         foreach ($content as $appointment) {
             $tmpl->setCurrentBlock("BLOCK_TERM");
             //term popupmenu
             if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
                 $tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON_MAIN");
                 $tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
                 $popupmenu = new \Widgets\PopupMenu();
                 $popupmenu->setCommand("GetPopupMenuTerm");
                 $popupmenu->setData($portlet);
                 $popupmenu->setNamespace("PortletAppointment");
                 $popupmenu->setElementId("portal-overlay");
                 $popupmenu->setParams(array(array("key" => "termIndex", "value" => $indexCount)));
                 $tmpl->setVariable("POPUPMENU_ENTRY", $popupmenu->getHtml());
                 $tmpl->parse("BLOCK_EDIT_BUTTON_TERM");
             }
             $indexCount++;
             $tmpl->setVariable("STARTDATE", $appointment["start_date"]["day"] . "." . $appointment["start_date"]["month"] . "." . $appointment["start_date"]["year"]);
             if (trim($appointment["location"]) != "" && trim($appointment["location"]) != "0") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_LOCATION");
                 $tmpl->setVariable("LOCATION", $UBB->encode($appointment["location"]));
                 $tmpl->setVariable("LOCATION_ROW", "");
                 $tmpl->parse("BLOCK_TERM_LOCATION");
             }
             if ($appointment["end_date"]["day"] != "") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_ENDDATE");
                 $tmpl->setVariable("ENDDATE", $appointment["end_date"]["day"] . "." . $appointment["end_date"]["month"] . "." . $appointment["end_date"]["year"]);
                 $tmpl->setVariable("ENDDATE_ROW", "");
                 $tmpl->parse("BLOCK_TERM_ENDDATE");
             }
             if ($appointment["start_time"]["hour"] != "") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_TIME");
                 $tmpl->setVariable("TIME", $appointment["start_time"]["hour"] . "." . $appointment["start_time"]["minutes"] . " Uhr");
                 $tmpl->setVariable("TIME_ROW", "");
                 $tmpl->parse("BLOCK_TERM_TIME");
             }
             if (trim($appointment["description"]) != "" && trim($appointment["description"]) != "0") {
                 $tmpl->setCurrentBlock("BLOCK_TERM_DESCRIPTION");
                 $tmpl->setVariable("DESCRIPTION", $UBB->encode($appointment["description"]));
                 $tmpl->parse("BLOCK_TERM_DESCRIPTION");
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Index.class.php


注:本文中的HTML_TEMPLATE_IT::parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。