| @@ -27,12 +27,12 @@ | ||
| 27 | 27 | * | 
| 28 | 28 | * @param array $tags | 
| 29 | 29 | * @param \Zend\I18n\Translator\TranslatorInterface $translator | 
| 30 | - * @return \UIComponents\Template\TemplateAbstract | |
| 30 | + * @return \UIComponents\Template\TemplateAbstract | |
| 31 | 31 | */ | 
| 32 | 32 | public function __construct ($tags = false, $translator = null) | 
| 33 | -	{ | |
| 34 | - return parent::__construct($tags, $translator); | |
| 35 | - } | |
| 33 | +    { | |
| 34 | + return parent::__construct($tags, $translator); | |
| 35 | + } | |
| 36 | 36 | |
| 37 | 37 | } | 
| 38 | 38 | ?> | 
| 39 | 39 | \ No newline at end of file | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | */ | 
| 25 | 25 | abstract class TemplateAbstract implements TemplateInterface, TranslatorAwareInterface | 
| 26 | 26 |  { | 
| 27 | - use TranslatorAwareInterfaceTrait; | |
| 27 | + use TranslatorAwareInterfaceTrait; | |
| 28 | 28 | |
| 29 | 29 | /** | 
| 30 | 30 | * Needles (static) | 
| @@ -77,7 +77,7 @@ discard block | ||
| 77 | 77 | * | 
| 78 | 78 | * @param array $tags | 
| 79 | 79 | * @param \Zend\I18n\Translator\TranslatorInterface $translator | 
| 80 | - * @return \UIComponents\Template\TemplateAbstract | |
| 80 | + * @return \UIComponents\Template\TemplateAbstract | |
| 81 | 81 | */ | 
| 82 | 82 | public function __construct ($tags = false, $translator = null) | 
| 83 | 83 |      { | 
| @@ -189,8 +189,7 @@ discard block | ||
| 189 | 189 | if (!@ is_file($template)) | 
| 190 | 190 |          { | 
| 191 | 191 | $content = & $template; //template is a string (it is a reference to save memory!!!) | 
| 192 | - } | |
| 193 | - else | |
| 192 | + } else | |
| 194 | 193 |          { | 
| 195 | 194 |              $content = implode("", file($template)); //template is a file | 
| 196 | 195 | } | 
| @@ -233,10 +232,11 @@ discard block | ||
| 233 | 232 |              //$content = str_replace("</head>", '<meta http-equiv="Content-Type" content="text/html; charset='.$this->_encoding.'">'."\n".'</head>', $content); | 
| 234 | 233 | } | 
| 235 | 234 | |
| 236 | - if ($return) | |
| 237 | - return $content; | |
| 238 | - else | |
| 239 | - echo $content; | |
| 235 | +        if ($return) { | |
| 236 | + return $content; | |
| 237 | +        } else { | |
| 238 | + echo $content; | |
| 239 | + } | |
| 240 | 240 | } | 
| 241 | 241 | |
| 242 | 242 | /** | 
| @@ -22,44 +22,44 @@ | ||
| 22 | 22 | interface TemplateInterface | 
| 23 | 23 |  { | 
| 24 | 24 | |
| 25 | - /** | |
| 26 | - * Set Templates placeholders and values | |
| 27 | - * | |
| 28 | - * With this method you can replace the placeholders | |
| 29 | - * in the static templates with dynamic data. | |
| 30 | - * | |
| 31 | - * @param $which String 's' for Static or else dynamic | |
| 32 | - * @param $needle String Placeholder | |
| 33 | - * @param $replacement String Replacement String | |
| 34 | - * | |
| 35 | - * @return void | |
| 36 | - */ | |
| 37 | - public function set($which = 's', $needle, $replacement); | |
| 25 | + /** | |
| 26 | + * Set Templates placeholders and values | |
| 27 | + * | |
| 28 | + * With this method you can replace the placeholders | |
| 29 | + * in the static templates with dynamic data. | |
| 30 | + * | |
| 31 | + * @param $which String 's' for Static or else dynamic | |
| 32 | + * @param $needle String Placeholder | |
| 33 | + * @param $replacement String Replacement String | |
| 34 | + * | |
| 35 | + * @return void | |
| 36 | + */ | |
| 37 | + public function set($which = 's', $needle, $replacement); | |
| 38 | 38 | |
| 39 | - /** | |
| 40 | - * Iterate internal counter by one | |
| 41 | - * | |
| 42 | - * @return void | |
| 43 | - */ | |
| 44 | - public function next(); | |
| 39 | + /** | |
| 40 | + * Iterate internal counter by one | |
| 41 | + * | |
| 42 | + * @return void | |
| 43 | + */ | |
| 44 | + public function next(); | |
| 45 | 45 | |
| 46 | - /** | |
| 47 | - * Reset template data | |
| 48 | - * | |
| 49 | - * @return void | |
| 50 | - */ | |
| 51 | - public function reset(); | |
| 46 | + /** | |
| 47 | + * Reset template data | |
| 48 | + * | |
| 49 | + * @return void | |
| 50 | + */ | |
| 51 | + public function reset(); | |
| 52 | 52 | |
| 53 | - /** | |
| 54 | - * Generate the template and | |
| 55 | - * print/return it. (do translations sequentially to save memory!!!) | |
| 56 | - * | |
| 57 | - * @param $template string/file Template | |
| 58 | - * @param $return bool Return or print template | |
| 59 | - * | |
| 60 | - * @return string complete Template string | |
| 61 | - */ | |
| 62 | - public function generate($template, $return = 0); | |
| 53 | + /** | |
| 54 | + * Generate the template and | |
| 55 | + * print/return it. (do translations sequentially to save memory!!!) | |
| 56 | + * | |
| 57 | + * @param $template string/file Template | |
| 58 | + * @param $return bool Return or print template | |
| 59 | + * | |
| 60 | + * @return string complete Template string | |
| 61 | + */ | |
| 62 | + public function generate($template, $return = 0); | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | } | 
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | */ | 
| 23 | 23 |  trait ComponentClassnamesTrait { | 
| 24 | 24 | |
| 25 | - /** | |
| 25 | + /** | |
| 26 | 26 | * component's class-names | 
| 27 | 27 | * | 
| 28 | 28 | * @var string | 
| @@ -36,12 +36,12 @@ | ||
| 36 | 36 | */ | 
| 37 | 37 | protected $serviceLocator; | 
| 38 | 38 | |
| 39 | - /** | |
| 40 | - * Set the event manager. | |
| 41 | - * | |
| 42 | - * @param EventManagerInterface $events | |
| 43 | - * @return AbstractHelper | |
| 44 | - */ | |
| 39 | + /** | |
| 40 | + * Set the event manager. | |
| 41 | + * | |
| 42 | + * @param EventManagerInterface $events | |
| 43 | + * @return AbstractHelper | |
| 44 | + */ | |
| 45 | 45 | public function setEventManager(EventManagerInterface $events) | 
| 46 | 46 |      { | 
| 47 | 47 | $events->setIdentifiers([ | 
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | */ | 
| 62 | 62 | protected static $defaultRole; | 
| 63 | 63 | |
| 64 | - /** | |
| 64 | + /** | |
| 65 | 65 | * Sets ACL to use when iterating pages | 
| 66 | 66 | * | 
| 67 | 67 |       * Implements {@link HelperInterface::setAcl()}. | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | return false; | 
| 111 | 111 | } | 
| 112 | 112 | |
| 113 | - /** | |
| 113 | + /** | |
| 114 | 114 | * Sets ACL role(s) to use when iterating pages | 
| 115 | 115 | * | 
| 116 | 116 |       * Implements {@link HelperInterface::setRole()}. | 
| @@ -66,7 +66,9 @@ | ||
| 66 | 66 |          if ( isset($options["block"]) ) { | 
| 67 | 67 | $component->setBlock($options["block"]); | 
| 68 | 68 | } | 
| 69 | -        if ($component->getBlock()) $component->addClass('btn-block expanded'); | |
| 69 | +        if ($component->getBlock()) { | |
| 70 | +            $component->addClass('btn-block expanded'); | |
| 71 | + } | |
| 70 | 72 | |
| 71 | 73 | |
| 72 | 74 | |
| @@ -85,8 +85,12 @@ | ||
| 85 | 85 | $component->setActive($options["active"]); | 
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | -        if ($component->getBlock()) $component->addClass('btn-block expanded'); | |
| 89 | -        if ($component->getActive()) $component->addClass('active'); | |
| 88 | +        if ($component->getBlock()) { | |
| 89 | +            $component->addClass('btn-block expanded'); | |
| 90 | + } | |
| 91 | +        if ($component->getActive()) { | |
| 92 | +            $component->addClass('active'); | |
| 93 | + } | |
| 90 | 94 | |
| 91 | 95 |          if ($component->getTagname() == 'a') { | 
| 92 | 96 | $component->setAttributes(array_merge_recursive($component->getAttributes(), array( | 
| @@ -479,12 +479,12 @@ | ||
| 479 | 479 | ''.Locale::getDisplayLanguage(null). // ' - '.Locale::getDefault().' - '.Locale::getPrimaryLanguage(null).''. | 
| 480 | 480 | '<span class="caret"></span>'. | 
| 481 | 481 | '</a>'. | 
| 482 | - sprintf( | |
| 482 | + sprintf( | |
| 483 | 483 | '<ul%s>%s</ul>', | 
| 484 | 484 |                          ($subulclass) ? sprintf(' class="%s"', $subulclass) : '', | 
| 485 | 485 | $list | 
| 486 | - ). | |
| 487 | - '</li>'. | |
| 486 | + ). | |
| 487 | + '</li>'. | |
| 488 | 488 | '</ul>' | 
| 489 | 489 | ; | 
| 490 | 490 | |