当前位置: 首页>>代码示例>>PHP>>正文


PHP Category::getLink方法代码示例

本文整理汇总了PHP中Category::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getLink方法的具体用法?PHP Category::getLink怎么用?PHP Category::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Category的用法示例。


在下文中一共展示了Category::getLink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderContent

 public function renderContent($args, $setting)
 {
     $t = array('name' => '', 'html' => '');
     $setting = array_merge($t, $setting);
     $nb = $setting['itemstab'] ? (int) $setting['itemstab'] : 6;
     $catids = $setting['categories'] ? $setting['categories'] : array();
     $orderby = $setting['orderby'] ? $setting['orderby'] : 'position';
     $orderway = $setting['orderway'] ? $setting['orderway'] : 'ASC';
     $items_page = $setting['itemspage'] ? (int) $setting['itemspage'] : 3;
     $columns_page = $setting['columns'] ? (int) $setting['columns'] : 3;
     $categories = array();
     foreach ($catids as $catid) {
         $category = new Category($catid, (int) Context::getContext()->language->id);
         if ($category->id) {
             $categories[$catid]['id'] = $category->id;
             $categories[$catid]['name'] = $category->name;
             $categories[$catid]['link'] = $category->getLink();
             $products = $category->getProducts((int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway);
             Context::getContext()->controller->addColorsToProductList($products);
             $categories[$catid]['products'] = $products;
         }
     }
     $setting['leocategories'] = $categories;
     $setting['itemsperpage'] = $items_page;
     $setting['columnspage'] = $columns_page;
     $setting['scolumn'] = 12 / $columns_page;
     $setting['myTab'] = 'leocategorytab' . rand(20, rand());
     $output = array('type' => 'categoriestabs', 'data' => $setting);
     return $output;
 }
开发者ID:evgrishin,项目名称:mh16014,代码行数:30,代码来源:categoriestabs.php

示例2: generateCategoriesMenu

 protected function generateCategoriesMenu($categories, $is_children = 0)
 {
     $html = '';
     foreach ($categories as $key => $category) {
         if ($category['level_depth'] > 1) {
             $cat = new Category($category['id_category']);
             $link = Tools::HtmlEntitiesUTF8($cat->getLink());
         } else {
             $link = $this->context->link->getPageLink('index');
         }
         /* Whenever a category is not active we shouldnt display it to customer */
         if ((bool) $category['active'] === false) {
             continue;
         }
         $html .= '<li' . ($this->page_name == 'category' && (int) Tools::getValue('id_category') == (int) $category['id_category'] ? ' class="sfHoverForce ' . Tools::link_rewrite($category['name']) . '"' : ' class="' . Tools::link_rewrite($category['name']) . '"') . '>';
         $html .= '<a href="' . $link . '" title="' . $category['name'] . '"><img src="/themes/aphrodinet/img/menu-icon-' . strtolower($category['name']) . '.png" /><br/>' . $category['name'] . '</a>';
         if (isset($category['children']) && !empty($category['children'])) {
             $html .= '<ul>';
             $html .= $this->generateCategoriesMenu($category['children'], 1);
             if ((int) $category['level_depth'] > 1 && !$is_children) {
                 $files = scandir(_PS_CAT_IMG_DIR_);
                 if (count(preg_grep('/^' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $files)) > 0) {
                     $html .= '<li class="category-thumbnail">';
                     foreach ($files as $file) {
                         if (preg_match('/^' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $file) === 1) {
                             $html .= '<div><img src="' . $this->context->link->getMediaLink(_THEME_CAT_DIR_ . $file) . '" alt="' . Tools::SafeOutput($category['name']) . '" title="' . Tools::SafeOutput($category['name']) . '" class="imgm" /></div>';
                         }
                     }
                     $html .= '</li>';
                 }
             }
             $html .= '</ul>';
         }
         $html .= '</li>';
     }
     return $html;
 }
开发者ID:paolobattistella,项目名称:aphro,代码行数:37,代码来源:blocktopmenu.php

示例3: getCategory

 private function getCategory(&$menu, $id_category, $id_lang = false, $id_shop = false, $is_child_item = false)
 {
     $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id;
     $category = new Category((int) $id_category, (int) $id_lang);
     if ($category->level_depth > 1) {
         $category_link = $category->getLink();
     } else {
         $category_link = $this->context->link->getPageLink('index');
     }
     if (is_null($category->id)) {
         return;
     }
     $children = Category::getChildren((int) $id_category, (int) $id_lang, true, (int) $id_shop);
     $selected = $this->page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? 'active ' : '';
     $is_intersected = array_intersect($category->getGroups(), $this->user_groups);
     $class = $selected . ($is_child_item ? $this->_subItemClass : $this->_itemClass);
     $head = $is_child_item ? $this->_subItemHead : $this->_itemHead;
     $tail = $is_child_item ? $this->_subItemTail : $this->_itemTail;
     // filter the categories that the user is allowed to see and browse
     if (!empty($is_intersected)) {
         $menu .= $head . '<li class="' . $class . '">';
         $menu .= '<a href="' . $category_link . '"><span>' . $category->name . '</span></a>';
         if (count($children) && ($this->_showAll !== 'one level' || $this->_showAllResponsive !== 'one level')) {
             $menu .= $this->_subMenuHead . '<ul class="' . $this->_subMenuClass . '">';
             foreach ($children as $child) {
                 $this->getCategory($menu, (int) $child['id_category'], (int) $id_lang, (int) $child['id_shop'], true);
             }
             $menu .= '</ul>' . $this->_subMenuTail;
         }
         $menu .= '</li>' . $tail;
     }
 }
开发者ID:tmdhosting,项目名称:TMDHosting-PrestaShop-Technology-Theme,代码行数:32,代码来源:blocktopmenu_mod.php

示例4: generateCategoriesMenu

 private function generateCategoriesMenu($categories)
 {
     $html = '';
     foreach ($categories as $key => $category) {
         if ($category['level_depth'] > 1) {
             $cat = new Category($category['id_category']);
             $link = Tools::HtmlEntitiesUTF8($cat->getLink());
         } else {
             $link = $this->context->link->getPageLink('index');
         }
         $html .= '<li' . ($this->page_name == 'category' && (int) Tools::getValue('id_category') == (int) $category['id_category'] ? ' class="sfHoverForce"' : '') . '>';
         $html .= '<a href="' . $link . '" title="' . $category['name'] . '">' . $category['name'] . '</a>';
         if (isset($category['children']) && !empty($category['children'])) {
             $html .= '<ul>';
             $html .= $this->generateCategoriesMenu($category['children']);
             if ((int) $category['level_depth'] == 2) {
                 $files = scandir(_PS_CAT_IMG_DIR_);
                 if (count($files) > 0) {
                     $html .= '<li class="category-thumbnail">';
                     foreach ($files as $file) {
                         if (preg_match('/^' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $file) === 1) {
                             $html .= '<div><img src="' . $this->context->link->getMediaLink(_THEME_CAT_DIR_ . $file) . '" alt="' . Tools::SafeOutput($category['name']) . '" title="' . Tools::SafeOutput($category['name']) . '" class="imgm" /></div>';
                         }
                     }
                     $html .= '</li>';
                 }
             }
             $html .= '</ul>';
         }
         $html .= '</li>';
     }
     return $html;
 }
开发者ID:MacFlay,项目名称:Presta-Domowy,代码行数:33,代码来源:blocktopmenu.php

示例5: getCategory

 private function getCategory($id_category, $id_lang = false, $id_shop = false)
 {
     $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id;
     $category = new Category((int) $id_category, (int) $id_lang);
     if ($category->level_depth > 1) {
         $category_link = $category->getLink();
     } else {
         $category_link = $this->context->link->getPageLink('index');
     }
     if (is_null($category->id)) {
         return;
     }
     $children = Category::getChildren((int) $id_category, (int) $id_lang, true, (int) $id_shop);
     $selected = $this->page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' class="sfHoverForce"' : '';
     $is_intersected = array_intersect($category->getGroups(), $this->user_groups);
     // filter the categories that the user is allowed to see and browse
     if (!empty($is_intersected)) {
         $this->_menu .= '<li ' . $selected . '>';
         $this->_menu .= '<a href="' . Tools::HtmlEntitiesUTF8($category_link) . '" title="' . $category->name . '">' . $category->name . '</a>';
         if (count($children)) {
             $this->_menu .= '<ul>';
             foreach ($children as $child) {
                 $this->getCategory((int) $child['id_category'], (int) $id_lang, (int) $child['id_shop']);
             }
             if ($category->level_depth == 2) {
                 $files = scandir(_PS_CAT_IMG_DIR_);
                 $this->_menu .= '<li id="category-thumbnail">';
                 foreach ($files as $file) {
                     if (preg_match('/' . $category->id . '-([0-9])?_thumb.jpg/i', $file) === 1) {
                         $this->_menu .= '<div><img src="' . Tools::getShopDomain(true, true) . __PS_BASE_URI__ . basename(_PS_IMG_DIR_) . '/' . basename(_PS_CAT_IMG_DIR_) . '/' . $file . '" alt="' . $category->name . '" class="imgm" /></div>';
                     }
                 }
                 $this->_menu .= '</li>';
             }
             $this->_menu .= '</ul>';
         }
         $this->_menu .= '</li>';
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:39,代码来源:blocktopmenu.php

示例6: getCategory

 private function getCategory($id_category, $id_lang)
 {
     global $page_name;
     $categorie = new Category($id_category, $id_lang);
     if (is_null($categorie->id)) {
         return;
     }
     $selected = $page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' class="sfHoverForce"' : '';
     $this->_menu .= '<li' . $selected . '>';
     if (count(explode('.', $categorie->name)) > 1) {
         $name = str_replace('.', '', strstr($categorie->name, '.'));
     } else {
         $name = $categorie->name;
     }
     $this->_menu .= '<a href="' . $categorie->getLink() . '">' . $name . '</a>';
     $childrens = Category::getChildren($id_category, $id_lang);
     if (count($childrens)) {
         $this->_menu .= '<ul>';
         foreach ($childrens as $children) {
             $this->getCategory($children['id_category'], $id_lang);
         }
         $this->_menu .= '</ul>';
     }
     $this->_menu .= '</li>';
 }
开发者ID:greench,项目名称:prestashop,代码行数:25,代码来源:blocktopmenu.php

示例7: generateCategoriesMenu

 protected function generateCategoriesMenu($categories, $is_children = 0)
 {
     $nodes = [];
     foreach ($categories as $key => $category) {
         $node = $this->makeNode([]);
         if ($category['level_depth'] > 1) {
             $cat = new Category($category['id_category']);
             $link = $cat->getLink();
         } else {
             $link = $this->context->link->getPageLink('index');
         }
         $node['url'] = $link;
         $node['type'] = 'category';
         $node['page_identifier'] = 'category-' . $category['id_category'];
         /* Whenever a category is not active we shouldnt display it to customer */
         if ((bool) $category['active'] === false) {
             continue;
         }
         $current = $this->page_name == 'category' && (int) Tools::getValue('id_category') == (int) $category['id_category'];
         $node['current'] = $current;
         $node['label'] = $category['name'];
         $node['image_urls'] = [];
         if (isset($category['children']) && !empty($category['children'])) {
             $node['children'] = $this->generateCategoriesMenu($category['children'], 1);
             $files = scandir(_PS_CAT_IMG_DIR_);
             if (count(preg_grep('/^' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $files)) > 0) {
                 foreach ($files as $file) {
                     if (preg_match('/^' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $file) === 1) {
                         $image_url = $this->context->link->getMediaLink(_THEME_CAT_DIR_ . $file);
                         $node['image_urls'][] = $image_url;
                     }
                 }
             }
         }
         $nodes[] = $node;
     }
     return $nodes;
 }
开发者ID:prestashop,项目名称:ps_mainmenu,代码行数:38,代码来源:ps_mainmenu.php

示例8: getCatMobileOption

 private function getCatMobileOption($id_category, $id_lang = false, $id_shop = false, $child = false)
 {
     $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id;
     $category = new Category((int) $id_category, (int) $id_lang);
     if ($category->level_depth > 1) {
         $category_link = $category->getLink();
     } else {
         $category_link = $this->context->link->getPageLink('index');
     }
     if (is_null($category->id)) {
         return;
     }
     $children = Category::getChildren((int) $id_category, (int) $id_lang, true, (int) $id_shop);
     $selected = $this->page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' class="active"' : '';
     /*
               $is_intersected = array_intersect($category->getGroups(), $this->user_groups);
               // filter the categories that the user is allowed to see and browse
               if (!empty($is_intersected))
               { */
     $this->_mmenu .= '<option value="' . htmlentities($category_link) . '">';
     if ($child == 1) {
         $this->_mmenu .= ' – ';
     }
     $this->_mmenu .= $category->name;
     $this->_mmenu .= '</option>';
     if (count($children)) {
         foreach ($children as $child) {
             $this->getCatMobileOption((int) $child['id_category'], (int) $id_lang, (int) $child['id_shop'], $child = 1);
         }
     }
     //}
 }
开发者ID:reshman,项目名称:swkart-presta,代码行数:32,代码来源:tdmegamenu.php

示例9: getCategory

 private function getCategory($id_category, $id_lang = false, $id_shop = false)
 {
     $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id;
     $category = new Category((int) $id_category, (int) $id_lang);
     if ($category->level_depth > 1) {
         $category_link = $category->getLink();
     } else {
         $category_link = $this->context->link->getPageLink('index');
     }
     if (is_null($category->id)) {
         return;
     }
     $children = Category::getChildren((int) $id_category, (int) $id_lang, true, (int) $id_shop);
     $selected = $this->page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' class="sfHoverForce"' : '';
     $is_intersected = array_intersect($category->getGroups(), $this->user_groups);
     // filter the categories that the user is allowed to see and browse
     if (!empty($is_intersected)) {
         $this->_menu .= '<li ' . $selected . '>';
         $this->_menu .= '<a href="' . $category_link . '">' . $category->name . '</a>';
         if (count($children)) {
             $this->_menu .= '<ul>';
             foreach ($children as $child) {
                 $this->getCategory((int) $child['id_category'], (int) $id_lang, (int) $child['id_shop']);
             }
             $this->_menu .= '</ul>';
         }
         $this->_menu .= '</li>';
     }
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:29,代码来源:blocktopmenu.php

示例10: getCategory

 private function getCategory($id_category, $id_lang)
 {
     global $page_name;
     $categorie = new Category($id_category, $id_lang);
     if (is_null($categorie->id)) {
         return;
     }
     $selected = $page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' class="sfHoverForce"' : '';
     $this->_menu .= '<li' . $selected . '>';
     if (count(explode('.', $categorie->name)) > 1) {
         $name = str_replace('.', '', strstr($categorie->name, '.'));
     } else {
         $name = $categorie->name;
     }
     if ($id_category == 1) {
         $this->_menu .= '<a href="' . _PS_BASE_URL_ . __PS_BASE_URI__ . '"><span>' . htmlentities($name) . '</span></a>';
     } else {
         $this->_menu .= '<a href="' . $categorie->getLink() . '"><span>' . htmlentities($name) . '</span></a>';
     }
 }
开发者ID:prayasjain,项目名称:MyCollegeStore,代码行数:20,代码来源:blank_blocktopmenu.php

示例11: generateCategoriesMenu

	protected function generateCategoriesMenu($categories, $is_children = 0, $iteration = 0)
    {
        $html = '';

        foreach ($categories as $key => $category) {
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                $link = Tools::HtmlEntitiesUTF8($cat->getLink());
            } else {
                $link = $this->context->link->getPageLink('index');
            }

            /* Whenever a category is not active we shouldnt display it to customer */
            if ((bool)$category['active'] === false) {
                continue;
            }

            $coWidth = $iteration ? "col-md-2" : "";

            $html .= '<li class="'.$coWidth.(($this->page_name == 'category'
                && (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' sfHoverForce' : '').'">';
            $html .= '<a href="'.$link.'" title="'.$category['name'].'">';
            if ($iteration && $category['link_rewrite']) {
            	$html .= '<img src="'.$this->context->link->getCatImageLink($category['link_rewrite'], $category['id_category']).'" alt="'.$category['name'].'" />';
            	$html .= '<span>'.$category['name'].'</span><i></i>';
            } else {
            	$html .= '<span>'.$category['name'].'</span><i></i>';
            }

            $html .= '</a>';

            if (isset($category['children']) && !empty($category['children'])) {
                $html .= '<ul>';
                $html .= $this->generateCategoriesMenu($category['children'], 1);

                if ((int)$category['level_depth'] > 1 && !$is_children) {
                    $files = scandir(_PS_CAT_IMG_DIR_);

                    if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) {
                        $html .= '<li class="category-thumbnail">';

                        foreach ($files as $file) {
                            if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) {
                                $html .= '<div><img src="'.$this->context->link->getMediaLink(_THEME_CAT_DIR_.$file)
                                .'" alt="'.Tools::SafeOutput($category['name']).'" title="'
                                .Tools::SafeOutput($category['name']).'" class="imgm" /></div>';
                            }
                        }

                        $html .= '</li>';
                    }
                }

                $html .= '</ul>';
            }

            $html .= '</li>';
        }
        
        if ($iteration == 2) {
            $html .= '<li class="center-li col-md-4"></li>';
        }

        return $html;
    }
开发者ID:satanicman,项目名称:Pizzushi.loc,代码行数:65,代码来源:blocktopmenu.php

示例12: generateCategoriesMenu

 private function generateCategoriesMenu($categories, $activeCategories = array(), $is_child_item = false)
 {
     $html = '';
     $class = $is_child_item ? $this->_subItemClass : $this->_itemClass;
     $head = $is_child_item ? $this->_subItemHead : $this->_itemHead;
     $tail = $is_child_item ? $this->_subItemTail : $this->_itemTail;
     foreach ($categories as $key => $category) {
         $currentId = (int) $category['id_category'];
         if ($category['level_depth'] > 1) {
             $cat = new Category($currentId);
             $link = Tools::HtmlEntitiesUTF8($cat->getLink());
         } else {
             $link = $this->context->link->getPageLink('index');
         }
         $selected = '';
         foreach ($activeCategories as $activeCategory) {
             if ($currentId === (int) $activeCategory['id_category']) {
                 $selected = ' active';
             }
         }
         $html .= $head . '<li class="' . $class . '">';
         $html .= '<a href="' . $link . '" title="' . $category['name'] . '"' . (empty($selected) ? '' : 'class="' . $selected . '"') . '><span>' . $category['name'] . '</span></a>';
         if (isset($category['children']) && !empty($category['children']) && ($this->_showAll !== 'one level' || $this->_showAllResponsive !== 'one level')) {
             $html .= $this->_subMenuHead . '<ul class="' . $this->_subMenuClass . $selected . '">';
             $html .= $this->generateCategoriesMenu($category['children'], $activeCategories, true);
             if ((int) $category['level_depth'] == 2) {
                 $files = scandir(_PS_CAT_IMG_DIR_);
                 if (count($files) > 0) {
                     $html .= $this->_subItemHead . '<li id="category-thumbnail" class="' . $this->_subItemClass . '">';
                     foreach ($files as $file) {
                         if (preg_match('/' . $category['id_category'] . '-([0-9])?_thumb.jpg/i', $file) === 1) {
                             $html .= '<div><img src="' . $this->context->link->getMediaLink(_THEME_CAT_DIR_ . $file) . '" alt="' . Tools::SafeOutput($category['name']) . '" title="' . Tools::SafeOutput($category['name']) . '" class="imgm" /></div>';
                         }
                     }
                     $html .= '</li>' . $this->_subItemTail;
                 }
             }
             $html .= '</ul>' . $this->_subMenuTail;
         }
         $html .= '</li>' . $tail;
     }
     return $html;
 }
开发者ID:tmdhosting,项目名称:TMDHosting-PrestaShop-Technology-Theme,代码行数:43,代码来源:blocktopmenu_mod.php

示例13: getCategories

 public static function getCategories($id_category, $id_lang, $ignore = array(), $maxLevel = 0, $currLevel = 0)
 {
     $results = array();
     $currLevel++;
     $categorie = new Category($id_category, $id_lang);
     if (is_null($categorie->id)) {
         return $results;
     }
     if (count(explode('.', $categorie->name)) > 1) {
         $title = str_replace('.', '', strstr($categorie->name, '.'));
     } else {
         $title = $categorie->name;
     }
     $link = $categorie->getLink();
     $childrens = array();
     $_childrens = Category::getChildren($id_category, $id_lang);
     if (count($_childrens)) {
         foreach ($_childrens as $children) {
             $id_category = $children['id_category'];
             $children = self::getCategories($id_category, $id_lang, $ignore, $maxLevel, $currLevel);
             if (!in_array($id_category, $ignore)) {
                 if (isset($children[0])) {
                     $childrens[] = $children[0];
                 }
             }
         }
     }
     if (!in_array($categorie->id, $ignore) && !($currLevel > $maxLevel && $maxLevel != 0)) {
         if (count(explode('.', $title)) > 1) {
             $title = str_replace('.', '', strstr($title, '.'));
         }
         $results[] = array('id' => $categorie->id, 'id_menu' => '', 'type' => 'category', 'title' => $title, 'logged' => null, 'css' => '', 'new_window' => false, 'level' => $currLevel, 'numProducts' => Configuration::get('MENU_CATEGORIES_NUM') ? self::getNumProductsByCategory($categorie->id) : 0, 'link' => $link, 'childrens' => $childrens);
     }
     return $results;
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:35,代码来源:menu.class.php

示例14: getCategory

 private function getCategory($id_category, $id_lang = false, $id_shop = false)
 {
     $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id;
     $category = new Category((int) $id_category, (int) $id_lang);
     if ($category->level_depth > 1) {
         $category_link = $category->getLink();
     } else {
         $category_link = $this->context->link->getPageLink('index');
     }
     if (is_null($category->id)) {
         return;
     }
     $children = Category::getChildren((int) $id_category, (int) $id_lang, true, (int) $id_shop);
     $selected = $this->page_name == 'category' && (int) Tools::getValue('id_category') == $id_category ? ' active ' : '';
     $is_intersected = array_intersect($category->getGroups(), $this->user_groups);
     // filter the categories that the user is allowed to see and browse
     if (!empty($is_intersected)) {
         $this->_menu .= '<li class="' . $selected;
         $add_data = '';
         if ($category->level_depth == 1) {
             $this->_menu .= 'dropdown">';
             $add_data = ' class="dropdown-toggle" data-toggle="dropdown"';
         } elseif ($category->level_depth > 1 && count($children)) {
             $this->_menu .= 'dropdown-submenu">';
         } else {
             $this->_menu .= '">';
         }
         $this->_menu .= '<a' . $add_data . ' href="' . $category_link . '">' . $category->name;
         if (count($children)) {
             $this->_menu .= '<b class="caret"></b>';
         }
         $this->_menu .= '</a>';
         if (count($children)) {
             $this->_menu .= '<ul class="dropdown-menu">';
             foreach ($children as $child) {
                 $this->getCategory((int) $child['id_category'], (int) $id_lang, (int) $child['id_shop']);
             }
             $this->_menu .= '</ul>';
         }
         $this->_menu .= '</li>';
     }
 }
开发者ID:pacxs,项目名称:pacxscom,代码行数:42,代码来源:blockleotopmenu.php

示例15: extractElementInfo

 public function extractElementInfo()
 {
     switch ($this->type) {
         case 'external':
             $this->link = $this->external;
             break;
     }
     if ($this->element) {
         switch ($this->type) {
             case 'cms_category':
                 $title = $this->element->name;
                 $this->link = $this->element->getLink();
                 if ($this->display_cms_cat_childs && !self::isAdmin()) {
                     foreach (CmsCategory::getChildren($this->element->id, self::getIdLang()) as $children) {
                         $obj = new CmsCategory($children['id_cms_category'], self::getIdLang());
                         $child = new self(array('type' => 'cms_category', 'id_cms_category' => $obj->id, 'element' => $obj, 'display_cms_cat_childs' => $this->display_cms_cat_childs));
                         $this->childrens[] = $child;
                     }
                     foreach ($this->getCMSPages($this->element->id) as $page) {
                         $obj = new CMS($page['id_cms'], self::getIdLang());
                         $child = new self(array('type' => 'cms', 'id_cms' => $obj->id, 'element' => $obj, 'display_cms_cat_childs' => $this->display_cms_cat_childs));
                         $this->childrens[] = $child;
                     }
                 }
                 break;
             case 'product_category':
                 $title = $this->element->name;
                 $link = $this->element->getLink();
                 if ($this->display_prod_cat_childs && !self::isAdmin()) {
                     /** @var $this->element CategoryCore */
                     foreach (Category::getChildren($this->element->id, self::getIdLang()) as $children) {
                         $obj = new Category($children['id_category'], self::getIdLang());
                         $child = new self(array('type' => 'product_category', 'id_category' => $obj->id, 'title' => $obj->name, 'link' => $obj->getLink(), 'display_prod_cat_childs' => $this->display_prod_cat_childs));
                         $this->childrens[] = $child;
                     }
                 }
                 break;
             case 'product':
                 $link = $this->element->getLink();
                 $title = $this->element->name;
                 break;
             case 'internal':
                 $link = self::getClassLink()->getPageLink($this->element->page);
                 $title = $this->element->title;
                 break;
             case 'cms':
                 $link = self::getClassLink()->getCMSLink($this->element, null);
                 $title = $this->element->meta_title;
                 break;
             case 'manufacturer':
                 $link = $this->element->getLink();
                 $title = $this->element->name;
                 break;
             case 'supplier':
                 $link = $this->element->getLink();
                 $title = $this->element->name;
                 break;
             case 'attachment':
                 $link = self::getClassLink()->getPageLink('attachment', NULL, "id_attachment=" . $this->id_attachment);
                 $title = $this->element->name;
                 break;
         }
     }
     //        if(self::isSSL())
     //            $this->link = str_replace('http://','https://',$this->link);
     if (empty($this->link)) {
         $this->link = @$link;
     }
     if (empty($this->title)) {
         $this->title = @$title;
     }
     if (is_array($this->title)) {
         $this->title = $this->title[self::getIdLang()];
     }
     if ($this->has_anchor) {
         $this->link .= '#' . $this->anchor;
     }
 }
开发者ID:simonbonjean,项目名称:PrestaSuperTool-Api,代码行数:78,代码来源:Item.php


注:本文中的Category::getLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。