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


PHP mslib_fe::getSubcatsArray方法代码示例

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


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

示例1: foreach

                     mslib_fe::getSubcatsArray($subcategories_tree, '', $category_tree['id'], $page_uid, $include_disabled_cats);
                     if (count($subcategories_tree)) {
                         foreach ($subcategories_tree[$category_tree['id']] as $subcategory_tree_0) {
                             $tmp_return_data[$subcategory_tree_0['id']] = implode(' > ', $catpath) . ' > ' . $subcategory_tree_0['name'] . (!$subcategory_tree_0['status'] ? ' (' . $this->pi_getLL('disabled') . ')' : '');
                             if (is_array($subcategories_tree[$subcategory_tree_0['id']])) {
                                 mslib_fe::build_categories_path($tmp_return_data, $subcategory_tree_0['id'], $tmp_return_data[$subcategory_tree_0['id']], $subcategories_tree, true);
                             }
                         }
                     } else {
                         $tmp_return_data[$category_tree['id']] = implode(' > ', $catpath);
                     }
                 }
             }
         } else {
             $categories_tree = array();
             mslib_fe::getSubcatsArray($categories_tree, '', $categoriesStartingPoint, $page_uid, $include_disabled_cats);
             //level 0
             foreach ($categories_tree[$categoriesStartingPoint] as $category_tree_0) {
                 if (!in_array($category_tree_0['id'], $skip_ids)) {
                     $tmp_return_data[$category_tree_0['id']] = $category_tree_0['name'] . (!$category_tree_0['status'] ? ' (' . $this->pi_getLL('disabled') . ')' : '');
                     if (is_array($categories_tree[$category_tree_0['id']])) {
                         mslib_fe::build_categories_path($tmp_return_data, $category_tree_0['id'], $tmp_return_data[$category_tree_0['id']], $categories_tree, true);
                     }
                 }
             }
         }
         if (!isset($this->get['no_maincat'])) {
             $return_data[] = array('id' => 0, 'text' => $this->pi_getLL('admin_main_category'));
         }
         break;
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:core.php

示例2: foreach

         foreach ($tmp_categories_id as $tmp_catid) {
             $reflector_cattree[$tmp_catid] = $catid;
         }
     } else {
         $catIds[$this->showCatalogFromPage][] = $this->post['link_categories_id'];
         $reflector_cattree[$this->post['link_categories_id']] = $catid;
     }
 }
 if ($this->conf['enableMultipleShops'] && is_array($this->post['tx_multishop_pi1']['categories_to_categories']) && count($this->post['tx_multishop_pi1']['categories_to_categories'])) {
     foreach ($this->post['tx_multishop_pi1']['categories_to_categories'] as $page_uid => $shopRecord) {
         if (in_array($page_uid, $this->post['tx_multishop_pi1']['enableMultipleShops']) && empty($shopRecord)) {
             $tmp_categories_id = array();
             $tmp_categories_id[] = $catid;
             // check if the cat have subcats
             $subcategories_array = array();
             mslib_fe::getSubcatsArray($subcategories_array, '', $catid, $this->showCatalogFromPage);
             if (isset($subcategories_array[$catid])) {
                 foreach ($subcategories_array[$catid] as $subcat_data) {
                     $subcatid = $subcat_data['id'];
                     $tmp_categories_id[] = $subcatid;
                     if (isset($subcategories_array[$subcatid])) {
                         mslib_fe::extractDeepestCat($tmp_categories_id, $subcategories_array, $subcatid);
                     }
                 }
             }
             //print_r($tmp_categories_id);
             $endpoint_catid = array();
             foreach ($tmp_categories_id as $tmp_category_id) {
                 $tmp_catname = mslib_fe::getCategoryName($tmp_category_id);
                 if (!empty($tmp_catname)) {
                     $foreign_catid = mslib_fe::getCategoryIdByName($tmp_catname, $page_uid, $tmp_category_id);
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_edit_category.php

示例3: getSubcatsArray

 public function getSubcatsArray(&$subcategories_array, $keyword = '', $parent_id = 0, $page_uid = '', $include_disabled_categories = 0)
 {
     if (!is_numeric($page_uid)) {
         $page_uid = $this->showCatalogFromPage;
     }
     if ($parent_id == '') {
         $parent_id = 0;
     }
     //
     $orderby = '';
     $filter = array();
     $filter[] = 'c.page_uid=\'' . $page_uid . '\'';
     if (!$include_disabled_categories) {
         $filter[] = 'c.status = \'1\'';
     }
     if (!empty($keyword) && strlen($keyword) > 0) {
         $filter[] = 'cd.categories_name like \'%' . addslashes($keyword) . '%\'';
     } else {
         $filter[] = 'c.parent_id = \'' . $parent_id . '\'';
         $orderby = 'cd.categories_name asc';
     }
     $filter[] = 'cd.language_id=\'' . $this->sys_language_uid . '\'';
     $filter[] = 'c.categories_id=cd.categories_id';
     //
     if (!empty($keyword) && strlen($keyword) > 0) {
         $qry = $GLOBALS['TYPO3_DB']->SELECTquery('c.categories_id, cd.categories_name, c.status', 'tx_multishop_categories c, tx_multishop_categories_description cd', implode(' and ', $filter), '', '', '');
         $subcategories_query = $GLOBALS['TYPO3_DB']->sql_query($qry);
         while ($subcategories = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subcategories_query)) {
             $subcategories_array[] = array('id' => $subcategories['categories_id'], 'name' => $subcategories['categories_name'], 'status' => $subcategories['status']);
         }
     } else {
         $qry = $GLOBALS['TYPO3_DB']->SELECTquery('c.categories_id, cd.categories_name, c.status', 'tx_multishop_categories c, tx_multishop_categories_description cd', implode(' and ', $filter), '', $orderby, '');
         $subcategories_query = $GLOBALS['TYPO3_DB']->sql_query($qry);
         while ($subcategories = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subcategories_query)) {
             $subcategories_array[$parent_id][] = array('id' => $subcategories['categories_id'], 'name' => $subcategories['categories_name'], 'status' => $subcategories['status']);
             if ($subcategories['categories_id'] != $parent_id) {
                 mslib_fe::getSubcatsArray($subcategories_array, $keyword, $subcategories['categories_id'], $page_uid, $include_disabled_categories);
             }
         }
     }
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:41,代码来源:class.mslib_fe.php


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