@@ -19,7 +19,6 @@ discard block |
||
| 19 | 19 | use Application\Controller\Traits\ControllerTranslatorTrait; |
| 20 | 20 | use Application\Controller\Traits\ControllerActiontitlesTrait; |
| 21 | 21 | use Application\Controller\Traits\ControllerToolbarTrait; |
| 22 | - |
|
| 23 | 22 | use Admin\Module as AdminModule; |
| 24 | 23 | use Admin\Form\RequestPasswordResetForm; |
| 25 | 24 | use Admin\Form\ResetPasswordForm; |
@@ -28,14 +27,11 @@ discard block |
||
| 28 | 27 | use Admin\Form\UserDataForm; |
| 29 | 28 | use Admin\Form\UserProfileForm; |
| 30 | 29 | use Admin\Model\UserProfile; |
| 31 | - |
|
| 32 | 30 | use Zend\Crypt\Password\Bcrypt; |
| 33 | 31 | use Zend\Stdlib\ResponseInterface as Response; |
| 34 | - |
|
| 35 | 32 | use Zend\View\Model\ViewModel; |
| 36 | 33 | use Zend\Mvc\MvcEvent; |
| 37 | 34 | use Zend\ServiceManager\ServiceLocatorInterface; |
| 38 | - |
|
| 39 | 35 | use ZfcUser\Controller\UserController; |
| 40 | 36 | use ZfcUser\Controller\Plugin\ZfcUserAuthentication; |
| 41 | 37 | |
@@ -377,8 +377,8 @@ discard block |
||
| 377 | 377 | $request = $this->getRequest(); |
| 378 | 378 | //$service = $this->getUserService(); |
| 379 | 379 | $service = \Application\Module::getService('zfcuser_user_service'); |
| 380 | - $form = new RequestPasswordResetForm(null, $options); |
|
| 381 | - $translator = $this->getTranslator(); |
|
| 380 | + $form = new RequestPasswordResetForm(null, $options); |
|
| 381 | + $translator = $this->getTranslator(); |
|
| 382 | 382 | |
| 383 | 383 | // if password reset is disabled |
| 384 | 384 | if (!$config['zfcuser']['enable_passwordreset']) { |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $redirect = false; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - $redirectUrl = $this->url()->fromRoute('userrequestpasswordreset') . ($redirect ? '?redirect=' . rawurlencode($redirect) : ''); |
|
| 394 | + $redirectUrl = $this->url()->fromRoute('userrequestpasswordreset').($redirect ? '?redirect='.rawurlencode($redirect) : ''); |
|
| 395 | 395 | |
| 396 | 396 | if (!$request->isPost()) { |
| 397 | 397 | return array( |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | sprintf($translator->translate("password reset email has been sent to user '%s'"), $identity) |
| 440 | 440 | ); |
| 441 | 441 | |
| 442 | - return $this->redirect()->toUrl($this->url()->fromRoute($config["zfcuser_registration_redirect_route"]) . ($redirect ? '?redirect='. rawurlencode($redirect) : '')); |
|
| 442 | + return $this->redirect()->toUrl($this->url()->fromRoute($config["zfcuser_registration_redirect_route"]).($redirect ? '?redirect='.rawurlencode($redirect) : '')); |
|
| 443 | 443 | |
| 444 | 444 | } |
| 445 | 445 | |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | $request = $this->getRequest(); |
| 466 | 466 | //$service = $this->getUserService(); |
| 467 | 467 | $service = \Application\Module::getService('zfcuser_user_service'); |
| 468 | - $form = new ResetPasswordForm(null, $options); |
|
| 469 | - $translator = $this->getTranslator(); |
|
| 468 | + $form = new ResetPasswordForm(null, $options); |
|
| 469 | + $translator = $this->getTranslator(); |
|
| 470 | 470 | |
| 471 | 471 | // if password reset is disabled |
| 472 | 472 | if (!$config['zfcuser']['enable_passwordreset']) { |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | $redirect = false; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | - $redirectUrl = $this->url()->fromRoute(static::ROUTE_LOGIN) . ($redirect ? '?redirect=' . rawurlencode($redirect) : ''); |
|
| 482 | + $redirectUrl = $this->url()->fromRoute(static::ROUTE_LOGIN).($redirect ? '?redirect='.rawurlencode($redirect) : ''); |
|
| 483 | 483 | |
| 484 | - if (!$request->isPost() ) { |
|
| 484 | + if (!$request->isPost()) { |
|
| 485 | 485 | |
| 486 | 486 | $user = false; |
| 487 | 487 | $userId = (int) $this->params()->fromRoute('user_id'); |
@@ -490,14 +490,14 @@ discard block |
||
| 490 | 490 | $userTable = \Application\Module::getService('zfcuser_user_mapper'); |
| 491 | 491 | $user = $userTable->findById($userId); |
| 492 | 492 | |
| 493 | - if (!$user ) { |
|
| 493 | + if (!$user) { |
|
| 494 | 494 | $this->flashMessenger()->addWarningMessage( |
| 495 | 495 | sprintf($translator->translate("invalid request"), '') |
| 496 | 496 | ); |
| 497 | 497 | return $this->redirect()->toUrl($redirectUrl); |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | - if (empty($resetToken) || ($resetToken != $user->getToken()) ) { |
|
| 500 | + if (empty($resetToken) || ($resetToken != $user->getToken())) { |
|
| 501 | 501 | $this->flashMessenger()->addWarningMessage( |
| 502 | 502 | sprintf($translator->translate("invalid request"), '') |
| 503 | 503 | ); |
@@ -526,23 +526,23 @@ discard block |
||
| 526 | 526 | $userTable = \Application\Module::getService('zfcuser_user_mapper'); |
| 527 | 527 | $user = $userTable->findByEmail($userId); |
| 528 | 528 | |
| 529 | - if (!$user ) { |
|
| 529 | + if (!$user) { |
|
| 530 | 530 | $this->flashMessenger()->addWarningMessage( |
| 531 | 531 | sprintf($translator->translate("invalid request"), $userId) |
| 532 | 532 | ); |
| 533 | 533 | return $this->redirect()->toUrl($redirectUrl); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if (empty($resetToken) || ($resetToken != $user->getToken()) ) { |
|
| 536 | + if (empty($resetToken) || ($resetToken != $user->getToken())) { |
|
| 537 | 537 | $this->flashMessenger()->addWarningMessage( |
| 538 | 538 | sprintf($translator->translate("invalid request"), $resetToken) |
| 539 | 539 | ); |
| 540 | 540 | return $this->redirect()->toUrl($redirectUrl); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - $form->setData((array)$this->params()->fromPost()); |
|
| 543 | + $form->setData((array) $this->params()->fromPost()); |
|
| 544 | 544 | |
| 545 | - if (!$form->isValid() ) { |
|
| 545 | + if (!$form->isValid()) { |
|
| 546 | 546 | |
| 547 | 547 | return array( |
| 548 | 548 | 'user' => $user, |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | ); |
| 569 | 569 | return $this->redirect()->toUrl( |
| 570 | 570 | $this->url()->fromRoute($config["zfcuser_registration_redirect_route"]) |
| 571 | - . ($redirect ? '?redirect='. rawurlencode($redirect) : '') |
|
| 571 | + . ($redirect ? '?redirect='.rawurlencode($redirect) : '') |
|
| 572 | 572 | ); |
| 573 | 573 | |
| 574 | 574 | } |
@@ -603,11 +603,11 @@ discard block |
||
| 603 | 603 | return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - $form = new UserDataForm(); |
|
| 607 | - $translator = $this->getTranslator(); |
|
| 606 | + $form = new UserDataForm(); |
|
| 607 | + $translator = $this->getTranslator(); |
|
| 608 | 608 | |
| 609 | 609 | /** @var \Admin\Entity\User $oIdentity */ |
| 610 | - $oIdentity = $this->zfcUserAuthentication()->getIdentity(); |
|
| 610 | + $oIdentity = $this->zfcUserAuthentication()->getIdentity(); |
|
| 611 | 611 | /** @var \Admin\Model\UserData $oUser */ |
| 612 | 612 | $oUser = new \Admin\Model\UserData(); |
| 613 | 613 | |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | |
| 617 | 617 | $form->bind($oUser); |
| 618 | 618 | |
| 619 | - if (!$this->getRequest()->isPost() ) { |
|
| 619 | + if (!$this->getRequest()->isPost()) { |
|
| 620 | 620 | |
| 621 | 621 | return new ViewModel( |
| 622 | 622 | array( |
@@ -629,10 +629,10 @@ discard block |
||
| 629 | 629 | |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - $data = (array)$this->params()->fromPost(); |
|
| 632 | + $data = (array) $this->params()->fromPost(); |
|
| 633 | 633 | $form->setData($data); |
| 634 | 634 | |
| 635 | - if (!$form->isValid() ) { |
|
| 635 | + if (!$form->isValid()) { |
|
| 636 | 636 | |
| 637 | 637 | $this->flashMessenger()->addWarningMessage( |
| 638 | 638 | $translator->translate("user data could not be changed") |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | $translator->translate("user data has been changed") |
| 659 | 659 | ); |
| 660 | 660 | |
| 661 | - if ($this->getRequest()->isXmlHttpRequest() ) { |
|
| 661 | + if ($this->getRequest()->isXmlHttpRequest()) { |
|
| 662 | 662 | return new ViewModel( |
| 663 | 663 | array( |
| 664 | 664 | 'showForm' => false, |
@@ -688,19 +688,19 @@ discard block |
||
| 688 | 688 | return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | - $form = new UserProfileForm(); |
|
| 692 | - $translator = $this->getTranslator(); |
|
| 691 | + $form = new UserProfileForm(); |
|
| 692 | + $translator = $this->getTranslator(); |
|
| 693 | 693 | /** |
| 694 | 694 | * @var \Zend\Http\PhpEnvironment\Request|\Zend\Http\Request $request |
| 695 | 695 | */ |
| 696 | 696 | $request = $this->getRequest(); |
| 697 | - $user = $this->zfcUserAuthentication()->getIdentity(); |
|
| 698 | - $userId = (int) $user->getId(); |
|
| 697 | + $user = $this->zfcUserAuthentication()->getIdentity(); |
|
| 698 | + $userId = (int) $user->getId(); |
|
| 699 | 699 | $profile = new UserProfile; |
| 700 | 700 | $profile->load($userId); |
| 701 | 701 | $form->bind($profile); |
| 702 | 702 | |
| 703 | - if (!$this->getRequest()->isPost() ) { |
|
| 703 | + if (!$this->getRequest()->isPost()) { |
|
| 704 | 704 | |
| 705 | 705 | return array( |
| 706 | 706 | 'showForm' => true, |
@@ -711,10 +711,10 @@ discard block |
||
| 711 | 711 | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | - $data = (array)$this->params()->fromPost(); |
|
| 714 | + $data = (array) $this->params()->fromPost(); |
|
| 715 | 715 | $form->setData($data); |
| 716 | 716 | |
| 717 | - if (!$form->isValid() ) { |
|
| 717 | + if (!$form->isValid()) { |
|
| 718 | 718 | |
| 719 | 719 | $this->flashMessenger()->addWarningMessage( |
| 720 | 720 | $translator->translate("user profile data could not be changed") |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | $translator->translate("user profile data has been changed") |
| 736 | 736 | ); |
| 737 | 737 | |
| 738 | - if ($request->isXmlHttpRequest() ) { |
|
| 738 | + if ($request->isXmlHttpRequest()) { |
|
| 739 | 739 | $response = array( |
| 740 | 740 | 'showForm' => false, |
| 741 | 741 | 'user' => $user, |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | namespace Admin\Model; |
| 17 | 17 | |
| 18 | -use Zend\Crypt\Password\Bcrypt; |
|
| 19 | 18 | use Zend\InputFilter\InputFilter; |
| 20 | 19 | use Zend\InputFilter\Factory as InputFactory; |
| 21 | 20 | use Zend\InputFilter\InputFilterAwareInterface; |
@@ -39,14 +39,14 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function exchangeArray($data) |
| 41 | 41 | { |
| 42 | - $this->clients_id = (isset($data['clients_id'])) ? $data['clients_id'] : null; |
|
| 42 | + $this->clients_id = (isset($data['clients_id'])) ? $data['clients_id'] : null; |
|
| 43 | 43 | $this->name = (isset($data['name'])) ? $data['name'] : null; |
| 44 | 44 | $this->extraname = (isset($data['extraname'])) ? $data['extraname'] : null; |
| 45 | 45 | $this->homepage = (isset($data['homepage'])) ? $data['homepage'] : null; |
| 46 | 46 | $this->email = (isset($data['email'])) ? $data['email'] : null; |
| 47 | - $this->contact = (isset($data['contact'])) ? $data['contact'] : null; |
|
| 47 | + $this->contact = (isset($data['contact'])) ? $data['contact'] : null; |
|
| 48 | 48 | $this->phone = (isset($data['phone'])) ? $data['phone'] : null; |
| 49 | - $this->statistics = (isset($data['statistics'])) ? $data['statistics'] : null; |
|
| 49 | + $this->statistics = (isset($data['statistics'])) ? $data['statistics'] : null; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function getArrayCopy() |
@@ -20,8 +20,6 @@ |
||
| 20 | 20 | use Zend\InputFilter\Factory as InputFactory; |
| 21 | 21 | use Zend\InputFilter\InputFilterAwareInterface; |
| 22 | 22 | use Zend\InputFilter\InputFilterInterface; |
| 23 | -use Zend\ServiceManager\ServiceLocator; |
|
| 24 | -use Zend\ServiceManager\ServiceLocatorInterface; |
|
| 25 | 23 | use Zend\ServiceManager\ServiceManager; |
| 26 | 24 | use Zend\ServiceManager\ServiceManagerInterface; |
| 27 | 25 | use Zend\ServiceManager\ServiceLocatorAwareInterface; |
@@ -54,30 +54,30 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function exchangeArray($data = array(), $forceEncryptPassword = false) |
| 56 | 56 | { |
| 57 | - if (isset($data['id']) && !empty($data["id"]) ) { |
|
| 57 | + if (isset($data['id']) && !empty($data["id"])) { |
|
| 58 | 58 | $this->id = ($data['id']); |
| 59 | 59 | $this->user_id = ($data['id']); |
| 60 | - } elseif (isset($data['user_id']) && !empty($data["user_id"]) ) { |
|
| 60 | + } elseif (isset($data['user_id']) && !empty($data["user_id"])) { |
|
| 61 | 61 | $this->id = ($data['user_id']); |
| 62 | 62 | $this->user_id = ($data['user_id']); |
| 63 | 63 | } |
| 64 | - $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
| 65 | - $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
| 66 | - if (isset($data['displayName']) ) { |
|
| 64 | + $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
| 65 | + $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
| 66 | + if (isset($data['displayName'])) { |
|
| 67 | 67 | $this->display_name = $data['displayName']; |
| 68 | 68 | $this->displayName = $data['displayName']; |
| 69 | - } elseif (isset($data['display_name']) ) { |
|
| 69 | + } elseif (isset($data['display_name'])) { |
|
| 70 | 70 | $this->display_name = $data['display_name']; |
| 71 | 71 | $this->displayName = $data['display_name']; |
| 72 | 72 | } |
| 73 | - if (isset($data["password"]) && $forceEncryptPassword ) { |
|
| 73 | + if (isset($data["password"]) && $forceEncryptPassword) { |
|
| 74 | 74 | $bcrypt = new Bcrypt; |
| 75 | 75 | $bcrypt->setCost(null); // @TODO $this->getUserService()->getOptions()->getPasswordCost()); |
| 76 | 76 | $data["password"] = $bcrypt->create($data['password']); |
| 77 | 77 | } |
| 78 | - $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
| 78 | + $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
| 79 | 79 | $this->state = (isset($data['state'])) ? $data['state'] : $this->state; |
| 80 | - $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
| 80 | + $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
| 81 | 81 | $this->token = (isset($data['token'])) ? $data['token'] : $this->token; |
| 82 | 82 | |
| 83 | 83 | return $this; |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | namespace Admin\Model; |
| 17 | 17 | |
| 18 | 18 | use Admin\Module as AdminModule; |
| 19 | - |
|
| 20 | 19 | use Zend\InputFilter\InputFilter; |
| 21 | 20 | use Zend\InputFilter\Factory as InputFactory; |
| 22 | 21 | use Zend\InputFilter\InputFilterAwareInterface; |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | protected $serviceManager; |
| 42 | 42 | protected $serviceLocator; |
| 43 | 43 | |
| 44 | - public function load( $id ) |
|
| 44 | + public function load($id) |
|
| 45 | 45 | { |
| 46 | - if (!$id ) { |
|
| 46 | + if (!$id) { |
|
| 47 | 47 | return $this; |
| 48 | 48 | } |
| 49 | 49 | $this->user_id = $id; |
@@ -79,17 +79,17 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function exchangeArray($data) |
| 81 | 81 | { |
| 82 | - $this->user_id = (isset($data['user_id'])) ? $data['user_id'] : null; |
|
| 82 | + $this->user_id = (isset($data['user_id'])) ? $data['user_id'] : null; |
|
| 83 | 83 | |
| 84 | - $this->street = (isset($data['street'])) ? $data['street'] : ''; |
|
| 84 | + $this->street = (isset($data['street'])) ? $data['street'] : ''; |
|
| 85 | 85 | $this->city = (isset($data['city'])) ? $data['city'] : ''; |
| 86 | - $this->country = (isset($data['country'])) ? $data['country'] : ''; |
|
| 87 | - $this->phone = (isset($data['phone'])) ? $data['phone'] : ''; |
|
| 86 | + $this->country = (isset($data['country'])) ? $data['country'] : ''; |
|
| 87 | + $this->phone = (isset($data['phone'])) ? $data['phone'] : ''; |
|
| 88 | 88 | $this->cell = (isset($data['cell'])) ? $data['cell'] : ''; |
| 89 | 89 | |
| 90 | 90 | $this->twitter = (isset($data['twitter'])) ? $data['twitter'] : ''; |
| 91 | 91 | $this->facebook = (isset($data['facebook'])) ? $data['facebook'] : ''; |
| 92 | - $this->skype = (isset($data['skype'])) ? $data['skype'] : ''; |
|
| 92 | + $this->skype = (isset($data['skype'])) ? $data['skype'] : ''; |
|
| 93 | 93 | $this->icq = (isset($data['icq'])) ? $data['icq'] : ''; |
| 94 | 94 | |
| 95 | 95 | } |
@@ -15,16 +15,10 @@ |
||
| 15 | 15 | |
| 16 | 16 | namespace UIComponents\View\Helper; |
| 17 | 17 | |
| 18 | -use RecursiveIteratorIterator; |
|
| 19 | -use Zend\EventManager\EventManager; |
|
| 20 | 18 | use Zend\EventManager\EventManagerAwareInterface; |
| 21 | -use Zend\EventManager\EventManagerInterface; |
|
| 22 | 19 | use Zend\I18n\Translator\TranslatorAwareInterface; |
| 23 | 20 | use Zend\Navigation\Page\AbstractPage; |
| 24 | -use Zend\Navigation\AbstractContainer; |
|
| 25 | -use Zend\Permissions\Acl; |
|
| 26 | 21 | use Zend\ServiceManager\ServiceLocatorAwareInterface; |
| 27 | -use Zend\ServiceManager\ServiceLocatorInterface; |
|
| 28 | 22 | use Zend\View; |
| 29 | 23 | use Zend\View\Exception; |
| 30 | 24 | use \UIComponents\Translator\TranslatorAwareInterfaceTrait; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | } catch (\Exception $e) { |
| 153 | 153 | |
| 154 | - $msg = get_class($e) . ': ' . $e->getMessage() . "\n" . $e->getTraceAsString(); |
|
| 154 | + $msg = get_class($e).': '.$e->getMessage()."\n".$e->getTraceAsString(); |
|
| 155 | 155 | trigger_error($msg, E_USER_ERROR); |
| 156 | 156 | return ''; |
| 157 | 157 | |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | /** @var \Zend\View\Helper\EscapeHtml $escaper */ |
| 196 | 196 | $escaper = $this->view->plugin('escapeHtml'); |
| 197 | - $label = $escaper($label); |
|
| 197 | + $label = $escaper($label); |
|
| 198 | 198 | |
| 199 | - return '<a' . $this->htmlAttribs($attribs) . '>' . $label . '</a>'; |
|
| 199 | + return '<a'.$this->htmlAttribs($attribs).'>'.$label.'</a>'; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $prefix = get_class($this); |
| 213 | 213 | $prefix = strtolower(trim(substr($prefix, strrpos($prefix, '\\')), '\\')); |
| 214 | 214 | |
| 215 | - return $prefix . '-' . $value; |
|
| 215 | + return $prefix.'-'.$value; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | // |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function buildComponent() { |
| 226 | 226 | $html = ' '.__CLASS__.' '; |
| 227 | - if ( empty($this->getTagname()) ) { |
|
| 227 | + if (empty($this->getTagname())) { |
|
| 228 | 228 | return ''; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | $body = $this->getContent(); |
| 236 | 236 | |
| 237 | 237 | $content = (array($header, $body, $footer)); |
| 238 | - if ( is_array($body) && !isset($body["tagname"])) { |
|
| 238 | + if (is_array($body) && !isset($body["tagname"])) { |
|
| 239 | 239 | $content = array_merge(array($header), ($body), array($footer)); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - $component = $this->_createElement($this->getTagname(), $this->getClassnames(), (array)$this->getAttributes(), $content); |
|
| 242 | + $component = $this->_createElement($this->getTagname(), $this->getClassnames(), (array) $this->getAttributes(), $content); |
|
| 243 | 243 | |
| 244 | 244 | return $component; |
| 245 | 245 | |
@@ -259,29 +259,29 @@ discard block |
||
| 259 | 259 | $html = ''; |
| 260 | 260 | $html .= '<'.$tagname.''.((isset($classnames) && !empty($classnames)) ? ' class="'.$classnames.'"' : '').' '.$this->htmlAttribs($attributes).'>'; |
| 261 | 261 | if (!empty($content)) { |
| 262 | - if ( $content instanceof AbstractHelper ) { |
|
| 262 | + if ($content instanceof AbstractHelper) { |
|
| 263 | 263 | $html .= $content->render(); |
| 264 | - } else if ( is_array($content) && isset($content['tagname']) ) { |
|
| 264 | + } else if (is_array($content) && isset($content['tagname'])) { |
|
| 265 | 265 | $html .= $this->_createElement( |
| 266 | 266 | $content['tagname'], |
| 267 | 267 | (isset($content['classnames']) && !empty($content['classnames']) ? $content['classnames'] : (isset($content['class']) && !empty($content['class']) ? $content['class'] : '')), |
| 268 | 268 | (isset($content['attributes']) && !empty($content['attributes']) ? $content['attributes'] : (isset($content['attr']) && !empty($content['attr']) ? $content['attr'] : '')), |
| 269 | 269 | (isset($content['content']) && !empty($content['content']) ? $content['content'] : '') |
| 270 | 270 | ); |
| 271 | - } else if ( is_array($content) ) { |
|
| 271 | + } else if (is_array($content)) { |
|
| 272 | 272 | foreach ($content as $key => $item) { |
| 273 | - if ( $item instanceof AbstractHelper ) { |
|
| 273 | + if ($item instanceof AbstractHelper) { |
|
| 274 | 274 | $html .= $item->render(); |
| 275 | - } else if ( is_array($item) && isset($item['tagname']) ) { |
|
| 275 | + } else if (is_array($item) && isset($item['tagname'])) { |
|
| 276 | 276 | $html .= $this->_createElement( |
| 277 | 277 | $item['tagname'], |
| 278 | 278 | (isset($item['classnames']) && !empty($item['classnames']) ? $item['classnames'] : (isset($item['class']) && !empty($item['class']) ? $item['class'] : '')), |
| 279 | - (array)(isset($item['attributes']) && !empty($item['attributes']) ? $item['attributes'] : (isset($item['attr']) && !empty($item['attr']) ? $item['attr'] : '')), |
|
| 279 | + (array) (isset($item['attributes']) && !empty($item['attributes']) ? $item['attributes'] : (isset($item['attr']) && !empty($item['attr']) ? $item['attr'] : '')), |
|
| 280 | 280 | (isset($item['content']) && !empty($item['content']) ? $item['content'] : '') |
| 281 | 281 | ); |
| 282 | - } else if ( is_array($item) ) { |
|
| 282 | + } else if (is_array($item)) { |
|
| 283 | 283 | foreach ($content as $key => $value) { |
| 284 | - $html .= (string)$value; |
|
| 284 | + $html .= (string) $value; |
|
| 285 | 285 | } |
| 286 | 286 | } else { |
| 287 | 287 | $html .= $item; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | * @param string $tagname |
| 317 | 317 | */ |
| 318 | 318 | public function setTagname($tagname) { |
| 319 | - if ( null !== $tagname ) { |
|
| 319 | + if (null !== $tagname) { |
|
| 320 | 320 | $this->tagname = $tagname; |
| 321 | 321 | } |
| 322 | 322 | return $this; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | * @param mixed $header |
| 338 | 338 | */ |
| 339 | 339 | public function setHeader($header) { |
| 340 | - if ( null !== $header ) { |
|
| 340 | + if (null !== $header) { |
|
| 341 | 341 | $this->header = $header; |
| 342 | 342 | } |
| 343 | 343 | return $this; |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | * @param mixed $footer |
| 359 | 359 | */ |
| 360 | 360 | public function setFooter($footer = null) { |
| 361 | - if ( null !== $footer ) { |
|
| 361 | + if (null !== $footer) { |
|
| 362 | 362 | $this->footer = $footer; |
| 363 | 363 | } |
| 364 | 364 | return $this; |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | * @return the $_DOMDoc |
| 389 | 389 | */ |
| 390 | 390 | public function getDOMDoc() { |
| 391 | - if ( ! $this->_DOMDoc instanceof \DOMDocument ) { |
|
| 391 | + if (!$this->_DOMDoc instanceof \DOMDocument) { |
|
| 392 | 392 | $this->_DOMDoc = new \DOMDocument(); |
| 393 | 393 | } |
| 394 | 394 | return $this->_DOMDoc; |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | */ |
| 93 | 93 | public function getTranslator() |
| 94 | 94 | { |
| 95 | - if (! $this->isTranslatorEnabled()) { |
|
| 95 | + if (!$this->isTranslatorEnabled()) { |
|
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * @param \Zend\I18n\Translator\TranslatorInterface $translator |
| 30 | 30 | * @return \UIComponents\Template\TemplateAbstract |
| 31 | 31 | */ |
| 32 | - public function __construct ($tags = false, $translator = null) |
|
| 32 | + public function __construct($tags = false, $translator = null) |
|
| 33 | 33 | { |
| 34 | 34 | return parent::__construct($tags, $translator); |
| 35 | 35 | } |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | * Needles (static) |
| 31 | 31 | * @var array |
| 32 | 32 | */ |
| 33 | - public $needles = array (); |
|
| 33 | + public $needles = array(); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Replacements (static) |
| 37 | 37 | * @var array |
| 38 | 38 | */ |
| 39 | - public $replacements = array (); |
|
| 39 | + public $replacements = array(); |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * dynamicNeedles (dynamic) |
| 43 | 43 | * @var array |
| 44 | 44 | */ |
| 45 | - public $dynamicNeedles = array (); |
|
| 45 | + public $dynamicNeedles = array(); |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * dynamicReplacements (dynamic) |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - public $dynamicReplacements = array (); |
|
| 51 | + public $dynamicReplacements = array(); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Dynamic counter |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * Tags array (for dynamic blocks); |
| 61 | 61 | * @var array |
| 62 | 62 | */ |
| 63 | - public $tags = array ( |
|
| 63 | + public $tags = array( |
|
| 64 | 64 | 'static' => '{%s}', |
| 65 | 65 | 'start' => '<!-- BEGIN:BLOCK -->', |
| 66 | 66 | 'end' => '<!-- END:BLOCK -->' |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param \Zend\I18n\Translator\TranslatorInterface $translator |
| 80 | 80 | * @return \UIComponents\Template\TemplateAbstract |
| 81 | 81 | */ |
| 82 | - public function __construct ($tags = false, $translator = null) |
|
| 82 | + public function __construct($tags = false, $translator = null) |
|
| 83 | 83 | { |
| 84 | 84 | if (is_array($tags)) |
| 85 | 85 | { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param $sDomain string Sets the domain to use for template translations |
| 103 | 103 | * @return self |
| 104 | 104 | */ |
| 105 | - public function setDomain ($sDomain) |
|
| 105 | + public function setDomain($sDomain) |
|
| 106 | 106 | { |
| 107 | 107 | $this->_sDomain = $sDomain; |
| 108 | 108 | return $this; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @param $encoding string Encoding to set |
| 143 | 143 | * @return self |
| 144 | 144 | */ |
| 145 | - public function setEncoding ($encoding) |
|
| 145 | + public function setEncoding($encoding) |
|
| 146 | 146 | { |
| 147 | 147 | $this->_encoding = $encoding; |
| 148 | 148 | return $this; |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | public function reset() |
| 168 | 168 | { |
| 169 | 169 | $this->dynamicContent = 0; |
| 170 | - $this->needles = array (); |
|
| 171 | - $this->replacements = array (); |
|
| 172 | - $this->dynamicNeedles = array (); |
|
| 173 | - $this->dynamicReplacements = array (); |
|
| 170 | + $this->needles = array(); |
|
| 171 | + $this->replacements = array(); |
|
| 172 | + $this->dynamicNeedles = array(); |
|
| 173 | + $this->dynamicReplacements = array(); |
|
| 174 | 174 | return $this; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | unset ($pieces[0][0]); |
| 216 | 216 | |
| 217 | 217 | //generate dynamic blocks |
| 218 | - for ($a = 0; $a < $this->dynamicContent; $a ++) { |
|
| 218 | + for ($a = 0; $a < $this->dynamicContent; $a++) { |
|
| 219 | 219 | $content .= str_replace($this->dynamicNeedles[$a], $this->dynamicReplacements[$a], $pieces[1][0]); |
| 220 | 220 | } |
| 221 | 221 | unset ($pieces[1][0]); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | if ($this->_encoding != "") |
| 231 | 231 | { |
| 232 | - $content = '<meta http-equiv="Content-Type" content="text/html; charset=' . $this->_encoding . '">' . "\n" . $content; |
|
| 232 | + $content = '<meta http-equiv="Content-Type" content="text/html; charset='.$this->_encoding.'">'."\n".$content; |
|
| 233 | 233 | //$content = str_replace("</head>", '<meta http-equiv="Content-Type" content="text/html; charset='.$this->_encoding.'">'."\n".'</head>', $content); |
| 234 | 234 | } |
| 235 | 235 | |
@@ -252,12 +252,12 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | // Be sure that php code stays unchanged |
| 254 | 254 | $php_matches = array(); |
| 255 | - $container = array(); |
|
| 255 | + $container = array(); |
|
| 256 | 256 | if (preg_match_all('/<\?(php)?((.)|(\s))*?\?>/i', $template, $php_matches)) { |
| 257 | 257 | $x = 0; |
| 258 | 258 | foreach ($php_matches[0] as $php_match) { |
| 259 | 259 | $x++; |
| 260 | - $template = str_replace ($php_match , "{PHP#".$x."#PHP}", $template); |
|
| 260 | + $template = str_replace($php_match, "{PHP#".$x."#PHP}", $template); |
|
| 261 | 261 | $container[$x] = $php_match; |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -267,14 +267,14 @@ discard block |
||
| 267 | 267 | preg_match_all("/".preg_quote($functionName, "/")."\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches); |
| 268 | 268 | |
| 269 | 269 | $matches = array_values(array_unique($matches[2])); |
| 270 | - for ($a = 0; $a < count($matches); $a ++) { |
|
| 270 | + for ($a = 0; $a < count($matches); $a++) { |
|
| 271 | 271 | $template = preg_replace("/".preg_quote($functionName, "/")."\\([\\\"\\']".preg_quote($matches[$a], "/")."[\\\"\\']\\)/s", $this->translate($matches[$a], $this->_sDomain), $template); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // Change back php placeholder |
| 275 | 275 | if (is_array($container)) { |
| 276 | 276 | foreach ($container as $x => $php_match) { |
| 277 | - $template = str_replace ("{PHP#".$x."#PHP}" , $php_match, $template); |
|
| 277 | + $template = str_replace("{PHP#".$x."#PHP}", $php_match, $template); |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | return $this; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $invokableClasses = [ ]; |
|
| 35 | + protected $invokableClasses = []; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Validate the plugin |