本文整理汇总了PHP中HTML_TEMPLATE_IT::get方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_TEMPLATE_IT::get方法的具体用法?PHP HTML_TEMPLATE_IT::get怎么用?PHP HTML_TEMPLATE_IT::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_TEMPLATE_IT
的用法示例。
在下文中一共展示了HTML_TEMPLATE_IT::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processData
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);
}
示例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:
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();
}
示例4: 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());
}
示例5: buildChecksum
$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;
}
示例6: gettext
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();
示例7: gettext
$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'");
示例8: 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);
//.........这里部分代码省略.........
示例9: catch
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;
示例10: 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();
示例11: foreach
// 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();
示例12: getHtml
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();
}
示例13: processData
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>";
//.........这里部分代码省略.........
示例14: h
$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();
示例15: define
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();
}