U4-7591 File cleanup for old editor 'tasks' and 'create' dialogs

This commit is contained in:
Shannon
2015-12-22 16:27:50 +01:00
parent f3f70a3243
commit c470df783c
14 changed files with 0 additions and 867 deletions

View File

@@ -35,7 +35,6 @@ namespace Umbraco.Tests.UI
[TestCase(typeof(stylesheetPropertyTasks), DefaultApps.settings)]
[TestCase(typeof(ScriptTasks), DefaultApps.settings)]
[TestCase(typeof(MemberGroupTasks), DefaultApps.member)]
[TestCase(typeof(MediaTypeTasks), DefaultApps.settings)]
[TestCase(typeof(dictionaryTasks), DefaultApps.settings)]
[TestCase(typeof(macroTasks), DefaultApps.developer)]
[TestCase(typeof(languageTasks), DefaultApps.settings)]

View File

@@ -1995,7 +1995,6 @@
<Content Include="Umbraco\Create\language.ascx">
<SubType>UserControl</SubType>
</Content>
<Content Include="Umbraco\Create\media.ascx" />
<Content Include="Umbraco\Create\member.ascx" />
<Content Include="Umbraco\Create\nodeType.ascx">
<SubType>UserControl</SubType>

View File

@@ -1,17 +0,0 @@
<%@ Control Language="c#" AutoEventWireup="True" Codebehind="media.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.media" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%=umbraco.ui.Text("name")%>: <asp:RequiredFieldValidator id="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator><br />
<asp:TextBox id="rename" Runat="server" Width="350px" CssClass="bigInput"></asp:TextBox>
<div style="MARGIN-TOP: 10px">
<%=umbraco.ui.Text("choose")%> <%=umbraco.ui.Text("media")%> <%=umbraco.ui.Text("type")%>:<br />
<asp:ListBox id="nodeType" Runat="server" Width="350px" CssClass="bigInput" Rows="1" SelectionMode="Single"></asp:ListBox><br />
</div>
<!-- added to support missing postback on enter in IE -->
<asp:TextBox runat="server" style="visibility:hidden;display:none;" ID="Textbox1"/>
<div style="MARGIN-TOP: 15px;">
<asp:Button id="sbmt" Runat="server" style="MARGIN-TOP: 14px" Width="90" onclick="sbmt_Click"></asp:Button>
<em> or </em>
<a href="#" style="color: Blue; margin-left: 6px;" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("cancel")%></a>
</div>

View File

@@ -1279,7 +1279,6 @@
<Compile Include="umbraco.presentation\umbraco\create\dictionaryTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\DLRScriptingTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\macroTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\MediaTypeTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\MemberGroupTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\ScriptTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\stylesheetPropertyTasks.cs" />
@@ -1381,30 +1380,9 @@
<Compile Include="umbraco.presentation\umbraco\dialogs\SendPublish.aspx.designer.cs">
<DependentUpon>SendPublish.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\content.ascx.cs">
<DependentUpon>content.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\content.ascx.designer.cs">
<DependentUpon>content.ascx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\dialogHandler_temp.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\media.ascx.cs">
<DependentUpon>media.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\media.ascx.designer.cs">
<DependentUpon>media.ascx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\member.ascx.cs">
<DependentUpon>member.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\member.ascx.designer.cs">
<DependentUpon>member.ascx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\create\languageTasks.cs">
<SubType>Code</SubType>
</Compile>
@@ -2056,13 +2034,6 @@
<Content Include="umbraco.presentation\umbraco\translation\default.aspx" />
<Content Include="umbraco.presentation\umbraco\translation\preview.aspx" />
<Content Include="umbraco.presentation\umbraco\translation\xml.aspx" />
<Content Include="umbraco.presentation\umbraco\create\content.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\create\media.ascx" />
<Content Include="umbraco.presentation\umbraco\create\member.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\dashboard\LatestEdits.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>

View File

@@ -1,49 +0,0 @@
using Umbraco.Core.Configuration;
using Umbraco.Web.UI;
using Umbraco.Core;
using umbraco.BusinessLogic;
namespace umbraco
{
public class MediaTypeTasks : LegacyDialogTask
{
public override bool PerformSave()
{
var mediaType = cms.businesslogic.media.MediaType.MakeNew(User, Alias.Replace("'", "''"));
mediaType.IconUrl = ".sprTreeFolder";
if (ParentID != -1)
{
mediaType.MasterContentType = ParentID;
mediaType.Save();
}
_returnUrl = string.Format("settings/editMediaType.aspx?id={0}", mediaType.Id);
return true;
}
public override bool PerformDelete()
{
var mediaType = ApplicationContext.Current.Services.ContentTypeService.GetMediaType(ParentID);
if (mediaType != null)
{
ApplicationContext.Current.Services.ContentTypeService.Delete(mediaType);
}
return false;
}
private string _returnUrl = "";
public override string ReturnUrl
{
get { return _returnUrl; }
}
public override string AssignedApp
{
get { return DefaultApps.settings.ToString(); }
}
}
}

