public function processData(\IRequestObject $requestObject) { $objectId = $requestObject->getId(); $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); //icon $referIcon = \Portal::getInstance()->getAssetUrl() . "icons/refer_white.png"; //reference handling $params = $requestObject->getParams(); if (isset($params["referenced"]) && $params["referenced"] == true) { $portletIsReference = true; $referenceId = $params["referenceId"]; } else { $portletIsReference = false; } $portletName = $portlet->get_attribute(OBJ_DESC); $this->getExtension()->addCSS(); $this->getExtension()->addJS(); //old bib include_once PATH_BASE . "koala-core/lib/bid/slashes.php"; //get content of portlet $content = $portlet->get_attribute("bid:portlet:content"); if (is_array($content) && count($content) > 0) { array_walk($content, "_stripslashes"); } else { $content = array(); } $portletInstance = \PortletRss::getInstance(); $portletPath = $portletInstance->getExtensionPath(); $num_items = isset($content["num_items"]) ? $content["num_items"] : 0; if (isset($content["address"])) { $feed = new \SimplePie(); $feed->set_cache_location(PATH_CACHE); $feed->set_feed_url(derive_url($content["address"])); $feed->init(); if ($num_items == 0) { $items = $feed->get_items(); } else { $items = array_slice($feed->get_items(), 0, $num_items); } } $desc_length = isset($content["desc_length"]) ? $content["desc_length"] : 0; if (isset($content["allow_html"])) { $allow_html = $content["allow_html"] == "checked" ? true : false; } else { $allow_html = false; } $UBB = new \UBBCode(); include_once PATH_BASE . "koala-core/lib/bid/derive_url.php"; $portletFileName = $portletPath . "/ui/html/index.html"; $tmpl = new \HTML_TEMPLATE_IT(); $tmpl->loadTemplateFile($portletFileName); $tmpl->setVariable("EDIT_BUTTON", ""); $tmpl->setVariable("PORTLET_ID", $portlet->get_id()); $tmpl->setVariable("RSS_NAME", $portletName); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } //popupmenu if (!$portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("PortletRss"); $popupmenu->setElementId("portal-overlay"); $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml()); } if ($portletIsReference && $portlet->check_access_write($GLOBALS["STEAM"]->get_current_steam_user())) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("Portal"); $popupmenu->setElementId("portal-overlay"); $popupmenu->setParams(array(array("key" => "sourceObjectId", "value" => $portlet->get_id()), array("key" => "linkObjectId", "value" => $referenceId))); $popupmenu->setCommand("PortletGetPopupMenuReference"); $tmpl->setVariable("POPUPMENU", $popupmenu->getHtml()); } if (sizeof($content) > 0) { if ($feed->error()) { $tmpl->setVariable("NOITEMSTEXT", "RSS-Ladefehler"); } else { if (count($items) == 0) { $tmpl->setVariable("NOITEMSTEXT", "RSS-Feed ist leer."); } else { foreach ($items as $item) { $tmpl->setCurrentBlock("BLOCK_RSS_ITEM"); if ($allow_html) { $itemtitle = $item->get_title(); $itemdesc = $item->get_description(); } else { $itemtitle = strip_tags($item->get_title()); $itemdesc = strip_tags($item->get_description()); } if ($desc_length == 0) { $itemdesc = ""; } else { if ($desc_length > 0 && strlen($itemdesc) > $desc_length) { $itemdesc = substr($itemdesc, 0, $desc_length) . "..."; } } $tmpl->setVariable("ITEMTITLE", $itemtitle); $tmpl->setVariable("ITEMDESC", $itemdesc); $tmpl->setVariable("ITEMURL", derive_url($item->get_permalink())); $tmpl->setVariable("LINK", ""); $tmpl->parse("BLOCK_RSS_ITEM"); } } } } else { $tmpl->setVariable("NOITEMSTEXT", "RSS-Feed nicht konfiguriert."); } $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->setHtml($htmlBody); $outputWidget->addWidget(new \Widgets\PopupMenu()); $this->rawHtmlWidget = $outputWidget; }
public function getHtmlForUrl(UrlRequestObject $urlRequestObject) { $steam = $GLOBALS["STEAM"]; //current room steam object if (isset($object) && (int) $object != 0) { $current_room = steam_factory::get_object($steam->get_id(), $object); } else { $current_room = $steam->get_current_steam_user()->get_workroom(); } //current room steam object //$current_room = ($object != 0)?new steam_object($object):$steam->get_workroom_user($steam->login_user); $current_room_path = $current_room->get_path(1); $current_room_data = $current_room->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_LAST_CHANGED, "bid:tags", "bid:presentation", "bid:collectiontype", "bid:description"), 1); $current_room_creator = $current_room->get_creator(1); //check if user may write in this folder $write_allowed = $current_room->check_access_write($steam->get_current_steam_user(), 1); //get inventory and inventorys attributes if allowed to $allowed = $current_room->check_access_read($steam->get_current_steam_user(), 1); $result = $steam->buffer_flush(); $write_allowed = $result[$write_allowed]; $allowed = $result[$allowed]; $current_room_path = $result[$current_room_path]; $current_room_data = $result[$current_room_data]; $current_room_creator = $result[$current_room_creator]; $current_room_creator_name = $current_room_creator->get_name(); $current_room_display_name = str_replace("'s workarea", "", stripslashes($current_room_data[OBJ_NAME])); if (isset($current_room_data[OBJ_DESC]) && $current_room_data[OBJ_DESC] != "") { $current_room_display_name = $current_room_data[OBJ_DESC]; } $current_room_display_name = str_replace("s workroom.", "", $current_room_display_name); $current_room_display_name = str_replace("s workroom", "", $current_room_display_name); $current_room_display_name = preg_replace("/.*'s bookmarks/", "Lesezeichen", $current_room_display_name); if ($allowed && $current_room instanceof steam_container) { $inventory = $current_room->get_inventory("", array("DOC_MIME_TYPE", "DOC_LAST_MODIFIED", "CONT_LAST_MODIFIED", "OBJ_LAST_CHANGED", "bid:tags", "bid:presentation", "bid:collectiontype", "bid:hidden", "bid:doctype", "bid:description", "DOC_EXTERN_URL", "OBJ_CREATION_TIME")); } else { $inventory = array(); } if (sizeof($inventory) > 0) { $hascontent = true; } else { $hascontent = false; } //get head mounted content if needed $head_mounted = $current_room_data["bid:presentation"] === "head" && is_array($inventory) && isset($inventory[0]) && $inventory[0] instanceof steam_document; if ($head_mounted) { $tmp_content = new doc_content($steam, $inventory[0]); $head_mounted_content = $tmp_content->get_content($config_webserver_ip); } //****************************************************** //** Display Stuff //****************************************************** //template stuff $contenttemplate = new HTML_TEMPLATE_IT(); $contenttemplate->loadTemplateFile($this->getExtensionPath() . "ui/taggedfolder.template.html"); $contenttemplate->setVariable("FOLDER_ID", $current_room->get_id()); $contenttemplate->setVariable("FOLDER_NAME", $current_room_display_name); //$contenttemplate->setVariable("FOLDER_PATH", PATH_URL . $current_room_path . "/"); //$contenttemplate->setVariable("FOLDER_ICON", (($current_room_data["bid:presentation"] === "index")?"$config_webserver_ip/icons/mimetype/folder_closed_index.gif":"$config_webserver_ip/icons/mimetype/folder_closed.gif")); $contenttemplate->setVariable("FOLDER_LAST_CHANGED", date("d.m.Y H:i", $current_room_data[OBJ_LAST_CHANGED])); if (sizeof($inventory) == 0) { $contenttemplate->setCurrentBlock("no_content"); $contenttemplate->setVariable("LANGUAGE_NO_CONTENT", gettext("LANGUAGE_NO_CONTENT")); $contenttemplate->parse("no_content"); } return $contenttemplate->get(); //set menu to write mode, if the user's access rights allow so and the user is not the guest user if ($write_allowed && $steam->get_login_user()->get_name() != "guest") { //$tpl->set_var("MENU",derive_menu("contentframe", $current_room, $current_room_path, 2)); } //display directory //$content = false; $tnr = array(); foreach ($inventory as $item) { $tnr[$item->get_id()] = array(); $tnr[$item->get_id()]["creator"] = $item->get_creator(1); $tnr[$item->get_id()]["writeaccess"] = $item->check_access_write($steam->get_login_user(), 1); if ($item instanceof steam_document) { $tnr[$item->get_id()]["contentsize"] = $item->get_content_size(1); } if ($item instanceof steam_link) { $tnr[$item->get_id()]["link_object"] = $item->get_link_object(1); } } $result = $steam->buffer_flush(); $creators = array(); $linktargets = array(); $accessresult = array(); $sizeresult = array(); foreach ($inventory as $item) { $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]]; $accessresult[$item->get_id()] = $result[$tnr[$item->get_id()]["writeaccess"]]; if ($item instanceof steam_document) { $sizeresult[$item->get_id()] = $result[$tnr[$item->get_id()]["contentsize"]]; } if ($item instanceof steam_link) { $linktargets[$item->get_id()] = $result[$tnr[$item->get_id()]["link_object"]]; } } steam_factory::load_attributes($steam, $creators, array(OBJ_NAME)); // If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite // insert caching mechanisms in here... // below this, the steam connector is no longer used... $tags = array(); foreach ($inventory as $item) { if (!$item instanceof steam_trashbin) { $itemname = $item->get_attribute(OBJ_NAME); $itemdescription = $item->get_attribute(OBJ_DESC); $itemmimetype = $item->get_attribute(DOC_MIME_TYPE); $lastchanged = $item->get_attribute(DOC_LAST_MODIFIED); if ($lastchanged === 0) { $lastchanged = $item->get_attribute(OBJ_CREATION_TIME); } // set display name if ($itemdescription != "") { $object_display_name = $itemdescription; } else { $object_display_name = stripslashes($itemname); } $owner = $creators[$item->get_id()]->get_name(); $bidDescription = $item->get_attribute("bid:description"); $bidTags = $item->get_attribute("bid:tags"); if (!$bidDescription) { $bidDescription = ""; } if (!$bidTags) { $bidTags = ""; } foreach (explode(" ", $bidTags) as $tag) { $tag = trim($tag); if (strlen($tag) > 0) { if (!in_array($tag, $tags)) { array_push($tags, $tag); } } } $tpl->set_var(array("OBJECT_ID" => $item->get_id(), "OBJECT_NAME" => $object_display_name, "OBJECT_NAME_GREY" => $object_display_name, "OBJECT_FILENAME" => stripslashes($itemname), "OBJECT_LAST_CHANGED" => date("d.m.Y H:i", $lastchanged), "bid:description" => $bidDescription, "bid:tags" => $bidTags, "OBJECT_OWNER" => $owner)); if ($show_hidden) { if ($content == false && $head_mounted) { $tpl->parse("OBJECT_NAME", "head_mounted_name"); } else { if ($item->get_attribute("bid:hidden")) { $tpl->parse("OBJECT_NAME", "grey_name"); } } } else { if ($item->get_attribute("bid:hidden")) { continue; } } //parse correct Properties symbol $access = $accessresult[$item->get_id()]; $tpl->parse("ITEM_PROPERTIES", $access ? "item_properties_on" : "item_properties_off"); $visible = false; // render a steam_document if ($item instanceof steam_document) { //derive mimetype $mimetype = derive_icon(array("object" => $item, "name" => $itemname, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:doctype" => $item->get_attribute("bid:doctype"), "mimetype" => $itemmimetype)); //derive size $size = $sizeresult[$item->get_id()]; $tpl->set_var(array("OBJECT_SIZE" => $size > 1048576 ? round($size / 1048576 + 0.05, 1) . " MB" : round($size / 1024 + 0.5) . " kB", "OBJECT_ICON" => $mimetype)); //care for documents not to be displayed in the browser if ($itemmimetype === "text/html" || $itemmimetype === "text/plain" || $itemmimetype === "text/css" || $itemmimetype === "text/xml" || $itemmimetype === "application/vnd.google-earth.kml+xml" || $itemmimetype === "image/gif" || $itemmimetype === "image/jpg" || $itemmimetype === "image/jpeg" || $itemmimetype === "image/png") { $tpl->parse("ITEM_LINK", "document"); $tpl->parse("DOCUMENTS", "item", true); } else { $tpl->parse("ITEM_LINK", "nb_document"); $tpl->parse("DOCUMENTS", "item", true); } $visible = true; } else { if ($item instanceof steam_link || $item instanceof steam_exit) { $linked_object = $linktargets[$item->get_id()]; if ($item instanceof steam_link) { if ($itemdescription != "") { $name = $itemdescription; } else { $name = $itemname; } if ($linked_object instanceof steam_document) { $size = $linked_object->get_content_size(); $tpl->set_var(array("OBJECT_SIZE" => $size > 1048576 ? round($size / 1048576 + 0.05, 1) . " MB" : round($size / 1024 + 0.5) . " kB")); } else { $tpl->set_var(array("OBJECT_SIZE" => "")); } } if ($item instanceof steam_exit) { if ($itemdescription != "") { $name = str_replace("s workroom.", "", stripslashes($itemdescription)); } else { $name = str_replace("'s workarea", "", stripslashes($itemname)); } } //derive mimetype $mimetype = derive_icon(array("object" => $item, "name" => $itemname, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:doctype" => $item->get_attribute("bid:doctype"), "mimetype" => $itemmimetype)); $tpl->set_var(array("LINK_OBJECT_ID" => is_object($linked_object) ? $linked_object->get_id() : -1, "OBJECT_NAME" => $name, "OBJECT_ICON" => $mimetype)); $tpl->parse("ITEM_LINK", "link"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item instanceof steam_docextern) { $url = derive_url($item->get_attribute(DOC_EXTERN_URL)); $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_LINK" => $url, "OBJECT_ICON" => "./icons/mimetype/www.gif")); $tpl->parse("ITEM_LINK", "www-link"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item->get_attribute("bid:doctype") != "") { $icon = array("bid:doctype" => $item->get_attribute("bid:doctype")); $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon))); $tpl->parse("ITEM_LINK", "folder"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item instanceof steam_messageboard) { $icon = array("object" => $item); $tpl->set_var(array("OBJECT_NAME" => stripslashes($itemname), "OBJECT_NAME_GREY" => stripslashes($itemname), "OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon))); $tpl->parse("ITEM_LINK", "folder"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item instanceof steam_container && !$item instanceof steam_user) { $icon = array("object" => $item, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:presentation" => $item->get_attribute("bid:presentation")); $icon = derive_icon($icon); $lastchanged = $item->get_attribute("CONT_LAST_MODIFIED"); if ($lastchanged === 0) { $lastchanged = $item->get_attribute(OBJ_CREATION_TIME); } $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_ICON" => $icon, "OBJECT_LAST_CHANGED" => date("d.m.Y H:i", $lastchanged))); $tpl->parse("ITEM_LINK", "folder"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } } } } } } //parse javascript mark/unmark if ($visible) { $tpl->parse("MARK", "mark", 1); $tpl->parse("UNMARK", "unmark", 1); } $content = $content || $visible; } } // if(!$content) $tpl->parse("DOCUMENTS", "no_content"); natsort($tags); $tagString = implode(" ", $tags); $tpl->set_var(array("TAGS" => $tagString)); $_SESSION["tags"] = $tagString; out(); //Logout & Disconnect $steam->disconnect(); function out() { //parse all out global $tpl; $tpl->parse("OUT", "content"); $tpl->p("OUT"); } }
$picture_width = ""; } else { if ($bare_picture_width > $column_width - 25) { $picture_width = $column_width - 25; } } } $tmpl->set_var(array("MESSAGE_PICTURE_ID" => $message->get_attribute("bid:portlet:msg:picture_id"), "MESSAGE_PICTURE_ALIGNMENT" => $message->get_attribute("bid:portlet:msg:picture_alignment"), "MESSAGE_PICTURE_WIDTH" => $picture_width)); $tmpl->parse("MESSAGE_PICTURE", "message_picture"); } //parse in link if it exists if (trim($message->get_attribute("bid:portlet:msg:link_url")) != "") { if (trim($message->get_attribute("bid:portlet:msg:link_open")) != "checked") { $tmpl->set_var(array("MESSAGE_LINK_URL_LABEL" => $message->get_attribute("bid:portlet:msg:link_url_label") !== "" ? $UBB->encode($message->get_attribute("bid:portlet:msg:link_url_label")) : $message->get_attribute("bid:portlet:msg:link_url"), "MESSAGE_LINK_URL" => derive_url($message->get_attribute("bid:portlet:msg:link_url")), "MESSAGE_LINK_TARGET" => "_top")); } else { $tmpl->set_var(array("MESSAGE_LINK_URL_LABEL" => $message->get_attribute("bid:portlet:msg:link_url_label") !== "" ? $UBB->encode($message->get_attribute("bid:portlet:msg:link_url_label")) : $message->get_attribute("bid:portlet:msg:link_url"), "MESSAGE_LINK_URL" => derive_url($message->get_attribute("bid:portlet:msg:link_url")), "MESSAGE_LINK_TARGET" => "_blank")); } $tmpl->parse("MESSAGE_LINK", "message_link"); } if ($separator) { $tmpl->parse("MESSAGES", "separator", true); } $tmpl->parse("MESSAGES", "message", true); $separator = true; } } else { $tmpl->set_var(array("PORTLET_ROOT" => $config_webserver_ip . "/modules/portal2/portlets/msg", "MESSAGE_PICTURE" => "", "MESSAGE_LINK" => "", "MESSAGE_HEADLINE" => "", "MESSAGE_SUBHEADLINE" => "", "MESSAGE_CONTENT" => "")); $tmpl->parse("MESSAGE_SUBHEADLINE", "message_none"); $tmpl->parse("MESSAGES", "message"); } $tmpl->parse("RSS_LINK", "rss_link");
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"); } if (trim($appointment["linkurl"]) != "" && trim($appointment["linkurl"]) != "0") { $tmpl->setCurrentBlock("BLOCK_TERM_LINK"); $tmpl->setVariable("LINKURL", derive_url($appointment["linkurl"])); $tmpl->setVariable("TOPIC", $UBB->encode($appointment["topic"])); $tmpl->parse("BLOCK_TERM_LINK"); } else { $tmpl->setCurrentBlock("BLOCK_TERM_NOLINK"); $tmpl->setVariable("TOPIC", $UBB->encode($appointment["topic"])); $tmpl->parse("BLOCK_TERM_NOLINK"); } $tmpl->parse("BLOCK_TERM"); } } $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->setHtml($htmlBody); //popummenu $outputWidget->addWidget(new \Widgets\PopupMenu()); $this->rawHtmlWidget = $outputWidget; }
if ($item instanceof steam_exit) { if ($itemdescription != "") { $name = str_replace("s workroom.", "", stripslashes($itemdescription)); } else { $name = str_replace("'s workarea", "", stripslashes($itemname)); } } //derive mimetype $mimetype = derive_icon(array("object" => $item, "name" => $itemname, "bid:collectiontype" => $item->get_attribute("bid:collectiontype"), "bid:doctype" => $item->get_attribute("bid:doctype"), "mimetype" => $itemmimetype)); $tpl->set_var(array("LINK_OBJECT_ID" => is_object($linked_object) ? $linked_object->get_id() : -1, "OBJECT_NAME" => $name, "OBJECT_ICON" => $mimetype)); $tpl->parse("ITEM_LINK", "link"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item instanceof steam_docextern) { $url = derive_url($item->get_attribute(DOC_EXTERN_URL)); $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_LINK" => $url, "OBJECT_ICON" => "./icons/mimetype/www.gif")); $tpl->parse("ITEM_LINK", "www-link"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item->get_attribute("bid:doctype") != "") { $icon = array("bid:doctype" => $item->get_attribute("bid:doctype")); $tpl->set_var(array("OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon))); $tpl->parse("ITEM_LINK", "folder"); $tpl->parse("DOCUMENTS", "item", true); $visible = true; } else { if ($item instanceof steam_messageboard) { $icon = array("object" => $item); $tpl->set_var(array("OBJECT_NAME" => stripslashes($itemname), "OBJECT_NAME_GREY" => stripslashes($itemname), "OBJECT_SIZE" => "", "OBJECT_ICON" => derive_icon($icon)));
$tmpl->set_file("content", "view.ihtml"); $tmpl->set_block("content", "edit_button", "DUMMY"); $tmpl->set_block("content", "linkurl", "DUMMY"); $tmpl->set_block("content", "separator", "DUMMY"); $tmpl->set_block("content", "enddate_row", "ENDDATE_ROW"); $tmpl->set_block("content", "time_row", "TIME_ROW"); $tmpl->set_block("content", "location_row", "LOCATION_ROW"); $tmpl->set_block("content", "description_row", "DESCRIPTION_ROW"); $tmpl->set_block("content", "appointment_row", "APPOINTMENT_ROW"); $tmpl->set_var(array("DUMMY" => "", "EDIT_BUTTON" => "", "PORTLET_ROOT" => "{$config_webserver_ip}/modules/portal2/portlets/appointment", "PORTLET_ID" => $portlet->get_id(), "APPOINTMENT_NAME" => $portlet_name)); if ($portlet->check_access_write($steam->get_login_user())) { $tmpl->parse("EDIT_BUTTON", "edit_button"); } if (sizeof($content) > 0) { foreach ($content as $appointment) { $tmpl->set_var(array("TOPIC" => $UBB->encode($appointment["topic"]), "LINK" => "", "LINKURL" => derive_url($appointment["linkurl"]), "STARTDATE" => $appointment["start_date"]["day"] . "." . $appointment["start_date"]["month"] . "." . $appointment["start_date"]["year"], "ENDDATE" => $appointment["end_date"]["day"] . "." . $appointment["end_date"]["month"] . "." . $appointment["end_date"]["year"], "ENDDATE_ROW" => "", "TIME" => $appointment["start_time"]["hour"] . "." . $appointment["start_time"]["minutes"], "TIME_ROW" => "", "LOCATION" => $UBB->encode($appointment["location"]), "LOCATION_ROW" => "", "DESCRIPTION" => $UBB->encode($appointment["description"]), "DESCRIPTION_ROW" => "")); if (trim($appointment["location"]) != "") { $tmpl->parse("LOCATION_ROW", "location_row"); } if ($appointment["end_date"]["day"] != "") { $tmpl->parse("ENDDATE_ROW", "enddate_row"); } if ($appointment["start_time"]["hour"] != "") { $tmpl->parse("TIME_ROW", "time_row"); } if (trim($appointment["description"]) != "") { $tmpl->parse("DESCRIPTION_ROW", "description_row"); } if (trim($appointment["linkurl"]) != "") { $tmpl->parse("LINK", "linkurl"); }
} if (sizeof($content) > 0) { if ($rss) { foreach ($items as $item) { if ($allow_html) { $itemtitle = utf8_encode($item["title"]); $itemdesc = utf8_encode($item["description"]); } else { $itemtitle = utf8_encode(strip_tags($item["title"])); $itemdesc = utf8_encode(strip_tags($item["description"])); } if ($desc_length == 0) { $itemdesc = ""; } else { if ($desc_length > 0 && strlen($itemdesc) > $desc_length) { $itemdesc = substr($itemdesc, 0, $desc_length) . "..."; } } $tmpl->set_var(array("ITEMTITLE" => $itemtitle, "ITEMDESC" => $itemdesc, "ITEMURL" => derive_url($item["link"]), "LINK" => "")); $tmpl->parse("LINK", "itemurl"); $tmpl->parse("RSS_ITEM", "rss_item", 1); } $tmpl->pparse("OUT", "content"); } else { $tmpl->set_var(array("RSS_ITEM" => "")); $tmpl->parse("RSS_ITEM", "feed_error"); $tmpl->pparse("OUT", "content"); } } else { echo ""; }
$tmpl->set_block("content", "topic_display_title", "DUMMY"); $tmpl->set_block("content", "topic_display_title_link", "DUMMY"); $tmpl->set_block("content", "topic_display_description", "TOPIC_DISPLAY_DESCRIPTION"); $tmpl->set_block("content", "topic_entry", "TOPIC_ENTRY"); $tmpl->set_block("content", "category", "CATEGORY"); $tmpl->set_var(array("DUMMY" => "", "EDIT_BUTTON" => "", "PORTLET_ROOT" => $config_webserver_ip . "/modules/portal2/portlets/topic", "PORTLET_ID" => $portlet->get_id(), "PORTLET_NAME" => $portlet_name)); if ($portlet->check_access_write($steam->get_login_user())) { $tmpl->parse("EDIT_BUTTON", "edit_button"); } if (sizeof($content) > 0) { foreach ($content as $category) { $tmpl->set_var("CATEGORY_TITLE", $UBB->encode($category["title"])); $tmpl->set_var("TOPIC_ENTRY", ""); if (isset($category["topics"])) { foreach ($category["topics"] as $topic) { $tmpl->set_var(array("TOPIC_TITLE" => $UBB->encode($topic["title"]), "TOPIC_DESCRIPTION" => $UBB->encode($topic["description"]), "TOPIC_LINK_URL" => derive_url($topic["link_url"], $portlet->get_path() . "/../../../"), "TOPIC_LINK_TARGET" => $topic["link_target"] == "checked" ? "_blank" : "_top")); //if there is a url parse headline as link if (trim($topic["link_url"]) == "") { $tmpl->parse("TOPIC_DISPLAY_TITLE", "topic_display_title"); } else { $tmpl->parse("TOPIC_DISPLAY_TITLE", "topic_display_title_link"); } //if there is a description parse out if (trim($topic["description"]) == "") { $tmpl->set_var("TOPIC_DISPLAY_DESCRIPTION", ""); } else { $tmpl->parse("TOPIC_DISPLAY_DESCRIPTION", "topic_display_description"); } //parse out every topic $tmpl->parse("TOPIC_ENTRY", "topic_entry", 1); }