public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $rawHtml = new \Widgets\RawHtml(); $boxManage = new \Widgets\PortfolioViewBox(); $boxManage->setTitle(\Portfolio::getInstance()->getText("Belege verwalten")); $boxManage->setTitleLink($this->getExtension()->getExtensionUrl() . "ManageArtefacts/"); $boxManage->setContent("this view helps in uploading and managing of desired artefacts"); //$boxManage->setButtons(array(array("name"=>"Edit", "link"=>$this->getextension()->getExtensionUrl()."ManageArtefacts/"), array("name"=>"Manage Acess", "link"=>''))); /* $boxDiscuss = new \Widgets\PortfolioViewBox(); $boxDiscuss->setTitle(gettext("Discuss View")); $boxDiscuss->setTitleLink($this->getextension()->getExtensionUrl()."ViewChart/"); $boxDiscuss->setContent("Discuss view shows what other have commeted about ur artefacts.if needed this content can be edited"); $boxDiscuss->setButtons(array(array("name"=>"Edit", "link"=>"#"), array("name"=>"Manage Acess", "link"=>$this->getextension()->getExtensionUrl()."ManageArtefacts/"))); */ $boxcompetence = new \Widgets\PortfolioViewBox(); $boxcompetence->setTitle(\Portfolio::getInstance()->getText("Kompetenzansicht")); $boxcompetence->setTitleLink($this->getextension()->getExtensionUrl() . "ViewCompetence/"); $boxcompetence->setContent(" Competence view shows the grading of artifacts on the basis of comments given by friends and other group members"); $boxcompetence->setButtons(array(array("name" => "Edit", "link" => "#"), array("name" => "Manage Acess", "link" => "#"))); //TODO // $box = new \Widgets\Box(); // $box->addWidget($boxManage); // $box->addWidget($boxDiscuss); // $box->addWidget($boxcompetence); $html = ""; $html .= <<<END <div class="box" style="float: left; width: 316px;"> <h3>{$this->portfolio->getName()}</h3> <br> END; // $html .= $box->getHtml(); $html .= $boxManage->getHtml(); // $html .= $boxDiscuss->getHtml(); $html .= $boxcompetence->getHtml(); $html .= <<<END </div> END; $rawHtml->setHtml($html); //$rawHtml->addWidget($box); $rawHtml->addWidget($boxManage); $rawHtml->addWidget($boxcompetence); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($rawHtml); return $ajaxResponseObject; }
public function frameResponse(\FrameResponseObject $frameResponseObject) { $portal = \lms_portal::get_instance(); $user = \lms_steam::get_current_user(); $frameResponseObject->setTitle(gettext("Your Desktop")); // Cache for 7 Minutes $cache = get_cache_function($user->get_name(), 420); $feeds = $cache->call("koala_user::get_news_feeds_static", 0, 10, FALSE, $user); $home = \Home::getInstance(); //$home->addJS(); $content = $home->loadTemplate("home.template.html"); $infobar = new \Widgets\InfoBar(); $infobar->setHeadline(gettext("Hallo") . " " . $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname() . "!"); $content->setVariable("INFOBAR", $infobar->getHtml()); $captionImage = new \Widgets\CaptionImage(); $captionImage->setLink(PATH_URL . "user/index/" . $user->get_name() . "/"); $captionImage->setLinkText(gettext("To your profile")); $captionImage->setImageSrc(\lms_user::get_user_image_url(140, 185)); $captionImage->setImageAlt(gettext("Profile Image")); $captionImage->setImageTitle(gettext("Complete your Profile")); $content->setVariable("PROFILEIMAGE", $captionImage->getHtml()); $rawHtml = new \Widgets\RawHtml(); $rawHtml->addWidget($infobar); $rawHtml->addWidget($captionImage); $homeExtensions = \ExtensionMaster::getInstance()->getExtensionByType("IHomeExtension"); foreach ($homeExtensions as $homeExtension) { $content->setCurrentBlock("HOME_EXTENSION"); $widget = $homeExtension->getWidget(); $rawHtml->addWidget($widget); $content->setVariable("HOME_EXTENSION_CONTENT", $widget->getHtml()); $content->parse("HOME_EXTENSION"); } $rawHtml->setHtml($content->get()); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $listViewer = new \Widgets\ListViewer(); $listViewer->setHeadlineProvider(new HeadlineProvider()); $listViewer->setContentProvider(new ContentProvider()); $listViewer->setColorProvider(new ColorProvider()); $listViewer->setContentFilter(new ContentFilter()); $listViewer->setContent($this->objects); $ajaxResponseObject->setStatus("ok"); $rawHtml = new \Widgets\RawHtml(); $rawHtml->addWidget($listViewer); $rawHtml->setHtml($listViewer->getHtml() . "<br><a class=\"pill button\" href=\"" . PATH_URL . "school/\">Alle Schul-Lesezeichen anzeigen</a>"); $ajaxResponseObject->addWidget($rawHtml); return $ajaxResponseObject; }
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 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"); $popupmenu->setElementId("portal-overlay"); $outputWidget->addWidget($popupmenu); $this->rawHtmlWidget = $outputWidget; }
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"); } if (trim($topic["link_url"]) != "") { $tmpl->setCurrentBlock("TOPIC_LINK"); $tmpl->setVariable("TOPIC_TITLE", $UBB->encode($topic["title"])); $tmpl->setVariable("TOPIC_LINK_URL", revealPath($topic["link_url"], $portlet->get_path())); $tmpl->setVariable("TOPIC_LINK_TARGET", $topic["link_target"] == "checked" ? "_blank" : "_top"); $tmpl->parse("TOPIC_LINK"); } else { $tmpl->setCurrentBlock("TOPIC_NOLINK"); $tmpl->setVariable("TOPIC_TITLE", $UBB->encode($topic["title"])); $tmpl->parse("TOPIC_NOLINK"); } $tmpl->setVariable("TOPIC_DESCRIPTION", $UBB->encode($topic["description"])); //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 $tmpl->setCurrentBlock("topic_display_description"); if (trim($topic["description"]) == "") { $tmpl->setVariable("TOPIC_DISPLAY_DESCRIPTION", ""); } else { //$tmpl->parse("TOPIC_DISPLAY_DESCRIPTION", "topic_display_description"); } $tmpl->parse("topic_display_description"); //parse out every topic $tmpl->parse("topic_entry"); $entryCount++; } } //parse out category $tmpl->parse("category"); $categoryCount++; } } else { $tmpl->setVariable("CATEGORY", ""); } $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->setHtml($htmlBody); //popummenu $outputWidget->addWidget(new \Widgets\PopupMenu()); $this->rawHtmlWidget = $outputWidget; }
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; }
public function frameResponse(\FrameResponseObject $frameResponseObject) { $portfolioExtension = \Portfolio::getInstance(); $content = $portfolioExtension->loadTemplate("portfolio.template.html"); $portfolio = \Portfolio\Model\Portfolio::getInstanceForUser($this->user); $rawHtml = new \Widgets\RawHtml(); $breadcrumb = new \Widgets\Breadcrumb(); $breadcrumb->setData(array(array("name" => "Kompetenzportfolio"))); $infobar = new \Widgets\InfoBar(); $infobar->setHeadline(""); $infobar->addParagraph(<<<END Mithilfe dieses Kompetenzportfolio-Systems können zentrale chemieberufliche Kompetenzen zur Bilanzierung gesichtet, bestimmt, geordnet und dokumentiert werden.<br><br> Das Kompetenzportfolio ist durch seine Bilanzierungs- und Dokumentationsfunktionen dafür geeignet, Ausbilder, Dozenten, Auszubildende, Schüler, Personalreferenten oder Angestellte von Berufen der chemischen Industrie bei Fragestellungen der Aus- und Weiterbildungseignung/-vorbereitung , der Anrechnung von Aus- und Weiterbildungszielen, der Personalauswahl, der Personalentwicklung, der Berufswahl sowie bei der Bewerbung zu unterstützen.\t\t\t\t END ); $content->setVariable("INFOBAR", $infobar->getHtml()); // Profilbild $captionImage = new \Widgets\CaptionImage(); $captionImage->setLink(PATH_URL . "user/index/" . $this->user->get_name() . "/"); $captionImage->setLinkText($this->user->get_attribute("USER_FIRSTNAME") . " " . $this->user->get_attribute("USER_FULLNAME")); $captionImage->setImageSrc(\lms_user::get_user_image_url(140, 185, $this->user->get_attribute("OBJ_ICON"))); $captionImage->setImageAlt(gettext("Profile Image")); $captionImage->setImageTitle(gettext("Complete your Profile")); $content->setVariable("PROFILEIMAGE", $captionImage->getHtml()); $rawHtml->addWidget($captionImage); // schulische Abschlüsse $schoolBox = \Portfolio\Model\EntrySchool::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $schoolBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($schoolBox); // berufliche Abschlüsse $jobBox = \Portfolio\Model\EntryEducation::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $jobBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($jobBox); /* $jobBox = new \Widgets\Box(); $jobBox->setId(\PortfolioHome::getInstance()->getId()); $jobBox->setTitle(\Portfolio::getInstance()->getText("Berufliche Aus- und Weiterbildungsgänge")); $jobBox->setTitleLink(PATH_URL . "portfolio/"); $html = <<<END <div style="text-align: center; color: gray; font-size: 80%"> Hier können relevante Informationen zu den beruflichen Aus- und Weiterbildungsgängen (wie die Art des Ausbildungsberufes sowie ggf. des Weiterbildungsberufes) hinterlegt, erläutert und belegt werden. </div> <br> <div style="border: 3px dotted lightblue; padding: 5px; background-color: #ffe"> Ausbildungsberuf: <em>Chemikant</em> <br> durchschnittliche Abschlussnote: <em>Gut (2)</em> <br> Jahrgang: <em>2005</em> <br> Ausbildungsbetrieb: <em>Bayer</em> <br> Ausbildungsstätte: <em>Infracor</em> <br> Bemerkung: <em>Schwerpunkt Anlagen</em> <br clear=all> <div style="float: right; display: inline"> <a href="">Eintrag bearbeiten</a> | <a href="">Beleg anfügen</a> </div> <br clear=all> Kompetenzen:<br><br> <em>Tätigkeitsfeld II (Chemische/biologische Produktionsverfahren vorbereiten/planen, durchführen und optimieren)</em><br> <div style="font-size:80%">Das Tätigkeitsfeld beinhaltet Kompetenzen, die für die erfolgreiche Planung, Durchführung, Optimierung und Dokumentation chemischer/biologischer Produktionsverfahren vorhanden sein sollten.</div> <div style="font-size:80%; text-align:right">Kompetenzniveau (gemäß DQR): 4<br> Er/Sie ist in der Lage kompetenzbezogene Aufgabenstellungen im Rahmen der Vorbereitung/Planung, Durchführung und Optimierung von chemischer/biologischer Produktionsverfahren (bspw. Feststoffe zu zerkleinern und klassieren) auch unter sich verändernden und nicht eindeutigen Rahmenbedingungen selbständig zu planen, zu bearbeiten, ggf. hierbei auftretende Probleme zu lösen sowie Arbeitsergebnisse unter Beachtung von Wechselwirkungen zu beurteilen. </div> <hr> END; $html .= $this->getKompetenzHtml("II.1", "Kann betriebsübliche verfahrenstechnische mechanische Grundoperationen durchführen"); $html .= $this->getKompetenzHtml("II.2", "Kann betriebsübliche verfahrenstechnische thermische Grundoperationen durchführen"); $html .= "<br clear=all><br><em>Tätigkeitsfeld III</em><hr>"; $html .= $this->getKompetenzHtml("III.1", "Kann betriebsübliche Arbeitsmitteln (z.B. Fördersysteme, Werkstoffe, Anlagenteile und Geräte usw.) handhaben, pflegen, instandhalten sowie funktionell relevante Faktoren (z.B. Korrosion, Verschleiß usw.) beurteilen"); $html .= $this->getKompetenzHtml("III.2", "Kann Installationstechnische Arbeiten (z.B. Rohre und Rohrleitungsteile verbinden und abdichten) planen und durchführen"); $html .="<br clear=all></div>"; $jobBox->setContent($html); $jobBox->setContentMoreLink(PATH_URL . "portfolio/"); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $jobBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($jobBox);*/ // Studium $studyBox = \Portfolio\Model\EntryAcademic::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $studyBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($studyBox); // Zertifikate $certBox = \Portfolio\Model\EntryCertificate::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $certBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($certBox); // Berufserfahrung $practiceBox = \Portfolio\Model\EntryEmployment::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $practiceBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($practiceBox); /* $practiceBox = new \Widgets\Box(); $practiceBox->setId(\PortfolioHome::getInstance()->getId()); $practiceBox->setTitle(\Portfolio::getInstance()->getText("Berufliche Erfahrungen")); $practiceBox->setTitleLink(PATH_URL . "portfolio/"); $html = <<<END <div style="text-align: center; color: gray; font-size: 80%"> Hier können relevante Informationen zu den beruflichen Erfahrungen (Art der Erfahrung) hinterlegt, erläutert und belegt werden. </div> <br> <div style="border: 3px dotted lightblue; padding: 5px; background-color: #ffe"> Art: <em>Praktikum oder Beschäftigung</em> <br> Betrieb: <em>Bayer</em> <br> Dauer: <em>2 Jahr</em> <br> Position: <em>Chemikant</em><br> Bemerkung: <em>Schwerpunkt Anlagen</em> <br clear=all> <div style="float: right; display: inline"> <a href="">Eintrag bearbeiten</a> | <a href="">Beleg anfügen</a> </div> <br clear=all> Kompetenzen:<br><br> <em>Tätigkeitsfeld II (Chemische/biologische Produktionsverfahren vorbereiten/planen, durchführen und optimieren)</em><br> <div style="font-size:80%">Das Tätigkeitsfeld beinhaltet Kompetenzen, die für die erfolgreiche Planung, Durchführung, Optimierung und Dokumentation chemischer/biologischer Produktionsverfahren vorhanden sein sollten.</div> <div style="font-size:80%; text-align:right">Kompetenzniveau (gemäß DQR): 4<br> Er/Sie ist in der Lage kompetenzbezogene Aufgabenstellungen im Rahmen der Vorbereitung/Planung, Durchführung und Optimierung von chemischer/biologischer Produktionsverfahren (bspw. Feststoffe zu zerkleinern und klassieren) auch unter sich verändernden und nicht eindeutigen Rahmenbedingungen selbständig zu planen, zu bearbeiten, ggf. hierbei auftretende Probleme zu lösen sowie Arbeitsergebnisse unter Beachtung von Wechselwirkungen zu beurteilen. </div> <hr> END; $html .= $this->getKompetenzHtml("II.1<br><div style=\"font-size:60%\">Chemikant</div>", "Kann betriebsübliche verfahrenstechnische mechanische Grundoperationen durchführen"); $html .="<br clear=all> <div style=\"float: right; display: inline\"> <a href=\"\">Kompetenzen verwalten</a> </div> <br clear=all> </div>"; $practiceBox->setContent($html); $practiceBox->setContentMoreLink(PATH_URL . "portfolio/"); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $practiceBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($practiceBox);*/ // Sonstige $otherBox = \Portfolio\Model\EntryOther::getViewWidget($portfolio); $content->setCurrentBlock("PORTFOLIO_BOX"); $content->setVariable("PORTFOLIO_CONTENT", $otherBox->getHtml()); $content->parse("PORTFOLIO_BOX"); $rawHtml->addWidget($otherBox); $frameResponseObject->setTitle("Kompetenzportfolio"); $frameResponseObject->addWidget($breadcrumb); $actionBar = new \Widgets\ActionBar(); $actionBar->setActions(array(array("name" => "Bildungsbiographie", "ajax" => array("onclick" => array("command" => "properties", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Kompetenzübersicht", "ajax" => array("onclick" => array("command" => "newElement", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Diskussionen", "ajax" => array("onclick" => array("command" => "newElement", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Kompetenzmodell", "ajax" => array("onclick" => array("command" => "newElement", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Import der Belege", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Export der Belege", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => "1"), "requestType" => "popup"))), array("name" => "Drucken", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => "1"), "requestType" => "popup"))))); $frameResponseObject->addWidget($actionBar); $rawHtml->setHtml($content->get()); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
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; } //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 = \PortletHeadline::getInstance(); $portletPath = $portletInstance->getExtensionPath(); 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("PortletHeadline"); $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()); } $UBB = new \UBBCode(); include_once PATH_BASE . "koala-core/lib/bid/derive_url.php"; $tmpl->setVariable("DUMMY", ""); $tmpl->setVariable("EDIT_BUTTON", ""); $tmpl->setVariable("PORTLET_ID", $portlet->get_id()); $tmpl->setVariable("ALIGNMENT", trim($content["alignment"])); $tmpl->setVariable("HEADLINE", $UBB->encode($content["headline"])); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } $tmpl->setVariable("SIZE", trim($content["size"])); 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"); } $htmlBody = $tmpl->get(); } else { $htmlBody = ""; } $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); //popummenu $outputWidget->addWidget(new \Widgets\PopupMenu()); $outputWidget->setHtml($htmlBody); $this->rawHtmlWidget = $outputWidget; }
public function frameResponse(\FrameResponseObject $frameResponseObject) { $rawHtml = new \Widgets\RawHtml(); $forumId = $this->forumId; $category_id = $this->id; $myExtension = \Forum::getInstance(); $myExtension->addCSS("style_topics.css"); //****************************************************** //** sTeam Server Connection //****************************************************** $steam = $GLOBALS["STEAM"]; /** log-in user */ $steamUser = \lms_steam::get_current_user(); /** id of the log-in user */ $steamUserId = $steamUser->get_id(); /** the login user name */ $steamUserLoginName = $steamUser->get_name(); $steamUserName = $steamUser->get_full_name(); /** the current category */ $category = \steam_factory::get_object($steam->get_id(), $category_id); /** additional required attributes */ $categoryAttributes = $category->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, "bid:description", "DOC_LAST_MODIFIED", "DOC_USER_MODIFIED"), 1); /** the content of the current category */ $categoryContent = $category->get_content(1); /** the creater of the current category */ $categoryCreator = $category->get_creator(1); /** the current forum */ $forum = $category->get_annotating(1); $category_allowed_write = $category->check_access_write($steamUser, 1); $category_allowed_read = $category->check_access_read($steamUser, 1); $category_allowed_annotate = $category->check_access_annotate($steamUser, 1); // flush the buffer $result = $steam->buffer_flush(); $categoryAttributes = $result[$categoryAttributes]; $categoryContent = $result[$categoryContent]; $categoryCreator = $result[$categoryCreator]; $categoryCreatorId = $categoryCreator->get_id(); $categoryAttributes["DOC_USER_MODIFIED"]->get_attributes(array(OBJ_NAME), 1); $forum = $result[$forum]; $category_allowed_write = $result[$category_allowed_write]; $category_allowed_read = $result[$category_allowed_read]; $category_allowed_annotate = $result[$category_allowed_annotate]; $category_allowed_sanction = $category->check_access(SANCTION_SANCTION); /** the environment of the forum object */ $forumEnvironment = $forum->get_environment(); /** additional required attributes */ $forumEnvironmentAttributes = $forumEnvironment->get_attributes(array(OBJ_NAME, OBJ_DESC), 1); /** additional required attributes */ $forumAttributes = $forum->get_attributes(array(OBJ_NAME, OBJ_DESC, "bid:description", "bid_forum_subtitle"), 1); /** the creator of the forum */ $forumCreator = $forum->get_creator(1); /** attributes of the creator of the category */ $categoryCreatorAttributes = $categoryCreator->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_ICON), 1); $result = $steam->buffer_flush(); $forumAttributes = $result[$forumAttributes]; $forumCreator = $result[$forumCreator]; $categoryCreatorAttributes = $result[$categoryCreatorAttributes]; $forumEnvironmentAttributes = $result[$forumEnvironmentAttributes]; /** attributes of the creator of the forum object */ $forumCreatorAttributes = $forumCreator->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_ICON), 1); $result = $steam->buffer_flush(); $forumCreatorAttributes = $result[$forumCreatorAttributes]; $forumCreatorId = $forumCreator->get_id(); //\Forum::getInstance()->addCSS(); if ($category_allowed_read) { $messages = $category->get_annotations(false, 1); $result = $steam->buffer_flush(); $messages = $result[$messages]; sort($messages); if (count($messages) > 0) { foreach ($messages as $message) { if (!empty($message)) { $id = $message->get_id(); $messageAttributes[$id] = $message->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, "DOC_LAST_MODIFIED", "DOC_USER_MODIFIED"), 1); $messageAccessWrite[$id] = $message->check_access_write($steamUser, 1); $messageContent[$id] = $message->get_content(1); $messageCreator[$id] = $message->get_creator(1); } } $result = $steam->buffer_flush(); foreach ($messages as $message) { $id = $message->get_id(); $messageAttributes[$id] = $result[$messageAttributes[$id]]; $messageContent[$id] = $result[$messageContent[$id]]; $messageCreator[$id] = $result[$messageCreator[$id]]; $messageCreator[$id]->get_attributes(array(OBJ_NAME), 1); $messageAttributes[$id]["DOC_USER_MODIFIED"]->get_attributes(array(OBJ_NAME), 1); $messageAccessWrite[$id] = $result[$messageAccessWrite[$id]]; } $result = $steam->buffer_flush(); } } //START CHECK RIGHTS OF THE CURRENT USER //$isReplyEditable= $category->get_attribute("bid:forum:is_editable"); //if(trim($isReplyEditable) == "checked"){ // $isReplyEditable=true; //} else{ // $isReplyEditable=false; //} $isForumCreator = false; $isTopicCreator = false; $canAnnotate = $category_allowed_write || $category_allowed_annotate; $canRead = $category_allowed_read; $hasSanctionRights = $category_allowed_sanction; if ($forumCreatorId == $steamUserId) { $isForumCreator = true; $isTopicCreator = true; $canAnnotate = true; $canRead = true; } elseif ($categoryCreatorId == $steamUserId) { $isTopicCreator = true; $canAnnotate = true; $canRead = true; } elseif ($canAnnotate) { $canRead = true; } //END CHECK RIGHTS OF THE CURRENT USER $content = \Forum::getInstance()->loadTemplate("forumShowTopic.template.html"); $addIcon = \Forum::getInstance()->getAssetUrl() . "icons/new.gif"; $editIcon = \Forum::getInstance()->getAssetUrl() . "icons/message_edit.gif"; $deleteIcon = \Forum::getInstance()->getAssetUrl() . "icons/message_delete.gif"; if ($category_allowed_read) { $content->setVariable("FORUM_NAME", $forumAttributes["OBJ_DESC"]); $content->setVariable("CATEGORIE_NAME", $categoryAttributes[OBJ_DESC]); $content->setVariable("FORUM_OWNER", $forumCreator->get_full_name()); $content->setVariable("FORUM_OWNER_URL", PATH_URL . "profile/index/" . $forumCreator->get_name()); $content->setVariable("CATEGORIE_DESCRIPTION", $categoryAttributes["bid:description"]); $content->setVariable("CATEGORIE_CREATOR", $categoryCreator->get_full_name()); $content->setVariable("CATEGORIE_CREATION_TIME", date("j.m.Y G:i", $categoryAttributes['OBJ_CREATION_TIME'])); $content->setVariable("CATEGORIE_CREATOR_URL", PATH_URL . "profile/index/" . $categoryCreator->get_name()); $content->setVariable("CATEGORIE_CONTENT", $categoryContent); if ($canAnnotate) { $popupMenu = new \Widgets\PopupMenu(); $popupMenu->setData($category); $popupMenu->setElementId("overlay_menu"); $popupMenu->setParams(array(array("key" => "forum", "value" => $forumId), array("key" => "category", "value" => $category_id))); $content->setVariable("POPUP_MENU", $popupMenu->getHtml()); $rawHtml->addWidget($popupMenu); } if ($categoryAttributes[OBJ_CREATION_TIME] != $categoryAttributes["DOC_LAST_MODIFIED"]) { if (strlen(trim($categoryContent)) > 0) { $content->setVariable("AUTHOR_EDIT", $categoryAttributes["DOC_USER_MODIFIED"]->get_full_name()); $content->setVariable("TIMESTAMP_EDIT", date("j.m.Y G:i", $categoryAttributes["DOC_LAST_MODIFIED"])); } else { $content->setVariable("AUTHOR_DELETE", $categoryAttributes["DOC_USER_MODIFIED"]->get_full_name()); $content->setVariable("TIMESTAMP_DELETE", date("j.m.Y G:i", $categoryAttributes["DOC_LAST_MODIFIED"])); } } $column_width = 763; if ($category->get_attribute("bid:forum:category:picture_id") !== 0) { $picture_width = $category->get_attribute("bid:forum:category:picture_width") != 0 ? $category->get_attribute("bid:forum:category:picture_width") : ""; if (extract_percentual_length($picture_width) == "") { $bare_picture_width = extract_length($picture_width); if ($bare_picture_width == "") { $picture_width = ""; } else { if ($bare_picture_width > $column_width - 25) { $picture_width = $column_width - 25; } } } $content->setVariable("MESSAGE_PICTURE_URL1", getDownloadUrlForObjectId($category->get_attribute("bid:forum:category:picture_id"))); if ($category->get_attribute("bid:forum:category:picture_alignment") !== "none") { $content->setVariable("MESSAGE_PICTURE_ALIGNMENT1", $category->get_attribute("bid:forum:category:picture_alignment")); } else { $content->setVariable("MESSAGE_PICTURE_ALIGNMENT1", ""); } $content->setVariable("MESSAGE_PICTURE_WIDTH1", $picture_width); } if (is_array($messages) && isset($messages)) { if (count($messages) > 0) { $content->setVariable("EXISTS_REPLY", "Antworten"); } foreach ($messages as $message) { $id = $message->get_id(); $content->setCurrentBlock("message"); $content->setVariable("MESSAGE_CONTENT", $messageContent[$id]); $content->setVariable("MESSAGE_CREATOR", $messageCreator[$id]->get_full_name()); $content->setVariable("MESSAGE_CREATOR_PROFILE", PATH_URL . "profile/index/" . $messageCreator[$id]->get_name()); $content->setVariable("MESSAGE_CREATION_TIME", date("j.m.Y G:i", $messageAttributes[$id][OBJ_CREATION_TIME])); $content->setVariable("MESSAGE_NAME", $messageAttributes[$id][OBJ_DESC]); $content->setVariable("MES_ID", "message_" . $id); if ($messageAttributes[$id][OBJ_CREATION_TIME] != $messageAttributes[$id]["DOC_LAST_MODIFIED"]) { if (strlen(trim($messageContent[$id])) > 0) { $content->setVariable("AUTHOR_MES_EDIT", $messageAttributes[$id]["DOC_USER_MODIFIED"]->get_full_name()); $content->setVariable("TIMESTAMP_MES_EDIT", date("j.m.Y G:i", $messageAttributes[$id]["DOC_LAST_MODIFIED"])); } else { $content->setVariable("AUTHOR_MES_DELETE", $messageAttributes[$id]["DOC_USER_MODIFIED"]->get_full_name()); $content->setVariable("TIMESTAMP_MES_DELETE", date("j.m.Y G:i", $messageAttributes[$id]["DOC_LAST_MODIFIED"])); } } if ($canAnnotate) { $popupMenu2 = new \Widgets\PopupMenu(); $popupMenu2->setData($message); $popupMenu2->setElementId("overlay_menu2"); $popupMenu2->setParams(array(array("key" => "forum", "value" => $forumId), array("key" => "category", "value" => $category_id))); $content->setVariable("POPUP_MENU2", $popupMenu2->getHtml()); $rawHtml->addWidget($popupMenu2); } if ($message->get_attribute("bid:forum:category:picture_id") !== 0) { $content->setCurrentBlock("BLOCK_MESSAGE_PICTURE"); $picture_width = $message->get_attribute("bid:forum:category:picture_width") != "0" ? trim($message->get_attribute("bid:forum:category:picture_width")) : ""; if (extract_percentual_length($picture_width) == "") { $bare_picture_width = extract_length($picture_width); if ($bare_picture_width == "") { $picture_width = ""; } else { if ($bare_picture_width > $column_width - 25) { $picture_width = $column_width - 25; } } } $content->setVariable("MESSAGE_PICTURE_URL", getDownloadUrlForObjectId($message->get_attribute("bid:forum:category:picture_id"))); if ($message->get_attribute("bid:forum:category:picture_alignment") !== "none") { $content->setVariable("MESSAGE_PICTURE_ALIGNMENT", $message->get_attribute("bid:forum:category:picture_alignment")); } else { $content->setVariable("MESSAGE_PICTURE_ALIGNMENT", ""); } $content->setVariable("MESSAGE_PICTURE_WIDTH", $picture_width); } $content->parse("message"); } } } else { $content->setVariable("NO_ACCESS", "Sie haben keine Berechtigung diesen Inhalt zu betrachten!\n\t\t\tBitte wenden Sie sich an die Forumsverwaltung!"); } $rawHtml->setHtml($content->get()); $actions = array(); if ($canAnnotate) { $actions[] = array("name" => "Antworten", "ajax" => array("onclick" => array("command" => "newReply", "params" => array("id" => $this->id, "forum" => $forumId), "requestType" => "popup"))); } if ($isForumCreator) { //$actions[] = array("name" => "Eigenschaften", "ajax"=>array("onclick"=>array("command"=>"EditTopic", "params"=>array("id"=>$this->id ,"forum" => $forumId), "requestType"=>"popup"))); } //if($category->check_access(SANCTION_SANCTION,$steamUser)){ //if($isForumCreator || $hasSanctionRights){ // $actions[] = array("name"=>"Rechte", "ajax"=>array("onclick"=>array("command"=>"Sanctions", "params"=>array("id"=>$this->id) , "requestType"=>"popup", "namespace"=>"explorer"))); //} $frameResponseObject->setTitle("Forum - " . $forumAttributes["OBJ_DESC"] . " - Thema - " . $categoryAttributes["OBJ_DESC"] . " "); $parent = $forum->get_environment(); if ($parent instanceof \steam_container) { $parentLink = PATH_URL . "explorer/Index/" . $parent->get_id(); } else { $parentLink = ""; } $title = $categoryAttributes[OBJ_DESC]; // $breadcrumb = new \Widgets\Breadcrumb(); // $breadcrumb->setData(array($parentLink, array("name" => "<img src=\"".PATH_URL."explorer/asset/icons/mimetype/".deriveIcon(\Explorer::getInstance())."\"></img> " . $title . " " . \Explorer\Model\Sanction::getMarkerHtml(\Explorer::getInstance(), false)))); $actionbar = new \Widgets\ActionBar(); $actionbar->setActions($actions); // $explorerId=$forum->get_environment()->get_id(); //$frameResponseObject->setHeadline(array(array("name" =>"Zurück zu ". $forumAttributes["OBJ_DESC"], "link" => PATH_URL ."forum/index/". $forumId))); $widget = new \Widgets\RawHtml(); $html = '<div id="backToForum">Zurück zu '; $html1 = '<a href="' . PATH_URL . "forum/index/" . $forumId . '">'; $html2 = $forum->get_name() . '</a></div>'; $widget->setHtml($html . $html1 . $html2); $frameResponseObject->addWidget($widget); $frameResponseObject->addWidget($actionbar); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
public function processData(\IRequestObject $requestObject) { $objectId = $requestObject->getId(); $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $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; } $this->getExtension()->addCSS(); $this->getExtension()->addJS(); $portletName = $portlet->get_attribute(OBJ_DESC); //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 = \PortletMsg::getInstance(); $portletPath = $portletInstance->getExtensionPath(); $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("PORTLET_ID", $portlet->get_id()); //headline $tmpl->setCurrentBlock("BLOCK_MESSAGE_HEADLINE"); $tmpl->setVariable("HEADLINE", $portletName); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } if (!$portletIsReference) { $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($portlet); $popupmenu->setNamespace("PortletMsg"); $popupmenu->setElementId("portal-overlay"); $popupmenu->setParams(array(array("key" => "portletObjectId", "value" => $portlet->get_id()))); $popupmenu->setCommand("GetPopupMenuHeadline"); $tmpl->setVariable("POPUPMENU_HEADLINE", $popupmenu->getHtml()); } else { $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_HEADLINE", $popupmenu->getHtml()); } //show empty headline in edit mode if (trim($portletName) == "") { $tmpl->setVariable("HEADLINE_CLASS", "headline editbutton"); } else { $tmpl->setVariable("HEADLINE_CLASS", "headline"); } $tmpl->parse("BLOCK_MESSAGE_HEADLINE"); if (sizeof($content) > 0) { /* * Convert old messages which save its content as UBB code to new messages * using a html representation */ $convertUBB = false; $version = $portlet->get_attribute("bid:portlet:version"); /* if(!$version){ $convertUBB = true; require_once("name.php"); $portlet->set_attribute("bid:portlet:version", $msg_version); } */ $separator = false; foreach ($content as $messageId) { $tmpl->setCurrentBlock("BLOCK_MESSAGE"); $message = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $messageId); $message->get_attributes(array("OBJ_DESC", "bid:portlet:msg:picture_id", "bid:portlet:msg:picture_alignment", "bid:portlet:msg:link_url", "bid:portlet:msg:link_url_label", "bid:portlet:msg:link_open")); //popupmenu $popupmenu = new \Widgets\PopupMenu(); $popupmenu->setData($message); $popupmenu->setNamespace("PortletMsg"); $popupmenu->setElementId("portal-overlay"); $popupmenu->setParams(array(array("key" => "messageObjectId", "value" => $messageId), array("key" => "portletObjectId", "value" => $portlet->get_id()))); $popupmenu->setCommand("GetPopupMenuMessage"); if (!$portletIsReference) { $tmpl->setVariable("POPUPMENU_MESSAGE", $popupmenu->getHtml()); } /* * Convert old messages which save its content as UBB code to new messages * using a html representation */ if ($convertUBB) { $message->set_content($UBB->encode($message->get_content())); } $tmpl->setVariable("MESSAGE_PICTURE", ""); $tmpl->setVariable("MESSAGE_LINK", ""); $tmpl->setVariable("MESSAGE_HEADLINE", $UBB->encode($message->get_attribute("OBJ_NAME"))); if ($UBB->encode($message->get_attribute("OBJ_DESC")) != "") { $tmpl->setVariable("MESSAGE_SUBHEADLINE", $UBB->encode($message->get_attribute("OBJ_DESC"))); } $tmpl->setVariable("MESSAGE_CONTENT", $message->get_content()); //get column width $columnObject = $portletObject->get_environment(); $column_width = $columnObject->get_attribute("bid:portal:column:width"); //PICTURE // parse in picture if it exists if ($message->get_attribute("bid:portlet:msg:picture_id") != "") { $tmpl->setCurrentBlock("BLOCK_MESSAGE_PICTURE"); $picture_width = $message->get_attribute("bid:portlet:msg:picture_width") != "" ? trim($message->get_attribute("bid:portlet:msg:picture_width")) : ""; if (extract_percentual_length($picture_width) == "") { $bare_picture_width = extract_length($picture_width); if ($bare_picture_width == "") { $picture_width = ""; } else { if ($bare_picture_width > $column_width - 25) { $picture_width = $column_width - 25; } } } $tmpl->setVariable("MESSAGE_PICTURE_ID", $message->get_attribute("bid:portlet:msg:picture_id")); //not used anymore $tmpl->setVariable("MESSAGE_PICTURE_URL", getDownloadUrlForObjectId($message->get_attribute("bid:portlet:msg:picture_id"))); $tmpl->setVariable("MESSAGE_PICTURE_ALIGNMENT", $message->get_attribute("bid:portlet:msg:picture_alignment")); $tmpl->setVariable("MESSAGE_PICTURE_WIDTH", $picture_width); $tmpl->parse("BLOCK_MESSAGE_PICTURE"); } //LINK //parse in link if it exists if (trim($message->get_attribute("bid:portlet:msg:link_url")) != "") { $tmpl->setCurrentBlock("BLOCK_MESSAGE_LINK"); if (trim($message->get_attribute("bid:portlet:msg:link_open")) != "checked") { $tmpl->setVariable("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")); $tmpl->setVariable("MESSAGE_LINK_URL", revealPath($message->get_attribute("bid:portlet:msg:link_url"), $message->get_path())); $tmpl->setVariable("MESSAGE_LINK_TARGET", "_top"); } else { $tmpl->setVariable("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")); $tmpl->setVariable("MESSAGE_LINK_URL", revealPath($message->get_attribute("bid:portlet:msg:link_url"), $message->get_path())); $tmpl->setVariable("MESSAGE_LINK_TARGET", "_blank"); } $tmpl->parse("BLOCK_MESSAGE_LINK"); } //SEPARATOR if ($separator) { $tmpl->setCurrentBlock("BLOCK_SEPARATOR"); $tmpl->parse("BLOCK_SEPARATOR"); } $separator = true; $tmpl->parse("BLOCK_MESSAGE"); } } else { //NO MESSAGE $tmpl->setCurrentBlock("BLOCK_NO_MESSAGE"); $tmpl->setVariable("NO_MESSAGE_INFO", "Keine Nachrichten vorhanden."); $tmpl->parse("BLOCK_NO_MESSAGE"); } $tmpl->setVariable("PATH_URL", PATH_URL); $tmpl->parse("BLOCK_PORTLET_MESSAGE"); $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); $outputWidget->addWidget(new \Widgets\PopupMenu()); $outputWidget->setHtml($htmlBody); $this->rawHtmlWidget = $outputWidget; }
public function processData(\IRequestObject $requestObject) { $objectId = $requestObject->getId(); $portletInstance = \PortletPoll::getInstance(); $portletPath = $portletInstance->getExtensionPath(); //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; } $portlet = $portletObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $portletName = $portlet->get_attribute(OBJ_DESC); $this->getExtension()->addCSS(); $this->getExtension()->addJS(); //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(); } $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); 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("PortletPoll"); $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"]; $end_date = $content["end_date"]; if (time() > mktime(0, 0, 0, $startDate["month"], $startDate["day"], $startDate["year"]) && time() < mktime(24, 0, 0, $end_date["month"], $end_date["day"], $end_date["year"])) { $pollActive = true; } else { $pollActive = false; } $options = $content["options"]; $options_votecount = $content["options_votecount"]; $max_votecount = 1; foreach ($options_votecount as $option_votecount) { if ($option_votecount > $max_votecount) { $max_votecount = $option_votecount; } } $tmpl->setVariable("PORTLET_ID", $portlet->get_id()); $tmpl->setVariable("POLL_NAME", $portletName); //refernce icon if ($portletIsReference) { $tmpl->setVariable("REFERENCE_ICON", "<img src='{$referIcon}'>"); } $tmpl->setVariable("POLL_TOPIC", $content["poll_topic"]); if ($pollActive) { $i = 0; foreach ($options as $option) { if ($option != "") { $tmpl->setCurrentBlock("choice"); $tmpl->setVariable("OPTION", $option); $tmpl->setVariable("OPTION_NUMBER", $i); //create command params $tmpl->setVariable("portletObjectId", $portlet->get_id()); $tmpl->setVariable("voteItemId", $i); $tmpl->parse("choice"); } $i++; } } else { $i = 0; foreach ($options as $option) { $tmpl->setCurrentBlock("BLOCK_VOTE_RESULT"); if ($option != "") { $tmpl->setVariable("OPTION", $option); $tmpl->setVariable("OPTION_VOTECOUNT", $options_votecount[$i]); $tmpl->setVariable("OPTION_NUMBER", $i); $tmpl->setVariable("PATH_COLOR", PATH_URL); $percentage = $options_votecount[$i] / $max_votecount * 100; $percentage = round($percentage); if ($percentage < 1) { $percentage = 1; } $tmpl->setVariable("WIDTH", $percentage); $tmpl->parse("BLOCK_VOTE_RESULT"); } $i++; } } // we show the edit button only if the user has write access to the portal // because all portal readers need write access in order to vote $portalCol = $portlet->get_environment(); $portal = $portalCol->get_environment(); if ($portal->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"); } } $htmlBody = $tmpl->get(); $this->content = $htmlBody; //widgets $outputWidget = new \Widgets\RawHtml(); //popummenu $outputWidget->addWidget(new \Widgets\PopupMenu()); $outputWidget->setHtml($htmlBody); $this->rawHtmlWidget = $outputWidget; }
public function getHtmlForObjectId(\FrameResponseObject $frameResponseObject) { $rawHtml = new \Widgets\RawHtml(); $objectId = $this->id; if (isset($this->params[1])) { $from = $this->params[1]; } else { $from = 0; } $steam = $GLOBALS["STEAM"]->get_id(); $currentRoom = \steam_factory::get_object($steam, $objectId); $this->object = $currentRoom; $currentRoomPath = $currentRoom->get_path(1); $currentRoomData = $currentRoom->get_attributes(array(OBJ_NAME, OBJ_DESC), 1); $steamUser = $GLOBALS["STEAM"]->get_current_steam_user(); $steamUserId = $steamUser->get_id(); //check if user may write in this folder $writeAllowed = $currentRoom->check_access_write($steamUser, 1); //get inventory and inventorys attributes if allowed to $allowed = $currentRoom->check_access_read($steamUser, 1); $result = $GLOBALS["STEAM"]->buffer_flush(); $writeAllowed = $result[$writeAllowed]; $allowed = $result[$allowed]; $currentRoomPath = $result[$currentRoomPath]; $currentRoomData = $result[$currentRoomData]; $currentRoomDisplayName = str_replace("'s workarea", "", stripslashes($currentRoomData[OBJ_NAME])); if (isset($currentRoomData[OBJ_DESC]) && $currentRoomData[OBJ_DESC] != "") { $currentRoomDisplayName = $currentRoomData[OBJ_DESC]; } $currentRoomDisplayName = str_replace("s workroom.", "", $currentRoomDisplayName); $numberOfThumbs = 10; //forces a stable navigation structure $from -= $from % $numberOfThumbs; //navigation commands $picCount = sizeof($currentRoom->get_inventory()); $to = $from + ($numberOfThumbs - 1); if ($from >= $picCount) { $from = $picCount - 1 - ($picCount - 1) % $numberOfThumbs; } if ($to >= $picCount) { $to = $picCount - 1; } if ($allowed && $currentRoom instanceof \steam_container) { if ($from >= 0 && $to >= $numberOfThumbs - 1) { $inventory = $currentRoom->get_inventory_paged($from, $to); } else { $inventory = $currentRoom->get_inventory_paged(0, $numberOfThumbs - 1); } } else { $inventory = array(); } //$contentJS = $this->loadTemplate("overlay.template.js"); //add css // \Gallery::getInstance()->addCSS(); //add js // \Gallery::getInstance()->addJS(); //\lms_portal::get_instance()->add_javascript_src("JQuery", PATH_URL . "gallery/js/jquery.min.js"); // \lms_portal::get_instance()->add_javascript_src("JQuery", PATH_URL . "gallery/js/jquery.colorbox.js"); // \lms_portal::get_instance()->add_javascript_src("JQuery", PATH_URL . "gallery/js/colorbox.control.js"); //TODO: overlay.template.js not working - overlay to start gallery missing //$this->addJS("overlay.template.js"); $tpl = \Gallery::getInstance()->loadTemplate("gallery.template.html"); //$tpl= new \HTML_TEMPLATE_IT(); //$tpl->loadTemplateFile(\Gallery::getInstance()->getExtensionPath()."ui/html/gallery.template.html"); $tpl->setVariable("IMAGEURL", \Gallery::getInstance()->getAssetUrl() . "image/round_green_play_button_4044.jpg"); $tpl->setVariable("FROM", max($from + 1, 1)); $tpl->setVariable("TO", min($to + 1, $picCount)); $tpl->setVariable("PIC_COUNT", $picCount); $pagemin = $from - $numberOfThumbs; $pagemin = max($pagemin, 0); //Navigation $backlink = "<a href=\"" . PATH_URL . "gallery/index/" . $objectId . "/" . $pagemin . "\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zurück\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_prev_on.gif\"></a>"; if ($from == 0) { $backlink = "<a href=\"\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zurück\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_prev_off.gif\"></a>"; $tpl->setVariable("BACKLINK", $backlink); } else { $tpl->setVariable("BACKLINK", $backlink); } $pagemax = min($to, $picCount - 1); $forwardlink = "<a href=\"" . PATH_URL . "gallery/index/" . $objectId . "/" . ($pagemax + 1) . "\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zurück\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_next_on.gif\"></a>"; if ($to >= $picCount - 1) { $forwardlink = "<a href=\"\" class=\"pagingright\"><img alt=\"Vor\" title=\"Vor\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_next_off.gif\">"; $tpl->setVariable("FORWARDLINK", $forwardlink); } else { $tpl->setVariable("FORWARDLINK", $forwardlink); } //Rights foreach ($inventory as $item) { $tnr[$item->get_id()] = array(); $tnr[$item->get_id()]["creator"] = $item->get_creator(1); $tnr[$item->get_id()]["item_write_access"] = $item->check_access_write($GLOBALS["STEAM"]->get_current_steam_user(), 1); $tnr[$item->get_id()]["item_read_access"] = $item->check_access_read($GLOBALS["STEAM"]->get_current_steam_user(), 1); } $result = $GLOBALS["STEAM"]->buffer_flush(); $creators = array(); $itemWriteAccess = array(); $itemReadAccess = array(); foreach ($inventory as $item) { $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]]; $itemWriteAccess[$item->get_id()] = $result[$tnr[$item->get_id()]["item_write_access"]]; $itemReadAccess[$item->get_id()] = $result[$tnr[$item->get_id()]["item_read_access"]]; } \steam_factory::load_attributes($steam, $inventory, array(OBJ_NAME, OBJ_DESC, OBJ_KEYWORDS, DOC_MIME_TYPE, "bid:description")); // 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... $undisplayedPicCount = 0; //GET RIGHTS $sanction = $currentRoom->get_sanction(); $attrib = $this->object->get_attributes(array(OBJ_NAME, OBJ_DESC, "bid:doctype")); $bid_doctype = isset($attrib["bid:doctype"]) ? $attrib["bid:doctype"] : ""; $docTypeQuestionary = strcmp($attrib["bid:doctype"], "questionary") == 0; $docTypeMessageBoard = $this->object instanceof \steam_messageboard; // in questionaries the write right is limited to insert rights only if ($docTypeQuestionary) { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_INSERT; } else { if ($docTypeMessageBoard) { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_ANNOTATE; } else { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_WRITE | SANCTION_EXECUTE | SANCTION_MOVE | SANCTION_INSERT | SANCTION_ANNOTATE; } } $sanctionFlag = false; if (isset($sanction[$steamUserId])) { if ($sanction[$steamUserId] >= $SANCTION_WRITE_FOR_CURRENT_OBJECT) { $sanctionFlag = true; } } $env = $currentRoom->get_environment(); if ($env instanceof \steam_room) { $envSanction = $env->get_sanction(); if (isset($envSanction[$steamUserId])) { if ($envSanction[$steamUserId] >= $SANCTION_WRITE_FOR_CURRENT_OBJECT) { $sanctionFlag = true; } } } $currentRoomCreater = $currentRoom->get_creator(); $currentRoomCreaterId = $currentRoomCreater->get_id(); if ($currentRoomCreaterId == $steamUserId) { $sanctionFlag = true; } for ($i = 0; $i < count($inventory); $i++) { $tpl->setCurrentBlock("ITEM"); $item = $inventory[$i]; if ($sanctionFlag) { $tpl->setVariable("REMOVE_ICON", \Gallery::getInstance()->getAssetUrl() . "icons/trash.png"); $tpl->setVariable("ITEM_PATH_URL2", PATH_URL); $tpl->setVariable("ITEM_THUMBNAIL_ID2", $item->get_id()); } $tpl->setVariable("FULLSCREEN_ICON", \Gallery::getInstance()->getAssetUrl() . "icons/image_fullscreen.png"); $tpl->setVariable("SAVE_ICON", \Gallery::getInstance()->getAssetUrl() . "icons/image_save.png"); $tpl->setVariable("EDIT_ICON", \Gallery::getInstance()->getAssetUrl() . "icons/image_properties.gif"); $popupMenu = new \Widgets\PopupMenu(); $popupMenu->setData($item); $popupMenu->setElementId("gallery-overlay"); $tpl->setVariable("POPUP_MENU", $popupMenu->getHtml()); $rawHtml->addWidget($popupMenu); // Skip image if rights are insufficient if (!$itemReadAccess[$item->get_id()]) { $undisplayedPicCount++; continue; } $itemName = $item->get_attribute(OBJ_NAME); $itemDescription = $item->get_attribute(OBJ_DESC); $itemKeywords = implode(", ", $item->get_attribute(OBJ_KEYWORDS)); $itemMimetype = $item->get_attribute(DOC_MIME_TYPE); //set Item $tpl->setVariable("OBJECT_ID", $item->get_id()); $tpl->setVariable("OBJECT_NAME", $itemName); $tpl->setVariable("OBJECT_DESC", $itemDescription); $tpl->setVariable("OBJECT_KEYWORDS", $itemKeywords); // render a steam_document if ($item instanceof \steam_document) { //care for documents not to be displayed in the browser if ($itemMimetype === "image/gif" || $itemMimetype === "image/jpg" || $itemMimetype === "image/jpeg" || $itemMimetype === "image/png") { $tpl->setVariable("ITEM_PATH_URL", PATH_URL); $tpl->setVariable("ITEM_THUMBNAIL_ID", $item->get_id()); $tpl->setVariable("ITEM_BIGTHUMB_ID", $item->get_id()); if ($i - $undisplayedPicCount == 0) { $tpl->setVariable("FIRST_GALLERY_ID", $item->get_id()); } $tpl->parse("ITEM"); } } } //set invisible items for colorbox for ($i = 0; $i < count($inventory); $i++) { $tpl->setCurrentBlock("INV"); $item = $inventory[$i]; // Skip image if rights are insufficient if (!$itemReadAccess[$item->get_id()]) { $undisplayedPicCount++; continue; } $itemName = $item->get_attribute(OBJ_NAME); $itemDescription = $item->get_attribute(OBJ_DESC); $itemKeywords = implode(", ", $item->get_attribute(OBJ_KEYWORDS)); $itemMimetype = $item->get_attribute(DOC_MIME_TYPE); // set display name $objectDisplayName = $itemName; if ($itemDescription === 0) { $itemDescription = ""; } $tpl->setVariable("OBJECT_NAME", $objectDisplayName); $tpl->setVariable("OBJECT_DESC", $itemDescription); // render a steam_document if ($item instanceof \steam_document) { //care for documents not to be displayed in the browser if ($itemMimetype === "image/gif" || $itemMimetype === "image/jpg" || $itemMimetype === "image/jpeg" || $itemMimetype === "image/png") { $tpl->setVariable("ITEM_PATH_URL", PATH_URL); $tpl->setVariable("ITEM_THUMBNAIL_ID", $item->get_id()); $tpl->parse("INV"); } } } $actionBar = new \Widgets\ActionBar(); $actionBar->setActions(array(array("name" => "Neues Bild", "ajax" => array("onclick" => array("command" => "Addpicture", "params" => array("id" => $this->id), "requestType" => "popup"))), array("name" => "Eigenschaften", "ajax" => array("onclick" => array("command" => "Properties", "params" => array("id" => $this->id), "requestType" => "popup", "namespace" => "explorer"))), array("name" => "Rechte", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => $this->id), "requestType" => "popup", "namespace" => "explorer"))))); $css = self::auslesen(PATH_URL . "gallery/css/style.css"); $js = self::auslesen(PATH_URL . "gallery/js/code.js"); $rawHtml->setCss($css); $rawHtml->setJs($js); $rawHtml->setHtml($tpl->get()); if ($sanctionFlag) { $frameResponseObject->addWidget($actionBar); } $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
public function frameResponse(\FrameResponseObject $frameResponseObject) { if (isset($this->id)) { $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); if ($object instanceof \steam_exit) { $object = $object->get_exit(); $this->id = $object->get_id(); } } else { $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $object = $currentUser->get_workroom(); $this->id = $object->get_id(); } if (!$object instanceof \steam_object) { \ExtensionMaster::getInstance()->send404Error(); die; } $objectModel = \AbstractObjectModel::getObjectModel($object); if ($object && $object instanceof \steam_container) { $count = $object->count_inventory(); if ($count > 150) { die("Es befinden sich {$count} Objekte im diesem Ordner. Das Laden ist nicht möglich."); } $objects = $object->get_inventory(); } else { $objects = array(); } $objectType = getObjectType($object); switch ($objectType) { case "document": header("location: " . PATH_URL . "explorer/ViewDocument/" . $this->id . "/"); die; break; case "forum": header("location: " . PATH_URL . "forum/Index/" . $this->id . "/"); die; break; case "referenceFolder": $exitObject = $object->get_exit(); header("location: " . PATH_URL . "explorer/Index/" . $exitObject->get_id() . "/"); die; break; case "referenceFile": $linkObject = $object->get_link_object(); header("location: " . PATH_URL . "explorer/Index/" . $linkObject->get_id() . "/"); die; break; case "user": header("location: " . PATH_URL . "user/Index/" . $object->get_name() . "/"); die; break; case "group": \ExtensionMaster::getInstance()->send404Error(); die; break; case "trashbin": \ExtensionMaster::getInstance()->send404Error(); die; break; case "portal_old": $rawHtml = new \Widgets\RawHtml(); //$rawHtml->setHtml("Dies ist ein \"altes\" Portal und kann nicht mehr angezeigt werden. Bitte umwandeln."); $frameResponseObject->addWidget($rawHtml); $frameResponseObject->setProblemDescription("Dies ist ein \"altes\" Portal und kann nicht mehr angezeigt werden."); $frameResponseObject->setProblemSolution("Bitte umwandeln."); return $frameResponseObject; break; case "gallery": header("location: " . PATH_URL . "gallery/Index/" . $this->id . "/"); die; break; case "portal": header("location: " . PATH_URL . "portal/Index/" . $this->id . "/"); die; break; case "portalColumn": \ExtensionMaster::getInstance()->send404Error(); die; break; case "portalPortlet": \ExtensionMaster::getInstance()->send404Error(); die; break; case "userHome": //ok break; case "groupWorkroom": //ok break; case "room": //ok break; case "container": //ok break; case "unknown": \ExtensionMaster::getInstance()->send404Error(); die; break; } $title = getCleanName($object); $parent = $object->get_environment(); if ($parent instanceof \steam_container) { //$parentLink = array("name"=>"nach oben", "link"=>PATH_URL . "explorer/Index/" . $parent->get_id() . "/"); $parentLink = ""; } else { $parentLink = ""; } $breadcrumb = new \Widgets\Breadcrumb(); $breadcrumb->setData(array($parentLink, array("name" => "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($object) . "\"></img> " . $title . " " . \Explorer\Model\Sanction::getMarkerHtml($object, false)))); $this->getExtension()->addJS(); $this->getExtension()->addCSS(); $actionBar = new \Widgets\ActionBar(); $actionBar->setActions(array(array("name" => "Neu", "ajax" => array("onclick" => array("command" => "newElement", "params" => array("id" => $this->id), "requestType" => "popup"))), array("name" => "Eigenschaften", "ajax" => array("onclick" => array("command" => "properties", "params" => array("id" => $this->id), "requestType" => "popup"))), array("name" => "Rechte", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => $this->id), "requestType" => "popup"))))); //$actionBar->setActions(array(array("name"=>"Neu", "ajax"=>array("onclick"=>array("command"=>"newelement"))), array("name"=>"Eigenschaften", "link"=>PATH_URL."explorer/properties/"), array("name"=>"Rechte", "link"=>PATH_URL."explorer/rights/"))); $presentation = $object->get_attribute("bid:presentation"); $preHtml = ""; if ($presentation === "head") { $objects = $object->get_inventory(); if (count($objects) > 0) { $first = $objects[0]; $mimetype = $first->get_attribute(DOC_MIME_TYPE); if ($mimetype == "image/png" || $mimetype == "image/jpeg" || $mimetype == "image/gif") { // Image $preHtml = "<div style=\"text-align:center\"><img style=\"max-width:100%\" src=\"" . PATH_URL . "Download/Document/" . $first->get_id() . "/\"></div>"; } else { if ($mimetype == "text/html") { $preHtml = strip_tags($first->get_content(), "<h1><h2><h3><h4><h5><p><a><div><style><b><i><strong><img><hr><table><tr><th><td><ul><ol><li>"); } else { if (strstr($mimetype, "text")) { $bidDokument = new \BidDocument($first); $preHtml = $bidDokument->get_content(); } } } } } else { if ($presentation === "index" && !(isset($_GET["view"]) && $_GET["view"] === "list")) { $objects = $object->get_inventory(); if (count($objects) > 0) { $first = $objects[0]; $url = \ExtensionMaster::getInstance()->getUrlForObjectId($first->get_id(), "view"); header("location: {$url}"); exit; } } } if ($preHtml !== "") { $preHtml = "<div style=\"border-bottom: 1px solid #ccc; padding-bottom:10px; margin-bottom:10px\">{$preHtml}</div>"; } $environment = new \Widgets\RawHtml(); $environment->setHtml("{$preHtml}<input type=\"hidden\" id=\"environment\" name=\"environment\" value=\"{$this->id}\">"); $loader = new \Widgets\Loader(); $loader->setWrapperId("explorerWrapper"); $loader->setMessage("Lade Dokumente ..."); $loader->setCommand("loadContent"); $loader->setParams(array("id" => $this->id)); $loader->setElementId("explorerWrapper"); $loader->setType("updater"); $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml("<div id=\"explorerContent\">" . $breadcrumb->getHtml() . $environment->getHtml() . $loader->getHtml() . "</div>"); $rawHtml->addWidget($breadcrumb); $rawHtml->addWidget($environment); $rawHtml->addWidget($loader); $frameResponseObject->setTitle($title); $frameResponseObject->addWidget($actionBar); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }