GetSimple Support Forum

Full Version: Default function call of plugin with loadtab.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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,
In GetSimple 3.1 an improved "loadtab" functionality will be included in the core, see here.
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.