/** * @see \wcf\system\importer\IImporter::import() */ public function import($oldID, array $data, array $additionalData = array()) { if (!empty($data['parentCategoryID'])) { $data['parentCategoryID'] = ImportHandler::getInstance()->getNewID($this->objectTypeName, $data['parentCategoryID']); } $category = CategoryEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID))); ImportHandler::getInstance()->saveNewID($this->objectTypeName, $oldID, $category->categoryID); return $category->categoryID; }
<?php use wcf\data\category\CategoryEditor; use wcf\data\object\type\ObjectTypeCache; use wcf\system\WCF; /** * @author Jens Krumsieck * @copyright 2013 - 2015 codeQuake * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt> * @package de.codequake.cms */ $sql = "UPDATE\twcf" . WCF_N . "_option\n\tSET\toptionValue = ?\n\tWHERE\toptionName = ?"; $optionUpdate = WCF::getDB()->prepareStatement($sql); // install date $optionUpdate->execute(array(TIME_NOW, 'cms_install_date')); // set default page title if (!defined('PAGE_TITLE') || !PAGE_TITLE) { $optionUpdate->execute(array('Fireball CMS 2.0', 'page_title')); } // create default file category CategoryEditor::create(array('objectTypeID' => ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', 'de.codequake.cms.file'), 'title' => 'Default Category', 'time' => TIME_NOW));
<?php use wcf\data\category\CategoryEditor; use wcf\data\object\type\ObjectTypeCache; use wcf\system\dashboard\DashboardHandler; use wcf\system\WCF; /** * @author Alexander Merz * @copyright 2014 Incendium Community * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt> */ // set default values for dashboard boxes DashboardHandler::setDefaultValues('com.woltlab.filebase.NewsOverviewPage', array('de.incendium.cms.news.tagCloud' => 1, 'de.incendium.cms.news.latestNews' => 2, 'de.incendium.cms.news.mostLikedNews' => 3, 'de.incendium.cms.news.featuredNews' => 4)); // add default category CategoryEditor::create(array('objectTypeID' => ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', 'de.incendium.cms.news.category'), 'title' => 'Default Category', 'description' => 'This is a Default Category', 'time' => TIME_NOW));