Modification of UserControl usage to allow for Virtual Path to be used correctly.
This commit is contained in:
@@ -60,6 +60,13 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
{
|
||||
base.OnInit (e);
|
||||
|
||||
if (!_usercontrolPath.StartsWith("~"))
|
||||
{
|
||||
if (_usercontrolPath.StartsWith("/"))
|
||||
_usercontrolPath = "~" + _usercontrolPath;
|
||||
else
|
||||
_usercontrolPath = "~/" + _usercontrolPath;
|
||||
}
|
||||
Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath);
|
||||
|
||||
if (HasSettings(oControl.GetType()))
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
|
||||
public override string DataTypeName
|
||||
{
|
||||
get { return "umbraco usercontrol wrapper"; }
|
||||
get { return "Umbraco Usercontrol Wrapper"; }
|
||||
}
|
||||
|
||||
public override umbraco.interfaces.IDataPrevalue PrevalueEditor
|
||||
|
||||
@@ -76,14 +76,15 @@ namespace umbraco.editorControls.userControlGrapper
|
||||
private void populateUserControls(string path)
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
|
||||
foreach (FileInfo uc in di.GetFiles("*.ascx"))
|
||||
{
|
||||
string root = IOHelper.MapPath(SystemDirectories.Root);
|
||||
string ucRoot = IOHelper.MapPath(SystemDirectories.Usercontrols);
|
||||
|
||||
_dropdownlistUserControl.Items.Add(
|
||||
|
||||
new ListItem(
|
||||
uc.FullName.Substring(root.Length).Replace(IOHelper.DirSepChar, '/'))
|
||||
new ListItem( SystemDirectories.Usercontrols +
|
||||
uc.FullName.Substring(ucRoot.Length).Replace(IOHelper.DirSepChar, '/'))
|
||||
|
||||
/*
|
||||
new ListItem(
|
||||
|
||||
Reference in New Issue
Block a user