View File

@@ -1,27 +0,0 @@
<%@ Control Language="c#" AutoEventWireup="True" Codebehind="content.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.content" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:literal id="typeJs" runat="server"/>
<div><%=umbraco.ui.Text("name")%>:<br /></div>
<asp:TextBox id="rename" Runat="server" CssClass="bigInput"></asp:TextBox><br /><br />
<asp:RequiredFieldValidator id="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator>
<span style="margin-left: -7px;"><%=umbraco.ui.Text("choose")%> <%=umbraco.ui.Text("documentType")%>:<br /></span>
<asp:ListBox id="nodeType" Runat="server" cssClass="bigInput" Rows="1" SelectionMode="Single"></asp:ListBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator2" ErrorMessage="*" ControlToValidate="nodeType" runat="server">*</asp:RequiredFieldValidator>
<br />
<!-- added to support missing postback on enter in IE -->
<asp:TextBox runat="server" style="visibility:hidden;display:none;" ID="Textbox1"/>
<div id="typeDescription" class="createDescription">
<asp:Literal ID="descr" runat="server"></asp:Literal>
</div>
<div style="margin-right: 15px;">
<asp:Button id="sbmt" Runat="server" style="Width: 90px; margin-right: 6px;" onclick="sbmt_Click"></asp:Button>
<em> <%= umbraco.ui.Text("or") %> </em>
<a href="#" style="color: Blue; margin-left: 6px;" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("cancel")%></a>
<!--
<input type="button" value="" onClick="if (confirm('<%=umbraco.ui.Text("areyousure")%>')) window.close()" style="width: 90px; margin-left: 6px;"/>
-->
</div>

View File

@@ -1,125 +0,0 @@
using System;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Umbraco.Core.IO;
using Umbraco.Web.UI;
using umbraco.cms.businesslogic.web;
using umbraco.presentation.create;
using Content=umbraco.cms.businesslogic.Content;
using umbraco.cms.helpers;
using umbraco.BasePages;
namespace umbraco.cms.presentation.create.controls
{
/// <summary>
/// Summary description for content.
/// </summary>
public partial class content : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
sbmt.Text = ui.Text("create");
var nodeId = int.Parse(Request["nodeID"]);
var allowedIds = new int[0];
if (nodeId > 0)
{
var c = new Document(nodeId);
allowedIds = c.ContentType.AllowedChildContentTypeIDs;
}
nodeType.Attributes.Add("onChange", "document.getElementById('typeDescription').innerHTML = typeInfo[this.selectedIndex];");
var counter = 0;
var typeInited = false;
var js = new StringBuilder();
var documentTypeList = DocumentType.GetAllAsList().ToList();
foreach (var dt in documentTypeList)
{
string docDescription = "<em>No description available...</em>";
if (string.IsNullOrEmpty(dt.Description) == false)
docDescription = System.Web.HttpUtility.HtmlEncode(dt.Description);
docDescription = "<strong>" + dt.Text + "</strong><br/>" + docDescription.Replace(Environment.NewLine, "<br />");
docDescription = docDescription.Replace("'", "\\'");
var docImage = (dt.Thumbnail != "") ? dt.Thumbnail : "../nada.gif";
docImage = IOHelper.ResolveUrl( SystemDirectories.Umbraco ) + "/images/thumbnails/" + docImage;
var li = new ListItem();
li.Text = dt.Text;
li.Value = dt.Id.ToString();
if (nodeId > 0)
{
foreach (var i in allowedIds) if (i == dt.Id)
{
nodeType.Items.Add(li);
js.Append("typeInfo[" + counter + "] = '<img src=\"" + docImage + "\"><p>" +
docDescription + "</p>'\n");
if (typeInited == false)
{
descr.Text = "<img src=\"" + docImage + "\"><p>" +
docDescription + "</p>";
typeInited = true;
}
counter++;
}
}
// The Any check is here for backwards compatibility, if none are allowed at root, then all are allowed
else if (documentTypeList.Any(d => d.AllowAtRoot) == false || dt.AllowAtRoot)
{
nodeType.Items.Add(li);
js.Append("typeInfo[" + counter + "] = '<img src=\"" + docImage + "\"><p>" +
docDescription + "</p>'\n");
if (typeInited == false)
{
descr.Text = "<img src=\"" + docImage + "\"><p>" +
docDescription + "</p>'";
typeInited = true;
}
counter++;
}
}
if (nodeType.Items.Count == 0) {
sbmt.Enabled = false;
}
typeJs.Text = "<script type=\"text/javascript\">\nvar typeInfo = new Array(" + counter.ToString() + ");\n " + js.ToString() + "\n</script>\n ";
}
}
protected void sbmt_Click(object sender, EventArgs e)
{
DoCreation();
}
private void DoCreation()
{
if (Page.IsValid)
{
var returnUrl = LegacyDialogHandler.Create(
new HttpContextWrapper(Context),
BasePage.Current.getUser(),
helper.Request("nodeType"),
int.Parse(Request["nodeID"]),
rename.Text,
int.Parse(nodeType.SelectedValue));
BasePage.Current.ClientTools
.ChangeContentFrameUrl(returnUrl)
.CloseModalWindow();
}
}
}
}

