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

Improve menu functions (Trac #2320) #2320

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 8 comments
Closed

Improve menu functions (Trac #2320) #2320

elgg-gitbot opened this issue Feb 16, 2013 · 8 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/2320 on 40501265-07-11 by cash, assigned to cash.

Elgg version: 1.8 Beta

(not saying that the <=1.7 system wasn't worse)

Issues:

  • elgg_get_submenu() returns HTML - view and list functions return HTML - not get functions
  • elgg_get_submenu() combines both the final processing of the submenu structure and the creation of the HTML. If a theme/plugin needs to create a different menu system on top of the $CONFIG->submenu structure, it has to copy all the code from elgg_get_submenu() that handles determining the selected menu item.
@elgg-gitbot
Copy link
Author

brettp wrote on 40521918-01-12

Let's spec out a clear path for this. If these are the only two issues, it sounds like they can be resolved by:

  1. Renaming the HTML-returning function to elgg_view_submenu().
  2. Pulling out the logic that builds the actual menu structure into a function that emits a plugin hook.

@elgg-gitbot
Copy link
Author

cash wrote on 40522268-11-08

I'll probably try implementing 1 or 2 different sidebar menu approaches to test this out. This is one of those things I found while writing the book. I'm trying to add tickets as I find these issues.

@elgg-gitbot
Copy link
Author

brettp wrote on 40522434-05-14

I figured it related to the book ;) I've just tried implementing an elgg_remove_submenu_item() function and am seeing what you mean. If you have some ideas in mind, I'll be interested to hear how they work out.

@elgg-gitbot
Copy link
Author

Title changed from new submenu code makes it difficult to override menu system to Improve menu functions by brettp on 40769001-01-18

@elgg-gitbot
Copy link
Author

brettp wrote on 40772282-12-16

See discussion at http://groups.google.com/group/elgg-development/browse_thread/thread/db96a04f292e0535

@elgg-gitbot
Copy link
Author

cash wrote on 40779607-05-14

I'll take a first crack at this.

@elgg-gitbot
Copy link
Author

cash wrote on 40962377-02-09

(In [svn:7655]) Refs #2320 added new menu functions and classes

@elgg-gitbot
Copy link
Author

cash wrote on 40996260-11-11

I'm closing this one. The new menu system is in core. It is being used for

  • Site nav (the site menu)
  • Sidebar nav (the page menu)
  • owner block menus
  • user hover menus
  • footer menu

I think this new system provides the flexibility that we need. It does make adding menu items a little more cumbersome but we could always add wrapper functions like elgg_add_admin_menu_item().

As plugins are updated to 1.8, they should be updated to the new menu code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant