Example #1
0
 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;
 }
Example #2
0
 public function getLink($pageNumber, $num)
 {
     $mainTag = new A();
     $mainTag->addStyleClasses(["link_style", "cursor_pointer", "text_non_select", "f-15", "input_hover"]);
     $mainTag->addAttribute("href", URLBuilder::getCatalogLinkNumeric($pageNumber, $num));
     $mainTag->addChild($pageNumber);
     return $mainTag;
 }
Example #3
0
 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;
 }
Example #4
0
 public static function getItemButton($url)
 {
     $button = new A();
     $button->addStyleClasses(["catalog_item_button", "f-17", "input_hover"]);
     $button->addChild("подробнее");
     $button->addAttribute("href", $url);
     return $button;
 }
Example #5
0
 public static function createNote($text, $link)
 {
     $note = new A();
     $note->addStyleClass("note");
     $textWrapper01 = new Div();
     $textWrapper = new Span();
     $textWrapper->addChild($text);
     $textWrapper01->addChild($textWrapper);
     $note->addChild($textWrapper01);
     if (strlen($link) > 0) {
         $note->addAttribute("href", $link);
         $note->addStyleClasses(["hover_text_underline"]);
     } else {
         $note->addStyleClasses(["cursor_default"]);
     }
     return $note;
 }