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; } } } } } } } }
function getObjectReadableSize($object) { $type = getObjectType($object); try { if ($type == "document") { $html = getReadableSize($object->get_content_size()); } else { if ($type == "container" || $type == "room" || $type == "groupWorkroom" || $type == "userHome") { $html = count($object->get_inventory()) . " Objekte"; } else { if ($type == "portal") { $html = count($object->get_inventory()) . " Spalten"; } else { if ($type == "gallery") { $html = count($object->get_inventory()) . " Bilder"; } else { if ($type == "forum") { $html = count($object->get_annotations()) . " Themen"; } else { if ($type == "referenceFile") { $linkObject = $object->get_link_object(); $html = getObjectReadableSize($linkObject); } else { if ($type == "referenceFolder") { $exitObject = $object->get_exit(); $html = getObjectReadableSize($exitObject); } else { $html = ""; } } } } } } } } catch (steam_exception $e) { $html = "keine Berechtigung"; } return $html; }
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"); $desc = $contentItem->get_attribute("OBJ_DESC"); $name = getCleanName($contentItem, 50); 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) { return getObjectReadableSize($contentItem); } } } } } }