private function createBottomTreeDom() { $mainDiv = new Div(); $mainDiv->addStyleClass("bottom_panel"); $div01 = new Div(); $mainDiv->addChild($div01); $div01->addStyleClasses(["bottom_panel_window"]); $container = new Div(); $container->addStyleClasses(["bottom_panel_item", "w-31p"]); $container->updateId("bottom_catalog_tree"); $containerChild = new Div(); $containerChild->addStyleClasses(["catalog"]); $container->addChild($containerChild); $div01->addChildList([$container]); $mainTitle = new A(); $mainTitle->addChild("Каталог"); $mainTitle->addAttribute("href", Labels::$TOP_NAVIGATION_LINKS["catalog"]); $mainTitle->addStyleClasses(["f-16", "title"]); $containerChild->addChild($mainTitle); $treeContainer = new Div(); $treeContainer->addStyleClass("content"); $containerChild->addChild($treeContainer); $this->treeProcessBottom($this->mainTree, $treeContainer); return $mainDiv; }
protected function createGeneralContent() { $mainTag = new Div(); $mainTag->addStyleClasses(["map_page", "float_left"]); $mainTag->addChildList([$this->getInfoBlock(), $this->getMap()]); return $mainTag; }
public function get3Dots() { $mainTag = new Div(); $mainTag->addStyleClasses(["three_dots_style", "f-15"]); $mainTag->addChild("..."); return $mainTag; }
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])))); }
public function getPaginationLinks($pageNumber, $num, $totalCount, $topBottom) { $mainTag = new Div(); $catalogLink = new CatalogLink(); $dots = false; $topBottomStyle = $topBottom == 'bottom' ? 'link_next_prev_bottom' : ''; if ($totalCount != 0) { $amountPages = ceil($totalCount / $num); if ($pageNumber > 0 && $pageNumber <= $amountPages) { $mainTag->addStyleClasses(["pagination_bar", "right_top_bar", $topBottomStyle]); $brokerTag = new Div(); $mainTag->addChild($brokerTag); $tagCenterContainer = new Span(); if ($pageNumber != 1) { $tagPrevious = new A(); $tagPrevious->addStyleClasses(["f-16", "text_non_select", "link_style", "link_next_prev", "input_hover", "prev_link"]); $tagPrevious->addAttribute("href", URLBuilder::getCatalogLinkPrev($pageNumber, $num)); $text = new Div(); $text->addStyleClass("text"); $text->addChild("назад"); $arrow = new Div(); $arrow->addStyleClass("arrow"); $tagCenterContainer->addChild($tagPrevious->addChildList([$arrow, $text])); } $brokerTag->addChild($tagCenterContainer); $tagCenterContainer->addStyleClasses(["numeric_links", "f-15"]); for ($currentRenderPage = 1; $currentRenderPage <= $amountPages; $currentRenderPage++) { if ($currentRenderPage < 2 || $currentRenderPage > $pageNumber - $this->linksGroupCount && $currentRenderPage < $pageNumber + $this->linksGroupCount || $currentRenderPage > $amountPages - 1) { $dots = false; if ($currentRenderPage != $pageNumber) { $tagCenterContainer->addChild($catalogLink->getLink($currentRenderPage, $num)); } else { $emptyLinkView = $catalogLink->getEmptyLink($pageNumber); $emptyLinkView->addStyleClass("f-16"); $tagCenterContainer->addChild($emptyLinkView); } } else { if (!$dots) { $dots = true; $tagCenterContainer->addChild($catalogLink->get3dots()); } } } if ($pageNumber != $amountPages) { $tagNext = new A(); $tagNext->addStyleClasses(["f-16", "text_non_select", "link_style", "input_hover", "link_next_prev", "next_link"]); $tagNext->addAttribute("href", URLBuilder::getCatalogLinkNext($pageNumber, $num)); $text = new Div(); $text->addStyleClass("text"); $text->addChild("вперед"); $arrow = new Div(); $arrow->addStyleClass("arrow"); $tagCenterContainer->addChild($tagNext->addChildList([$text, $arrow])); } } } return $mainTag; }
private function createGeneralContentForEmptyResult($valueToSearch) { $mainTag = new Div(); $mainTag->addStyleClass("empty_search_result"); $emptySearchResultLabel = new Div(); $emptySearchResultLabel->addStyleClasses(["empty_search_result_label", "f-16"]); $mainTag->addChild($emptySearchResultLabel->addChild(Labels::prefillMessage([$valueToSearch], Labels::EMPTY_SEARCH_RESULT))); TagUtils::createShadow($mainTag); return $mainTag; }
private function getItemInfo($name, $description) { $mainTag = new Div(); $itemTitle = new Div(); $itemTitle->addStyleClasses(["title", "font_arial"]); $itemTitle->addChild($name); $itemDescription = new Div(); $itemDescription->addStyleClasses(["title", "font_arial"]); $itemDescription->addChild($description); return $mainTag->addChildList([$itemTitle, $itemDescription]); }
private function buildPathLink($data) { $links = []; $zIndex = 10; $pathIndex = 0; $arrow = new Div(); $arrow->addStyleClass("path_link_item_arrow_right"); for ($index = 0; $index < count($data); $index++) { $node = new Div(); $node->addAttributes(["xmlns:v" => "http://rdf.data-vocabulary.org/#", "typeof" => "v:Breadcrumb"]); $node->addAttribute("style", "z-index: " . $zIndex--); $node->addStyleClass("level" . ($index + 1)); if (count($data[$index]) > 1 && strlen(trim($data[$index][1])) > 0) { $pathNode = new A(); $pathNode->addAttributes(["rel" => "v:url", "property" => "v:title"]); $pathNode->addAttribute("href", $data[$index][1]); } else { $pathNode = new Div(); } $trimText = Utils::trimStr($data[$index][0], Constants::DEFAULT_TEXT_LENGTH_FOR_CATALOG_PATH_LINK); $pathNode->addChild($trimText); $pathNode->addStyleClasses(["path_link_item_text", $index > 0 ? "not_level_first_level" : ""]); array_push($links, $node->addChildList([$pathNode])); } return $links; }
public function createPathLinks() { $mainTag = new Div(); $mainTag->addStyleClasses(["path_link", "f-16"]); /*$blockForTree = new Div(); $blockForTree->addStyleClasses(["w-18p"]);*/ $blockForCatalog = new Div(); $blockForCatalog->addStyleClasses(["path_link_chain"]); $mainTag->addChildList([$blockForCatalog->addChild($this->getPathLinkForMainBlock()), $this->getViewModeBlock()]); return $mainTag; }
public static function getCompactItemView($name, $images, $itemId, $pageNumber, $num, $key, $valueToSearch, $type, $trimName, $isHighLightElement) { $blackOut = new Div(); $blackOut->addStyleClasses(["blackout", "catalog_item_button_container"]); $blackOut->addAttributes(["itemscope" => "", "itemtype" => "http://data-vocabulary.org/Product"]); $mainDiv = new Div(); $blackOut->addChild($mainDiv); TagUtils::createShadow($mainDiv); $mainDiv->addStyleClasses(["simple_item_compact", $isHighLightElement ? Constants::HIGH_LIGHT_ELEMENT : ""]); $imagesContainer = new Div(); $imagesContainer->addStyleClass("catalog_img_container"); $mainDiv->addChild($imagesContainer); $index = 0; foreach ($images as $image) { if ($index == 1) { break; } $imgView = new Img(); $imgView->addAttributes(array("src" => addslashes($image), "alt" => $name, TagLabels::ON_CLICK => "openSimpleImg(arguments[0])")); $imagesContainer->addChild($imgView); $index++; } if ($type == 'HARD') { $url = URLBuilder::getCatalogLinkForSingleItem($pageNumber, $num, $itemId, array(UrlParameters::KEY => $key, UrlParameters::SEARCH_VALUE => $valueToSearch)); $mainDiv->addStyleClass("cursor_pointer"); $link = TagUtils::createNote($trimName, ""); $blackOut->addChild($link); $blackOut->addChild(self::getItemButton($url)); } elseif ($type == 'SIMPLE') { $text = TagUtils::createNote($trimName, ""); $blackOut->addChild($text); } return $blackOut; }
private function renderPriceDownloadItems() { $mainDiv = new Div(); $mainDiv->addStyleClasses(["w-25p", "price_download_container", "blackout"]); $button = new Div(); $buttonContainer = new Div(); $button->addStyleClasses(["price_download_button", "button", "note", "w-50p", "input_hover", "f-15"]); $button->addChild("скачать прайс-лист"); $buttonContainer->addChild($button); $mainDiv->addChild($buttonContainer); return $mainDiv; }
public static function createPriceListLink() { $pref = new DBPreferencesType(); $pricesDir = $pref->getPreference(Constants::PRICE_DIRECTORY)[DB::TABLE_PREFERENCES__VALUE]; $prices = FileUtils::getFilesByDescription($pricesDir, 'xls'); $descriptions = FileUtils::getFilesByDescription($pricesDir, 'txt'); $mainTag = new Div(); $mainTag->addStyleClass("download_table"); for ($index = 0; $index < count($prices); $index++) { $priceItem = new Div(); $priceIcon = new Div(); $priceIcon->addStyleClasses(["price_icon", "float_left"]); $priceText = new Div(); $priceText->addStyleClass(["download_description", "float_left"]); $priceText->addChild(file_get_contents($descriptions[$index])); $priceItem->addChildList([$priceIcon, $priceText]); $mainTag->addChild($priceItem); } return $mainTag; }