コード例 #1
0
ファイル: TreeView.php プロジェクト: gingerP/shop
 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]))));
 }
コード例 #2
0
ファイル: BottomPanel.php プロジェクト: gingerP/shop
 private function bottomTreeRender(Tree &$tree, $isRoot)
 {
     $children = count($tree->childrens);
     $span = new Li();
     $mainDiv = new Div();
     $span->addStyleClass($isRoot);
     /*if ($children == 0) {*/
     $mainDiv = new A();
     $span->addChild($mainDiv);
     $mainDiv->addStyleClasses(["f-17", "cursor_pointer", "bottom_tree_hover", "label"]);
     $mainDiv->addAttribute(TagLabels::HREF, URLBuilder::getCatalogLinkForTree($tree->key));
     /*} else {
           $span->addChild($mainDiv);
           $mainDiv->addStyleClasses(["f-17", "label"]);
       }*/
     $mainDiv->addChild($tree->value);
     return $span;
 }
コード例 #3
0
ファイル: navigation.php プロジェクト: kientran/BonesTemplate
function printnavigation($selected = "")
{
    include_once 'gagawa-1.2-beta.php';
    $conf = Config::getConf();
    $navigation = $conf['site']['navigation'];
    $ul = new Ul();
    foreach ($navigation as $i => $value) {
        $li = new Li();
        $link = new A();
        $link->setHref($value);
        $link->appendChild(new Text($i));
        $li->appendChild($link);
        if ($selected === $i) {
            $link->setCSSClass('selected');
        }
        $ul->appendChild($li);
    }
    return $ul->write();
}
コード例 #4
0
ファイル: TopNavigationLinks.php プロジェクト: gingerP/shop
 private function createSearchLink($selectedPageStyle, $title, $link)
 {
     $mainTag = new Li();
     $searchLabel = new Div();
     $searchInput = new Input();
     $searchButton = new Div();
     $mainTag->addStyleClass("");
     if (Utils::isIE()) {
         $mainTag->addChild($searchLabel);
     } else {
         $searchInput->addAttribute("placeholder", "Поиск по товарам...");
     }
     $mainTag->addChild($searchInput);
     $mainTag->addChild($searchButton);
     $mainTag->addStyleClasses(["search_button_container", $selectedPageStyle]);
     $searchLabel->addChild($title);
     $searchLabel->updateId('search');
     $searchLabel->addStyleClasses(["search_label", "f-16", "float_left"]);
     $searchInput->addStyleClasses(["search_input", "f-16", "float_left"]);
     $searchButton->addStyleClasses(["search_button", "float_left"]);
     return $mainTag;
 }
コード例 #5
0
ファイル: PathLinks.php プロジェクト: gingerP/shop
 public static function getDOMForViewModeSelector()
 {
     $rt_numeric_view_mode = Labels::VIEW_MODE_NUMERIC_DEF;
     $rt_compact_view_mode = Labels::VIEW_MODE_COMPACT_DEF;
     if (array_key_exists(UrlParameters::ITEMS_COUNT, $_GET) && in_array(Utils::getFromGET(UrlParameters::ITEMS_COUNT), Labels::$VIEW_MODE_NUMERIC)) {
         $rt_numeric_view_mode = Utils::getFromGET(UrlParameters::ITEMS_COUNT);
     }
     if (array_key_exists(UrlParameters::VIEW_MODE, $_GET) && array_key_exists(Utils::getFromGET(UrlParameters::VIEW_MODE), Labels::$VIEW_MODE_COMPACT)) {
         $rt_compact_view_mode = Utils::getFromGET(UrlParameters::VIEW_MODE);
     }
     $mainTag = new Div();
     $mainTag->addStyleClass("view_mode");
     $numeric = new Div();
     $numeric->addStyleClass("numeric");
     $selectNumeric = new Ul();
     for ($numIndex = 0; $numIndex < count(Labels::$VIEW_MODE_NUMERIC); $numIndex++) {
         $value = Labels::$VIEW_MODE_NUMERIC[$numIndex];
         $option = new Li();
         $item = new Div();
         $item->addChild($value);
         $item->addStyleClass("numeric_item");
         $option->addChild($item);
         if ($value == $rt_numeric_view_mode) {
             $option->addStyleClass("selected");
         }
         $selectNumeric->addChild($option);
     }
     $line = new Div();
     $line->addStyleClass("view");
     $selectCompact = new Ul();
     foreach (Labels::$VIEW_MODE_COMPACT as $key => $value) {
         $option = new Li();
         /*$option->addChild($value);*/
         //$option->addAttribute("value", $key);
         $option->addChild(self::getDOMForViewMode($key));
         if ($key == $rt_compact_view_mode) {
             $option->addStyleClass("selected");
         }
         $selectCompact->addChild($option);
     }
     return $mainTag->addChildList([$line->addChild($selectCompact), $numeric->addChild($selectNumeric)]);
 }
コード例 #6
0
ファイル: TagUtils.php プロジェクト: gingerP/shop
 public static function createList($arr)
 {
     if (is_array($arr) && count($arr) > 0) {
         $mainTag = new Ul();
         for ($arrIndex = 0; $arrIndex < count($arr); $arrIndex++) {
             $li = new Li();
             $li->addChild($arr[$arrIndex]);
             $mainTag->addChild($li);
         }
         return $mainTag;
     }
     return "";
 }