To create a new configuration-menu "group" as part of your plugin's install, you'll need (at a minimum) two files:
/YOUR_ADMIN/includes/languages/english/extra_definitions/social_media_icons_name.php:
Code:
<?php
define ('BOX_SOCIAL_MEDIA_ICONS', 'Social Media Icons');
/YOUR_ADMIN/includes/functions/extra_functions/init_social_media_icons.php
Code:
<?php
$configurationGroupTitle = 'Social Media Icons';
$configuration = $db->Execute ("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = '$configurationGroupTitle' LIMIT 1");
if ($configuration->EOF) {
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . "
(configuration_group_title, configuration_group_description, sort_order, visible)
VALUES ('$configurationGroupTitle', '$configurationGroupTitle', '1', '1');");
$cgi = $db->Insert_ID();
$db->Execute ("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = $cgi WHERE configuration_group_id = $cgi");
} else {
$cgi = $configuration->fields['configuration_group_id'];
}
// -----
// Set the various configuration items, the plugin wasn't previously installed.
//
if (!defined ('SOCIAL_MEDIA_ICONS_ENABLED')) {
$db->Execute ("INSERT INTO " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, date_added, sort_order, use_function, set_function ) VALUES ( 'Enable Social Media Icons?', 'SOCIAL_MEDIA_ICONS_ENABLED', 'false', 'Enable the social-media icons processing for your store? Default: <b>false</b>', $cgi, now(), 10, NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),')");
//-Additional configuration items get added here
}
// -----
// Register the plugin's configuration page for display on the menus.
//
if (!zen_page_key_exists ('configSocialMediaIcons')) {
zen_register_admin_page ('configSocialMediaIcons', 'BOX_SOCIAL_MEDIA_ICONS', 'FILENAME_CONFIGURATION', "gID=$cgi", 'configuration', 'Y', $cgi);
}
Bookmarks