*/
_delete: function(item) {
var $confirmMessage = item.data('internalData')['confirmMessage'];
- if (confirm($confirmMessage)) {
+ WCF.System.Confirmation.show($confirmMessage, function() {
WCF.Clipboard.sendRequest(item);
- }
+ });
}
};
parent::readParameters();
// get type id
- $this->typeID = ClipboardHandler::getInstance()->getTypeID('com.woltlab.wcf.user');
+ $this->typeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
if ($this->typeID === null) {
throw new SystemException("clipboard item type 'com.woltlab.wcf.user' is unknown.");
}
parent::readParameters();
// get type id
- $this->typeID = ClipboardHandler::getInstance()->getTypeID('com.woltlab.wcf.user');
+ $this->typeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
if ($this->typeID === null) {
throw new SystemException("clipboard item type 'com.woltlab.wcf.user' is unknown.");
}
// get marked user ids
if (empty($this->action)) {
// get type id
- $typeID = ClipboardHandler::getInstance()->getTypeID('com.woltlab.wcf.user');
+ $typeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
if ($typeID === null) {
throw new SystemException("clipboard item type 'com.woltlab.wcf.user' is unknown.");
}
* @return array<integer>
*/
protected function getObjectIDs() {
- $typeID = ClipboardHandler::getInstance()->getTypeID($this->typeName);
+ $typeID = ClipboardHandler::getInstance()->getObjectTypeID($this->typeName);
if ($typeID === null) {
throw new AJAXException("clipboard item type '".$this->typeName."' is unknown");
}
$objectIDs = $this->getObjectIDs();
// create object action instance
- $this->objectAction = new $this->parameters['className']($objectIDs, $this->actionName);
+ $this->objectAction = new $this->parameters['className']($objectIDs, $this->parameters['actionName']);
// validate action
try {
parent::validateDelete();
$userIDs = array();
- foreach ($this->users as $user) $userIDs[] = $user->userID;
+ foreach ($this->objects as $user) {
+ $userIDs[] = $user->userID;
+ }
// validate groups
$conditions = new PreparedStatementConditionBuilder();
* @param string $url
*/
public function setURL($url) {
- if (StringUtil::indexOf($url, '?') === false) {
- $url .= SID_ARG_1ST;
- }
- else {
- $url .= SID_ARG_2ND_NOT_ENCODED;
- }
-
$this->url = $url;
}
}
/**
* Loads a list of marked items grouped by type name.
*
- * @param integer $typeID
+ * @param integer $objectTypeID
*/
- protected function loadMarkedItems($typeID = null) {
+ protected function loadMarkedItems($objectTypeID = null) {
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("userID = ?", array(WCF::getUser()->userID));
- if ($typeID !== null) $conditions->add("typeID = ?", array($typeID));
+ if ($objectTypeID !== null) {
+ $conditions->add("objectTypeID = ?", array($objectTypeID));
+ }
// fetch object ids
$sql = "SELECT objectTypeID, objectID
use wcf\system\clipboard\ClipboardEditorItem;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
+use wcf\system\request\LinkHandler;
use wcf\system\WCF;
/**
switch ($actionName) {
case 'assignToGroup':
$item->setName('user.assignToGroup');
- $item->setURL('index.php?form=UserAssignToGroup');
+ $item->setURL(LinkHandler::getInstance()->getLink('UserAssignToGroup'));
break;
case 'delete':
return null;
}
- // TODO: use language variable
- $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.user.confirmMessage', array('count' => $count)));
+ $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.user.delete.confirmMessage', array('count' => $count)));
$item->addParameter('actionName', 'delete');
$item->addParameter('className', 'wcf\data\user\UserAction');
$item->setName('user.delete');
case 'exportMailAddress':
$item->setName('user.exportMailAddress');
- $item->setURL('index.php?form=UserEmailAddressExport');
+ $item->setURL(LinkHandler::getInstance()->getLink('UserEmailAddressExport'));
break;
case 'sendMail':
$item->setName('user.sendMail');
- $item->setURL('index.php?form=UserMail');
+ $item->setURL(LinkHandler::getInstance()->getLink('UserMail'));
break;
default:
* @see wcf\system\clipboard\action\IClipboardAction::getEditorLabel()
*/
public function getEditorLabel(array $objects) {
- return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.user.marked', array('count' => count($objects)));
+ return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.label.user.marked', array('count' => count($objects)));
}
}
if ($progress == 100) {
// clear markings
- $typeID = ClipboardHandler::getInstance()->getTypeID('com.woltlab.wcf.user');
+ $typeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
ClipboardHandler::getInstance()->removeItems($typeID);
// clear session
<?xml version="1.0" encoding="UTF-8"?>
<language xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/language.xsd" languagecode="de" languagename="Deutsch">
- <category name="wcf.clipboard">
- <item name="wcf.clipboard.user.confirmMessage"><![CDATA[{if $count == 1}Einen{else}{#$count}{/if} Benutzer löschen?]]></item>
- <item name="wcf.clipboard.user.marked"><![CDATA[{if $count == 1}Ein{else}{#$count}{/if} Benutzer markiert]]></item>
- </category>
-
<category name="wcf.acp.cronjob">
<item name="wcf.acp.cronjob.list"><![CDATA[Cronjobs]]></item>
<item name="wcf.acp.cronjob.add"><![CDATA[Cronjob hinzufügen]]></item>
<item name="wcf.acp.user.sendMail.text"><![CDATA[Nachricht]]></item>
</category>
+ <category name="wcf.clipboard">
+ <item name="wcf.clipboard.item.user.assignToGroup"><![CDATA[Benutzergruppe zuweisen]]></item>
+ <item name="wcf.clipboard.item.user.delete"><![CDATA[Benutzer löschen]]></item>
+ <item name="wcf.clipboard.item.user.delete.confirmMessage"><![CDATA[{if $count == 1}Einen{else}{#$count}{/if} Benutzer löschen?]]></item>
+ <item name="wcf.clipboard.item.user.exportMailAddress"><![CDATA[E-Mail-Adressen exportieren]]></item>
+ <item name="wcf.clipboard.item.user.sendMail"><![CDATA[E-Mail senden]]></item>
+ <item name="wcf.clipboard.label.user.marked"><![CDATA[{if $count == 1}Ein{else}{#$count}{/if} Benutzer markiert]]></item>
+ </category>
+
<category name="wcf.date">
<item name="wcf.date.dateFormat"><![CDATA[j. F Y]]></item>
<item name="wcf.date.timeFormat"><![CDATA[H:i]]></item>
<?xml version="1.0" encoding="UTF-8"?>
<language xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/language.xsd" languagecode="en" languagename="English">
- <category name="wcf.clipboard">
- <item name="wcf.clipboard.user.confirmMessage"><![CDATA[Delete {if $count == 1}one{else}{#$count}{/if} user{if $count > 1}s{/if}?]]></item>
- <item name="wcf.clipboard.user.marked"><![CDATA[{if $count == 1}One{else}{#$count}{/if} user{if $count > 1}s{/if} marked]]></item>
- </category>
-
<category name="wcf.acp.cronjob">
<item name="wcf.acp.cronjob.list"><![CDATA[Cron jobs]]></item>
<item name="wcf.acp.cronjob.add"><![CDATA[Add a new cron job]]></item>
<item name="wcf.acp.user.sendMail.text"><![CDATA[Message]]></item>
</category>
+ <category name="wcf.clipboard">
+ <item name="wcf.clipboard.item.user.assignToGroup"><![CDATA[Assign to user group]]></item>
+ <item name="wcf.clipboard.item.user.delete"><![CDATA[Delete users]]></item>
+ <item name="wcf.clipboard.item.user.delete.confirmMessage"><![CDATA[Delete {if $count == 1}one{else}{#$count}{/if} user{if $count > 1}s{/if}?]]></item>
+ <item name="wcf.clipboard.item.user.exportMailAddress"><![CDATA[Export e-mail addresses]]></item>
+ <item name="wcf.clipboard.item.user.sendMail"><![CDATA[Send an e-mail]]></item>
+ <item name="wcf.clipboard.label.user.marked"><![CDATA[{if $count == 1}One{else}{#$count}{/if} user{if $count > 1}s{/if} marked]]></item>
+ </category>
+
<category name="wcf.date">
<item name="wcf.date.dateFormat"><![CDATA[M jS Y]]></item>
<item name="wcf.date.timeFormat"><![CDATA[g:ia]]></item>