From 87dba3892e2cf4cf6d1337eaa8ca367d8fd525da Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 11 Aug 2016 16:40:08 +0200 Subject: [PATCH] Removed some todos Some of them are already resolved and others don't matter at all. --- com.woltlab.wcf/templates/wysiwyg.tpl | 1 - wcfsetup/install/files/acp/js/WCF.ACP.js | 6 ----- .../install/files/acp/templates/wysiwyg.tpl | 1 - .../redactor2/plugins/WoltLabImage.js | 1 - wcfsetup/install/files/js/WCF.Message.js | 12 ++-------- .../lib/acp/form/BBCodeAddForm.class.php | 1 - .../files/lib/acp/form/StyleAddForm.class.php | 1 - .../lib/data/menu/item/MenuItem.class.php | 2 +- .../files/lib/form/MessageForm.class.php | 19 --------------- .../cli/command/PackageCLICommand.class.php | 3 --- .../cli/command/WorkerCLICommand.class.php | 1 - .../clipboard/ClipboardHandler.class.php | 2 -- ...ractMessageEmbeddedObjectHandler.class.php | 10 -------- .../quote/MessageQuoteManager.class.php | 23 +++++-------------- .../group/TextUserGroupOptionType.class.php | 3 --- .../PackageInstallationDispatcher.class.php | 4 +--- .../PackageInstallationFormManager.class.php | 2 +- .../PackageInstallationNodeBuilder.class.php | 2 -- .../PackageUninstallationDispatcher.class.php | 3 +-- .../lib/system/poll/PollManager.class.php | 1 - wcfsetup/install/files/style/ui/dropdown.scss | 1 - .../files/style/ui/tabMenuMessage.scss | 2 +- 22 files changed, 13 insertions(+), 88 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 77bf603f94..973115b20d 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -94,7 +94,6 @@ var highlighters = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} }; - // TODO: Should the media stuff be here? {include file='mediaJavaScript'} var element = elById('{if $wysiwygSelector|isset}{$wysiwygSelector|encodeJS}{else}text{/if}'); diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 710769e457..cc19d57ac1 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -1001,12 +1001,6 @@ WCF.ACP.Package.Search = Class.extend({ this._packageSearchResultContainer.find('.pagination').wcfPages('destroy').remove(); if (this._pageCount > 1) { - // TODO: Fix ui.wcfPages to properly synchronize multiple instances without triggering events - /*$('
').insertBefore(this._packageSearchResultList).wcfPages({ - activePage: this._pageNo, - maxPage: this._pageCount - }).on('wcfpagesswitched', $.proxy(this._showPage, this));*/ - $('
').insertAfter(this._packageSearchResultList).wcfPages({ activePage: this._pageNo, maxPage: this._pageCount diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 77bf603f94..973115b20d 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -94,7 +94,6 @@ var highlighters = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} }; - // TODO: Should the media stuff be here? {include file='mediaJavaScript'} var element = elById('{if $wysiwygSelector|isset}{$wysiwygSelector|encodeJS}{else}text{/if}'); diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js index 7d8f837447..f009730ab2 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js @@ -7,7 +7,6 @@ $.Redactor.prototype.WoltLabImage = function() { this.button.addCallback(button, this.WoltLabImage.add); // add support for image source when editing - // TODO: float var mpShowEdit = this.image.showEdit; this.image.showEdit = (function($image) { var image = $image[0]; diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index 5131bb8121..20e5393144 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1603,11 +1603,6 @@ WCF.Message.Quote.Manager = Class.extend({ this._toggleShowQuotes(); - // TODO: when is this event being used? - WCF.System.Event.addListener('com.woltlab.wcf.message.quote', 'insert', (function(data) { - this._insertQuote(null, undefined, data); - }).bind(this)); - WCF.System.Event.addListener('com.woltlab.wcf.quote', 'reload', this.countQuotes.bind(this)); }, @@ -1832,7 +1827,7 @@ WCF.Message.Quote.Manager = Class.extend({ // insert all quotes this._dialog.find('input.jsCheckbox:checked').each($.proxy(function(index, input) { - this._insertQuote(null, input, undefined); + this._insertQuote(null, input); }, this)); // close dialog @@ -1844,11 +1839,8 @@ WCF.Message.Quote.Manager = Class.extend({ * * @param {Event} event * @param {Object} inputElement - * @param {Object} data */ - _insertQuote: function(event, inputElement, data) { - // TODO: what is with this data attribute, when is the event actually used? - + _insertQuote: function(event, inputElement) { var listItem = $(event ? event.currentTarget : inputElement).parents('li:eq(0)'); var text = listItem.children('.jsFullQuote')[0].textContent.trim(); diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php index 45c4a230bb..29c1b08e3e 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php @@ -127,7 +127,6 @@ class BBCodeAddForm extends AbstractForm { if (isset($_POST['showButton'])) $this->showButton = true; if (isset($_POST['wysiwygIcon'])) $this->wysiwygIcon = StringUtil::trim($_POST['wysiwygIcon']); - // TODO: The code below violates every implicit convention of value reading and type casting $attributeNo = 0; foreach ($this->attributes as $key => $val) { $val['attributeNo'] = $attributeNo++; diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index c064a0677e..c365820194 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -207,7 +207,6 @@ class StyleAddForm extends AbstractForm { I18nHandler::getInstance()->readValues(); - // @TODO $colors = []; foreach ($this->colors as $categoryName => $variables) { foreach ($variables as $variable) { diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php index 5e974c3b6c..077c1fba33 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php @@ -137,7 +137,7 @@ class MenuItem extends DatabaseObject { } /** - * TODO: Comment + * Returns the page handler for this item. * * @return IMenuPageHandler|null * @throws SystemException diff --git a/wcfsetup/install/files/lib/form/MessageForm.class.php b/wcfsetup/install/files/lib/form/MessageForm.class.php index d9c487e50f..321a4ca106 100644 --- a/wcfsetup/install/files/lib/form/MessageForm.class.php +++ b/wcfsetup/install/files/lib/form/MessageForm.class.php @@ -263,25 +263,6 @@ abstract class MessageForm extends AbstractCaptchaForm { parent::save(); $this->text = $this->htmlInputProcessor->getHtml(); - - // parse URLs - /* TODO - if ($this->preParse == 1) { - // BBCodes are enabled - if ($this->enableBBCodes) { - if ($this->allowedBBCodesPermission) { - $this->text = PreParser::getInstance()->parse($this->text, ArrayUtil::trim(explode(',', WCF::getSession()->getPermission($this->allowedBBCodesPermission)))); - } - else { - $this->text = PreParser::getInstance()->parse($this->text); - } - } - // BBCodes are disabled, thus no allowed BBCodes - else { - $this->text = PreParser::getInstance()->parse($this->text, array()); - } - } - */ } /** diff --git a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php index ba3ec95b8f..c32c92373e 100644 --- a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php @@ -101,8 +101,6 @@ class PackageCLICommand implements IArgumentedCLICommand { // PackageStartInstallForm::validateArchive() // try to open the archive try { - // TODO: Exceptions thrown within openArchive() are discarded, resulting in - // the meaningless message 'not a valid package' $archive->openArchive(); } catch (SystemException $e) { @@ -273,7 +271,6 @@ class PackageCLICommand implements IArgumentedCLICommand { $queue = new PackageInstallationQueue($queueID); if (!$queue->queueID) { - // todo: what to output? echo "InstallPackageAction::readParameters()"; return; } diff --git a/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php index 2aacb4dfe5..48ee2ac37b 100644 --- a/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php @@ -189,7 +189,6 @@ class WorkerCLICommand implements IArgumentedCLICommand { * @inheritDoc */ public function canAccess() { - // TODO: Check access return true; } } diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php index e9d419f948..2f9111e530 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php @@ -169,8 +169,6 @@ class ClipboardHandler extends SingletonFactory { * Returns the id of the clipboard object type with the given name or `null` if no such * clipboard object type exists. * - * TODO: The name of this method does not reflect its return type and appears not to be used. - * * @param string $objectType * @return integer|null */ diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php index 9cc6a47dc1..0d1804d41d 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php @@ -2,7 +2,6 @@ namespace wcf\system\message\embedded\object; use wcf\data\object\type\ObjectType; use wcf\data\DatabaseObjectDecorator; -use wcf\system\html\input\HtmlInputProcessor; /** * Provides default implementations for message embedded object handlers. @@ -20,13 +19,4 @@ abstract class AbstractMessageEmbeddedObjectHandler extends DatabaseObjectDecora * @inheritDoc */ protected static $baseClass = ObjectType::class; - - /** - * @inheritDoc - */ - public function parse(HtmlInputProcessor $htmlInputProcessor, array $embeddedData) { - // TODO: DEBUG ONLY, remove this method! - return []; - } - } diff --git a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php index e4cdb4d944..702a3a750b 100644 --- a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php +++ b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php @@ -3,7 +3,6 @@ namespace wcf\system\message\quote; use wcf\data\object\type\ObjectType; use wcf\data\object\type\ObjectTypeCache; use wcf\data\IMessage; -use wcf\system\application\ApplicationHandler; use wcf\system\exception\SystemException; use wcf\system\SingletonFactory; use wcf\system\WCF; @@ -12,10 +11,10 @@ use wcf\util\ArrayUtil; /** * Manages message quotes. * - * @author Alexander Ebert - * @copyright 2001-2016 WoltLab GmbH - * @license GNU Lesser General Public License - * @package WoltLabSuite\Core\System\Message\Quote + * @author Alexander Ebert + * @copyright 2001-2016 WoltLab GmbH + * @license GNU Lesser General Public License + * @package WoltLabSuite\Core\System\Message\Quote */ class MessageQuoteManager extends SingletonFactory { /** @@ -36,12 +35,6 @@ class MessageQuoteManager extends SingletonFactory { */ protected $objectTypes = []; - /** - * primary application's package id - * @var integer - */ - protected $packageID = 0; - /** * list of stored quotes * @var mixed[][] @@ -70,12 +63,8 @@ class MessageQuoteManager extends SingletonFactory { * @inheritDoc */ protected function init() { - // @todo - $this->packageID = 1; - //$this->packageID = ApplicationHandler::getInstance()->getPrimaryApplication()->packageID; - // load stored quotes from session - $messageQuotes = WCF::getSession()->getVar('__messageQuotes'.$this->packageID); + $messageQuotes = WCF::getSession()->getVar('__messageQuotes'); if (is_array($messageQuotes)) { $this->quotes = isset($messageQuotes['quotes']) ? $messageQuotes['quotes'] : []; $this->quoteData = isset($messageQuotes['quoteData']) ? $messageQuotes['quoteData'] : []; @@ -601,7 +590,7 @@ class MessageQuoteManager extends SingletonFactory { * Updates data stored in session, */ protected function updateSession() { - WCF::getSession()->register('__messageQuotes'.$this->packageID, [ + WCF::getSession()->register('__messageQuotes', [ 'quotes' => $this->quotes, 'quoteData' => $this->quoteData, 'removeQuoteIDs' => $this->removeQuoteIDs diff --git a/wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php index 3f9cb7efc2..e122f9e502 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php @@ -12,9 +12,6 @@ use wcf\util\StringUtil; * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package WoltLabSuite\Core\System\Option\User\Group - * - * @todo text options types can't have line breaks, why use them to split - * values? what to do? */ class TextUserGroupOptionType extends TextOptionType implements IUserGroupOptionType { /** diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 600573edb0..30ade3e998 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -457,9 +457,7 @@ class PackageInstallationDispatcher { } /** - * Saves the localized package infos. - * - * @todo license and readme + * Saves the localized package info. */ protected function saveLocalizedPackageInfos() { $package = new Package($this->queue->packageID); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php index d653a892f6..72743dfca6 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php @@ -101,7 +101,7 @@ abstract class PackageInstallationFormManager { $statement->execute([ base64_encode(serialize($document)), $queue->queueID, - $document->formName // TODO: FormDocument::$formName does not exist, FormDocument::getName()? + $document->getName() ]); } diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index 6c474d238f..521ee75b8c 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -507,8 +507,6 @@ class PackageInstallationNodeBuilder { // the new delivered required version of the package has a // higher version number, thus update/replace the existing // package installation queue - - // todo } } diff --git a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php index f53dc27b66..f91e0fd067 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php @@ -139,8 +139,7 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher { protected function uninstallPackage(array $nodeData) { PackageEditor::deleteAll([$this->queue->packageID]); - // remove localized package infos - // todo: license/readme + // remove localized package info $sql = "DELETE FROM wcf".WCF_N."_language_item WHERE languageItem IN (?, ?)"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 7643dc2511..35e98f90d6 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -145,7 +145,6 @@ class PollManager extends SingletonFactory { ORDER BY showOrder ASC"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->poll->pollID]); - // TODO?: $this->pollOptions = $statement->fetchAll(\PDO::FETCH_ASSOC); while ($row = $statement->fetchArray()) { $this->pollOptions[] = $row; } diff --git a/wcfsetup/install/files/style/ui/dropdown.scss b/wcfsetup/install/files/style/ui/dropdown.scss index 52d88c92f3..a881bbd352 100644 --- a/wcfsetup/install/files/style/ui/dropdown.scss +++ b/wcfsetup/install/files/style/ui/dropdown.scss @@ -27,7 +27,6 @@ } &.preInput { - // TODO: use flex-box instead display: table; width: 100%; diff --git a/wcfsetup/install/files/style/ui/tabMenuMessage.scss b/wcfsetup/install/files/style/ui/tabMenuMessage.scss index e63b599575..6542311814 100644 --- a/wcfsetup/install/files/style/ui/tabMenuMessage.scss +++ b/wcfsetup/install/files/style/ui/tabMenuMessage.scss @@ -49,7 +49,7 @@ } .messageTabMenu + .innerError { - margin-top: -1px; // TODO + margin-top: -1px; width: 100%; } -- 2.20.1