View File

@@ -1,88 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.cms.presentation.create.controls {
public partial class content {
/// <summary>
/// typeJs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal typeJs;
/// <summary>
/// rename control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox rename;
/// <summary>
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// nodeType control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ListBox nodeType;
/// <summary>
/// RequiredFieldValidator2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
/// <summary>
/// Textbox1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Textbox1;
/// <summary>
/// descr control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal descr;
/// <summary>
/// sbmt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button sbmt;
}
}

View File

@@ -1,17 +0,0 @@
<%@ Control Language="c#" AutoEventWireup="True" Codebehind="media.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.media" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%=umbraco.ui.Text("name")%>: <asp:RequiredFieldValidator id="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator><br />
<asp:TextBox id="rename" Runat="server" Width="350px" CssClass="bigInput"></asp:TextBox>
<div style="MARGIN-TOP: 10px">
<%=umbraco.ui.Text("choose")%> <%=umbraco.ui.Text("media")%> <%=umbraco.ui.Text("type")%>:<br />
<asp:ListBox id="nodeType" Runat="server" Width="350px" CssClass="bigInput" Rows="1" SelectionMode="Single"></asp:ListBox><br />
</div>
<!-- added to support missing postback on enter in IE -->
<asp:TextBox runat="server" style="visibility:hidden;display:none;" ID="Textbox1"/>
<div style="MARGIN-TOP: 15px;">
<asp:Button id="sbmt" Runat="server" style="MARGIN-TOP: 14px" Width="90" onclick="sbmt_Click"></asp:Button>
<em> or </em>
<a href="#" style="color: Blue; margin-left: 6px;" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("cancel")%></a>
</div>

View File

