+++ /dev/null
-{if $isMultiDomainSetup}
- <input type="hidden" name="values[{$option->optionName}]" value="1">
- <select name="values[{$option->optionName}]" id="{$option->optionName}">
- {foreach from=$applications item=application}
- <option value="{@$application->packageID}"{if $application->packageID == $value} selected{/if}>{$application->getPackage()}</option>
- {/foreach}
- </select>
-{else}
- <input type="hidden" name="values[{$option->optionName}]" value="1">
- <script>
- (function() {
- {* pretend that this option does not exist *}
- var container = elBySel('.{$option->optionName}Input');
- container.style.setProperty('margin', '0', 'important');
- container.style.setProperty('max-height', '0', 'important');
- container.style.setProperty('overflow', 'hidden', 'important');
- })();
- </script>
-{/if}
+++ /dev/null
-<?php
-
-namespace wcf\system\option;
-
-use wcf\data\option\Option;
-use wcf\system\application\ApplicationHandler;
-use wcf\system\exception\UserInputException;
-use wcf\system\WCF;
-
-/**
- * Option type implementation for the desktop notification application selection. This
- * option is intentionally designed to be invisible at most times.
- *
- * @author Alexander Ebert
- * @copyright 2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Option
- */
-class DesktopNotificationApplicationSelectOptionType extends AbstractOptionType
-{
- /**
- * @inheritDoc
- */
- public function getFormElement(Option $option, $value)
- {
- return WCF::getTPL()->fetch('desktopNotificationApplicationSelectOptionType', 'wcf', [
- 'applications' => ApplicationHandler::getInstance()->getApplications(),
- 'isMultiDomainSetup' => ApplicationHandler::getInstance()->isMultiDomainSetup(),
- 'option' => $option,
- 'value' => $value,
- ]);
- }
-
- /**
- * @inheritDoc
- */
- public function validate(Option $option, $newValue)
- {
- if (ApplicationHandler::getInstance()->isMultiDomainSetup()) {
- if (ApplicationHandler::getInstance()->getApplicationByID($newValue) === null) {
- throw new UserInputException($option->optionName, 'validationFailed');
- }
- }
- }
-}