예제 #1
0
파일: Chat.class.php 프로젝트: rolwi/koala
 public function getHtml()
 {
     $portal = \lms_portal::get_instance();
     $annotations = $this->data->get_annotations();
     $annotations = array_reverse($annotations);
     $lastAnnotation = 0;
     foreach ($annotations as $annotation) {
         $this->getContent()->setCurrentBlock("BLOCK_CHAT");
         if ($lastAnnotation === 0) {
             $lastAnnotation = $annotation->get_attribute("OBJ_CREATION_TIME");
             $this->getContent()->setCurrentBlock("BLOCK_STATUS");
             $this->getContent()->setVariable("STATUS_MESSAGE", "Diskussion mit " . $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname() . ".<br>" . getReadableDate($lastAnnotation));
             $this->getContent()->parse("BLOCK_STATUS");
         } else {
             $tmp = $lastAnnotation;
             $lastAnnotation = $annotation->get_attribute("OBJ_CREATION_TIME");
             if ($lastAnnotation - $tmp > 600) {
                 $this->getContent()->setCurrentBlock("BLOCK_STATUS");
                 $this->getContent()->setVariable("STATUS_MESSAGE", getReadableDate($lastAnnotation));
                 $this->getContent()->parse("BLOCK_STATUS");
             }
         }
         $this->getContent()->setCurrentBlock("BLOCK_OUTGOING");
         $this->getContent()->setVariable("OUTGOING_MESSAGE", $annotation->get_content());
         $this->getContent()->setVariable("OUTGOING_IMG", \lms_user::get_user_image_url(32, 32));
         $this->getContent()->setVariable("OUTGOING_TITLE", $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname());
         $this->getContent()->parse("BLOCK_OUTGOING");
         $this->getContent()->parse("BLOCK_CHAT");
     }
     return $this->getContent()->get();
 }
예제 #2
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == 1) {
         //TODO
         return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->getRoom()) . "\"></img>";
     } else {
         if ($cell == 2) {
             $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->getId(), "view");
             $desc = $contentItem->getDescription();
             if ($desc !== 0 && $desc !== "") {
                 $name = $desc;
             } else {
                 $name = str_replace("%20", " ", $contentItem->getName());
             }
             if (isset($url) && $url != "") {
                 return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
             } else {
                 return $name;
             }
         } else {
             if ($cell == 3) {
                 return $contentItem->count();
             } else {
                 if ($cell == 4) {
                     return getReadableDate($contentItem->getModificationTime());
                 }
             }
         }
     }
 }
예제 #3
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == 0) {
         return "<input style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"if(this.checked) { jQuery('#{$contentItem->getId()}').css({'background-color':'#eee', 'boarder':'1px solid #eee'})} else {jQuery('#{$contentItem->getId()}').css({'background-color':'transparent', 'boarder':'1px solid white'})}\"></input>";
     } else {
         if ($cell == 1) {
             //TODO
             return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->getRoom()) . "\"></img>";
         } else {
             if ($cell == 2) {
                 $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->getId(), "view");
                 $desc = $contentItem->getDescription();
                 if ($desc !== 0 && $desc !== "") {
                     $name = $desc;
                 } else {
                     $name = str_replace("%20", " ", $contentItem->getName());
                 }
                 if (isset($url) && $url != "") {
                     return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
                 } else {
                     return $name;
                 }
             } else {
                 if ($cell == 3) {
                     return getReadableDate($contentItem->getModificationTime());
                 }
             }
         }
     }
 }
