As of Nucleus v2.5, plugins can create admin area pages that integrate with the Nucleus admin area. These pages can be accessed either from the plugin admin page, or the quickmenu on the left.
To provide an admin area, you'll need take these steps:
NP_PluginName. Note that the name should be lowercase!<?php
// if your 'plugin' directory is not in the default location,
// edit this variable to point to your site directory
// (where config.php is)
$strRel = '../../../';
include($strRel . 'config.php');
if (!$member->isLoggedIn())
doError('You\'re not logged in.');
include($DIR_LIBS . 'PLUGINADMIN.php');
// create the admin area page
$oPluginAdmin = new PluginAdmin('PluginName');
$oPluginAdmin->start();
echo '<h2>Plugin Name</h2>';
echo '<p>Page contents here<p>';
$oPluginAdmin->end();
?>
QuickMenu event and add this code in your plugin:
function event_QuickMenu(&$data) {
array_push(
$data['options'],
array(
'title' => 'Plugin Name',
'url' => $this->getAdminURL(),
'tooltip' => 'Tooltip text'
)
);
}
function hasAdminArea()
{
return 1;
}
$strRel variable in the index.php needs to be adapted manually if the plugins directory is not located in nucleus/plugins/The purpose of the PluginAdmin is to help you. Once created, you can use $oPluginAdmin->plugin to access the instance of your plugin.