|
Revision 3244, 1.8 kB
(checked in by fabien, 6 years ago)
|
updated lib/filter/ directory phpdoc
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id Rev Date
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class sfFlashFilter extends sfFilter |
|---|
| 20 |
{ |
|---|
| 21 |
|
|---|
| 22 |
* Executes this filter. |
|---|
| 23 |
* |
|---|
| 24 |
* @param sfFilterChain A sfFilterChain instance. |
|---|
| 25 |
*/ |
|---|
| 26 |
public function execute($filterChain) |
|---|
| 27 |
{ |
|---|
| 28 |
$context = $this->getContext(); |
|---|
| 29 |
$userAttributeHolder = $context->getUser()->getAttributeHolder(); |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
if ($this->isFirstCall()) |
|---|
| 33 |
{ |
|---|
| 34 |
|
|---|
| 35 |
$names = $userAttributeHolder->getNames('symfony/flash'); |
|---|
| 36 |
if ($names) |
|---|
| 37 |
{ |
|---|
| 38 |
if (sfConfig::get('sf_logging_enabled')) |
|---|
| 39 |
{ |
|---|
| 40 |
$context->getLogger()->info('{sfFilter} flag old flash messages ("'.implode('", "', $names).'")'); |
|---|
| 41 |
} |
|---|
| 42 |
foreach ($names as $name) |
|---|
| 43 |
{ |
|---|
| 44 |
$userAttributeHolder->set($name, true, 'symfony/flash/remove'); |
|---|
| 45 |
} |
|---|
| 46 |
} |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
$filterChain->execute(); |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
$names = $userAttributeHolder->getNames('symfony/flash/remove'); |
|---|
| 54 |
if ($names) |
|---|
| 55 |
{ |
|---|
| 56 |
if (sfConfig::get('sf_logging_enabled')) |
|---|
| 57 |
{ |
|---|
| 58 |
$context->getLogger()->info('{sfFilter} remove old flash messages ("'.implode('", "', $names).'")'); |
|---|
| 59 |
} |
|---|
| 60 |
foreach ($names as $name) |
|---|
| 61 |
{ |
|---|
| 62 |
$userAttributeHolder->remove($name, 'symfony/flash'); |
|---|
| 63 |
$userAttributeHolder->remove($name, 'symfony/flash/remove'); |
|---|
| 64 |
} |
|---|
| 65 |
} |
|---|
| 66 |
} |
|---|
| 67 |
} |
|---|
| 68 |
|
|---|