Ejemplo n.º 1
0
/**
 * Check if the given length is a relative length and convert
 * it to an absolute length using the given base value.
 */
function calculate_absolute_length($length, $base_value)
{
    if (($relative_length = extract_percentual_length($length)) != "") {
        return floor($base_value * $relative_length / 100);
    } else {
        return extract_length($length);
    }
}
Ejemplo n.º 2
0
Archivo: view.php Proyecto: rolwi/koala
 foreach ($content as $msg_id) {
     //get obj and attributes
     $message = steam_factory::get_object($steam, $msg_id);
     $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"));
     /* 
      * 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->set_var(array("MESSAGE_PICTURE" => "", "MESSAGE_LINK" => "", "MESSAGE_HEADLINE" => $UBB->encode($message->get_attribute("OBJ_NAME")), "MESSAGE_SUBHEADLINE" => $UBB->encode($message->get_attribute("OBJ_DESC")), "MESSAGE_CONTENT" => $message->get_content()));
     // parse in picture if it exists
     if ($message->get_attribute("bid:portlet:msg:picture_id") != "") {
         $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->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") {
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 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;
 }