* @param object parameters
*/
_execute: function(event, type, actionName, parameters) {
- if (type === 'com.woltlab.wcf.conversation.conversation' && actionName === 'conversation.assignLabel') {
+ if (type === 'com.woltlab.wcf.conversation.conversation' && actionName === 'com.woltlab.wcf.conversation.conversation.assignLabel') {
new WCF.Conversation.Label.Editor(this._editorHandler, null, parameters.objectIDs);
}
},
}
switch (actionName) {
- case 'conversation.leave':
- case 'conversation.leavePermanently':
- case 'conversation.restore':
+ case 'com.woltlab.wcf.conversation.conversation.leave':
+ case 'com.woltlab.wcf.conversation.conversation.leavePermanently':
+ case 'com.woltlab.wcf.conversation.conversation.restore':
window.location.reload();
break;
- case 'conversation.close':
- case 'conversation.open':
+ case 'com.woltlab.wcf.conversation.conversation.close':
+ case 'com.woltlab.wcf.conversation.conversation.open':
for (var $conversationID in data.returnValues.conversationData) {
var $data = data.returnValues.conversationData[$conversationID];
<?php
namespace wcf\system\clipboard\action;
-use wcf\system\clipboard\ClipboardEditorItem;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
* @category Community Framework
*/
class ConversationClipboardAction extends AbstractClipboardAction {
+ /**
+ * @see wcf\system\clipboard\action\AbstractClipboardAction::$actionClassActions
+ */
+ protected $actionClassActions = array('close', 'open');
+
/**
* list of conversations
* @var array<wcf\data\conversation\Conversation>
public $conversations = null;
/**
- * @see wcf\system\clipboard\action\IClipboardAction::getTypeName()
+ * @see wcf\system\clipboard\action\AbstractClipboardAction::$supportedActions
*/
- public function getTypeName() {
- return 'com.woltlab.wcf.conversation.conversation';
- }
+ protected $supportedActions = array('assignLabel', 'close', 'leave', 'leavePermanently', 'open', 'restore');
/**
* @see wcf\system\clipboard\action\IClipboardAction::execute()
return null;
}
- $item = new ClipboardEditorItem();
+ $item = parent::execute($objects, $actionName);
+
+ if ($item === null) {
+ return null;
+ }
switch ($actionName) {
case 'assignLabel':
}
$item->addParameter('objectIDs', array_keys($this->conversations));
- $item->setName('conversation.assignLabel');
- break;
-
- case 'close':
- $conversationIDs = $this->validateClose();
- if (empty($conversationIDs)) {
- return null;
- }
-
- $item->addParameter('objectIDs', $conversationIDs);
- $item->addParameter('actionName', 'close');
- $item->addParameter('className', 'wcf\data\conversation\ConversationAction');
- $item->setName('conversation.close');
break;
case 'leave':
- $conversationIDs = $this->validateLeave();
- if (empty($conversationIDs)) {
- return null;
- }
-
$item->addInternalData('parameters', array('hideConversation' => 1));
- $item->addParameter('objectIDs', $conversationIDs);
$item->addParameter('actionName', 'hideConversation');
- $item->addParameter('className', 'wcf\data\conversation\ConversationAction');
- $item->setName('conversation.leave');
+ $item->addParameter('className', $this->getClassName());
break;
case 'leavePermanently':
- $item->addInternalData('parameters', array('hideConversation' => 2));
$item->addParameter('objectIDs', array_keys($this->conversations));
+ $item->addInternalData('parameters', array('hideConversation' => 2));
$item->addParameter('actionName', 'hideConversation');
- $item->addParameter('className', 'wcf\data\conversation\ConversationAction');
- $item->setName('conversation.leavePermanently');
- break;
-
- case 'open':
- $conversationIDs = $this->validateOpen();
- if (empty($conversationIDs)) {
- return null;
- }
-
- $item->addParameter('objectIDs', $conversationIDs);
- $item->addParameter('actionName', 'open');
- $item->addParameter('className', 'wcf\data\conversation\ConversationAction');
- $item->setName('conversation.open');
+ $item->addParameter('className', $this->getClassName());
break;
case 'restore':
- $conversationIDs = $this->validateRestore();
- if (empty($conversationIDs)) {
- return null;
- }
-
$item->addInternalData('parameters', array('hideConversation' => 0));
- $item->addParameter('objectIDs', array_keys($this->conversations));
$item->addParameter('actionName', 'hideConversation');
- $item->addParameter('className', 'wcf\data\conversation\ConversationAction');
- $item->setName('conversation.restore');
- break;
-
- default:
- throw new SystemException("Unknown action '".$actionName."'");
+ $item->addParameter('className', $this->getClassName());
break;
}
return 'wcf\data\conversation\ConversationAction';
}
+ /**
+ * @see wcf\system\clipboard\action\IClipboardAction::getTypeName()
+ */
+ public function getTypeName() {
+ return 'com.woltlab.wcf.conversation.conversation';
+ }
+
/**
* Returns a list of conversations with user participation.
*
* @see wcf\system\clipboard\action\IClipboardAction::getEditorLabel()
*/
public function getEditorLabel(array $objects) {
- return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.label.conversation.marked', array('count' => count($objects)));
+ return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.label.com.woltlab.wcf.conversation.conversation.marked', array('count' => count($objects)));
}
}
</category>
<category name="wcf.clipboard">
- <item name="wcf.clipboard.label.conversation.marked"><![CDATA[{if $count == 1}Eine Konversation{else}{#$count} Konversationen{/if} markiert]]></item>
- </category>
-
- <category name="wcf.clipboard.item">
- <item name="wcf.clipboard.item.conversation.assignLabel"><![CDATA[Label zuweisen ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.close"><![CDATA[Schließen ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.leave"><![CDATA[Konversation ausblenden ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.leavePermanently"><![CDATA[Konversation verlassen ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.open"><![CDATA[Öffnen ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.restore"><![CDATA[Als aktiv markieren ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.assignLabel"><![CDATA[Label zuweisen ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.close"><![CDATA[Schließen ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.leave"><![CDATA[Konversation ausblenden ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.leavePermanently"><![CDATA[Konversation verlassen ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.open"><![CDATA[Öffnen ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.restore"><![CDATA[Als aktiv markieren ({#$count})]]></item>
+ <item name="wcf.clipboard.label.com.woltlab.wcf.conversation.conversation.marked"><![CDATA[{if $count == 1}Eine Konversation{else}{#$count} Konversationen{/if} markiert]]></item>
</category>
<category name="wcf.conversation">
</category>
<category name="wcf.clipboard">
- <item name="wcf.clipboard.label.conversation.marked"><![CDATA[{if $count == 1}One Conversation{else}{#$count} Conversations{/if} Selected]]></item>
- </category>
-
- <category name="wcf.clipboard.item">
- <item name="wcf.clipboard.item.conversation.assignLabel"><![CDATA[Assign Label ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.close"><![CDATA[Close ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.leave"><![CDATA[Hide ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.leavePermanently"><![CDATA[Leave ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.open"><![CDATA[Open ({#$count})]]></item>
- <item name="wcf.clipboard.item.conversation.restore"><![CDATA[Restore ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.assignLabel"><![CDATA[Assign Label ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.close"><![CDATA[Close ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.leave"><![CDATA[Hide ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.leavePermanently"><![CDATA[Leave ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.open"><![CDATA[Open ({#$count})]]></item>
+ <item name="wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.restore"><![CDATA[Restore ({#$count})]]></item>
+ <item name="wcf.clipboard.label.com.woltlab.wcf.conversation.conversation.marked"><![CDATA[{if $count == 1}One Conversation{else}{#$count} Conversations{/if} Selected]]></item>
</category>
<category name="wcf.conversation">