Added setting to trigger some alerts with 'inline' setting

This commit is contained in:
Simon DELAGE 2018-11-15 07:11:39 +01:00
parent 35e1d042d2
commit 333cadec5c
5 changed files with 6 additions and 2 deletions

View file

@ -52,7 +52,7 @@ class action_plugin_tagalerts extends DokuWiki_Action_Plugin{
global $conf;
global $ACT;
if (($this->getConf('action') == "messages") & ($ACT == "show")) {
if ((($this->getConf('action') == "messages") or ($this->getConf('forcemsg') != null)) & ($ACT == "show")) {
// Get an array of triggers from settings (make sure the list is well formated: no blanks between triggers and no '_' in triggers)
$errorTriggers = explode(',',str_replace('_', ' ', str_replace(', ', ',', $this->getConf('error'))));
$infoTriggers = explode(',',str_replace('_', ' ', str_replace(', ', ',', $this->getConf('info'))));
@ -66,7 +66,7 @@ class action_plugin_tagalerts extends DokuWiki_Action_Plugin{
$tagalerts['notify'] = array_values((array_intersect($this->pagetags, $notifyTriggers)));
foreach($tagalerts as $type=>$tags) {
for ($i = 0; $i < count($tags); $i++) {
if (isset($tags[$i]) {
if ((isset($tags[$i])) and (($this->getConf('action') == "messages") or (strpos($this->getConf('forcemsg'), $tags[$i]) !== false))) {
// Alert from conf file
if (isset($conf['plugin']['tagalerts']['specAlerts'][$tags[$i]])) {
$msg = $conf['plugin']['tagalerts']['specAlerts'][$tags[$i]];

View file

@ -11,3 +11,4 @@ $conf['error'] = ''; //comma separated list of tags for w
$conf['info'] = ''; //comma separated list of tags for wich a "tag info" should be thrown
$conf['success'] = ''; //comma separated list of tags for wich a "tag success" should be thrown
$conf['notify'] = ''; //comma separated list of tags for wich a "tag notification" should be thrown
$conf['forcemsg'] = ''; //comma separated list of tags for wich messages will be forced, even with `inline` setting

View file

@ -11,3 +11,4 @@ $meta['error'] = array('string');
$meta['info'] = array('string');
$meta['success'] = array('string');
$meta['notify'] = array('string');
$meta['forcemsg'] = array('string');

View file

@ -13,3 +13,4 @@ $lang['error'] = 'Comma separated list of tags that will trigge
$lang['info'] = 'Comma separated list of tags that will trigger an alert based on system information message.';
$lang['success'] = 'Comma separated list of tags that will trigger an alert based on system success message.';
$lang['notify'] = 'Comma separated list of tags that will trigger an alert based on system notification message.';
$lang['forcemsg'] = 'Comma separated list of tags for wich messages will be forced, even with `inline` setting.';

View file

@ -11,3 +11,4 @@ $lang['error'] = 'Liste de tags séparés par une virgule qui d
$lang['info'] = 'Liste de tags séparés par une virgule qui déclencheront une alerte basée sur les messages système d\'information.';
$lang['success'] = 'Liste de tags séparés par une virgule qui déclencheront une alerte basée sur les messages système de succès.';
$lang['notify'] = 'Liste de tags séparés par une virgule qui déclencheront une alerte basée sur les messages système de notification..';
$lang['forcemsg'] = 'Liste de tags séparés par une virgule pour lesquels une alerte sera déclenchés, même avec l\'option `inline`.';