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


PHP Journal2Utils::getIconOptions方法代码示例

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


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

示例1: generateMenu

 private function generateMenu($items)
 {
     $items = Journal2Utils::sortArray($items);
     foreach ($items as $key => &$item) {
         $icon = Journal2Utils::getIconOptions($item);
         /* menu href */
         $href = null;
         $name = null;
         $target = $item['target'] ? ' target="_blank"' : '';
         $class = Journal2Utils::getProperty($item, 'hide_on_mobile') ? 'hide-on-mobile' : '';
         if ($class === 'hide-on-mobile' && (Journal2Cache::$mobile_detect->isMobile() || Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
             unset($items[$key]);
             continue;
         }
         if (Journal2Utils::getProperty($item, 'hide_on_desktop', '0') === '1' && !Journal2Cache::$mobile_detect->isMobile()) {
             unset($items[$key]);
             continue;
         }
         /* menu type */
         switch ($item['menu']['menu_type']) {
             case 'category':
                 $category_info = $this->model_catalog_category->getCategory(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$category_info) {
                     continue;
                 }
                 $name = $category_info['name'];
                 $href = $this->url->link('product/category', 'path=' . $category_info['category_id']);
                 break;
             case 'product':
                 $product_info = $this->model_catalog_product->getProduct(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$product_info) {
                     continue;
                 }
                 $name = $product_info['name'];
                 $href = $this->url->link('product/product', 'product_id=' . $product_info['product_id']);
                 break;
             case 'manufacturer':
                 $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$manufacturer_info) {
                     continue;
                 }
                 $name = $manufacturer_info['name'];
                 $href = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer_info['manufacturer_id']);
                 break;
             case 'information':
                 $information_info = $this->model_catalog_information->getInformation(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$information_info) {
                     continue;
                 }
                 $name = $information_info['title'];
                 $href = $this->url->link('information/information', 'information_id=' . $information_info['information_id']);
                 break;
             case 'popup':
                 $href = "javascript:Journal.openPopup('{$item['menu']['menu_item']}')";
                 break;
             case 'opencart':
                 $customer_name = null;
                 switch ($item['menu']['menu_item']['page']) {
                     case 'login':
                         $item['menu']['menu_item']['page'] = $this->customer->isLogged() ? 'account/account' : 'account/login';
                         $customer_name = $this->customer->isLogged() ? '{{_customer_}}' : null;
                         break;
                     case 'register':
                         $item['menu']['menu_item']['page'] = $this->customer->isLogged() ? 'account/logout' : 'account/register';
                         break;
                     case 'account/wishlist':
                         $class .= ' wishlist-total';
                         break;
                     case 'product/compare':
                         $class .= ' compare-total';
                     default:
                 }
                 $name = $customer_name ? $customer_name : $this->model_journal2_menu->getMenuName($item['menu']['menu_item']['page']);
                 $href = $this->model_journal2_menu->link($item['menu']['menu_item']['page']);
                 break;
             case 'blog_home':
                 $name = $this->journal2->settings->get('config_blog_settings.title.value.' . $this->config->get('config_language_id'), 'Journal Blog');
                 $href = $this->url->link('journal2/blog');
                 break;
             case 'blog_category':
                 $category_info = $this->model_journal2_blog->getCategory(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$category_info) {
                     continue;
                 }
                 $name = $category_info['name'];
                 $href = $this->url->link('journal2/blog', 'journal_blog_category_id=' . $category_info['category_id']);
                 break;
             case 'blog_post':
                 $post_info = $this->model_journal2_blog->getPost(Journal2Utils::getProperty($item, 'menu.menu_item.id', -1));
                 if (!$post_info) {
                     continue;
                 }
                 $name = $post_info['name'];
                 $href = $this->url->link('journal2/blog/post', 'journal_blog_post_id=' . $post_info['post_id']);
                 break;
             case 'custom':
                 $name = Journal2Utils::getProperty($item, 'name.value.' . $this->config->get('config_language_id'), '');
                 $href = Journal2Utils::getProperty($item, 'menu.menu_item.url');
                 break;
         }
//.........这里部分代码省略.........
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:101,代码来源:journal2_side_column_menu.php


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