Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

Kaik
Copy link
Contributor

@Kaik Kaik commented Nov 22, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no*
Deprecations? no
Tests pass? no
Fixed tickets
Refs tickets #1753
License MIT
Doc PR -
Changelog updated yes

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

  • Move security etc private functions somewhere?..
  • Split notices into separate functions
  • Move breadcrumbs to separate function
  • Find place for moduleheader and modulelinks Extensions? module ModuleInterfaceController?..
  • AdminTab's breadcrumb's etc css and js improvements
  • Documentation
  • Improvements and fixes

$i++;

if (System::isLegacyMode() && !empty($class) && isset($menuitem['class'])) {
if ($menuitem['class'] == 'z-icon-es-add') {
Copy link
Member

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))).

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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".

@Guite
Copy link
Member

Guite commented Nov 22, 2015

Very nice 👍

public function categorymenuAction($acid = null)
{

if (!SecurityUtil::checkPermission('ZikulaAdminModule::', '::', ACCESS_ADMIN)) {
Copy link
Member

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.

@craigh craigh added this to the 1.4.2 milestone Nov 22, 2015
@craigh craigh added the Feature label Nov 22, 2015
@craigh
Copy link
Member

craigh commented Nov 22, 2015

Find place for moduleheader and modulelinks Extensions? module ModuleInterfaceController?..

I don't understand what you mean here. Can you please explain more?

@Kaik
Copy link
Contributor Author

Kaik commented Nov 22, 2015

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

@craigh
Copy link
Member

craigh commented Nov 22, 2015

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.

@Kaik
Copy link
Contributor Author

Kaik commented Nov 23, 2015

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.
We can split them so they will be per module Controller/Twig...

AdminModule -> own AdminInterfaceController + Twig tags
ExtensionsModule -> own ExtensionInterfaceController + Twig tags

Eventually instead of {{ render(controller('ZikulaAdminModule:AdminInterface:header')) }}
We use more familiar {{ adminheader }}...

To consider... it is bugging my head so I will write it down...
I'm using request stack getMasterRequest to get calling module but might be better to move it to twig tag and pass to AdminInterfaceController another question is should it be possible to pass caller arguments into twig tag?

@craigh
Copy link
Member

craigh commented Jan 1, 2016

$update_show = true;
$update_version = $onlineVersion;
} else {
$update_show = false;
Copy link
Member

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?

@Kaik
Copy link
Contributor Author

Kaik commented Jan 1, 2016

👍 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 %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CS

@Kaik
Copy link
Contributor Author

Kaik commented Jan 22, 2016

Hi, I have just spend day with this and have focused on updatecheck - this how it looks now.

  • first view when releases are listed and - its kind of active check
  • second view - passive check, when active check was performed previously (latest release was saved) and next check time has not yet been reached.

@Kaik
Copy link
Contributor Author

Kaik commented Jan 22, 2016

Compleate collapsed state UpdateChecker status
screencapture-core-desktop-local-blocks-admin-view-1453552621876

Opened passive state

screencapture-core-desktop-local-blocks-admin-view-1453506846857

Opened active state

screencapture-core-desktop-local-blocks-admin-view-1453552524301

Opened active state with extended latest release information's

screencapture-core-desktop-local-blocks-admin-view-1453506921750 1

@craigh
Copy link
Member

craigh commented Feb 11, 2016

ping @Kaik

@craigh
Copy link
Member

craigh commented Feb 20, 2016

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.
@craigh
Copy link
Member

craigh commented Feb 27, 2016

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

@Kaik
Copy link
Contributor Author

Kaik commented Feb 27, 2016

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.

@craigh
Copy link
Member

craigh commented Mar 1, 2016

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. 👎

@Kaik
Copy link
Contributor Author

Kaik commented Mar 2, 2016

I will finish this week.

@craigh
Copy link
Member

craigh commented Mar 7, 2016

Closing in favor of #2793

for the record - @Kaik did some great work. His major commit (which is still present as a standalone commit) and subsequent work is present in #2793. It only needed some fine tuning and fixing a few minor bugs.

@craigh craigh closed this Mar 7, 2016
@Kaik Kaik deleted the admin_module_twig branch March 15, 2016 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants