`disabled` is renamed to `isDisabled` and cronjob's `active` is replaced with `isDisabled`.
Also adds missing `wcf\data\IToggleAction` to `wcf\data\language\server\LanguageServerAction`.
`wcf\system\style\handler\StyleHandler` still uses `disabled` as an array key at two points (cf. WoltLab/WCF#1031).
<xs:element name="execmultiple" type="woltlab_boolean" minOccurs="0" default="0" />
<xs:element name="canbeedited" type="woltlab_boolean" minOccurs="0" default="1" />
<xs:element name="canbedisabled" type="woltlab_boolean" minOccurs="0" default="1" />
- <xs:element name="active" type="woltlab_boolean" minOccurs="0" default="1" />
+ <xs:element name="isdisabled" type="woltlab_boolean" minOccurs="0" default="0" />
</xs:all>
</xs:complexType>
</xs:schema>
\ No newline at end of file
<img src="{@$__wcf->getPath()}icon/play.svg" alt="" title="{lang}wcf.acp.cronjob.execute{/lang}" class="icon16 jsExecuteButton jsTooltip pointer" data-object-id="{@$cronjob->cronjobID}" />
{if $cronjob->canBeDisabled()}
- <img src="{@$__wcf->getPath()}icon/{if $cronjob->active}enabled{else}disabled{/if}.svg" alt="" title="{lang}wcf.global.button.{if $cronjob->active}disable{else}enable{/if}{/lang}" class="icon16 jsToggleButton jsTooltip pointer" data-object-id="{@$cronjob->cronjobID}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" />
+ <img src="{@$__wcf->getPath()}icon/{if !$cronjob->isDisabled}enabled{else}disabled{/if}.svg" alt="" title="{lang}wcf.global.button.{if !$cronjob->isDisabled}disable{else}enable{/if}{/lang}" class="icon16 jsToggleButton jsTooltip pointer" data-object-id="{@$cronjob->cronjobID}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" />
{else}
- {if $cronjob->active}
+ {if !$cronjob->isDisabled}
<img src="{@$__wcf->getPath()}icon/enabled.svg" alt="" title="{lang}wcf.global.button.disable{/lang}" class="icon16 disabled" />
{else}
<img src="{@$__wcf->getPath()}icon/disabled.svg" alt="" title="{lang}wcf.global.button.enable{/lang}" class="icon16 disabled" />
{/if}
</td>
<td class="columnDate columnNextExec">
- {if $cronjob->active && $cronjob->nextExec != 1}
+ {if !$cronjob->isDisabled && $cronjob->nextExec != 1}
<p>{@$cronjob->nextExec|plainTime}</p>
{/if}
</td>
{foreach from=$objects item=updateServer}
<tr class="jsUpdateServerRow">
<td class="columnIcon">
- <img src="{@$__wcf->getPath()}icon/{if !$updateServer->disabled}enabled{else}disabled{/if}.svg" alt="" title="{lang}wcf.global.button.{if !$updateServer->disabled}disable{else}enable{/if}{/lang}" class="icon16 jsToggleButton jsTooltip pointer" data-object-id="{@$updateServer->packageUpdateServerID}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" />
+ <img src="{@$__wcf->getPath()}icon/{if !$updateServer->isDisabled}enabled{else}disabled{/if}.svg" alt="" title="{lang}wcf.global.button.{if !$updateServer->isDisabled}disable{else}enable{/if}{/lang}" class="icon16 jsToggleButton jsTooltip pointer" data-object-id="{@$updateServer->packageUpdateServerID}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" />
<a href="{link controller='UpdateServerEdit' id=$updateServer->packageUpdateServerID}{/link}"><img src="{@$__wcf->getPath()}icon/edit.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" class="icon16 jsTooltip" /></a>
<img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.global.button.delete{/lang}" class="icon16 jsDeleteButton jsTooltip pointer" data-object-id="{@$updateServer->packageUpdateServerID}" data-confirm-message="{lang}wcf.acp.updateServer.delete.sure{/lang}" />
-
+
{event name='buttons'}
</td>
<td class="columnID"><p>{@$updateServer->packageUpdateServerID}</p></td>
<td class="columnStatus"><p class="badge{if $updateServer->status == 'online'} green{else} red{/if}">{@$updateServer->status}</p></td>
<td class="columnText"><p title="{@$updateServer->errorMessage}">{@$updateServer->errorMessage|truncate:"30"}</p></td>
<td class="columnDate"><p>{if $updateServer->lastUpdateTime}{@$updateServer->lastUpdateTime|time}{/if}</p></td>
-
+
{event name='columns'}
</tr>
{/foreach}
*/
public function toggle() {
foreach ($this->objects as $cronjob) {
- $newStatus = ($cronjob->active) ? 0 : 1;
- $cronjob->update(array('active' => $newStatus));
+ $cronjob->update(array('isDisabled' => 1 - $cronjob->isDisabled));
}
}
<?php
namespace wcf\data\language\server;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\IToggleAction;
/**
* Executes language server-related actions.
* @subpackage data.language.server
* @category Community Framework
*/
-class LanguageServerAction extends AbstractDatabaseObjectAction {
+class LanguageServerAction extends AbstractDatabaseObjectAction implements IToggleAction {
/**
* @see wcf\data\AbstractDatabaseObjectAction::$className
*/
* @see wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
*/
protected $permissionsUpdate = array('admin.language.canEditServer');
+
+ /**
+ * @see wcf\data\IToggleAction::toggle()
+ */
+ public function toggle() {
+ foreach ($this->objects as $serverEditor) {
+ $serverEditor->update(array(
+ 'isDisabled' => 1 - $serverEditor->isDisabled
+ ));
+ }
+ }
+
+ /**
+ * @see wcf\data\IToggleAction::validateToggle()
+ */
+ public function validateToggle() {
+ $this->validateUpdate();
+ }
}
public static function getActiveUpdateServers(array $packageUpdateServerIDs = array()) {
$list = new PackageUpdateServerList();
$list->sqlLimit = 0;
- $list->getConditionBuilder()->add("disabled = ?", array(0));
+ $list->getConditionBuilder()->add("isDisabled = ?", array(0));
if (!empty($packageUpdateServerIDs)) {
$list->getConditionBuilder()->add("packageUpdateServerID IN (?)", array($packageUpdateServerIDs));
}
*/
public function toggle() {
foreach ($this->objects as $server) {
- $server->update(array('disabled' => ($server->disabled) ? 0 : 1));
+ $server->update(array('isDisabled' => ($server->isDisabled) ? 0 : 1));
}
}
}
'packageID' => PACKAGE_ID,
'styleName' => $styleName,
'templateGroupID' => $this->styleEditor->templateGroupID,
- 'disabled' => 1, // newly created styles are disabled by default
+ 'isDisabled' => 1, // newly created styles are disabled by default
'styleDescription' => $this->styleEditor->styleDescription,
'styleVersion' => $this->styleEditor->styleVersion,
'styleDate' => $this->styleEditor->styleDate,
*/
public function toggle() {
foreach ($this->objects as $style) {
- $disabled = ($style->disabled) ? 0 : 1;
- $style->update(array('disabled' => $disabled));
+ $isDisabled = ($style->isDisabled) ? 0 : 1;
+ $style->update(array('isDisabled' => $isDisabled));
}
}
*/
public function validateChangeStyle() {
$this->style = $this->getSingleObject();
- if ($this->style->disabled && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
+ if ($this->style->isDisabled && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
throw new PermissionDeniedException();
}
}
public function getStyleChooser() {
$styleList = new StyleList();
if (!WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
- $styleList->getConditionBuilder()->add("style.disabled = ?", array(0));
+ $styleList->getConditionBuilder()->add("style.isDisabled = ?", array(0));
}
$styleList->sqlOrderBy = "style.styleName ASC";
$styleList->readObjects();
// set new default
$this->update(array(
'isDefault' => 1,
- 'disabled' => 0
+ 'isDisabled' => 0
));
self::resetCache();
$value = intval(!$enable);
$sql = "UPDATE wcf".WCF_N."_user_option
- SET disabled = ?
+ SET isDisabled = ?
WHERE optionID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($value, $this->optionID));
$sql = "SELECT *
FROM wcf".WCF_N."_cronjob cronjob
WHERE (cronjob.nextExec <= ? OR cronjob.afterNextExec <= ?)
- AND cronjob.active = ?
+ AND cronjob.isDisabled = ?
AND cronjob.failCount < ?
AND cronjob.state = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
TIME_NOW,
TIME_NOW,
- 1,
+ 0,
Cronjob::MAX_FAIL_COUNT,
Cronjob::READY
));
// disable cronjob
if ($failCount == 3) {
- $data['active'] = 0;
+ $data['isDisabled'] = 1;
$executeCronjob = false;
}
}
* @see wcf\system\option\OptionHandler::checkVisibility()
*/
protected function checkVisibility(Option $option) {
- if ($option->disabled) {
+ if ($option->isDisabled) {
return false;
}
*/
protected function prepareImport(array $data) {
return array(
- 'active' => (isset($data['elements']['active'])) ? intval($data['elements']['active']) : 1,
'canBeDisabled' => (isset($data['elements']['canbedisabled'])) ? intval($data['elements']['canbedisabled']) : 1,
'canBeEdited' => (isset($data['elements']['canbeedited'])) ? intval($data['elements']['canbeedited']) : 1,
'className' => (isset($data['elements']['classname'])) ? $data['elements']['classname'] : '',
'description' => (isset($data['elements']['description'])) ? $data['elements']['description'] : '',
+ 'isDisabled' => (isset($data['elements']['isdisabled'])) ? intval($data['elements']['isdisabled']) : 0,
'startDom' => $data['elements']['startdom'],
'startDow' => $data['elements']['startdow'],
'startHour' => $data['elements']['starthour'],
* list of names of tags which aren't considered as additional data
* @var array<string>
*/
- public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'disabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata');
+ public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'isdisabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata');
/**
* @see wcf\system\package\plugin\AbstractOptionPackageInstallationPlugin::saveCategory()
protected function saveOption($option, $categoryName, $existingOptionID = 0) {
// default values
$optionName = $optionType = $validationPattern = $outputClass = $selectOptions = $enableOptions = $permissions = $options = '';
- $required = $editable = $visible = $searchable = $disabled = $askDuringRegistration = 0;
+ $required = $editable = $visible = $searchable = $isDisabled = $askDuringRegistration = 0;
$defaultValue = $showOrder = null;
// get values
if (isset($option['outputclass'])) $outputClass = $option['outputclass'];
if (isset($option['selectoptions'])) $selectOptions = $option['selectoptions'];
if (isset($option['enableoptions'])) $enableOptions = $option['enableoptions'];
- if (isset($option['disabled'])) $disabled = intval($option['disabled']);
+ if (isset($option['isdisabled'])) $isDisabled = intval($option['isdisabled']);
$showOrder = $this->getShowOrder($showOrder, $categoryName, 'categoryName');
if (isset($option['permissions'])) $permissions = $option['permissions'];
if (isset($option['options'])) $options = $option['options'];
'outputClass' => $outputClass,
'searchable' => $searchable,
'showOrder' => $showOrder,
- 'disabled' => $disabled,
+ 'isDisabled' => $isDisabled,
'permissions' => $permissions,
'options' => $options,
'additionalData' => serialize($additionalData)
$styles = array();
foreach ($this->cache['styles'] as $styleID => $style) {
- if ((!$style->disabled && empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) || WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
+ if ((!$style->isDisabled && empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) || WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
$styles[$styleID] = $style;
}
}
// check permission
if (!$ignorePermissions) {
if (isset($this->cache['styles'][$styleID])) {
- if (($this->cache['styles'][$styleID]->disabled || !empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
+ if (($this->cache['styles'][$styleID]->isDisabled || !empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
$styleID = 0;
}
}
lastExec INT(10) NOT NULL DEFAULT 0,
nextExec INT(10) NOT NULL DEFAULT 0,
afterNextExec INT(10) NOT NULL DEFAULT 0,
- active TINYINT(1) NOT NULL DEFAULT 1,
+ isDisabled TINYINT(1) NOT NULL DEFAULT 0,
canBeEdited TINYINT(1) NOT NULL DEFAULT 1,
canBeDisabled TINYINT(1) NOT NULL DEFAULT 1,
state TINYINT(1) NOT NULL DEFAULT 0,
CREATE TABLE wcf1_language_server (
languageServerID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
serverURL VARCHAR(255) NOT NULL DEFAULT '',
- disabled TINYINT(1) NOT NULL DEFAULT 0
+ isDisabled TINYINT(1) NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_modification_log;
serverURL VARCHAR(255) NOT NULL DEFAULT '',
loginUsername VARCHAR(255) NOT NULL DEFAULT '',
loginPassword VARCHAR(255) NOT NULL DEFAULT '',
- disabled TINYINT(1) NOT NULL DEFAULT 0,
+ isDisabled TINYINT(1) NOT NULL DEFAULT 0,
lastUpdateTime INT(10) NOT NULL DEFAULT 0,
status ENUM('online', 'offline') NOT NULL DEFAULT 'online',
errorMessage TEXT
styleName VARCHAR(255) NOT NULL DEFAULT '',
templateGroupID INT(10) NOT NULL DEFAULT 0,
isDefault TINYINT(1) NOT NULL DEFAULT 0,
- disabled TINYINT(1) NOT NULL DEFAULT 0,
+ isDisabled TINYINT(1) NOT NULL DEFAULT 0,
styleDescription TEXT,
styleVersion VARCHAR(255) NOT NULL DEFAULT '',
styleDate CHAR(10) NOT NULL DEFAULT '0000-00-00',
outputClass VARCHAR(255) NOT NULL DEFAULT '',
searchable TINYINT(1) NOT NULL DEFAULT 0,
showOrder INT(10) NOT NULL DEFAULT 0,
- disabled TINYINT(1) NOT NULL DEFAULT 0,
+ isDisabled TINYINT(1) NOT NULL DEFAULT 0,
permissions TEXT,
options TEXT,
additionalData MEDIUMTEXT,
INSERT INTO wcf1_user_group_option_value (groupID, optionID, optionValue) VALUES (4, 3, '1'); -- Administrators
-- default update servers
-INSERT INTO wcf1_package_update_server (serverURL, status, disabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://update.woltlab.com/maelstrom/', 'online', 0, NULL, 0, '', '');
-INSERT INTO wcf1_package_update_server (serverURL, status, disabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://store.woltlab.com/maelstrom/', 'online', 0, NULL, 0, '', '');
+INSERT INTO wcf1_package_update_server (serverURL, status, isDisabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://update.woltlab.com/maelstrom/', 'online', 0, NULL, 0, '', '');
+INSERT INTO wcf1_package_update_server (serverURL, status, isDisabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://store.woltlab.com/maelstrom/', 'online', 0, NULL, 0, '', '');
-- style default values
INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfContentBackgroundColor', 'rgba(255, 255, 255, 1)');