@@ -17,8 +17,6 @@ |
||
| 17 | 17 | use Nette; |
| 18 | 18 | use Nette\Application; |
| 19 | 19 | use Nette\Localization; |
| 20 | -use Nette\Utils; |
|
| 21 | - |
|
| 22 | 20 | use IPub; |
| 23 | 21 | use IPub\FlashMessages; |
| 24 | 22 | use IPub\FlashMessages\Exceptions; |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Control.php |
|
| 4 | - * |
|
| 5 | - * @copyright More in license.md |
|
| 6 | - * @license http://www.ipublikuj.eu |
|
| 7 | - * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | - * @package iPublikuj:FlashMessages! |
|
| 9 | - * @subpackage Components |
|
| 10 | - * @since 5.0 |
|
| 11 | - * |
|
| 12 | - * @date 12.03.14 |
|
| 13 | - */ |
|
| 3 | + * Control.php |
|
| 4 | + * |
|
| 5 | + * @copyright More in license.md |
|
| 6 | + * @license http://www.ipublikuj.eu |
|
| 7 | + * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | + * @package iPublikuj:FlashMessages! |
|
| 9 | + * @subpackage Components |
|
| 10 | + * @since 5.0 |
|
| 11 | + * |
|
| 12 | + * @date 12.03.14 |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Components; |
| 16 | 16 | |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | $messages = $this->sessionStorage->get(FlashMessages\SessionStorage::KEY_MESSAGES); |
| 151 | 151 | |
| 152 | 152 | // Assign vars to template |
| 153 | - $this->template->flashes = $messages ? $messages : []; |
|
| 154 | - $this->template->useTitle = $this->useTitle; |
|
| 155 | - $this->template->useOverlay = $this->useOverlay; |
|
| 153 | + $this->template->flashes = $messages ? $messages : []; |
|
| 154 | + $this->template->useTitle = $this->useTitle; |
|
| 155 | + $this->template->useOverlay = $this->useOverlay; |
|
| 156 | 156 | |
| 157 | 157 | // Check if translator is available |
| 158 | 158 | if ($this->getTranslator() instanceof Localization\ITranslator) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | // If template was not defined before... |
| 163 | 163 | if ($this->template->getFile() === NULL) { |
| 164 | 164 | // ...try to get base component template file |
| 165 | - $templateFile = !empty($this->templateFile) ? $this->templateFile : __DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR .'default'. DIRECTORY_SEPARATOR .'default.latte'; |
|
| 165 | + $templateFile = !empty($this->templateFile) ? $this->templateFile : __DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 166 | 166 | $this->template->setFile($templateFile); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -191,12 +191,12 @@ discard block |
||
| 191 | 191 | $template = basename($templateFile, '.latte'); |
| 192 | 192 | |
| 193 | 193 | // ...check if extension template is used |
| 194 | - if (is_file(__DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR .'default.latte')) { |
|
| 195 | - $templateFile = __DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR .'default.latte'; |
|
| 194 | + if (is_file(__DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'default.latte')) { |
|
| 195 | + $templateFile = __DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 196 | 196 | |
| 197 | 197 | } else { |
| 198 | 198 | // ...if not throw exception |
| 199 | - throw new Exceptions\FileNotFoundException('Template file "'. $templateFile .'" was not found.'); |
|
| 199 | + throw new Exceptions\FileNotFoundException('Template file "' . $templateFile . '" was not found.'); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -14,9 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Events; |
| 16 | 16 | |
| 17 | -use Nette; |
|
| 18 | 17 | use Nette\Application; |
| 19 | - |
|
| 20 | 18 | use IPub; |
| 21 | 19 | use IPub\FlashMessages; |
| 22 | 20 | |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * OnResponseHandler.php |
|
| 4 | - * |
|
| 5 | - * @copyright More in license.md |
|
| 6 | - * @license http://www.ipublikuj.eu |
|
| 7 | - * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | - * @package iPublikuj:FlashMessages! |
|
| 9 | - * @subpackage Events |
|
| 10 | - * @since 5.0 |
|
| 11 | - * |
|
| 12 | - * @date 06.02.15 |
|
| 13 | - */ |
|
| 3 | + * OnResponseHandler.php |
|
| 4 | + * |
|
| 5 | + * @copyright More in license.md |
|
| 6 | + * @license http://www.ipublikuj.eu |
|
| 7 | + * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | + * @package iPublikuj:FlashMessages! |
|
| 9 | + * @subpackage Events |
|
| 10 | + * @since 5.0 |
|
| 11 | + * |
|
| 12 | + * @date 06.02.15 |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Events; |
| 16 | 16 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $messages = $this->sessionStorage->get(FlashMessages\SessionStorage::KEY_MESSAGES, []); |
| 44 | 44 | |
| 45 | - foreach($messages as $key => $message) { |
|
| 45 | + foreach ($messages as $key => $message) { |
|
| 46 | 46 | if ($message->isDisplayed()) { |
| 47 | 47 | unset($messages[$key]); |
| 48 | 48 | } |
@@ -16,10 +16,8 @@ |
||
| 16 | 16 | |
| 17 | 17 | use Nette; |
| 18 | 18 | use Nette\Localization; |
| 19 | - |
|
| 20 | 19 | use Kdyby; |
| 21 | 20 | use Kdyby\Translation; |
| 22 | - |
|
| 23 | 21 | use IPub; |
| 24 | 22 | use IPub\FlashMessages\Adapters; |
| 25 | 23 | use IPub\FlashMessages\Entities; |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TFlashMessages.php |
|
| 4 | - * |
|
| 5 | - * @copyright More in license.md |
|
| 6 | - * @license http://www.ipublikuj.eu |
|
| 7 | - * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | - * @package iPublikuj:FlashMessages! |
|
| 9 | - * @subpackage common |
|
| 10 | - * @since 5.0 |
|
| 11 | - * |
|
| 12 | - * @date 01.02.15 |
|
| 13 | - */ |
|
| 3 | + * TFlashMessages.php |
|
| 4 | + * |
|
| 5 | + * @copyright More in license.md |
|
| 6 | + * @license http://www.ipublikuj.eu |
|
| 7 | + * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | + * @package iPublikuj:FlashMessages! |
|
| 9 | + * @subpackage common |
|
| 10 | + * @since 5.0 |
|
| 11 | + * |
|
| 12 | + * @date 01.02.15 |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages; |
| 16 | 16 | |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Exceptions; |
| 16 | 16 | |
| 17 | -class InvalidStateException extends \RuntimeException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class InvalidStateException extends \RuntimeException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Exceptions; |
| 16 | 16 | |
| 17 | -interface IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +interface IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Exceptions; |
| 16 | 16 | |
| 17 | -class IOException extends \RuntimeException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class IOException extends \RuntimeException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Exceptions; |
| 16 | 16 | |
| 17 | -class FileNotFoundException extends IOException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class FileNotFoundException extends IOException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | */ |
| 85 | 85 | public static function register(Nette\Configurator $config, $extensionName = 'flashMessages') |
| 86 | 86 | { |
| 87 | - $config->onCompile[] = function (Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 87 | + $config->onCompile[] = function(Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 88 | 88 | $compiler->addExtension($extensionName, new FlashMessagesExtension()); |
| 89 | 89 | }; |
| 90 | 90 | } |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Message.php |
|
| 4 | - * |
|
| 5 | - * @copyright More in license.md |
|
| 6 | - * @license http://www.ipublikuj.eu |
|
| 7 | - * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | - * @package iPublikuj:FlashMessages! |
|
| 9 | - * @subpackage Entities |
|
| 10 | - * @since 5.0 |
|
| 11 | - * |
|
| 12 | - * @date 06.02.15 |
|
| 13 | - */ |
|
| 3 | + * Message.php |
|
| 4 | + * |
|
| 5 | + * @copyright More in license.md |
|
| 6 | + * @license http://www.ipublikuj.eu |
|
| 7 | + * @author Adam Kadlec http://www.ipublikuj.eu |
|
| 8 | + * @package iPublikuj:FlashMessages! |
|
| 9 | + * @subpackage Entities |
|
| 10 | + * @since 5.0 |
|
| 11 | + * |
|
| 12 | + * @date 06.02.15 |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | namespace IPub\FlashMessages\Entities; |
| 16 | 16 | |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | class Message extends Nette\Object implements IMessage |
| 25 | 25 | { |
| 26 | - const LEVEL_INFO = 'info'; |
|
| 26 | + const LEVEL_INFO = 'info'; |
|
| 27 | 27 | const LEVEL_SUCCESS = 'success'; |
| 28 | 28 | const LEVEL_WARNING = 'warning'; |
| 29 | - const LEVEL_ERROR = 'error'; |
|
| 29 | + const LEVEL_ERROR = 'error'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @var string |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function __construct(Localization\ITranslator $translator = NULL, Adapters\IPhraseAdapter $phraseAdapter) |
| 71 | 71 | { |
| 72 | - $this->translator = $translator; |
|
| 73 | - $this->phraseAdapter = $phraseAdapter; |
|
| 72 | + $this->translator = $translator; |
|
| 73 | + $this->phraseAdapter = $phraseAdapter; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |