Merge pull request #770 from PoisnFang/flexible-index-page-in-custom-modules
Allows page to find Custom Index page in Module from Actions Property
This commit is contained in:
commit
e934a28c39
@ -76,7 +76,7 @@
|
|||||||
User user = null;
|
User user = null;
|
||||||
List<Module> modules;
|
List<Module> modules;
|
||||||
var moduleid = -1;
|
var moduleid = -1;
|
||||||
var action = string.Empty;
|
var action = Constants.DefaultAction;
|
||||||
var urlparameters = string.Empty;
|
var urlparameters = string.Empty;
|
||||||
var editmode = false;
|
var editmode = false;
|
||||||
var reload = Reload.None;
|
var reload = Reload.None;
|
||||||
@ -202,6 +202,7 @@
|
|||||||
{
|
{
|
||||||
modIdPos = i + 1;
|
modIdPos = i + 1;
|
||||||
actionPos = modIdPos + 1;
|
actionPos = modIdPos + 1;
|
||||||
|
// Route to index page if no action is specifed
|
||||||
if (actionPos > segments.Length - 1)
|
if (actionPos > segments.Length - 1)
|
||||||
{
|
{
|
||||||
action = Constants.DefaultAction;
|
action = Constants.DefaultAction;
|
||||||
@ -459,25 +460,18 @@
|
|||||||
typename = Constants.ErrorModule;
|
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
|
foreach (string route in module.ModuleDefinition.ControlTypeRoutes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||||
if (module.ModuleDefinition.ControlTypeRoutes != "")
|
|
||||||
{
|
{
|
||||||
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
|
// get additional metadata from IModuleControl interface
|
||||||
typename = module.ModuleType;
|
typename = module.ModuleType;
|
||||||
|
Reference in New Issue
Block a user