예제 #4
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == 0) {
         return "<input style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"event.stopPropagation(); if(this.checked) { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-unhover').addClass('listviewer-item-selected') } else { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-selected').addClass('listviewer-item-unhover') }\"></input>";
     } else {
         if ($cell == 1) {
             return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem) . "\"></img>";
         } else {
             if ($cell == 2) {
                 $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_id(), "view");
                 $desc = $contentItem->get_attribute("OBJ_DESC");
                 if ($desc !== 0 && $desc !== "") {
                     $name = $desc;
                 } else {
                     $name = str_replace("%20", " ", $contentItem->get_name());
                 }
                 if ($name == "Trashbin") {
                     $name = "Papierkorb";
                 }
                 if (isset($url) && $url != "") {
                     return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
                 } else {
                     return $name;
                 }
             } else {
                 if ($cell == 3) {
                     return getReadableDate($contentItem->get_attribute("OBJ_LAST_CHANGED"));
                 } else {
                     if ($cell == 4) {
                         if ($contentItem instanceof \steam_document) {
                             return getReadableSize($contentItem->get_content_size());
                         } else {
                             if ($contentItem instanceof \steam_container) {
                                 try {
                                     $html = "<div style=\"color: #ccc\">" . count($contentItem->get_inventory()) . " Objekte</div>";
                                 } catch (\steam_exception $e) {
                                     $html = "keine Berechtigung";
                                 }
                                 return $html;
                             }
                         }
                     } else {
                         if ($cell == 5) {
                             $popupMenu = new \Widgets\PopupMenu();
                             $popupMenu->setData($contentItem);
                             return $popupMenu;
                         }
                     }
                 }
             }
         }
     }
 }
예제 #5
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == $this->rawImage) {
         return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->get_link_object()) . "\"></img>";
     } else {
         if ($cell == $this->rawName) {
             $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_link_object()->get_id(), "view");
             $desc = $contentItem->get_link_object()->get_attribute("OBJ_DESC");
             $name = getCleanName($contentItem->get_link_object(), 50);
             if (isset($url) && $url != "") {
                 return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
             } else {
                 return $name;
             }
         } else {
             if ($cell == $this->rawChangeDate) {
                 return getReadableDate($contentItem->get_link_object()->get_attribute("OBJ_LAST_CHANGED"));
             }
         }
     }
 }
예제 #6
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == $this->rawCheckbox) {
         return "<input style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"event.stopPropagation(); if(this.checked) { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-unhover').addClass('listviewer-item-selected') } else { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-selected').addClass('listviewer-item-unhover') }\"></input>";
     } else {
         if ($cell == $this->rawImage) {
             return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->get_link_object()) . "\"></img>";
         } else {
             if ($cell == $this->rawName) {
                 $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_link_object()->get_id(), "view");
                 $desc = $contentItem->get_link_object()->get_attribute("OBJ_DESC");
                 if (!($desc === false || $desc === 0 || $desc === "")) {
                     $name = $desc;
                 } else {
                     $name = str_replace("%20", " ", $contentItem->get_link_object()->get_name());
                 }
                 if ($name == "Trashbin") {
                     $name = "Papierkorb";
                 }
                 if (isset($url) && $url != "") {
                     return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
                 } else {
                     return $name;
                 }
             } else {
                 if ($cell == $this->rawMarker) {
                     $html = "";
                     if ($contentItem->get_link_object()->check_access_read(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), STEAM_GUEST_LOGIN)) || $contentItem->get_link_object()->check_access_read(\steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "steam"))) {
                         $html .= "<img onclick=\"event.stopPropagation(); this.src='" . PATH_URL . "bookmarks/asset/icons/star_inactive_16.png' \" style=\"cursor: pointer\" title=\"Öffentlich lesbar.\" src=\"" . PATH_URL . "explorer/asset/icons/public_16.png\"></img>";
                     }
                     //$html .= "<img onclick=\"event.stopPropagation(); this.src='".PATH_URL."bookmarks/asset/icons/star_inactive_16.png' \" style=\"cursor: pointer\" title=\"Als Lesezeichen markiert.\" src=\"".PATH_URL."bookmarks/asset/icons/star_16.png\"></img>";
                     return $html;
                 } else {
                     if ($cell == $this->rawChangeDate) {
                         return getReadableDate($contentItem->get_link_object()->get_attribute("OBJ_LAST_CHANGED"));
                     } else {
                         if ($cell == $this->rawSize) {
                             if ($contentItem->get_link_object() instanceof \steam_document) {
                                 return getReadableSize($contentItem->get_link_object()->get_content_size());
                             } else {
                                 if ($contentItem->get_link_object() instanceof \steam_container) {
                                     try {
                                         $html = "<div style=\"color: #ccc\">" . count($contentItem->get_link_object()->get_inventory()) . " Objekte</div>";
                                     } catch (\steam_exception $e) {
                                         $html = "keine Berechtigung";
                                     }
                                     return $html;
                                 }
                             }
                         } else {
                             if ($cell == $this->rawMenu) {
                                 $popupMenu = new \Widgets\PopupMenu();
                                 $popupMenu->setData($contentItem);
                                 $popupMenu->setElementId("listviewer-overlay");
                                 return $popupMenu;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #7
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     $objType = getObjectType($contentItem);
     if ($cell == $this->rawCheckbox) {
         if (!$contentItem instanceof \steam_trashbin) {
             return "<input id=\"{$contentItem->get_id()}_checkbox\" style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"event.stopPropagation(); if(this.checked) { jQuery('#{$contentItem->get_id()}').addClass('listviewer-item-selected') } else { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-selected') }\"></input>";
         } else {
             return "";
         }
     } else {
         if ($cell == $this->rawImage) {
             return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem) . "\"></img>";
         } else {
             if ($cell == $this->rawName) {
                 $tipsy = new \Widgets\Tipsy();
                 $tipsy->setElementId($contentItem->get_id() . "_" . $this->rawName);
                 $tipsy->setHtml("<div style=\"font-weight:bold; width:100px; float:left;\">Besitzer</div> <img style=\"margin: 3px\" align=\"middle\" src=\"" . PATH_URL . "download/image/" . $contentItem->get_creator()->get_attribute(OBJ_ICON)->get_id() . "/30/30\"> " . $contentItem->get_creator()->get_attribute(USER_FIRSTNAME) . " " . $contentItem->get_creator()->get_attribute(USER_FULLNAME) . "<br clear=\"all\">" . "<div style=\"font-weight:bold; width:100px; float:left;\">zuletzt geändert</div> " . getFormatedDate($contentItem->get_attribute(OBJ_LAST_CHANGED)) . "<br>" . "<div style=\"font-weight:bold; width:100px; float:left;\">erstellt</div> " . getFormatedDate($contentItem->get_attribute(OBJ_CREATION_TIME)) . "<br>");
                 $url = PATH_URL . "explorer/index/" . $contentItem->get_id() . "/";
                 $desc = $contentItem->get_attribute("OBJ_DESC");
                 //$name = $objectModel->getReadableName();
                 $name = getCleanName($contentItem, 50);
                 if (isset($url) && $url != "") {
                     return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>" . "<script>" . $tipsy->getHtml() . "</script>";
                 } else {
                     return $name . "<script>" . $tipsy->getHtml() . "</script>";
                 }
             } else {
                 if ($cell == $this->rawMarker) {
                     $html = "";
                     if ($objType == "referenceFile") {
                         $html .= "<div class=\"marker\">" . \Explorer\Model\Sanction::getMarkerHtml($contentItem->get_link_object()) . "</div>";
                     } else {
                         $html .= "<div class=\"marker\">" . \Explorer\Model\Sanction::getMarkerHtml($contentItem) . "</div>";
                     }
                     $html .= "<div class=\"marker\" id=\"{$contentItem->get_id()}_BookmarkMarkerWrapper\">";
                     $linkError = false;
                     if ($contentItem instanceof \steam_exit) {
                         $exitObject = $contentItem->get_exit();
                         if ($exitObject instanceof \steam_object) {
                             $id = $exitObject->get_id();
                         } else {
                             $linkError = true;
                             $html .= "<div style=\"color:red\">Link defekt</div>";
                         }
                     } else {
                         if ($contentItem instanceof \steam_link) {
                             $linkObject = $contentItem->get_link_object();
                             if ($linkObject instanceof \steam_object) {
                                 $id = $linkObject->get_id();
                             } else {
                                 $linkError = true;
                                 $html .= "<div style=\"color:red\">Link defekt</div>";
                             }
                         } else {
                             $id = $contentItem->get_id();
                         }
                     }
                     if (!$linkError && \Bookmarks\Model\Bookmark::isBookmark($id)) {
                         $html .= \Bookmarks\Model\Bookmark::getMarkerHtml($id);
                     }
                     $html .= "</div>";
                     return $html;
                 } else {
                     if ($cell == $this->rawChangeDate) {
                         if ($objType == "referenceFile") {
                             return getReadableDate($contentItem->get_link_object()->get_attribute("OBJ_LAST_CHANGED"));
                         } else {
                             return getReadableDate($contentItem->get_attribute("OBJ_LAST_CHANGED"));
                         }
                     } else {
                         if ($cell == $this->rawSize) {
                             return getObjectReadableSize($contentItem);
                         } else {
                             if ($cell == $this->rawMenu) {
                                 $popupMenu = new \Widgets\PopupMenu();
                                 $popupMenu->setData($contentItem);
                                 $popupMenu->setElementId("listviewer-overlay");
                                 return $popupMenu;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #8
0
파일: Index.class.php 프로젝트: rolwi/koala
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $rawHtml = new \Widgets\RawHtml();
     $steam = $GLOBALS["STEAM"];
     $objectId = $this->id;
     $myExtension = \Forum::getInstance();
     $forumObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $steamUser = $GLOBALS["STEAM"]->get_current_steam_user();
     $lastSessionTime = $steamUser->get_attribute("bid:last_session_time");
     $lastSessionTime = is_array($lastSessionTime) ? intval($lastSessionTime[0]) : intval(time());
     /** check the rights of the log-in user */
     $forum_allowed_write = $forumObject->check_access(SANCTION_SANCTION, $steamUser);
     $forum_allowed_read = $forumObject->check_access_read($steamUser);
     $forum_allowed_annotate = $forumObject->check_access_annotate($steamUser);
     if (!$forum_allowed_read) {
         throw new \Exception("You have no permission to read this forum", E_USER_RIGHTS);
     }
     $forumAttributes = $forumObject->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, "bid:description", "bid:forum_subscription"));
     $categories = $forumObject->get_annotations();
     $forumAnnotations = $categories;
     foreach ($categories as $category) {
         $id = $category->get_id();
         $categoryAttributes[$id] = $category->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, "bid:description"), 1);
         $messages[$id] = $category->get_annotations(false, 1);
         $categoryCreator[$id] = $category->get_creator(1);
     }
     $result = $steam->buffer_flush();
     foreach ($categories as $category) {
         $id = $category->get_id();
         $messages[$id] = $result[$messages[$id]];
         $categoryMessageCount[$id] = count($messages[$id]);
         sort($messages[$id]);
         if ($categoryMessageCount[$id] > 0) {
             $categoryLastMessageAttributes[$id] = end($messages[$id])->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME), 1);
             $categoryLastMessageCreator[$id] = end($messages[$id])->get_creator(1);
         }
         $categoryAttributes[$id] = $result[$categoryAttributes[$id]];
         $categoryCreator[$id] = $result[$categoryCreator[$id]];
         $categoryCreator[$id]->get_attributes(array(OBJ_NAME), 1);
     }
     $result = $steam->buffer_flush();
     foreach ($categories as $category) {
         $id = $category->get_id();
         if ($categoryMessageCount[$id] > 0) {
             $categoryLastMessageAttributes[$id] = $result[$categoryLastMessageAttributes[$id]];
             $categoryLastMessageCreator[$id] = $result[$categoryLastMessageCreator[$id]];
             $categoryLastMessageCreator[$id]->get_attributes(array(OBJ_NAME), 1);
         }
     }
     $result = $steam->buffer_flush();
     $myExtension->addCSS();
     $content = $myExtension->loadTemplate("forumIndex.template.html");
     $content->setCurrentBlock('BLOCK_FORUM_HEAD');
     $content->setVariable("FORUM_HEADING", urldecode($forumAttributes["OBJ_NAME"]));
     $content->setVariable("FORUM_UNDERTITLE", $forumAttributes["OBJ_DESC"] !== 0 ? $forumAttributes["OBJ_DESC"] : "");
     $content->setVariable("FORUM_DESCRIPTION", $forumAttributes["bid:description"] !== 0 ? $forumAttributes["bid:description"] : "");
     $content->parse('BLOCK_FORUM_HEAD');
     // sort all forum topics
     usort($forumAnnotations, "sortTopicsByDate");
     if (count($forumAnnotations) == 0) {
         $content->setVariable("NO_CONTENT", "Dieses Forum enthält keine Themen.");
     } else {
         foreach ($forumAnnotations as $annotation) {
             $content->setCurrentBlock('BLOCK_FORUM_CONTENT');
             $content->setVariable("TOPIC", $annotation->get_attribute("OBJ_DESC"));
             $content->setVariable("TOPIC_AUTHOR", getCleanName($annotation->get_attribute("DOC_USER_MODIFIED")));
             $content->setVariable("TOPIC_DATE", getReadableDate($annotation->get_attribute("OBJ_CREATION_TIME")));
             $content->setVariable("LINK_SHOW_TOPIC", PATH_URL . "forum/showTopic/" . $objectId . "/" . $annotation->get_id());
             $count = count($annotation->get_annotations());
             $content->setVariable("REPLY_COUNT", $count);
             if ($count > 0) {
                 $content->setVariable("LAST_REPLY_TOPIC", $categoryLastMessageAttributes[$annotation->get_id()][OBJ_DESC]);
                 $content->setVariable("LAST_REPLY_DATE", date("d.m.Y G:i", $annotation->get_attribute("OBJ_LAST_CHANGED")));
                 $content->setVariable("LAST_REPLY_USER", getCleanName($annotation->get_attribute("DOC_USER_MODIFIED")));
                 $lastPostTime = $annotation->get_attribute("OBJ_CREATION_TIME");
                 if ($lastSessionTime < $lastPostTime) {
                     $imageUrl = \Forum::getInstance()->getAssetUrl() . "icons/new_message_info.gif";
                     //$content->setVariable("NEW_IMAGE", '<img src="'.$imageUrl.'" title="Neue Antworten.">');
                 }
             }
             //	$popupMenu= new \Widgets\PopupMenu();
             //	$popupMenu->setData($annotation);
             //	$popupMenu->setElementId("overlay_menu");
             //	$popupMenu->setParams(array(array("key" => "forum", "value" => $objectId)));
             //	$content->setVariable("POPUP_MENU", $popupMenu->getHtml());
             //	$rawHtml->addWidget($popupMenu);
             $content->parse('BLOCK_FORUM_CONTENT');
         }
     }
     $actionBar = new \Widgets\ActionBar();
     $actions = array();
     if ($forum_allowed_annotate) {
         $actions[] = array("name" => "Neues Thema", "ajax" => array("onclick" => array("command" => "newTopic", "params" => array("id" => $this->id), "requestType" => "popup")));
     }
     if ($forum_allowed_write) {
         $actions[] = array("name" => "Eigenschaften", "ajax" => array("onclick" => array("command" => "Properties", "params" => array("id" => $this->id), "requestType" => "popup", "namespace" => "explorer")));
         $actions[] = array("name" => "Rechte", "ajax" => array("onclick" => array("command" => "Sanctions", "params" => array("id" => $this->id), "requestType" => "popup", "namespace" => "explorer")));
     }
     $actionBar->setActions($actions);
     //$breadcrumb = new \Widgets\Breadcrumb();
     //$breadcrumb->setData(array($currentRoom));
     $frameResponseObject->setTitle("Forum - " . $forumAttributes["OBJ_DESC"]);
     $rawHtml->setHtml($content->get());
     $frameResponseObject->addWidget($actionBar);
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == $this->rawImage) {
         return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->get_link_object()) . "\"></img>";
     } else {
         if ($cell == $this->rawName) {
             $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_link_object()->get_id(), "view");
             $desc = $contentItem->get_link_object()->get_attribute("OBJ_DESC");
             if (!($desc === false || $desc === 0 || $desc === "")) {
                 $name = $desc;
             } else {
                 $name = str_replace("%20", " ", $contentItem->get_link_object()->get_name());
             }
             if ($name == "Trashbin") {
                 $name = "Papierkorb";
             }
             if (isset($url) && $url != "") {
                 return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
             } else {
                 return $name;
             }
         } else {
             if ($cell == $this->rawMarker) {
                 $html = "";
                 if ($contentItem instanceof \steam_exit) {
                     $obj = $contentItem->get_exit();
                 } else {
                     if ($contentItem instanceof \steam_link) {
                         $obj = $contentItem->get_link_object();
                     } else {
                         $obj = $contentItem;
                     }
                 }
                 $html .= "<div class=\"marker\">" . \Explorer\Model\Sanction::getMarkerHtml($obj) . "</div>";
                 return $html;
             } else {
                 if ($cell == $this->rawChangeDate) {
                     return getReadableDate($contentItem->get_link_object()->get_attribute("OBJ_LAST_CHANGED"));
                 }
             }
         }
     }
 }
예제 #10
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == 0) {
         return "<input style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"event.stopPropagation(); if(this.checked) { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-unhover').addClass('listviewer-item-selected') } else { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-selected').addClass('listviewer-item-unhover') }\"></input>";
     } else {
         if ($cell == 1) {
             return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem) . "\"></img>";
         } else {
             if ($cell == 2) {
                 $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_id(), "view");
                 $desc = $contentItem->get_attribute("OBJ_DESC");
                 if ($desc !== 0 && $desc !== "") {
                     $name = $desc;
                 } else {
                     $name = str_replace("%20", " ", $contentItem->get_name());
                 }
                 if ($name == "Trashbin") {
                     $name = "Papierkorb";
                 }
                 if (isset($url) && $url != "") {
                     return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
                 } else {
                     return $name;
                 }
             } else {
                 if ($cell == 3) {
                     return getReadableDate($contentItem->get_attribute("OBJ_LAST_CHANGED"));
                 } else {
                     if ($cell == 4) {
                         $competencesArray = $contentItem->getCompetences();
                         $competences = "";
                         foreach ($competencesArray as $competence) {
                             $competences .= "<a href=\"/portfolio/ViewCompetence/?job=" . $competence->getJobAffiliation() . "&activity=" . $competence->getActivityAffiliation() . "&facet=" . $competence->getFacetAffiliation() . "\">" . $competence->short . " </a>";
                         }
                         return $competences;
                     } else {
                         if ($cell == 6) {
                             $popupMenu = new \Widgets\PopupMenu();
                             $popupMenu->setData($contentItem);
                             $popupMenu->setElementId("listviewer-overlay");
                             return $popupMenu;
                         } else {
                             if ($cell == 5) {
                                 return $contentItem->getArtefactClass();
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #11
0
 public function getCellData($cell, $contentItem)
 {
     if (!is_int($cell)) {
         throw new \Exception("cell must be an integer!!");
     }
     if ($cell == $this->rawImage) {
         return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem) . "\"></img>";
     } else {
         if ($cell == $this->rawName) {
             $url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_id(), "view");
             $name = getCleanName($contentItem);
             if (isset($url) && $url != "") {
                 return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
             } else {
                 return $name;
             }
         } else {
             if ($cell == $this->rawMarker) {
                 $html = "";
                 $html .= "<div class=\"marker\">" . \Explorer\Model\Sanction::getMarkerHtml($contentItem) . "</div>";
                 $html .= "<div class=\"marker\" id=\"{$contentItem->get_id()}_BookmarkMarkerWrapper\">";
                 $linkError = false;
                 if ($contentItem instanceof \steam_exit) {
                     $exitObject = $contentItem->get_exit();
                     if ($exitObject instanceof \steam_object) {
                         $id = $exitObject->get_id();
                     } else {
                         $linkError = true;
                         $html .= "<div style=\"color:red\">Link defekt</div>";
                     }
                 } else {
                     if ($contentItem instanceof \steam_link) {
                         $linkObject = $contentItem->get_link_object();
                         if ($linkObject instanceof \steam_object) {
                             $id = $linkObject->get_id();
                         } else {
                             $linkError = true;
                             $html .= "<div style=\"color:red\">Link defekt</div>";
                         }
                     } else {
                         $id = $contentItem->get_id();
                     }
                 }
                 if (!$linkError && \Bookmarks\Model\Bookmark::isBookmark($id)) {
                     $html .= \Bookmarks\Model\Bookmark::getMarkerHtml($id);
                 }
                 $html .= "</div>";
                 return $html;
             } else {
                 if ($cell == $this->rawChangeDate) {
                     return getReadableDate($contentItem->get_attribute("OBJ_LAST_CHANGED"));
                 } else {
                     if ($cell == $this->rawSize) {
                         if ($contentItem instanceof \steam_document) {
                             return getReadableSize($contentItem->get_content_size());
                         } else {
                             if ($contentItem instanceof \steam_container) {
                                 try {
                                     $html = "<div style=\"color: #ccc\">" . count($contentItem->get_inventory()) . " Objekte</div>";
                                 } catch (\steam_exception $e) {
                                     $html = "keine Berechtigung";
                                 }
                                 return $html;
                             }
                         }
                     }
                 }
             }
         }
     }
 }