Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default function call of plugin with loadtab.php
#1
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,
Reply
#2
In GetSimple 3.1 an improved "loadtab" functionality will be included in the core, see here.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
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.
Reply




Users browsing this thread: 1 Guest(s)