-
Notifications
You must be signed in to change notification settings - Fork 67
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
AdminModule AdminInterfaceController - twig #2648
Conversation
$i++; | ||
|
||
if (System::isLegacyMode() && !empty($class) && isset($menuitem['class'])) { | ||
if ($menuitem['class'] == 'z-icon-es-add') { |
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.
Maybe replace these if blocks by a mapping array checking like if (in_array($menuitem['class'], array_keys($oldIconMap)))
.
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.
Yes this was copy & paste many thing's still not working I will be doing all issues you will point out so please comment what you think could be solved differently. This is very initial state we will need to work on it. I will update PR with issues and ideas to discuss.
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.
yes please - replace this entire if/else block with something faster. even a switch block would be faster, but a mapping array is the best idea.
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 have looked into this and I want to move all html to template - all css I will just pass them through controller to template with menu as array. I will also remove that old icon mapping as it is useless in case of twig modules we will just use icon class and drop mapping to "icon".
Very nice 👍 |
public function categorymenuAction($acid = null) | ||
{ | ||
|
||
if (!SecurityUtil::checkPermission('ZikulaAdminModule::', '::', ACCESS_ADMIN)) { |
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.
use new permissionApi - everywhere in this controller. I won't comment on every instance.
I don't understand what you mean here. Can you please explain more? |
moduleheader and modulelinks function are not only for admin for general purpose, those functions should be moved to other place best place is extension used to be in themes https://github.com/zikula/core/blob/1.4/src/system/ThemeModule/Resources/views/moduleheader.tpl |
Aha. I see. These probably need to be converted to proper Twig tags but I will need to look more closely at them to be sure. |
Well there is more of them (smarty plugins for module use etc not this PR) and some for sure will be better do as Twig tags some using controller. AdminModule -> own AdminInterfaceController + Twig tags Eventually instead of {{ render(controller('ZikulaAdminModule:AdminInterface:header')) }} To consider... it is bugging my head so I will write it down... |
also can you convert to use template namespaces: https://github.com/zikula/core/blob/1.4/src/docs/Core-2.0/Performance.md#use-namespace-notation-for-templates |
$update_show = true; | ||
$update_version = $onlineVersion; | ||
} else { | ||
$update_show = false; |
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.
this (and line 247) overwrites all previous values of $update_show
so why is it set previously?
👍 Need to do few things before and then I will do this one and will implement it in blocks module few days 2-3 |
{{ pageAddAsset('stylesheet', zasset('@ZikulaAdminModule:js/jQuery.mmenu-5.5.1/dist/core/css/jquery.mmenu.all.css')) }} | ||
{{ pageAddAsset('stylesheet', zasset('@ZikulaAdminModule:css/mmenu-hiddenpanel-customwidth.css')) }} | ||
|
||
{% macro draw(links, caller, module) %} {% for link in links %} |
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.
CS
Hi, I have just spend day with this and have focused on updatecheck - this how it looks now.
|
9419b72
to
13c7ee8
Compare
ping @Kaik |
ping @Kaik |
| Q | A | ----------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | no | Fixed tickets | - | Refs tickets | - | License | MIT | Doc PR | included | Changelog updated | yes - Add Twig tags and InterfaceController for Core-2.0 modules-AdminModule. - Add Twig tags and InterfaceController for Core-2.0 modules-ExtensionsModule. - Refactor to Twig and improve templates for headers, breadcrumbs, footers, menue's and links -AdminModule and ExtensionsModule.
13c7ee8
to
bfe892d
Compare
to clear up the StyleCI issues, click on the Details link and then click the Login link at the top (can't remember here, but you may need to go through an OAuth procedure allowing StyleCI access to your Github stuff). Then once logged in, click "create Fix PR" and follow through with that. Then you have to merge the PR to your branch and delete the PR Fix branch. Then PULL your repository from github again to make sure you have the newest changes. Works great - especially in situations like this where there are many changes. If there are only a few, I will sometimes just manually fix the issues and push the fix myself. You can see I have done both methods on my current PR |
Ok this is cool I will try to fix some cs stuff manually, while I'm finishing things - basing on what is in details so I will learn/remember right cs. Anyway 2 things are left - update checker and that help function I will finish it tomorrow. |
would really like to get this complete and integrated soon ( = this week), or it may have to wait for 1.4.3 which is another 4 months later. 👎 |
I will finish this week. |
AdminInteraceController for new spec 2.0 modules using AbstractController and Twig.
Please take a look on it you can test it with this https://github.com/Kaik/core/tree/admin_settings_multilingual
Usage
{{ render(controller('ZikulaAdminModule:AdminInterface:header')) }}
This is still not finished do not merge.
Tasks