2011-09-07, 23:31:47
It would be nice, if the loadtab.php (see e.g. in I18N Gallery plugin) could be installed in the admin directory by default.
Include loadtab.php in Core
|
2011-09-07, 23:31:47
It would be nice, if the loadtab.php (see e.g. in I18N Gallery plugin) could be installed in the admin directory by default.
2011-09-07, 23:43:32
2011-09-08, 00:15:55
It provides the template for displaying the pages on a tab created with the nav-tab action.
Basically a load.php, but with actions pluginname-sidebar and pluginname-sidebar-extra and optionally calling a function based on the item parameter instead of the main function specified on register_plugin. Currently plugins (e.g. GSGallery, I18N Gallery) copy this file to the admin folder, if it does not exist.
2011-09-08, 03:09:02
2011-09-08, 05:28:18
ccagle8 Wrote:pardon my ignorance, but is nav-tab useless without it? You could link the navigation tab to a php file in your plugins/your-plugin folder, but
There are some other problems with side menus and nav tabs:
Instead of loadtab.php some small changes will make tabs and side menus (better) usable - see next post.
2011-09-08, 06:06:03
OK, here are the suggested changes:
plugin_functions.php / createSideMenu: replace it with the following (compatible) code: Code: function createSideMenu($id, $txt, $action=null, $always=true){ Setting $always to false will only show the menu item, if the page is active ($action should be non-empty) plugin_functions.php / createNavTab: Not compatible, but I doubt that anybody uses it. Code: function createNavTab($tabname, $id, $txt, $action=null) { Other parameters like for createSideMenu. To highlight the tab, add the following to the CSS (or rather add the selector to the already existing rule for highlighting): Code: <style type="text/css"> load.php: Replace the <div id="sidebar"> ... </div> code with: Code: <div id="sidebar" > Attached:
It creates side menu items in Pages and Plugins and a new tab. I hope you can include this in 3.1! Martin
2011-10-11, 23:38:48
@ccagle8: will this be included in 3.1?
2011-10-12, 22:34:10
2011-10-12, 22:43:23
ccagle8 Wrote:it's already in the SVN!Great. Thanks!
2011-11-13, 05:18:48
Checked this topic because http://get-simple.info/forum/topic/2852/...oadtabphp/
ccagle8 Wrote:it's already in the SVN! I did a checkout just now, but I can't find the code above in the SVN?
2011-11-13, 05:57:40
2011-11-13, 06:10:29
n00dles101 Wrote:Hi leenm,That's even better, but how do I create a sidemenu for my plugin then? The createSideMenu function isn't sufficient: Code: unction createSideMenu($id,$txt){ I'd like to have this function working properly. I'm willing to propose improvements, but not if this is working already of course. Maybe I'm not understanding how to use the loadtab functionality with a sidemenu properly?
2011-11-13, 06:27:34
n00dles101 Wrote:Hi leenm, Sorry to hear that - I understood that the changes were added, as they provide a much cleaner and better way and allow the plugin developer to easily put his menu items either on an existing tab or a new one. With just the loadtab.php he has to duplicate the actual code for the adding of menu items in each plugin. I definitely encourage you to use the other way in the GetSimple core!
2011-11-13, 06:39:56
Nothing wrong with including loadtab, provided the following changes will be added also:
in loadtab.php (line 25), add: Code: # Set default action change function createSideMenu() to Code: function createSideMenu($id,$txt,$pluginid = null){ Only thing left to fix is styling for the active loadtab tab.
2011-11-13, 07:14:42
2011-11-13, 07:30:30
n00dles101 Wrote:ok, will have a look at the code and add it to the SVN. Adding loadtab.php was the first approach, but it has a lot of deficiencies, like still needing additional functions for actually adding menu items in the tab. With the changes described here
So above changes are the far better solution than adding loadtab.php.
2011-12-06, 19:52:37
2012-01-23, 18:06:55
n00dles101 Wrote:Any chance you could do a quick wiki on how plugin writers should use it ?? Finally done!
2012-01-24, 09:41:02
Why is loadtab.php still included (in SVN)? That file isn't needed with mvlcek's changes, right?
2012-01-25, 01:53:20
@mvlcek, thanks for updating the wiki.
I've moved it into its own page for editing; http://get-simple.info/wiki/plugins:tabs_menus |
« Next Oldest | Next Newest »
|