private function mainTreeRender(Tree &$tree, $selectedKey) { $li = new Li(); $mainDiv = new Div(); $mainDiv->addStyleClasses(["expand", "text_non_select", "tree_text_node", "input_hover"]); $table = new Table(); $tr = new Tr(); $nodeIcon = new Td(); $nodeText = new Td(); $nodeText->addStyleClass("tree_text"); $nodeSearchCount = new Td(); $nodeSearchCount->addStyleClass("tree_search_count"); if (count($tree->childrens) > 0) { $nodeIcon->addStyleClasses(["tree_btn"]); $icon = new Img(); $icon->addAttribute("style", "top: 2px; position: relative; margin: 0 5px;"); $icon->addAttribute("src", $this->treeLevel <= $this->DEFAULT_TREE_LEVEL_TO_SHOW || $tree->show ? "images/arrow90.png" : "images/arrow00.png"); $nodeIcon->addChild($icon); } else { $nodeIcon->addStyleClass("tree_empty"); } $link = new A(); $link->addAttribute("href", URLBuilder::getCatalogLinkForTree($tree->key)); $link->addChild($tree->value); $link->addStyleClass("input_hover"); $nodeSelected = new Div(); $nodeSelected->addStyleClass($tree->key == $selectedKey ? 'selected' : 'tree_empty'); $link->addChild($nodeSelected); $nodeText->addChild($link); return $li->addChild($mainDiv->addChild($table->addChild($tr->addChildList([$nodeIcon, $nodeText, $nodeSearchCount])))); }
private function getPreviewImages($images, $key, $display) { $mainTag = new Div(); $mainTag->addStyleClasses(["default-skin"]); $viewPort = new Div(); $viewPort->addStyleClass("viewport"); $overviewImages = new Div(); $overviewImages->addStyleClasses([$key, "overview"]); if (!$display) { $overviewImages->addAttribute("style", "display:none;"); } foreach ($images as $image) { $imageContainer = new Div(); $imageContainer->addStyleClasses(["blackout", "image_preview"]); $img = new Img(); $img->addAttribute("src", $image); $overviewImages->addChild($imageContainer->addChild($img)); } if (count($images) == 0) { $mainTag->addAttribute('style', 'display: none;'); } return $mainTag->addChild($viewPort->addChild($overviewImages)); }
private function renderGalleryItemWithSingleItem($data) { $mainDiv = new Div(); $mainDiv->addStyleClasses(["main_page_item", "blackout", "catalog_item_button_container"]); $container = new Div(); $container->addStyleClass("main_page_item_sub"); $urlToItem = URLBuilder::getItemLinkForComplexType("", $data[DB::TABLE_GOODS__KEY_ITEM], 1, 48); $itemImagePath = ''; $itemName = $data[DB::TABLE_GOODS__NAME]; $images = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $data[DB::TABLE_GOODS__KEY_ITEM] . DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, 'jpg'); if ($images[0] == '') { $itemImagePath = FileUtils::getCapImage(Labels::CAP_IMAGE_FOR_CLOTHING); } else { $itemImagePath = $images[0]; } $singleItemView = new Div(); $singleItemView->addStyleClasses(["main_page_item_sub_single"]); $imgView = new Img(); $noteView = null; $imgView->addAttribute("src", $itemImagePath); if ($data[DB::TABLE_GOODS__GOD_TYPE] == "HARD") { $singleItemView->addStyleClass("cursor_pointer"); $noteView = TagUtils::createNote($itemName, ""); } else { $noteView = TagUtils::createNote($itemName, ""); } $noteView->addStyleClasses(["f-15"]); $container->addChildList([$singleItemView, $noteView, Item::getItemButton($urlToItem)]); $singleItemView->addChild($imgView); return $mainDiv->addChild($container); }