From: Marcel Werk Date: Wed, 13 Nov 2013 11:56:57 +0000 (+0100) Subject: Added importer for smiley categories X-Git-Tag: 2.0.0_RC_2~28^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=295d811f8f44e380ccc99653d7abed3999d31616;p=GitHub%2FWoltLab%2FWCF.git Added importer for smiley categories --- diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 3226a06550..0824bfb07d 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -272,6 +272,11 @@ com.woltlab.wcf.importer + + com.woltlab.wcf.smiley.category + com.woltlab.wcf.importer + + diff --git a/wcfsetup/install/files/lib/system/importer/SmileyCategoryImporter.class.php b/wcfsetup/install/files/lib/system/importer/SmileyCategoryImporter.class.php new file mode 100644 index 0000000000..4c3f48d312 --- /dev/null +++ b/wcfsetup/install/files/lib/system/importer/SmileyCategoryImporter.class.php @@ -0,0 +1,28 @@ + + * @package com.woltlab.wcf + * @subpackage system.importer + * @category Community Framework + */ +class SmileyCategoryImporter extends AbstractCategoryImporter { + /** + * @see \wcf\system\importer\AbstractCommentImporter::$objectTypeName + */ + protected $objectTypeName = 'com.woltlab.wcf.smiley.category'; + + /** + * Creates a new SmileyCategoryImporter object. + */ + public function __construct() { + $objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.category', 'com.woltlab.wcf.bbcode.smiley'); + $this->objectTypeID = $objectType->objectTypeID; + } +} diff --git a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php index 72d5248f4c..09cd00f91e 100644 --- a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php @@ -73,6 +73,9 @@ class SmileyImporter extends AbstractImporter { $data['aliases'] = implode("\n", $aliases); } + // get category id + if (!empty($data['categoryID'])) $data['categoryID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.smiley.category', $data['categoryID']); + // save smiley $smiley = SmileyEditor::create($data);