Ejemplo n.º 1
0
 public function tep_get_chained_categories_select($categories_id = '0', $aid = '', $level = 0, $selectedid = '', $page_uid = '')
 {
     if (!$page_uid) {
         $page_uid = $this->shop_pid;
     }
     if (!$categories_id) {
         $categories_id = 0;
     }
     $output = array();
     $str = $GLOBALS['TYPO3_DB']->SELECTquery('cd.categories_name, c.categories_id, c.parent_id', 'tx_multishop_categories c, tx_multishop_categories_description cd', 'c.parent_id=\'' . $categories_id . '\' and c.status=1 and c.categories_id=cd.categories_id and c.page_uid=\'' . $page_uid . '\'', '', 'c.sort_order, cd.categories_name', '');
     $parent_categories_query = $GLOBALS['TYPO3_DB']->sql_query($str);
     $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($parent_categories_query);
     while (($parent_categories = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($parent_categories_query)) != false) {
         $output[$level] .= '<option value="' . $parent_categories['categories_id'] . '" ' . ($selectedid == $parent_categories['categories_id'] ? 'selected' : '') . ' class="' . ($level > 0 ? '' . $parent_categories['parent_id'] : '') . '">' . $parent_categories['categories_name'] . '</option>';
         $strchk = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_categories c', 'c.parent_id=\'' . $parent_categories['categories_id'] . '\'', '', '', '');
         $qrychk = $GLOBALS['TYPO3_DB']->sql_query($strchk);
         if ($GLOBALS['TYPO3_DB']->sql_num_rows($qrychk)) {
             $tmp_array = mslib_befe::tep_get_chained_categories_select($parent_categories['categories_id'], $aid, $level + 1, $selectedid, $page_uid);
             if (is_array($tmp_array) && count($tmp_array)) {
                 foreach ($tmp_array as $key => $value) {
                     $output[$key] .= $value;
                 }
             }
         }
     }
     return $output;
 }