From: Matthias Schmidt Date: Sun, 23 Mar 2014 22:06:36 +0000 (+0100) Subject: Adds nice value for template listeners X-Git-Tag: 2.1.0_Alpha_1~956^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da84cf755031c0b7713c870ddd3724dc8154e5fb;p=GitHub%2FWoltLab%2FWCF.git Adds nice value for template listeners --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php index f067d50d81..20e81cf276 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php @@ -20,6 +20,7 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder { // get template codes for specified template $templateListenerList = new TemplateListenerList(); $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($parameters['environment'])); + $templateListenerList->sqlOrderBy = 'template_listener.niceValue ASC, template_listener.listenerID ASC'; $templateListenerList->readObjects(); $data = array(); diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php index ce1197f72c..80699b13ab 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php @@ -45,9 +45,18 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() */ protected function prepareImport(array $data) { + $niceValue = isset($data['elements']['nice']) ? intval($data['elements']['nice']) : 0; + if ($niceValue < -128) { + $niceValue = -128; + } + else if ($niceValue > 127) { + $niceValue = 127; + } + return array( 'environment' => $data['elements']['environment'], 'eventName' => $data['elements']['eventname'], + 'niceValue' => $niceValue, 'name' => $data['attributes']['name'], 'templateCode' => $data['elements']['templatecode'], 'templateName' => $data['elements']['templatename'] diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 1648aa969b..fe09ea57c4 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -930,6 +930,7 @@ CREATE TABLE wcf1_template_listener ( templateName VARCHAR(80) NOT NULL DEFAULT '', eventName VARCHAR(50) NOT NULL DEFAULT '', templateCode TEXT NOT NULL, + niceValue TINYINT(3) NOT NULL DEFAULT 0, KEY templateName (environment, templateName) );