View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
12174Feature requestsPluginspublic2023-08-16 18:04
ReporterDenisChenu Assigned To 
PrioritynoneSeverityfeature 
Status newResolutionopen 
Summary12174: A global beforeMenuRender
Description

In 2.6 : we have https://manual.limesurvey.org/BeforeAdminMenuRender for the top menu
In 2.6X : we have https://manual.limesurvey.org/BeforeToolsMenuRender for the tool submenu

=> I think we need a global event, starting by some and add new menu after.

event : beforeMenuRender
input:

  • menu (survey/token/global/statitics)
  • submenu (if set) : tools
  • surveyid
  • objectid (qid for question / gid for group)
  • Maybe action (edit/view for question, edit/view for group)
Additional Information

After we can remove beforeToolsMenuRender with API broker (then 4.0)

TagsNo tags attached.
Attached Files
Bug heat10
Story point estimate20
Users affected %20

Relationships

related to 18654 new Make all menus changeable via plugin events (or a global registry) 

Users monitoring this issue

2BITS_PL, ollehar

Activities

DenisChenu

DenisChenu

2017-03-07 16:31

developer   ~43190

Just for your advice/idea here ?
I think i work on it for 2.7 or 3.0 : seems really needed. Maybe not for whole menu (each menu need a different input then own event) but .....

Alternative : construct an extension/menu but : this take really more time (and we don't have submenu event)

ollehar

ollehar

2017-03-08 09:36

administrator   ~43211

  1. Do we want plugin devs to be able to put new menu entries anywhere, or should all plugin menus be put in a specific place?

  2. Louis would scream about this idea, since he wants a menu system inspired from Joomla. Such a system would register menu entries in the database based on place holder number or such, and XML config. Personally, I feel like both systems - events or XML/database - have the same level of complexity.

ollehar

ollehar

2017-03-08 09:37

administrator   ~43212

Last edited: 2017-03-08 09:38

  1. It would probably be possible to use one event for all menus. The event listener must then check one of the input args to the event to know which menu is relevant for this specific event triggering. Edit: Oh, maybe that's what you're suggesting. ^^
DenisChenu

DenisChenu

2017-03-08 10:39

developer   ~43213

For 1 : i really think allowing entry everywhere is a must have. If not : need : Token menu/Response menu/Statistics menu/Question view/Group view
For 2 : XML or event or DB : it's not the point. The point is 'did we need one' , and again : Yii extensions/modules is made in Yii event.
For 3 : yes, it's what i'm suggesting ...

ollehar

ollehar

2017-03-08 10:48

administrator   ~43214

OK, I agree with this design then.

Do we need it? Don't know. :) What's the use-case? Do we have any idea on what the plugin system should NOT be able to do? Well, it's the only way to extend LS, for now, so. :P

DenisChenu

DenisChenu

2017-03-08 11:03

developer   ~43216

Use case : some example

PS : we need 2 things

  • A way to add menu item
  • A way to call 'specic admin part' : for example : call token view except content.
ollehar

ollehar

2017-03-08 11:05

administrator   ~43217

Wow, OK.

" - A way to call 'specic admin part' : for example : call token view except content. "

How is this different than to render a side-body?

DenisChenu

DenisChenu

2017-03-08 11:12

developer   ~43218

sidebody add 'Survey menu' if surveyid is set, we need side body with 'token menu' or 'reponse menu' or .....

ollehar

ollehar

2017-03-08 11:21

administrator   ~43219

Bah. Those menus should be removed anyway... Or at least be collapsed into one bigger drop-down menu.

But OK, I get your point.

DenisChenu

DenisChenu

2017-03-08 11:24

developer   ~43221

You mean this 2 menu (for example) ????

I didn't get it and don't remind of any discussion to remove this specific menu, and what replacement must done

ollehar

ollehar

2017-03-08 11:30

administrator   ~43222

Yeah, but that's just me, there's no discussion about it. See my screenshot in the IRC of the Yahoo user settings web site.

You think the side-body event can be modified to configure which menu to show?

DenisChenu

DenisChenu

2017-03-08 11:33

developer   ~43223

Yes, maybe : what 'layout' must be used.

default
nothing : global page
surveyid set : survey page
surveyid + page set : page dependent : page can be token/response/ for starting, adding statitics or question ....

But if we remove all if this in 6 month : i didn't work on it ....

ollehar

ollehar

2017-03-08 11:41

administrator   ~43224

Hm, I don't know if we have any concrete plans for the admin interface at this point.

ollehar

ollehar

2017-03-08 11:41

administrator   ~43225

Personally, I'd prefer if LS 4 was Louis doing question object types, but that's only me.

ollehar

ollehar

2017-03-08 11:43

administrator   ~43226

Markus has expressed a wish to modify the admin interface. No idea if that will happen.

ollehar

ollehar

2017-03-08 12:28

administrator   ~43227

Maybe we should bring it up on the next team meeting, so we can guarantee some stability?

DenisChenu

DenisChenu

2017-03-14 15:03

developer   ~43282

Example of usage (private plugin, based on https://framagit.org/SondagePro-LimeSurvey-plugin/statsPivotTable)

DenisChenu

DenisChenu

2022-06-07 12:19

developer   ~70270

Another example

Adding via script
https://gitlab.com/SondagesPro/Authentification/AuthRemoteToken/-/blob/main/AuthRemoteToken.php#L339

ollehar

ollehar

2022-06-07 12:21

administrator   ~70271

Ye. Five years later... Louis wanted to do a database-based menu system, Markus did some menu database tables, but they're kind of weird and maybe bloated... Not sure now.

DenisChenu

DenisChenu

2022-06-07 12:24

developer   ~70272

database-based menu system

Survey menu currently .
Already use it too …
https://gitlab.com/SondagesPro/TokenManagement/TokenUsersListAndManage/-/blob/master/TokenUsersListAndManage.php#L653

But hacking, doing it via my own way ;)

ollehar

ollehar

2022-06-07 12:40

administrator   ~70274

'addSurveyId' => true,
'addQuestionGroupId' => false,
'addQuestionId' => false,

I smell a security issue here, if it's possible to add all three of those in one URL.......

ollehar

ollehar

2022-06-07 16:47

administrator   ~70283

One problem with putting all menus in db is that every time we change a link or translation, we have to do a db update. A possible solution:

1) Add a new menu service provider, from which all menus come from, in form of classes like Menu and MenuItem
2) Add an event in the menu service provider that plugins can hook into
3) Possibly also add support for fetching menus from the database

