コード例 #1
0
ファイル: LoadPortfolios.class.php プロジェクト: rolwi/koala
 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;
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: toolkit.php プロジェクト: rolwi/koala
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;
}
コード例 #3
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;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: Portfoliosdebug.class.php プロジェクト: rolwi/koala
 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) {
                     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 == 4) {
                         return "0";
                     }
                 }
             }
         }
     }
 }
コード例 #5
0
ファイル: LoadLastVisited.class.php プロジェクト: rolwi/koala
 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;
                             }
                         }
                     }
                 }
             }
         }
     }
 }