Commit d64da26b authored by Côme Chilliet's avatar Côme Chilliet

Merge branch...

Merge branch '6074-add-an-option-to-pause-trigger-aka-keep-the-configuration-but-not-run-it' into '1.4-dev'

Resolve "add an option to pause trigger aka keep the configuration but not run it"

See merge request fusiondirectory/fd!747
parents ab1d952d b4eca89c
......@@ -484,6 +484,10 @@ class config
$class = strtoupper($parts[0]);
$mode = strtoupper($parts[1]);
$cmd = $parts[2];
if (!isset($cmd[0]) || ($cmd[0] == '#')) {
/* Ignore commented out and empty triggers */
continue;
}
if (!isset($this->data['HOOKS'][$class])) {
$this->data['HOOKS'][$class] = ['CLASS' => $parts[0]];
}
......
......@@ -70,13 +70,19 @@ class hooksConfig extends simplePlugin
'precreate', 'preremove', 'premodify', 'check',
'prelock', 'postlock', 'preunlock', 'postunlock']
),
new BooleanAttribute(
_('Deactivated'), _('Use this to temporarily deactivate a trigger'),
'triggerDecativate', TRUE,
FALSE, '',
'#', ''
),
new TextAreaAttribute(
_('Command'), _('The command that will be called'),
'triggerCmd', TRUE
)
],
'/^([^\\|]+)\\|([^\\|]+)\\|(.*)$/',
'%s|%s|%s',
'/^([^\\|]+)\\|([^\\|]+)\\|(#?)(.*)$/',
'%s|%s|%s%s',
'', // acl
_('Triggers')
),
......@@ -99,6 +105,7 @@ class hooksConfig extends simplePlugin
$this->attributesAccess['fdTabHook']->setHeaders([
_('Tab'),
_('Mode'),
_('Deactivated'),
_('Command'),
'',
]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment