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

🚜 feat(hooks) Rename hooks to triggers in the interface

issue #6037
parent f55e80bf
......@@ -293,7 +293,7 @@ class msgPool
*/
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
$str = implode("\n", $arr);
@DEBUG(DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Result: ".$str);
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
/* Check values */
function check (): array
{
/* Call common method to give check the hook */
$message = parent::check();
$namingAttr = static::$namingAttr;
......
......@@ -24,8 +24,8 @@ class hooksConfig extends simplePlugin
static function plInfo (): array
{
return [
'plShortName' => _('Hooks'),
'plTitle' => _('Hooks configuration'),
'plShortName' => _('Triggers'),
'plTitle' => _('Triggers configuration'),
'plPriority' => 1,
'plObjectType' => ['configuration'],
......@@ -44,41 +44,41 @@ class hooksConfig extends simplePlugin
sort($plugins);
return [
'hooks' => [
'name' => _('Hooks'),
'triggers' => [
'name' => _('Triggers'),
'class' => ['fullwidth'],
'attrs' => [
new BooleanAttribute(
_('Display hook output'),
_('When enabled successful hook execution output is displayed to the user using a dialog.'),
_('Display trigger output'),
_('When enabled successful trigger execution output is displayed to the user using a dialog.'),
'fdDisplayHookOutput'
),
new OrderedArrayAttribute(
new CompositeAttribute(
_('Hooks that are called when specific actions happens'),
_('Triggers that are called when specific actions happens'),
'fdTabHook',
[
new SelectAttribute(
_('Tab'), _('The tab that this hook concerns'),
'hookTab', TRUE,
_('Tab'), _('The tab that this trigger concerns'),
'triggerTab', TRUE,
$plugins
),
new SelectAttribute(
_('Mode'), _('When to call this command'),
'hookMode', TRUE,
'triggerMode', TRUE,
['postcreate', 'postremove', 'postmodify',
'precreate', 'preremove', 'premodify', 'check',
'prelock', 'postlock', 'preunlock', 'postunlock']
),
new TextAreaAttribute(
_('Command'), _('The command that will be called'),
'hookCmd', TRUE
'triggerCmd', TRUE
)
],
'/^([^\\|]+)\\|([^\\|]+)\\|(.*)$/',
'%s|%s|%s',
'', // acl
_('Hooks')
_('Triggers')
),
FALSE, // non-ordered
[],
......
......@@ -51,7 +51,7 @@ class mainPluginsConfig extends simplePlugin
'name' => _('SASL'),
'attrs' => [
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,
FALSE
),
......
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