Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems "Top-level" plugin
#1
i want to write a small "top-level" plugin (means: i use an additional tab next to the plugins tab in the menu')
in the main section of the plugin, i want to use a php file which renders my form.
i decided to put that into the admin/plugins/myplugin folder and added the tab with:
Code:
add_action('nav-tab', 'createNavTab', array(''plugins/myplugin/myplugin.php', 'My Plugin'));

the starting code of plugins/myplugin/myplugin.php, but the include of ../../inc/common.php fails. It fails, because include of cookie_functions:121 fails and that cause cookie_functions:9 inc_configuration.php fails). what can i do?
Code:
<?php

/****************************************************
*
* @File:     plugins.php
* @Package:    GetSimple
* @Action:    Displays all installed plugins.    
*
*****************************************************/
// Setup inclusions
$load['plugin'] = true;

// Relative
$relative = '../../../';
// Include common.php
include('../../inc/common.php');

// Variable settings
login_cookie_check();
$path = tsl('plugins');
$counter = '0';
$table = '';

?>
Reply
#2
The createNavTab function was created originally for the plugins tab and was not meant for general use as top level
nav for plugins.

We recommend you use the Sidebar for your plugin configurations

Let me think about the other problem...
My Github Repos: Github
Website: DigiMute
Reply
#3
1. nav-tab
n00dles101 Wrote:The createNavTab function was created originally for the plugins tab and was not meant for general use as top level
nav for plugins.
hm... then, i've got 2 questions:
  • but why is the action nav-tab documented if it should not be used? see http://get-simple.info/plugin-codex
  • what's the meaning of such a function like createNavTab() - only to render the Plugins tab? you could use the core tab creation function for that, right? (i think, there's one ?!

2. top-level plugin
hm... ok, if i choose to use the plugins the original way (not as top level nav, but as second level sidebar menu item), it seems to work well.
Reply
#4
The 'nav-tab' hook was originally put in when we created the hook system. Hooks were inserted all over the system as we wanted to have as many in before version 2 came out. Some like this one will probably never be used, but better to have them in just in case, instead of bringing out new revisions just for a hook.

The original build of the plugin system checked to see if any plugins were in the directory and dynamically displayed the Plugin tab using the createNavTab() function, if there were none it wasn't displayed. it was later hardcoded into the Tab bar, so the function was longer required for this purpose, see r71 of the SVN.

Most of the hook documentation was written before the change was made... and was left in.
My Github Repos: Github
Website: DigiMute
Reply




Users browsing this thread: 1 Guest(s)