2 namespace wcf\system\package\plugin;
6 * This PIP installs, updates or deletes clipboard item types.
8 * @author Alexander Ebert
9 * @copyright 2001-2011 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package com.woltlab.wcf
12 * @subpackage acp.package.plugin
13 * @category Community Framework
15 class ClipboardItemTypePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
17 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className
19 public $className = 'wcf\data\clipboard\item\type\ClipboardItemTypeEditor';
22 * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
24 public $tableName = 'clipboard_item_type';
27 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
29 public $tagName = 'type';
32 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
34 protected function handleDelete(array $items) {
35 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
38 $statement = WCF::getDB()->prepareStatement($sql);
39 foreach ($items as $item) {
40 $statement->execute(array(
41 $item['attributes']['name'],
42 $this->installation->getPackageID()
48 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
50 protected function prepareImport(array $data) {
52 'listClassName' => $data['elements']['listclassname'],
53 'typeName' => $data['attributes']['name']
58 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::findExistingItem()
60 protected function findExistingItem(array $data) {
62 FROM wcf".WCF_N."_".$this->tableName."
67 $this->installation->getPackageID()
72 'parameters' => $parameters