Exemple #1
0
 /**
  * import the categories provided
  */
 private function importCategories()
 {
     $rootCatId = CategoryRegistryUtil::getRegisteredModuleCategory('Content', 'content_page', ModUtil::getVar('Content', 'categoryPropPrimary'));
     $rootCatObj = CategoryUtil::getCategoryById($rootCatId);
     $this->categoryPathMap[$this->rootCategoryLocalId] = $rootCatObj['path'];
     $this->categoryMap[$this->rootCategoryLocalId] = (int) $rootCatId;
     $oldCategories = $this->getCategories();
     foreach ($oldCategories as $oldCategory) {
         if (isset($this->categoryPathMap[$oldCategory['pid']])) {
             $id = CategoryUtil::createCategory($this->categoryPathMap[$oldCategory['pid']], $oldCategory['title'], null, $oldCategory['title'], $oldCategory['title']);
             $catObj = CategoryUtil::getCategoryById($id);
             $this->categoryPathMap[$oldCategory['id']] = $catObj['path'];
             $this->categoryMap[$oldCategory['id']] = (int) $id;
         }
     }
 }