Hi Chadd,
Hope all is well!
Originally Posted by
chadderuski
how to get the configuration settings page to show.
I can do it manually with the Admin Page Registration with these values:
Page Key: Easy Populate 4
Page Name: BOX_TOOLS_EASYPOPULATE_4
Page Filename: FILENAME_CONFIGURATION
Page Parameters: gID=32 (I look this up in phpMyAdmin)
Menu: Configuration
display: checked
sort order: 99
Any advice on how to do this automatically would be great.
In Ceon URI Mapping I implement the following code:
PHP Code:
// Make sure configuration group can be displayed in admin menu
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('ceon_uri_mapping_config_group')) {
// Add the link to the Ceon URI Mapping Config Utility to the admin menu
zen_register_admin_page('ceon_uri_mapping_config_group',
'BOX_CEON_URI_MAPPING_CONFIG_GROUP', 'FILENAME_CONFIGURATION',
'gID=' . $configuration_group_id, 'configuration', 'Y',
$configuration_group_id);
$messageStack->add('Configuration group added to admin menu.', 'success');
}
}
The value for the $configuration_group_id variable is either generated or looked up right before this call.
Adjusting that for your settings would result in the following code:
PHP Code:
// Make sure configuration group can be displayed in admin menu
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('easy_populate_4')) {
// Add the link to the Easy Populate 4 to the admin menu
zen_register_admin_page('easy_populate_4',
'BOX_TOOLS_EASYPOPULATE_4', 'FILENAME_CONFIGURATION',
'gID=' . $configuration_group_id, 'configuration', 'Y',
$configuration_group_id);
$messageStack->add('Configuration group added to admin menu.', 'success');
}
}
You'd have to look up the configuration group beforehand and the messageStack notification is obviously optional but I've left it in here as I think that kind of feedback's nice for the user.
Example code for looking up configuration group ID:
PHP Code:
$check_config_group_exists_sql = "
SELECT
configuration_group_id
FROM
" . TABLE_CONFIGURATION_GROUP . "
WHERE
configuration_group_title = 'Ceon URI Mapping (SEO)';";
$check_config_group_exists_result = $db->Execute($check_config_group_exists_sql);
if (!$check_config_group_exists_result->EOF) {
$configuration_group_id =
$check_config_group_exists_result->fields['configuration_group_id'];
}
Hope that helps!
All the best...
Conor
ceon
Bookmarks