load(array('extension' => 'com_weblinks', 'title' => 'Uncategorised'))) { $category->extension = 'com_weblinks'; $category->title = 'Uncategorised'; $category->description = ''; $category->published = 1; $category->access = 1; $category->params = '{"category_layout":"","image":""}'; $category->metadata = '{"author":"","robots":""}'; $category->language = '*'; // Set the location in the tree $category->setLocation(1, 'last-child'); // Check to make sure our data is valid if (!$category->check()) { JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); return; } // Now store the category if (!$category->store(true)) { JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); return; } // Build the path for our category $category->rebuildPath($category->id); } } }