allows page to find Custom Index page in Module from Actions Property

This commit is contained in:
Michael Atwood
2020-09-30 22:53:41 -07:00
parent 14746f47da
commit 6e41cd850e

View File

@ -76,7 +76,7 @@
User user = null;
List<Module> modules;
var moduleid = -1;
var action = string.Empty;
var action = Constants.DefaultAction;
var urlparameters = string.Empty;
var editmode = false;
var reload = Reload.None;
@ -459,25 +459,18 @@
typename = Constants.ErrorModule;
}
if (module.ModuleId == moduleid && action != "")
// check if the module defines custom routes*@
if (module.ModuleDefinition.ControlTypeRoutes != "")
{
// check if the module defines custom routes
if (module.ModuleDefinition.ControlTypeRoutes != "")
foreach (string route in module.ModuleDefinition.ControlTypeRoutes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
foreach (string route in module.ModuleDefinition.ControlTypeRoutes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
if (route.StartsWith(action + "="))
{
if (route.StartsWith(action + "="))
{
typename = route.Replace(action + "=", "");
}
typename = route.Replace(action + "=", "");
}
}
module.ModuleType = typename.Replace(Constants.ActionToken, action);
}
else
{
module.ModuleType = typename.Replace(Constants.ActionToken, Constants.DefaultAction);
}
module.ModuleType = typename.Replace(Constants.ActionToken, action);
// get additional metadata from IModuleControl interface
typename = module.ModuleType;