Skip to content

Commit 1af7d1c

Browse files
committed
Remove obsolete code
1 parent 3b8ee5d commit 1af7d1c

File tree

2 files changed

+1
-129
lines changed

2 files changed

+1
-129
lines changed

wcfsetup/install/files/acp/js/WCF.ACP.Style.js

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -63,86 +63,3 @@ WCF.ACP.Style.CopyStyle = Class.extend({
6363
window.location = data.returnValues.redirectURL;
6464
}
6565
});
66-
67-
/**
68-
* Handles style list management buttons.
69-
*/
70-
WCF.ACP.Style.List = Class.extend({
71-
/**
72-
* action proxy
73-
* @var WCF.Action.Proxy
74-
*/
75-
_proxy: null,
76-
77-
/**
78-
* Initializes the WCF.ACP.Style.List class.
79-
*/
80-
init: function() {
81-
this._proxy = new WCF.Action.Proxy({
82-
success: $.proxy(this._success, this)
83-
});
84-
85-
$('.styleList .buttonList').each($.proxy(function(index, list) {
86-
var $list = $(list);
87-
var $styleID = $list.data('styleID');
88-
89-
var self = this;
90-
$list.find('.jsSetAsDefault').click(function(event) {
91-
event.preventDefault();
92-
self._click('setAsDefault', $styleID);
93-
});
94-
$list.find('.jsDelete').click(function(event) { self._delete(event, $styleID); });
95-
}, this));
96-
},
97-
98-
/**
99-
* Executes actions.
100-
*
101-
* @param string actionName
102-
* @param integer styleID
103-
*/
104-
_click: function(actionName, styleID) {
105-
this._proxy.setOption('data', {
106-
actionName: actionName,
107-
className: 'wcf\\data\\style\\StyleAction',
108-
objectIDs: [ styleID ]
109-
});
110-
this._proxy.sendRequest();
111-
},
112-
113-
/**
114-
* Prepares to delete a style.
115-
*
116-
* @param object event
117-
* @param integer styleID
118-
*/
119-
_delete: function(event, styleID) {
120-
event.preventDefault();
121-
122-
var $confirmMessage = $(event.currentTarget).data('confirmMessageHtml');
123-
if ($confirmMessage) {
124-
var self = this;
125-
WCF.System.Confirmation.show($confirmMessage, function(action) {
126-
if (action === 'confirm') {
127-
self._click('delete', styleID);
128-
}
129-
}, undefined, undefined, true);
130-
}
131-
else {
132-
// invoke action directly
133-
this._click('delete', styleID);
134-
}
135-
},
136-
137-
/**
138-
* Reloads the page after an action was executed successfully.
139-
*
140-
* @param object data
141-
* @param string textStatus
142-
* @param jQuery jqXHR
143-
*/
144-
_success: function (data, textStatus, jqXHR) {
145-
// reload page
146-
window.location.reload();
147-
}
148-
});

wcfsetup/install/files/lib/data/style/StyleAction.class.php

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use wcf\data\user\UserAction;
1010
use wcf\system\cache\builder\StyleCacheBuilder;
1111
use wcf\system\exception\PermissionDeniedException;
12-
use wcf\system\exception\UserInputException;
1312
use wcf\system\image\ImageHandler;
1413
use wcf\system\language\LanguageFactory;
1514
use wcf\system\Regex;
@@ -57,7 +56,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction
5756
/**
5857
* @inheritDoc
5958
*/
60-
protected $requireACP = ['copy', 'delete', 'markAsTainted', 'setAsDefault', 'toggle', 'update', 'upload'];
59+
protected $requireACP = ['copy', 'delete', 'markAsTainted', 'update', 'upload'];
6160

6261
/**
6362
* style object
@@ -488,36 +487,6 @@ protected function updateCustomAssets(Style $style)
488487
}
489488
}
490489

491-
/**
492-
* Validates parameters to assign a new default style.
493-
*/
494-
public function validateSetAsDefault()
495-
{
496-
if (!WCF::getSession()->getPermission('admin.style.canManageStyle')) {
497-
throw new PermissionDeniedException();
498-
}
499-
500-
if (empty($this->objects)) {
501-
$this->readObjects();
502-
if (empty($this->objects)) {
503-
throw new UserInputException('objectIDs');
504-
}
505-
}
506-
507-
if (\count($this->objects) > 1) {
508-
throw new UserInputException('objectIDs');
509-
}
510-
}
511-
512-
/**
513-
* Sets a style as new default style.
514-
*/
515-
public function setAsDefault()
516-
{
517-
$styleEditor = \current($this->objects);
518-
$styleEditor->setAsDefault();
519-
}
520-
521490
/**
522491
* Validates parameters to copy a style.
523492
*/
@@ -663,20 +632,6 @@ public function copy()
663632
];
664633
}
665634

666-
/**
667-
* @inheritDoc
668-
*/
669-
public function validateToggle()
670-
{
671-
parent::validateUpdate();
672-
673-
foreach ($this->getObjects() as $style) {
674-
if ($style->isDefault) {
675-
throw new UserInputException('objectIDs');
676-
}
677-
}
678-
}
679-
680635
/**
681636
* Validates parameters to change user style.
682637
*/

0 commit comments

Comments
 (0)