PostNuke

Flexible Content Management System

News

How to add icons to the Profile (0.8)

Contributed by on Sep 19, 2007 - 02:40 PM

In the standard version the Profile contains just one icon to edit your personal data and one icon to logout.

So, I investigated how this works - as I never used it in over 3 years.

All modules are classified as 'admin' modules or user modules. Every user module and that is the vast majority of modules can have an icon in the Profile folder. What it requires is a pnaccountapi.php file in the modules directory. That means, if you want to show the Pages icon in the Profile folder you need a file named ./modules/Pages/pnaccountapi.php.

This program does not contain much but the definition of the icon to show. Sample content is like this:

[code]function Pages_accountapi_getall($args)

{

if (!isset($args['uname'])) {

if (!pnUserloggedIn()) {

$uname = null;

} else {

$uname = pnUserGetVar('uname');

}

}

// Create an array of links to return

if ($uname != null) {

$uid = pnUserGetIDFromName($uname);

$items = array(array('url' => pnModURL('Pages', 'user'),

'module' => 'core',

'set' => 'icons/large',

'title' => _PAGES,

'icon' => 'pages.gif'));

} else {

$items = null;

}

// Return the items

return $items;

}[/code]



That's it. Pretty easy.
1338