Unverified Commit a925e77b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:tractor: feat(hooks) Rename hooks to triggers in the interface

issue #6037
Showing with 15 additions and 16 deletions
+15 -16
...@@ -293,7 +293,7 @@ class msgPool ...@@ -293,7 +293,7 @@ class msgPool
*/ */
public static function cmdnotfound ($type, $plugin) public static function cmdnotfound ($type, $plugin)
{ {
return sprintf(_("Command specified as %s hook for plugin '%s' does not exist!"), $type, $plugin); return sprintf(_('Command specified as %s trigger for plugin "%s" does not exist!'), $type, $plugin);
} }
/*! /*!
......
...@@ -1535,7 +1535,7 @@ class simplePlugin implements SimpleTab ...@@ -1535,7 +1535,7 @@ class simplePlugin implements SimpleTab
$str = implode("\n", $arr); $str = implode("\n", $arr);
@DEBUG(DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Result: ".$str); @DEBUG(DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Result: ".$str);
if (!empty($str) && $config->get_cfg_value("displayHookOutput", "FALSE") == "TRUE") { if (!empty($str) && $config->get_cfg_value("displayHookOutput", "FALSE") == "TRUE") {
msg_dialog::display('['.get_class($this).' '.strtolower($cmd)."hook] $command", $str, INFO_DIALOG); msg_dialog::display('['.get_class($this).' '.strtolower($cmd).'trigger] '.$command, $str, INFO_DIALOG);
} }
} }
} }
......
...@@ -162,7 +162,6 @@ class department extends simplePlugin ...@@ -162,7 +162,6 @@ class department extends simplePlugin
/* Check values */ /* Check values */
function check (): array function check (): array
{ {
/* Call common method to give check the hook */
$message = parent::check(); $message = parent::check();
$namingAttr = static::$namingAttr; $namingAttr = static::$namingAttr;
......
...@@ -24,8 +24,8 @@ class hooksConfig extends simplePlugin ...@@ -24,8 +24,8 @@ class hooksConfig extends simplePlugin
static function plInfo (): array static function plInfo (): array
{ {
return [ return [
'plShortName' => _('Hooks'), 'plShortName' => _('Triggers'),
'plTitle' => _('Hooks configuration'), 'plTitle' => _('Triggers configuration'),
'plPriority' => 1, 'plPriority' => 1,
'plObjectType' => ['configuration'], 'plObjectType' => ['configuration'],
...@@ -44,41 +44,41 @@ class hooksConfig extends simplePlugin ...@@ -44,41 +44,41 @@ class hooksConfig extends simplePlugin
sort($plugins); sort($plugins);
return [ return [
'hooks' => [ 'triggers' => [
'name' => _('Hooks'), 'name' => _('Triggers'),
'class' => ['fullwidth'], 'class' => ['fullwidth'],
'attrs' => [ 'attrs' => [
new BooleanAttribute( new BooleanAttribute(
_('Display hook output'), _('Display trigger output'),
_('When enabled successful hook execution output is displayed to the user using a dialog.'), _('When enabled successful trigger execution output is displayed to the user using a dialog.'),
'fdDisplayHookOutput' 'fdDisplayHookOutput'
), ),
new OrderedArrayAttribute( new OrderedArrayAttribute(
new CompositeAttribute( new CompositeAttribute(
_('Hooks that are called when specific actions happens'), _('Triggers that are called when specific actions happens'),
'fdTabHook', 'fdTabHook',
[ [
new SelectAttribute( new SelectAttribute(
_('Tab'), _('The tab that this hook concerns'), _('Tab'), _('The tab that this trigger concerns'),
'hookTab', TRUE, 'triggerTab', TRUE,
$plugins $plugins
), ),
new SelectAttribute( new SelectAttribute(
_('Mode'), _('When to call this command'), _('Mode'), _('When to call this command'),
'hookMode', TRUE, 'triggerMode', TRUE,
['postcreate', 'postremove', 'postmodify', ['postcreate', 'postremove', 'postmodify',
'precreate', 'preremove', 'premodify', 'check', 'precreate', 'preremove', 'premodify', 'check',
'prelock', 'postlock', 'preunlock', 'postunlock'] 'prelock', 'postlock', 'preunlock', 'postunlock']
), ),
new TextAreaAttribute( new TextAreaAttribute(
_('Command'), _('The command that will be called'), _('Command'), _('The command that will be called'),
'hookCmd', TRUE 'triggerCmd', TRUE
) )
], ],
'/^([^\\|]+)\\|([^\\|]+)\\|(.*)$/', '/^([^\\|]+)\\|([^\\|]+)\\|(.*)$/',
'%s|%s|%s', '%s|%s|%s',
'', // acl '', // acl
_('Hooks') _('Triggers')
), ),
FALSE, // non-ordered FALSE, // non-ordered
[], [],
......
...@@ -51,7 +51,7 @@ class mainPluginsConfig extends simplePlugin ...@@ -51,7 +51,7 @@ class mainPluginsConfig extends simplePlugin
'name' => _('SASL'), 'name' => _('SASL'),
'attrs' => [ 'attrs' => [
new BooleanAttribute( new BooleanAttribute(
_('Force to ask for password'), _('Useful if you add a hook using password value when SASL user passwords are edited'), _('Force to ask for password'), _('Useful if you add a trigger using password value when SASL user passwords are edited'),
'fdForceSaslPasswordAsk', TRUE, 'fdForceSaslPasswordAsk', TRUE,
FALSE FALSE
), ),
......
Supports Markdown
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