本文整理汇总了PHP中HTML_TEMPLATE_IT::setVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_TEMPLATE_IT::setVariable方法的具体用法?PHP HTML_TEMPLATE_IT::setVariable怎么用?PHP HTML_TEMPLATE_IT::setVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_TEMPLATE_IT
的用法示例。
在下文中一共展示了HTML_TEMPLATE_IT::setVariable方法的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:
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();
}
示例3: header
$cache->drop("lms_portal::get_menu_html", $user->get_name(), TRUE);
if (!$group->is_member($user)) {
$backlink = PATH_URL . 'desktop/';
}
header('Location: ' . $backlink);
} else {
$portal->set_problem_description($result["problem"], $result["hint"]);
}
} else {
$portal->set_problem_description(gettext("You are already member of tutorial") . " " . $in_group->get_name() . ".", gettext("Resign from the tutorial to become member here."));
}
}
// GET
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "groups_join.template.html");
$content->setVariable("BACKLINK", $backlink);
if ($group->requested_membership($user)) {
if (empty($_SESSION['confirmation'])) {
// don't warn if we came here on successful membership request...
if ($group instanceof koala_group_course) {
$portal->set_problem_description(gettext("You have already requested a membership for this course."));
} else {
$portal->set_problem_description(gettext("You have already requested a membership for this group."));
}
}
} else {
if ($group->is_member($user)) {
if (empty($_SESSION['confirmation'])) {
// don't warn if we came here on successful membership request...
if ($group instanceof koala_group_course) {
$portal->set_problem_description(gettext("You are already member of this course."));
示例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();
}
示例5: gettext
$actions = '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/">' . gettext("show properties") . '</a><br>';
$actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/edit/">' . gettext("edit properties") . '</a><br>';
$actions .= '<a href="' . PATH_URL . 'doc/' . $image->get_id() . '/deleteImage/" onclick="return confirmDeletion();">' . gettext("delete image") . '</a>';
$imageData = imagecreatefromstring($image->get_content());
$width = $newWidth = imagesx($imageData);
$height = $newHeight = imagesy($imageData);
if ($width > 160) {
$newHeight = (int) ($height * 160 / $width);
$newWidth = 160;
}
if ($newHeight > 80) {
$newWidth = (int) ($newWidth * 80 / $newHeight);
$newHeight = 80;
}
$content->setCurrentBlock("BLOCK_IMAGE");
$content->setVariable("IMAGE_NAME", $image->get_name());
$content->setVariable("IMAGE_ID", $image->get_id());
$content->setVariable("IMAGE_DESCRIPTION", $image->get_attribute('OBJ_DESC'));
$content->setVariable("IMAGE_LINK", PATH_URL . "get_document.php?id=" . $image->get_id() . "&width=" . $newWidth . "&height=" . $newHeight);
$content->setVariable("PREVIEW_LINK", "javascript:showBox(" . $image->get_id() . "," . $width . "," . $height . ");");
$content->setVariable("IMAGE_ACTIONS", $actions);
$content->parse("BLOCK_IMAGE");
}
}
$question = gettext("Do you really want to delete this image?");
$note = gettext("NOTE: All wiki-entries containing this image have to be updated manually!");
$content->setVariable("QUESTION", $question);
$content->setVariable("NOTE", $note);
$content->setVariable("LABEL_CLOSE", gettext("close"));
$content->setVariable("BACK_LINK", PATH_URL . "wiki/" . $wiki_container->get_id() . "/");
$content->setVariable("BACK_LABEL", gettext("back"));
示例6: gettext
$html_handler_group = new koala_html_group($group);
$html_handler_group->set_context("members");
$members = $cache->call("lms_steam::group_get_members", $group->get_id());
break;
}
$is_admin = $group->is_admin($user);
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html");
$is_member = $group->is_member($user);
//echo "is_member? " . $is_member;
$privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY");
//echo "attribute: ''" . $privacy_deny_participants . "''";
if ($privacy_deny_participants == PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS && !$is_member) {
//echo "*** deny ***";
//TODO
$content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", gettext("Participants are hidden."));
} else {
//echo "*** permit ***";
$no_members = count($members);
if ($no_members > 0) {
switch (get_class($group)) {
case "koala_group_course":
$groupname = $group->get_course_id();
break;
default:
$groupname = $group->get_name();
break;
}
if (!USER_LIST_NO_PAGEING) {
$start = $portal->set_paginator($content, 10, $no_members, "(" . str_replace("%NAME", h($groupname), gettext("%TOTAL members in %NAME")) . ")");
$end = $start + 10 > $no_members ? $no_members : $start + 10;
示例7: gettext
$content->setVariable("HINT_BB_IMAGE", gettext("image"));
$content->setVariable("LABEL_BB_URL", gettext("URL"));
$content->setVariable("HINT_BB_URL", gettext("web link"));
$content->setVariable("LABEL_BB_MAIL", gettext("MAIL"));
$content->setVariable("HINT_BB_MAIL", gettext("email link"));
//hier Voreinstellung?!
//$values[ "privacy_deny_participants" ] = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS; //TODO
//$values[ "privacy_deny_documents" ] = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS;
//$privacy_deny_participants_default = PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS;
//$privacy_deny_documents_default = PERMISSION_GROUP_PRIVACY_DENY_DOCUMENTS;
if ($create_new && $is_public || $grouptype !== "group_moderated" && $grouptype !== "group_private") {
// Add group maxsize field
$m = new HTML_TEMPLATE_IT();
$m->loadTemplateFile(PATH_TEMPLATES . "groups_maxsize_widget.template.html");
$m->setCurrentBlock("BLOCK_MAXSIZE");
$m->setVariable("LABEL_MAXSIZE", gettext("Max number of participants"));
$m->setVariable("LABEL_MAXSIZE_DSC", gettext("To limit the max number of participants for your course enter a number greater than 0. Leave this field blank or enter a '0' for no limitation."));
isset($values["maxsize"]) ? $m->setVariable("VALUE_MAXSIZE", h($values["maxsize"])) : "";
$mhtml = $m->get();
}
$content->setVariable("BACKLINK", "<a class=\"button\" href=\"{$backlink}\">" . gettext("back") . "</a>");
// extensions:
if (count($extensions) > 0) {
$content->setCurrentBlock("BLOCK_EXTENSIONS");
$content->setVariable("LABEL_EXTENSIONS", gettext("Extensions"));
$extension_list = array();
foreach ($extensions as $extension) {
$extension_name = $extension->get_name();
$content->setCurrentBlock("BLOCK_EXTENSION");
$content->setVariable("EXTENSION_ID", $extension_name);
$content->setVariable("EXTENSION_NAME", $extension->get_display_name());
示例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: array
$inventory = $wiki_container->get_inventory();
if (!is_array($inventory)) {
$inventory = array();
}
if (sizeof($inventory) > 0) {
steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $inventory, array(OBJ_NAME, OBJ_DESC, DOC_MIME_TYPE));
$images = array();
foreach ($inventory as $object) {
$mime = strtolower($object->get_attribute(DOC_MIME_TYPE));
if ($mime === "image/jpg" || $mime === "image/jpeg" || $mime === "image/gif" || $mime === "image/png") {
$images[] = $object;
}
}
foreach ($images as $image) {
$widget->setCurrentBlock("BLOCK_IMAGE");
$widget->setVariable("WIKI_IMAGE_NAME", $image->get_name());
$widget->setVariable("WIKI_IMAGE_ADD_LINK", "javascript:insert('[[Image:" . $image->get_identifier() . "]]', '', 'formular', 'values[body]')");
$widget->setVariable("WIKI_IMAGE_VIEW_LINK", $image->get_name());
$widget->setVariable("WIKI_IMAGE_TITLE", $image->get_name() . " ( " . $image->get_attribute(OBJ_DESC) . " )");
$widget->setVariable("WIKI_IMAGE_LINK", PATH_URL . "get_document?id=" . $image->get_id() . "&width=40&height=80");
$widget->setVariable("WIKI_IMAGE_VIEW_LINK", PATH_URL . "doc/" . $image->get_id() . "/");
$widget->setVariable("WIKI_IMAGE_TITLE", $image->get_name());
$widget->setVariable("WIKI_IMAGE_ADD", gettext("Insert"));
$widget->setVariable("WIKI_IMAGE_VIEW", gettext("View"));
$widget->parse("BLOCK_IMAGE");
}
}
$widget->setVariable("UPLOAD_TEXT", gettext("Upload an image"));
$widget->setVariable("UPLOAD_LINK", PATH_URL . "upload?env=" . $wiki_container->get_id());
$widget->setVariable("WIKI_IMAGE_EXTERNAL", gettext("External image"));
$widget->setVariable("WIKI_IMAGE_EXTERNAL_LINK", "javascript:insert('[[Image:http://', ']]', 'formular', 'values[body]')");
示例10: gettext
//$excelRowArray[$matriculationNumber]=$examOffice->getExcelRowString($tmpFileDestination, $matriculationNumber); //HIS excel
$firstName = $ldapManager->matriculationNumber2firstName($matriculationNumber);
$lastName = $ldapManager->matriculationNumber2lastName($matriculationNumber);
//$imtLogin = $ldapManager->matriculationNumber2imtLogin($matriculationNumber); //removed for speed
$matriculationNumbersTable .= "<tr>";
$matriculationNumbersTable .= "<td>" . $lastName . "</td>";
$matriculationNumbersTable .= "<td>" . $firstName . "</td>";
$matriculationNumbersTable .= "<td>" . $matriculationNumber . "</td>";
$matriculationNumbersTable .= "<td> <input type='checkbox' name='PARTICIPANT_" . $matriculationNumber . "' checked='checked'> </input> </td>";
$matriculationNumbersTable .= "</tr>";
}
$excelRowArray = $examOffice->parseFullExcel2rowStringArray($tmpFileDestination);
$_SESSION["exam_organization_excelRowArray"] = $excelRowArray;
//HIS excel
$matriculationNumbersTable .= "</table>";
$content->setVariable("MATRICULATION_NUMBERS_TABLE", $matriculationNumbersTable);
$content->setVariable("INFO_MATRICULATION_NUMBERS_TABLE", gettext("The following matriculation numbers will be added to the exam organization database"));
$content->setVariable("BUTTON_SAVE_LIST", '<input type="submit" name="import_participants_save" value="' . gettext('Add choosen participants to exam') . '"/>');
$content->setVariable("BUTTON_SAVE_LIST_REPLACE", '<input type="submit" name="import_participants_save_replace" value="' . gettext('Replace participants for this exam with choosen participants') . '"/>');
unlink($tmpFileDestination);
//delete temp file
$showedParsedTable = true;
}
}
//end post data
//create site
//some page content
if ($is_admin) {
//clipboard:
$koala_user = new koala_html_user(new koala_user($current_user));
//$clipboard_menu = $koala_user->get_clipboard_menu( $koala_container ); //error
示例11: define
<?php
if (!defined("PATH_TEMPLATES_UNITS_PYRAMID")) {
define("PATH_TEMPLATES_UNITS_PYRAMID", PATH_EXTENSIONS . "units_pyramiddiscussion/templates/");
}
//$portal = lms_portal::get_instance();
//$portal->initialize( GUEST_ALLOWED );
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("units", array("subcontext" => "unit"));
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_PYRAMID . "units_pyramiddiscussion.template.html");
$content->setVariable("VALUE_DESC", $unit->get_attribute("OBJ_DESC"));
$content->setVariable("VALUE_LONG_DESC", get_formatted_output($unit->get_attribute("OBJ_LONG_DESC")));
$appearance = $unit->get_attribute("UNIT_PYRAMIDDISCUSSION_APPEARANCE");
if ($appearance === 0 || $appearance === "") {
$appearance = "direct";
}
$unit_url = "https://" . $GLOBALS["STEAM"]->get_config_value("web_server") . ($GLOBALS["STEAM"]->get_config_value("web_port_http") != "443" ? ":" . $GLOBALS["STEAM"]->get_config_value("web_port_http") : "") . $unit->get_steam_object()->get_path() . "/";
$unit_url = str_replace("?", "%3f", $unit_url);
if ($appearance === "direct") {
header("Location: " . $unit_url);
exit;
} else {
if ($appearance == "2") {
$content->setCurrentBlock("BLOCK_IFRAME");
$content->setVariable("VALUE_IFRAME_URL", $unit_url);
$content->parse("BLOCK_IFRAME");
} else {
$content->setCurrentBlock("BLOCK_LINK");
$content->setVariable("VALUE_LINK_URL", $unit_url);
$content->setVariable("VALUE_LINK_TEXT", gettext("Show pyramiddiscussion"));
示例12: array
require_once( "Cache/Lite.php" );
$cache = new Cache_Lite( array( "cacheDir" => PATH_CACHE ) );
$cache->clean( $user->get_name() );
$cache->clean( $user->get_id() );*/
$lang_index = language_support::get_language_index();
language_support::choose_language($lang_index[$values["USER_LANGUAGE"]]);
$cache = get_cache_function(lms_steam::get_current_user()->get_name());
$cache->drop("lms_portal::get_menu_html", lms_steam::get_current_user()->get_name(), TRUE);
$cache = get_cache_function($user->get_name());
$cache->drop("lms_steam::user_get_profile", $user->get_name());
$_SESSION["confirmation"] = gettext("Your profile data has been saved.");
header("Location: " . PATH_URL . "profile_edit.php");
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "profile_edit.template.html");
$content->setVariable("LABEL_INFO", gettext("Please complete your profile. None of the fields are mandatory. Some of the fields can not be changed due to central identity management at the IMT.<br/><b>Note: With the button <i>Profile Privacy</i> you can control which information can be seen by other users.</b>"));
$content->setVariable("LABEL_PROFILE", gettext("General Information"));
$content->setVariable("LABEL_LOOKING", gettext("Your buddy icon"));
$content->setVariable("LABEL_MAIL_PREFS", gettext("Your mail preferences"));
$content->setVariable("LABEL_PROFILE_PRIVACY", gettext("Profile Privacy"));
$content->setVariable("LINK_BUDDY_ICON", PATH_URL . "profile_icon.php");
$content->setVariable("LINK_MAIL_PREFS", PATH_URL . "messages_prefs.php");
$content->setVariable("LINK_PROFILE_PRIVACY", PATH_URL . "profile_privacy.php");
$content->setVariable("LABEL_FIRST_NAME", gettext("First name"));
$content->setVariable("LABEL_LAST_NAME", gettext("Last name"));
$content->setVariable("LABEL_TITLE", gettext("Academic title"));
$content->setVariable("LABEL_DEGREE", gettext("Academic degree"));
$content->setVariable("LABEL_IF_AVAILABLE", gettext("only if available"));
$content->setVariable("LABEL_STATUS", gettext("Status"));
$content->setVariable("LABEL_GENDER", gettext("Gender"));
$content->setVariable("LABEL_FEMALE", gettext("female"));
示例13: elseif
// UND EINLOGGE
// 2 FAELLE: ENTWEDER SERVICE IST BEANTRAGT => FREISCHALTEN
// SERVICE IST NICHT BEANTRAGT, DANN BEANTRAGEN UND DANN FREISCHALTEN
echo "Antragsstatus: " . $result . "\n";
if (!strcmp($result, "NONE") || !strcmp($result, "WANTED")) {
if (!strcmp($result, "NONE")) {
// Antrag stellen
$result = $client->__soapCall('request', $parameter);
echo "Antragsstatus: " . $result . "\n";
}
// Antragstatus bestimmen
$result = $client->__soapCall('getState', $parameter);
echo "Antragsstatus: " . $result . "\n";
// Antrag genehmigen
$result = $client->__soapCall('approve', $parameter);
echo "Antragsstatus: " . $result . "\n";
// Antragstatus bestimmen
$result = $client->__soapCall('getState', $parameter);
echo "Antragsstatus: " . $result . "\n";
}
} elseif (!empty($_SESSION["LDAP_LOGIN"]) && !empty($_SESSION["LDAP_PASSWORD_ENCR"])) {
$content = new HTML_TEMPLATE_IT(PATH_TEMPLATES);
$content->loadTemplateFile("disclaimer.de_DE.html");
$content->setVariable("PATH_IMAGES", PATH_STYLE . "images/");
$content->setVariable("LDAP_UID", $_SESSION["LDAP_LOGIN"]);
$portal->set_page_title(gettext("Disclaimer"));
$portal->set_page_main(gettext("Disclaimer"), $content->get());
} else {
print "FALSCH AUFGERUFEN";
}
$portal->show_html();
示例14: processData
public function processData(\IRequestObject $requestObject)
{
$objectId = $requestObject->getId();
$portletInstance = \PortletMedia::getInstance();
$portletPath = $portletInstance->getExtensionPath();
$portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
//icon
$referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png";
//reference handling
$params = $requestObject->getParams();
if (isset($params["referenced"]) && $params["referenced"] == true) {
$portletIsReference = true;
$referenceId = $params["referenceId"];
} else {
$portletIsReference = false;
}
//hack
include_once PATH_BASE . "koala-core/lib/bid/slashes.php";
//get content of portlet
$content = $portlet->get_attribute("bid:portlet:content");
if (is_array($content) && count($content) > 0) {
array_walk($content, "_stripslashes");
} else {
$content = array();
}
if (sizeof($content) > 0) {
$portletFileName = $portletPath . "/ui/html/index.html";
$tmpl = new \HTML_TEMPLATE_IT();
$tmpl->loadTemplateFile($portletFileName);
//popupmenu
if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
$popupmenu = new \Widgets\PopupMenu();
$popupmenu->setData($portlet);
$popupmenu->setNamespace("PortletMedia");
$popupmenu->setElementId("portal-overlay");
$tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
}
if ($portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
$popupmenu = new \Widgets\PopupMenu();
$popupmenu->setData($portlet);
$popupmenu->setNamespace("Portal");
$popupmenu->setElementId("portal-overlay");
$popupmenu->setParams(array(array("key" => "sourceObjectId", "value" => $portlet->get_id()), array("key" => "linkObjectId", "value" => $referenceId)));
$popupmenu->setCommand("PortletGetPopupMenuReference");
$tmpl->setVariable("POPUPMENU", $popupmenu->getHtml());
}
$tmpl->setVariable("EDIT_BUTTON", "");
$tmpl->setVariable("PORTLET_ID", $portlet->get_id());
$tmpl->setVariable("HEADLINE", $content["headline"]);
//refernce icon
if ($portletIsReference) {
$tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>");
}
$tmpl->setVariable("URL", $content["url"]);
$tmpl->setVariable("DESCRIPTION", $content["description"]);
$media_type = $content["media_type"];
if ($media_type == "image") {
$tmpl->setCurrentBlock("image");
$tmpl->parse("MEDIA_ELEMENT", "image");
$tmpl->parse("image");
} else {
if ($media_type == "movie") {
$tmpl->setCurrentBlock("movie");
$width = str_replace(array("px", "%"), "", $portlet->get_environment()->get_attribute("bid:portal:column:width")) - 10;
$media_player = $portletInstance->getAssetUrl() . 'mediaplayer.swf';
$tmpl->setVariable("MEDIA_PLAYER", $media_player);
$tmpl->setVariable("MEDIA_PLAYER_WIDTH", $width);
$tmpl->setVariable("MEDIA_PLAYER_HEIGHT", round($width * 3 / 4));
$tmpl->parse("movie");
} else {
if ($media_type == "audio") {
$tmpl->setCurrentBlock("audio");
$width = str_replace(array("px", "%"), "", $portlet->get_environment()->get_attribute("bid:portal:column:width")) - 10;
$media_player = $portletInstance->getAssetUrl() . 'emff_lila_info.swf';
$tmpl->setVariable("MEDIA_PLAYER", $media_player);
$tmpl->setVariable("MEDIA_PLAYER_WIDTH", $width);
$tmpl->setVariable("MEDIA_PLAYER_HEIGHT", round($width * 11 / 40));
$tmpl->parse("audio");
}
}
}
if ($portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) {
$tmpl->setCurrentBlock("BLOCK_EDIT_BUTTON");
$tmpl->setVariable("PORTLET_ID_EDIT", $portlet->get_id());
$tmpl->parse("BLOCK_EDIT_BUTTON");
}
//output
$htmlBody = $tmpl->get();
} else {
//output for no content
$htmlBody = "";
}
$this->content = $htmlBody;
//widgets
$outputWidget = new \Widgets\RawHtml();
$outputWidget->setHtml($htmlBody);
//popummenu
$popupmenu = new \Widgets\PopupMenu();
$popupmenu->setData($portlet);
$popupmenu->setNamespace("PortletMedia");
//.........这里部分代码省略.........
示例15: gettext
}
if (!isset($backlink) || empty($backlink)) {
$upper_link = lms_steam::get_link_to_root($document);
$backlink = $upper_link["link"];
}
if (lms_steam::delete($document)) {
$_SESSION["confirmation"] = str_replace("%DOC_NAME", $doc_name, gettext("%DOC_NAME successfully deleted."));
// DASS DAS DOKUMENT IRGENDWO IM CACHE LIEGT, IST MIR ZZT NICHT BEKANNT.
// FALLS CACHE-BEREINIGUNG NOTWENDIG IST, DANN HIER.
header("Location: " . $backlink);
exit;
} else {
throw new Exception("Cannot delete document");
}
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "document_delete.template.html");
$content->setVariable("FORM_ACTION", "");
$content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?"));
$content->setVariable("INFO_DELETE_DOCUMENT", str_replace("%DOCNAME", h($document->get_name()), gettext("You are going to delete %DOCNAME.")));
$content->setVariable("LABEL_DELETE_IT", gettext("YES, DELETE THIS DOCUMENT"));
$content->setVariable("DELETE_BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("BACK_LINK", $_SERVER["HTTP_REFERER"]);
$content->setVariable("LABEL_RETURN", gettext("back"));
// TEST
// $env = $document->get_environment();
// if ( is_object( $env ) && is_object( $koala_container = koala_object::get_koala_object( $env ) ) )
// $backlink = $koala_container->get_url();
//error_log("backlink=" . $backlink);
$portal->set_page_main(array(lms_steam::get_link_to_root($env), array("link" => "", "name" => h($document->get_name()))), $content->get(), "");
$portal->show_html();