ollehar

ollehar

2022-06-07 16:50

administrator   ~70284

NB, I'm using service locator pattern in the plugin update system

image.png (119,383 bytes)
DenisChenu

DenisChenu

2022-06-07 17:17

developer   ~70285

form of classes like Menu and MenuItem

This need to be improved (there are some TODO)

DenisChenu

DenisChenu

2023-02-10 08:01

developer   ~73786

https://forums.limesurvey.org/forum/plugins/127587-how-to-add-custom-button-in-tool-bar-section#240133

bismark

bismark

2023-03-06 18:35

reporter   ~74058

Please do not fetch menu items from database. Always add and remove items via event
keep in mind that action buttons are kind of menus, too, eg Tools menu

DenisChenu

DenisChenu

2023-03-07 14:52

developer   ~74064

Please do not fetch menu items from database. Always add and remove items via event

+1

ollehar

ollehar

2023-08-16 18:04

administrator   ~76628

As expressed in ticket 18654, I prefer a global registry class rather than multiple events. But maybe one global event could work too, actually.

Issue History

Date Modified Username Field Change
2017-03-07 16:29 DenisChenu New Issue
2017-03-07 16:31 DenisChenu Assigned To => ollehar
2017-03-07 16:31 DenisChenu Status new => feedback
2017-03-07 16:31 DenisChenu Note Added: 43190
2017-03-08 09:36 ollehar Note Added: 43211
2017-03-08 09:37 ollehar Note Added: 43212
2017-03-08 09:38 ollehar Note Edited: 43212
2017-03-08 10:39 DenisChenu Note Added: 43213
2017-03-08 10:39 DenisChenu Status feedback => assigned
2017-03-08 10:39 DenisChenu Assigned To ollehar =>
2017-03-08 10:39 DenisChenu Status assigned => new
2017-03-08 10:48 ollehar Note Added: 43214
2017-03-08 11:03 DenisChenu Note Added: 43216
2017-03-08 11:05 ollehar Note Added: 43217
2017-03-08 11:12 DenisChenu Note Added: 43218
2017-03-08 11:21 ollehar Note Added: 43219
2017-03-08 11:24 DenisChenu File Added: Capture du 2017-03-08 11-23-08.png
2017-03-08 11:24 DenisChenu File Added: Capture du 2017-03-08 11-23-34.png
2017-03-08 11:24 DenisChenu Note Added: 43221
2017-03-08 11:30 ollehar Note Added: 43222
2017-03-08 11:33 DenisChenu Note Added: 43223
2017-03-08 11:41 ollehar Note Added: 43224
2017-03-08 11:41 ollehar Note Added: 43225
2017-03-08 11:43 ollehar Note Added: 43226
2017-03-08 12:28 ollehar Note Added: 43227
2017-03-14 15:03 DenisChenu File Added: Capture du 2017-03-14 15-00-13.png
2017-03-14 15:03 DenisChenu Note Added: 43282
2022-06-06 16:20 ollehar Issue Monitored: ollehar
2022-06-06 16:20 ollehar Bug heat 4 => 6
2022-06-07 12:19 DenisChenu Note Added: 70270
2022-06-07 12:19 DenisChenu File Added: Capture d’écran du 2022-06-07 11-46-42.png
2022-06-07 12:21 ollehar Note Added: 70271
2022-06-07 12:24 DenisChenu Note Added: 70272
2022-06-07 12:40 ollehar Note Added: 70274
2022-06-07 16:47 ollehar Note Added: 70283
2022-06-07 16:50 ollehar Note Added: 70284
2022-06-07 16:50 ollehar File Added: image.png
2022-06-07 17:17 DenisChenu Note Added: 70285
2023-02-06 09:38 2BITS_PL Issue Monitored: 2BITS_PL
2023-02-06 09:38 2BITS_PL Bug heat 6 => 8
2023-02-10 08:01 DenisChenu Note Added: 73786
2023-02-10 11:43 ollehar Story point estimate => 20
2023-02-10 11:43 ollehar Users affected % => 20
2023-03-06 18:35 bismark Note Added: 74058
2023-03-06 18:35 bismark Bug heat 8 => 10
2023-03-07 14:52 DenisChenu Note Added: 74064
2023-08-16 18:04 ollehar Relationship added related to 18654
2023-08-16 18:04 ollehar Note Added: 76628