GetSimple Support Forum
Default function call of plugin with loadtab.php - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8)
+--- Thread: Default function call of plugin with loadtab.php (/showthread.php?tid=2379)



Default function call of plugin with loadtab.php - leenm - 2011-11-13

Hi guys,

Trying to get a plugin working as a new tab with the nav-tab hook. When a plugin is displayed with loadtab.php and without $_GET['item'] specified, nothing is displayed. I think the default function should be called in that situation.

The code in loadtab.php (line 40-44):
Code:
if ($plugin_id == @$_GET['item']) {
    call_user_func_array($plugin_info[$plugin_id]['load_data'], array());
} else if (isset($_GET['item'])) {
    call_user_func_array($_GET['item'], array());
}
shouldn't it be like
Code:
if(isset($_GET['item'])) {
    call_user_func_array($_GET['item'], array());
} else {
    call_user_func_array($plugin_info[$plugin_id]['load_data'], array());
}
This way, when a plugin is requested with loadtab.php, without $_GET['item'] specified, the default plugin function is called.

Regards,


Default function call of plugin with loadtab.php - mvlcek - 2011-11-13

In GetSimple 3.1 an improved "loadtab" functionality will be included in the core, see here.


Default function call of plugin with loadtab.php - leenm - 2011-11-13

Ah, ok. I'm testing with v3.1 beta, but this enhancement isn't included in this version. Good to see this will be included in 3.1 final.