mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Simplify code used to generate plugin flash messages.
This commit is contained in:
parent
fd50d1976a
commit
925647ae2b
1 changed files with 3 additions and 10 deletions
|
@ -38,7 +38,6 @@ class FlashComponent extends Component {
|
|||
'key' => 'flash',
|
||||
'element' => 'default',
|
||||
'params' => array(),
|
||||
'plugin' => '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -77,17 +76,11 @@ class FlashComponent extends Component {
|
|||
$message = $message->getMessage();
|
||||
}
|
||||
|
||||
list($plugin, $element) = pluginSplit($options['element']);
|
||||
|
||||
if ($plugin) {
|
||||
$options['plugin'] = $plugin;
|
||||
}
|
||||
|
||||
list($plugin, $element) = pluginSplit($options['element'], true);
|
||||
if (!empty($options['plugin'])) {
|
||||
$options['element'] = $options['plugin'] . '.Flash/' . $element;
|
||||
} else {
|
||||
$options['element'] = 'Flash/' . $element;
|
||||
$plugin = $options['plugin'] . '.';
|
||||
}
|
||||
$options['element'] = $plugin . 'Flash/' . $element;
|
||||
|
||||
CakeSession::write('Message.' . $options['key'], array(
|
||||
'message' => $message,
|
||||
|
|
Loading…
Reference in a new issue