Ejemplo n.º 1
0
 /**
  * @param $lConf
  */
 function initCatmenuEnv(&$lConf)
 {
     if ($lConf['catOrderBy']) {
         $this->config['catOrderBy'] = $lConf['catOrderBy'];
     }
     if ($this->catExclusive) {
         $this->catlistWhere = ' AND tt_news_cat.uid' . ($this->config['categoryMode'] < 0 ? ' NOT' : '') . ' IN (' . $this->catExclusive . ')';
     } else {
         if ($lConf['excludeList']) {
             $this->catlistWhere = ' AND tt_news_cat.uid NOT IN (' . implode(t3lib_div::intExplode(',', $lConf['excludeList']), ',') . ')';
         }
         if ($lConf['includeList']) {
             $this->catlistWhere .= ' AND tt_news_cat.uid IN (' . implode(t3lib_div::intExplode(',', $lConf['includeList']), ',') . ')';
         }
     }
     if ($lConf['includeList'] || $lConf['excludeList'] || $this->catExclusive) {
         // MOUNTS (in tree mode) must only contain the main/parent categories. Therefore it is required to filter out the subcategories from $this->catExclusive or $lConf['includeList']
         $categoryMounts = $this->catExclusive ? $this->catExclusive : $lConf['includeList'];
         $tmpres = $this->db->exec_SELECTquery('uid,parent_category', 'tt_news_cat', 'tt_news_cat.uid IN (' . $categoryMounts . ')' . $this->SPaddWhere . $this->enableCatFields, '', 'tt_news_cat.' . $this->config['catOrderBy']);
         $this->cleanedCategoryMounts = array();
         if ($tmpres) {
             while ($tmprow = $this->db->sql_fetch_assoc($tmpres)) {
                 if (!t3lib_div::inList($categoryMounts, $tmprow['parent_category'])) {
                     $this->dontStartFromRootRecord = true;
                     $this->cleanedCategoryMounts[] = $tmprow['uid'];
                 }
             }
         }
     }
 }