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

Add a "friendly id" method to ElggPlugin to generate markup / CSS safe IDs (Trac #4311) #4311

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

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/4311 on 42053904-07-19 by brettp, assigned to brettp.

Elgg version: 1.8.3

Plugin dirs with dots break the "More" js toggle. The plugin id is used in the class for the hidden input. Dots aren't valid in class names.

@elgg-gitbot
Copy link
Author

brettp wrote on 42056571-03-09

Since we do this in at least one other spot, a better idea might be to make a generic function. Any other places besides menus that generate class or ID names and need to substitute characters?

@elgg-gitbot
Copy link
Author

cash wrote on 42061264-02-28

We need to get away from creating functions for things like this. It just creates bloat. My favorite example for this is elgg_get_ini_setting_in_bytes(). Ok, useful function but do we really need to be loading that one every page load?

What is far better is creating a class like ElggIniHelper and adding static methods. Right now we have ini_get_bool() and elgg_get_ini_setting_in_bytes().

As we cannot change the API in 1.8, why don't we do a fix in place for this and then come up with a strategy for 1.9 and beyond for convenience functionality.

@elgg-gitbot
Copy link
Author

brettp wrote on 42061281-08-26

Sounds like a plan.

@elgg-gitbot
Copy link
Author

trac user Brett Profitt wrote on 42062152-03-04

Fixes #4311. Rewriting all invalid CSS characters to - for plugin id in plugin admin area.
Changeset: 2e499d0

@elgg-gitbot
Copy link
Author

trac user Brett Profitt wrote on 42088991-01-06

Fixes #4311. Rewriting all invalid CSS characters to - for plugin id in plugin admin area.
Changeset: 2e499d0

@elgg-gitbot
Copy link
Author

trac user coldtrick wrote on 42396605-04-18

you forgot to also rewrite the plugin id's in the plugin activate/deactivate action.

So for some plugins after activate/deactivate you no longer jump to the plugin.

example: activate "blog" you jump to blog in the plugin list.
activate custom_index and you end up at the beginning of the plugin list :(

@elgg-gitbot
Copy link
Author

cash wrote on 43074391-07-08

Assigning to 1.8.14 milestone so we look at this

@cash
Copy link
Contributor

cash commented Feb 18, 2013

Setting milestone back to 1.8.4 and closing because it works for me (enabling custom_index and having it load with that at the top).

@cash cash closed this as completed Feb 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants