-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactored mailer module to 2.0 style #2849
Changes from 10 commits
c718f0e
6e6ee56
5193772
0322d1c
bb87dba
591cebf
8001862
6d9b3d3
7f2ac37
59c68db
b480870
7473bc1
b61435e
e8a40ab
0f724d4
0372eff
776b5ec
93e9470
a4c00a9
3f0ff10
37d1e58
3733467
fd53812
221556b
efc4b64
d69750b
187543e
330b1f9
bbf06b9
1ca430e
d6ad7ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,12 @@ class LinkContainer implements LinkContainerInterface | |
* @var Translator | ||
*/ | ||
private $translator; | ||
|
||
/** | ||
* @var RouterInterface | ||
*/ | ||
private $router; | ||
|
||
/** | ||
* @var PermissionApi | ||
*/ | ||
|
@@ -87,8 +89,7 @@ private function getAdmin() | |
'text' => $this->translator->__('Create new block'), | ||
'icon' => 'plus' | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is removed because it was checked twice.
became
|
||
} | ||
if ($this->permissionApi->hasPermission('ZikulaBlocksModule::', '::', ACCESS_ADD)) { | ||
|
||
$links[] = [ | ||
'url' => $this->router->generate('zikulablocksmodule_position_edit'), | ||
'text' => $this->translator->__('Create new block position'), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,7 @@ public function viewAction(Request $request) | |
* @Template | ||
* | ||
* @param Request $request | ||
* @throws AccessDeniedException Thrown if the user doesn't have admin access to the module | ||
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | ||
*/ | ||
public function configAction(Request $request) | ||
|
@@ -127,22 +128,23 @@ public function configAction(Request $request) | |
} | ||
|
||
$form = $this->createFormBuilder($this->getVars()) | ||
->add('collapseable', 'checkbox', ['label' => __('Enable block collapse icons'), | ||
->add('collapseable', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', [ | ||
'label' => $this->__('Enable block collapse icons'), | ||
'required' => false | ||
]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you for correcting these. |
||
->add('save', 'submit', ['label' => 'Save']) | ||
->add('cancel', 'submit', ['label' => 'Cancel']) | ||
->add('save', 'Symfony\Component\Form\Extension\Core\Type\SubmitType', ['label' => $this->__('Save')]) | ||
->add('cancel', 'Symfony\Component\Form\Extension\Core\Type\SubmitType', ['label' => $this->__('Cancel')]) | ||
->getForm(); | ||
|
||
$form->handleRequest($request); | ||
|
||
if ($form->isValid()) { | ||
if ($form->get('save')->isClicked()) { | ||
$this->setVars($form->getData()); | ||
$this->addFlash('status', __('Done! Module configuration updated.')); | ||
$this->addFlash('status', $this->__('Done! Module configuration updated.')); | ||
} | ||
if ($form->get('cancel')->isClicked()) { | ||
$this->addFlash('status', __('Operation cancelled.')); | ||
$this->addFlash('status', $this->__('Operation cancelled.')); | ||
} | ||
|
||
return $this->redirect($this->generateUrl('zikulablocksmodule_admin_view')); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
<?php | ||
/** | ||
* This file is part of the Zikula package. | ||
* | ||
* Copyright Zikula Foundation - http://zikula.org/ | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use the new header from now on. https://github.com/zikula/core/wiki/Coding-Standards#php-files |
||
|
||
namespace Zikula\BlocksModule\DependencyInjection; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,5 @@ | |
</div> | ||
{{ form_end(form) }} | ||
</div> | ||
|
||
</div> | ||
{{ adminFooter() }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
</div> | ||
{{ form_end(form) }} | ||
</div> | ||
|
||
</div> | ||
{{ adminFooter() }} | ||
<script type="text/javascript"> | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to decide here. I usually leave no space between property declarations. Otherwise we will keep 'fixing' each others code 😉 @cmfcmf @Guite others? opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep the blank lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any way to make styleCI check this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find a way.