Hi,

Originally Posted by
conor
At the minute I'm thinking of simply adding a file which gets loaded by one of the existing auto-loading directories.
But this file would simply call the above function to register a page that can then be accessed by the admin user through the admin menu.
This seems rather wasteful of system resources as this file will autoload every time an admin page is opened.
The solution to that is then to unlink() the auto-loading file once the module's page has been accessed through the menu for the first time, but none of this is a "desirable" way to work.
Given that this seemed ot be the only way to do things, this is how I've implemented this in Ceon URI Mapping v4.0.3.
It works perfectly well but is a strange way to have had to make things work.
Just letting know in case any other developer wants to add a link to the Zen Cart admin...
How to add a menu item to the Zen Cart admin, when users are only copying files across:
Simply create a file that goes in:
admin/includes/auto_loaders
Sample content (minus obligatory comments which should already have been added for good coding standards:)
PHP Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$autoLoadConfig[199][] = array(
'autoType' => 'init_script',
'loadFile' => 'init_ceon_uri_mapping_config.php'
);
Then create a file in
admin/includes/init_includes
Sample content:
PHP Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('ceon_uri_mapping_config')) {
// Add the link to the Ceon URI Mapping Config Utility
zen_register_admin_page('ceon_uri_mapping_config', 'BOX_CEON_URI_MAPPING',
'FILENAME_CEON_URI_MAPPING_CONFIG', '', 'modules', 'Y', 40);
}
}
// Now that the menu item has been created/registered, can stop the wasteful process of having
// this script run again by removing it from the auto-loader array
@unlink(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.ceon_uri_mapping_config.php');
Obviously adjust as desired for your own software!
All the best...
Conor
ceon
Bookmarks