Admin custom config page for my custom module

Hello Everyone!

Just wanted to ask if anyone knows how to resolve my admin custom configuration. I created custom modules, and I added a link for configuration in the admin panel.

Admin Page

Admin Options Defs

$admin_option_defs = array();

$admin_option_defs['Administration']['dvtac_SMS_Settings'] = array(
    "dvtac_SMSSettings",
    "Configure",
    "Set SMS Plugins configurations.",
    "./index.php?module=dvtac_SMS&action=dvtac_SMSSettings",
);

$admin_option_defs['Administration']['dvtac_SMSPlugins_Activation'] = array(
    "SMSPlugins_Activation",
    "License Management",
    "Check your SMS Plugins License",
    "./index.php?module=dvtac_SMS&action=dvtac_SMSSettings_license",
);

$admin_group_header[] = array(
    'SMS Plugins',
    '',
    false,
    $admin_option_defs,
    'Set SMS Plugins configurations and license management.'
);

It works perfectly fine if I click the link if I`m at https://example.com/#Administration, but if I am at the https://example.com/#bwc/index.php?module=Administration&action=index this is the error I got. And the link I set on the admin options defs will also change instead of having this link: /index.php?module=dvtac_SMS&action=dvtac_SMSSettings_license will be having this one: #dvtac_SMS/dvtac_SMSSettings_license.

Parents
  • Nevermind this questions, I was able to fix it :) Check my codes below:

    if(preg_match( "/^6.*/", $sugar_version) ) {
        $admin_option_defs['Administration']['dvtac_SMS_Settings'] = array(
            "dvtac_SMSSettings",
            "Configure",
            "Set SMS Plugins configurations.",
            "./index.php?module=dvtac_SMS&action=settings",
        );
    
        $admin_option_defs['Administration']['dvtac_SMSPlugins_Activation'] = array(
            "SMSPlugins_Activation",
            "License Management",
            "Check your SMS Plugins License",
            "./index.php?module=dvtac_SMS&action=license",
        );
    }else{
        $admin_option_defs['Administration']['dvtac_SMS_Settings'] = array(
            "dvtac_SMSSettings",
            "Configure",
            "Set SMS Plugins configurations.",
            'javascript:parent.SUGAR.App.router.navigate("#bwc/index.php?module=dvtac_SMS&action=settings", {trigger: true});',
        );
    
        $admin_option_defs['Administration']['dvtac_SMSPlugins_Activation'] = array(
            "SMSPlugins_Activation",
            "License Management",
            "Check your SMS Plugins License",
            'javascript:parent.SUGAR.App.router.navigate("#bwc/index.php?module=dvtac_SMS&action=license", {trigger: true});',
        );
    }

Reply
  • Nevermind this questions, I was able to fix it :) Check my codes below:

    if(preg_match( "/^6.*/", $sugar_version) ) {
        $admin_option_defs['Administration']['dvtac_SMS_Settings'] = array(
            "dvtac_SMSSettings",
            "Configure",
            "Set SMS Plugins configurations.",
            "./index.php?module=dvtac_SMS&action=settings",
        );
    
        $admin_option_defs['Administration']['dvtac_SMSPlugins_Activation'] = array(
            "SMSPlugins_Activation",
            "License Management",
            "Check your SMS Plugins License",
            "./index.php?module=dvtac_SMS&action=license",
        );
    }else{
        $admin_option_defs['Administration']['dvtac_SMS_Settings'] = array(
            "dvtac_SMSSettings",
            "Configure",
            "Set SMS Plugins configurations.",
            'javascript:parent.SUGAR.App.router.navigate("#bwc/index.php?module=dvtac_SMS&action=settings", {trigger: true});',
        );
    
        $admin_option_defs['Administration']['dvtac_SMSPlugins_Activation'] = array(
            "SMSPlugins_Activation",
            "License Management",
            "Check your SMS Plugins License",
            'javascript:parent.SUGAR.App.router.navigate("#bwc/index.php?module=dvtac_SMS&action=license", {trigger: true});',
        );
    }

Children
No Data