@@ -1,91 +0,0 @@
using System.Linq;
using System.Web;
using System.Web.UI;
using Umbraco.Web.UI;
using Umbraco.Web.UI.Controls;
using Umbraco.Web;
using umbraco.BusinessLogic;
using UmbracoUserControl = Umbraco.Web.UI.Controls.UmbracoUserControl;
namespace umbraco.cms.presentation.create.controls
{
using System;
using System.Web.UI.WebControls;
using umbraco.BasePages;
/// <summary>
/// Summary description for media.
/// </summary>
public partial class media : UmbracoUserControl
{
protected void Page_Load(object sender, System.EventArgs e)
{
sbmt.Text = ui.Text("create");
int NodeId = int.Parse(Request["nodeID"]);
int[] allowedIds = new int[0];
if (NodeId > 2)
{
cms.businesslogic.Content c = new cms.businesslogic.media.Media(NodeId);
allowedIds = c.ContentType.AllowedChildContentTypeIDs;
}
var documentTypeList = businesslogic.media.MediaType.GetAllAsList().ToList();
foreach (var dt in documentTypeList)
{
ListItem li = new ListItem();
li.Text = dt.Text;
li.Value = dt.Id.ToString();
if (NodeId > 2)
{
foreach (int i in allowedIds) if (i == dt.Id) nodeType.Items.Add(li);
}
// The Any check is here for backwards compatibility, if none are allowed at root, then all are allowed
else if (documentTypeList.Any(d => d.AllowAtRoot) == false || dt.AllowAtRoot)
nodeType.Items.Add(li);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
protected void sbmt_Click(object sender, System.EventArgs e)
{
if (Page.IsValid)
{
var returnUrl = LegacyDialogHandler.Create(
new HttpContextWrapper(Context),
new User(Security.CurrentUser),
Request.GetItemAsString("nodeType"),
int.Parse(Request["nodeID"]),
rename.Text,
int.Parse(nodeType.SelectedValue));
BasePage.Current.ClientTools
.ChangeContentFrameUrl(returnUrl)
.CloseModalWindow();
}
}
}
}

View File

@@ -1,61 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.cms.presentation.create.controls {
public partial class media {
/// <summary>
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// rename control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox rename;
/// <summary>
/// nodeType control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ListBox nodeType;
/// <summary>
/// Textbox1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Textbox1;
/// <summary>
/// sbmt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button sbmt;
}
}

View File

@@ -1,43 +0,0 @@
<%@ Control Language="c#" AutoEventWireup="True" CodeBehind="member.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.member"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:ValidationSummary runat="server" DisplayMode="BulletList" ID="validationSummary"
CssClass="error"></asp:ValidationSummary>
<asp:Literal ID="nameLiteral" runat="server"></asp:Literal>:<asp:RequiredFieldValidator
ID="nameRequired" ErrorMessage="*" ControlToValidate="rename" runat="server">*</asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="rename" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox>
<asp:Panel ID="memberChooser" runat="server">
<%=umbraco.ui.Text("choose")%>
<%=umbraco.ui.Text("membertype")%>:<asp:RequiredFieldValidator ID="memberTypeRequired" ErrorMessage="*" ControlToValidate="nodeType"
runat="server">*</asp:RequiredFieldValidator><br />
<asp:ListBox ID="nodeType" runat="server" Width="350px" CssClass="bigInput" Rows="1"
SelectionMode="Single"></asp:ListBox>
</asp:Panel>
<p>
Login Name:<asp:RequiredFieldValidator ID="loginRequired" ErrorMessage="*" ControlToValidate="Login"
runat="server">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="loginExistsCheck" runat="server" ErrorMessage="*" ControlToValidate="Login" ValidateEmptyText="false" OnServerValidate="LoginExistsCheck"></asp:CustomValidator>
<br />
<asp:TextBox ID="Login" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox><br />
</p>
<p>
E-mail:<asp:RequiredFieldValidator ID="emailRequired" ErrorMessage="*" ControlToValidate="Email"
runat="server">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="emailExistsCheck" runat="server" ErrorMessage="*" ControlToValidate="Email" ValidateEmptyText="false" OnServerValidate="EmailExistsCheck"></asp:CustomValidator>
<br />
<asp:TextBox ID="Email" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox><br />
</p>
<p>
Password: <em>
<asp:Literal runat="server" ID="PasswordRules"></asp:Literal></em><asp:RequiredFieldValidator
ID="passwordRequired" ControlToValidate="Password" runat="server">*</asp:RequiredFieldValidator><br />
<asp:TextBox ID="Password" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox><br />
</p>
<!-- added to support missing postback on enter in IE -->
<asp:TextBox runat="server" Style="visibility: hidden; display: none;" ID="Textbox1" />
<div style="padding-top: 15px;">
<asp:Button ID="sbmt" runat="server" Style="margin-top: 14px" Width="90" OnClick="sbmt_Click">
</asp:Button>
&nbsp; <em>
<%= umbraco.ui.Text("or") %></em> &nbsp;<a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("cancel")%></a>
</div>

View File

@@ -1,132 +0,0 @@
using Umbraco.Web.UI;
using System.Globalization;
using Umbraco.Core.Security;
namespace umbraco.cms.presentation.create.controls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
using umbraco.cms.helpers;
using umbraco.BasePages;
using umbraco.cms.businesslogic.member;
/// <summary>
/// Summary description for member.
/// </summary>
public partial class member : System.Web.UI.UserControl
{
protected void Page_Load(object sender, System.EventArgs e)
{
var provider = MembershipProviderExtensions.GetMembersMembershipProvider();
sbmt.Text = ui.Text("create");
if (provider.IsUmbracoMembershipProvider())
{
nameLiteral.Text = ui.Text("name");
memberChooser.Attributes.Add("style", "padding-top: 10px");
foreach (var dt in MemberType.GetAll)
{
ListItem li = new ListItem();
li.Text = dt.Text;
li.Value = dt.Id.ToString();
nodeType.Items.Add(li);
}
}
else
{
nameLiteral.Text = ui.Text("login");
memberChooser.Visible = false;
}
string[] pwRules =
{
provider.MinRequiredPasswordLength.ToString(CultureInfo.InvariantCulture),
provider.MinRequiredNonAlphanumericCharacters.ToString(CultureInfo.InvariantCulture)
};
PasswordRules.Text = PasswordRules.Text = ui.Text(
"errorHandling", "", pwRules, UmbracoEnsuredPage.CurrentUser);
if (!IsPostBack)
{
passwordRequired.ErrorMessage = ui.Text("errorHandling", "errorMandatoryWithoutTab", ui.Text("password"), BasePages.UmbracoEnsuredPage.CurrentUser);
nameRequired.ErrorMessage = ui.Text("errorHandling", "errorMandatoryWithoutTab", nameLiteral.Text, BasePages.UmbracoEnsuredPage.CurrentUser);
emailRequired.ErrorMessage = ui.Text("errorHandling", "errorMandatoryWithoutTab", "E-mail", BasePages.UmbracoEnsuredPage.CurrentUser);
loginRequired.ErrorMessage = ui.Text("errorHandling", "errorMandatoryWithoutTab", "Login Name", BasePages.UmbracoEnsuredPage.CurrentUser);
loginExistsCheck.ErrorMessage = ui.Text("errorHandling", "errorExistsWithoutTab", "Login Name", BasePages.UmbracoEnsuredPage.CurrentUser);
emailExistsCheck.ErrorMessage = ui.Text("errorHandling", "errorExistsWithoutTab", "E-mail", BasePages.UmbracoEnsuredPage.CurrentUser);
memberTypeRequired.ErrorMessage = ui.Text("errorHandling", "errorMandatoryWithoutTab", "Member Type", BasePages.UmbracoEnsuredPage.CurrentUser);
Password.Text =
Membership.GeneratePassword(provider.MinRequiredPasswordLength, provider.MinRequiredNonAlphanumericCharacters);
}
}
protected void sbmt_Click(object sender, System.EventArgs e)
{
if (Page.IsValid)
{
var memberType = memberChooser.Visible ? int.Parse(nodeType.SelectedValue) : -1;
var emailAppend = String.IsNullOrEmpty(Email.Text) ? "" : String.Format("|{0}|{1}|{2}", Email.Text, Password.Text,Login.Text);
var returnUrl = LegacyDialogHandler.Create(
new HttpContextWrapper(Context),
BasePage.Current.getUser(),
helper.Request("nodeType"),
-1,
rename.Text + emailAppend,
memberType);
BasePage.Current.ClientTools
.ChangeContentFrameUrl(returnUrl)
.CloseModalWindow();
}
}
/// <summary>
/// Validation to Check if Login Name Exists
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LoginExistsCheck(object sender, ServerValidateEventArgs e)
{
if (Login.Text != "" && Member.GetMemberFromLoginName(Login.Text.Replace(" ", "").ToLower()) != null)
e.IsValid = false;
else
e.IsValid = true;
}
/// <summary>
/// Validation to Check if Member with email Exists
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void EmailExistsCheck(object sender, ServerValidateEventArgs e)
{
var provider = MembershipProviderExtensions.GetMembersMembershipProvider();
if (Email.Text != "" && Member.GetMemberFromEmail(Email.Text.ToLower()) != null && provider.RequiresUniqueEmail)
e.IsValid = false;
else
e.IsValid = true;
}
protected void EmailValidator_OnServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = MembershipProviderBase.IsEmailValid(args.Value);
}
}
}

View File

@@ -1,186 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.cms.presentation.create.controls {
public partial class member {
/// <summary>
/// EmailValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator EmailValidator;
/// <summary>
/// validationSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary validationSummary;
/// <summary>
/// nameLiteral control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal nameLiteral;
/// <summary>
/// nameRequired control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator nameRequired;
/// <summary>
/// rename control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox rename;
/// <summary>
/// memberChooser control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel memberChooser;
/// <summary>
/// memberTypeRequired control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator memberTypeRequired;
/// <summary>
/// nodeType control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ListBox nodeType;
/// <summary>
/// loginRequired control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator loginRequired;
/// <summary>
/// loginExistsCheck control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator loginExistsCheck;
/// <summary>
/// Login control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Login;
/// <summary>
/// emailRequired control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator emailRequired;
/// <summary>
/// emailExistsCheck control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator emailExistsCheck;
/// <summary>
/// Email control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Email;
/// <summary>
/// PasswordRules control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal PasswordRules;
/// <summary>
/// passwordRequired control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator passwordRequired;
/// <summary>
/// Password control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Password;
/// <summary>
/// Textbox1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Textbox1;
/// <summary>
/// sbmt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button sbmt;
}
}