January 1, 2015 in Feedback
I've encountered a situation in which it's much more appropriate to add more than one item to FrontNavigation in the app I'm developing (distinctly different sections relying on the same core functionality) and I noticed that every item added by an app has the same ID attribute, due to the use of strtok(), It seems strange to decidedly make the $id passed by \IPS\Application::allExtensions( 'core', 'FrontNavigation' ) non-unique, though I admit it may be done for a reason currently unbeknownst to me.
I would suggest using said $id unchanged rather than passing it through strtok(). The added flexibility would offset the very minor cosmetic redundancy of having some item IDs end in app_App (i.e. calendar_Calendar). The one-nav-item-per-app thing also seems very 3.x.
In addition, I think a case can be made for having the classes added to the FrontNavigation extension implement an interface. Either way, a note ought be added to the children() method stating that each array item must be an object with the same methods as the parent.
This topic is now archived and is closed to further replies.
Started 2 hours ago
Started October 7, 2020
Started July 29