Avoid clear flash messages for plugin templates on regions - refs BT#10376 #TMI

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 3ec2b07512
commit 37db867b42
  1. 2
      main/inc/lib/plugin.lib.php
  2. 12
      main/inc/lib/template.lib.php

@ -387,7 +387,7 @@ class AppPlugin
if (!empty($plugin_tpl)) {
//$template_plugin_file = api_get_path(SYS_PLUGIN_PATH)."$plugin_name/$plugin_tpl"; //for smarty
$template_plugin_file = "$plugin_name/$plugin_tpl"; // for twig
$template->display($template_plugin_file);
$template->display($template_plugin_file, false);
}
}
}

@ -1118,12 +1118,18 @@ class Template
}
/**
* @param string $template
* Render the template
* @param string $template The template path
* @param boolean $clearFlashMessages Clear the $_SESSION variables for flash messages
*/
public function display($template)
public function display($template, $clearFlashMessages = true)
{
$this->assign('flash_messages', Display::getFlashToString());
Display::cleanFlashMessages();
if ($clearFlashMessages) {
Display::cleanFlashMessages();
}
echo $this->twig->render($template, $this->params);
}

Loading…
Cancel
Save