@@ -66,11 +66,11 @@ |
||
| 66 | 66 | $dir = dirname($this->getReflection()->getFileName()); |
| 67 | 67 | |
| 68 | 68 | // ...check if extension template is used |
| 69 | - if (is_file($dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $templateFile)) { |
|
| 70 | - $templateFile = $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $templateFile; |
|
| 69 | + if (is_file($dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.$templateFile)) { |
|
| 70 | + $templateFile = $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.$templateFile; |
|
| 71 | 71 | |
| 72 | - } else if (is_file($dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $templateFile . '.latte')) { |
|
| 73 | - $templateFile = $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $templateFile . '.latte'; |
|
| 72 | + } else if (is_file($dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.$templateFile.'.latte')) { |
|
| 73 | + $templateFile = $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.$templateFile.'.latte'; |
|
| 74 | 74 | |
| 75 | 75 | } else { |
| 76 | 76 | // ...if not throw exception |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | use Nette\Application; |
| 20 | 20 | use Nette\Localization; |
| 21 | - |
|
| 22 | 21 | use IPub\Widgets\Exceptions; |
| 23 | 22 | |
| 24 | 23 | /** |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $dir = dirname($this->getReflection()->getFileName()); |
| 57 | 57 | |
| 58 | 58 | // ...try to get base component template file |
| 59 | - $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 59 | + $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.'default.latte'; |
|
| 60 | 60 | $this->template->setFile($templateFile); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use Nette\Application; |
| 20 | 20 | use Nette\Bridges; |
| 21 | 21 | use Nette\Localization; |
| 22 | - |
|
| 23 | 22 | use IPub\Widgets; |
| 24 | 23 | use IPub\Widgets\Decorators; |
| 25 | 24 | use IPub\Widgets\Exceptions; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // Register widget to manager and group |
| 134 | 134 | foreach ($groups as $group) { |
| 135 | - $widgetsManager->addSetup('register', ['@' . $serviceName, $serviceName, $group]); |
|
| 135 | + $widgetsManager->addSetup('register', ['@'.$serviceName, $serviceName, $group]); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | // Get all registered widgets decorators |
| 143 | 143 | foreach (array_keys($builder->findByTag(self::TAG_WIDGET_DECORATOR)) as $serviceName) { |
| 144 | 144 | // Register decorator to manager |
| 145 | - $decoratorsManager->addSetup('register', ['@' . $serviceName, $serviceName]); |
|
| 145 | + $decoratorsManager->addSetup('register', ['@'.$serviceName, $serviceName]); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // Get widgets filters manager |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $priority = 999; |
| 154 | 154 | |
| 155 | 155 | // Register filter to manager |
| 156 | - $filtersManager->addSetup('register', ['@' . $serviceName, $serviceName, $priority]); |
|
| 156 | + $filtersManager->addSetup('register', ['@'.$serviceName, $serviceName, $priority]); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // Get widgets control provider |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $dir = dirname($this->getReflection()->getFileName()); |
| 167 | 167 | |
| 168 | 168 | // ...try to get base component template file |
| 169 | - $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 169 | + $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.'default.latte'; |
|
| 170 | 170 | $this->template->setFile($templateFile); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $widget = $factory->create($data); |
| 309 | 309 | |
| 310 | 310 | // Add widget component to container/position |
| 311 | - $positionContainer->addComponent($widget, ($widget->getName() . spl_object_hash($data))); |
|
| 311 | + $positionContainer->addComponent($widget, ($widget->getName().spl_object_hash($data))); |
|
| 312 | 312 | |
| 313 | 313 | return $widget; |
| 314 | 314 | } |
@@ -21,14 +21,12 @@ |
||
| 21 | 21 | use Nette\ComponentModel; |
| 22 | 22 | use Nette\Localization; |
| 23 | 23 | use Nette\Utils; |
| 24 | - |
|
| 25 | 24 | use IPub\Widgets\Application\UI; |
| 26 | 25 | use IPub\Widgets\Decorators; |
| 27 | 26 | use IPub\Widgets\Entities; |
| 28 | 27 | use IPub\Widgets\Exceptions; |
| 29 | 28 | use IPub\Widgets\Managers; |
| 30 | 29 | use IPub\Widgets\Widgets; |
| 31 | -use Tracy\Debugger; |
|
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | 32 | * Widgets container control definition |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ->render(); |
| 126 | 126 | |
| 127 | 127 | // Modify widget name |
| 128 | - $name = $title . mb_substr($name, $pos); |
|
| 128 | + $name = $title.mb_substr($name, $pos); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // If widget name has subtitle... |
@@ -142,19 +142,19 @@ discard block |
||
| 142 | 142 | ->render(); |
| 143 | 143 | |
| 144 | 144 | // Split name to title & subtitle |
| 145 | - $name = $title . $subtitle; |
|
| 145 | + $name = $title.$subtitle; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // Set badge if exists |
| 149 | 149 | if ($badge = $this->data->getBadge()) { |
| 150 | 150 | $badge = Utils\Html::el('i') |
| 151 | - ->addAttributes(['class' => 'badge badge-' . $badge]); |
|
| 151 | + ->addAttributes(['class' => 'badge badge-'.$badge]); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Set icon if exists |
| 155 | 155 | if ($icon = $this->data->getIcon()) { |
| 156 | 156 | $icon = Utils\Html::el('i') |
| 157 | - ->addAttributes(['class' => 'ipub-icon ipub-icon-' . $icon]); |
|
| 157 | + ->addAttributes(['class' => 'ipub-icon ipub-icon-'.$icon]); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // Assign basic widget data to template |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $dir = dirname($this->getReflection()->getFileName()); |
| 184 | 184 | |
| 185 | 185 | // ...try to get base component template file |
| 186 | - $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 186 | + $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.'default.latte'; |
|
| 187 | 187 | $this->template->setFile($templateFile); |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | use Nette\ComponentModel; |
| 22 | 22 | use Nette\Localization; |
| 23 | 23 | use Nette\Utils; |
| 24 | - |
|
| 25 | 24 | use IPub\Widgets; |
| 26 | 25 | use IPub\Widgets\Entities; |
| 27 | 26 | use IPub\Widgets\Exceptions; |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | |
| 94 | 94 | return "/* line $node->startLine */ " |
| 95 | 95 | . ($name[0] === '$' ? "if (is_object($name)) \$_tmp = $name; else " : '') |
| 96 | - . '$_tmp = $this->global->uiControl->getComponent('. $prefix . $name . '); ' |
|
| 96 | + . '$_tmp = $this->global->uiControl->getComponent('.$prefix.$name.'); ' |
|
| 97 | 97 | . 'if ($_tmp instanceof Nette\Application\UI\IRenderable) $_tmp->redrawControl(NULL, FALSE); ' |
| 98 | 98 | . ($node->modifiers === '' |
| 99 | 99 | ? "\$_tmp->$method($param);" |