Merge branch 'temp8' into temp8-remove-package-ascx-3996

This commit is contained in:
Shannon
2019-01-09 20:47:26 +11:00
38 changed files with 32 additions and 2369 deletions

View File

@@ -164,13 +164,6 @@
<Compile Include="Umbraco\Developer\Packages\DirectoryBrowser.aspx.designer.cs">
<DependentUpon>directoryBrowser.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Dialogs\ChangeDocType.aspx.cs">
<DependentUpon>ChangeDocType.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\ChangeDocType.aspx.designer.cs">
<DependentUpon>ChangeDocType.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Masterpages\Default.Master.cs">
<DependentUpon>default.Master</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -301,15 +294,6 @@
<Content Include="Umbraco\Config\Lang\pt.xml" />
<Content Include="Umbraco\Config\Lang\ru.xml" />
<Content Include="Umbraco\Config\Lang\zh.xml" />
<Content Include="Umbraco\Developer\RelationTypes\EditRelationType.aspx" />
<Content Include="Umbraco\Developer\RelationTypes\Images\Bidirectional.png" />
<Content Include="Umbraco\Developer\RelationTypes\Images\ParentToChild.png" />
<Content Include="Umbraco\Developer\RelationTypes\Images\Refresh.gif" />
<Content Include="Umbraco\Developer\RelationTypes\NewRelationType.aspx" />
<Content Include="Umbraco\Developer\RelationTypes\RelationTypesWebService.asmx" />
<Content Include="Umbraco\Dialogs\ChangeDocType.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="Umbraco\Config\Lang\ko.xml" />
<Content Include="Umbraco\Dashboard\FeedProxy.aspx" />
<Content Include="default.aspx" />
@@ -323,7 +307,6 @@
<Content Include="Umbraco\Config\Lang\nl.xml" />
<Content Include="Umbraco\Config\Lang\nb.xml" />
<Content Include="Umbraco\Config\Lang\sv.xml" />
<Content Include="Umbraco\Dialogs\republish.aspx" />
<Content Include="Umbraco\Developer\Packages\directoryBrowser.aspx" />
<Content Include="Umbraco\Developer\Packages\editPackage.aspx" />
<Content Include="Umbraco\Config\Create\UI.xml" />

View File

@@ -1,147 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" Inherits="umbraco.cms.presentation.developer.RelationTypes.EditRelationType" MasterPageFile="../../masterpages/umbracoPage.Master" %>
<%@ Register TagPrefix="umb" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
table.relations { }
table.relations th { width:auto; }
table.relations th.objectTypeIcon { width:20px; }
table.relations th.directionIcon { width:16px; height:16px; }
table.relations td { background: transparent none no-repeat scroll center center }
table.relations td a { text-decoration: underline; }
/* objectType icons */
table.relations td.ContentItemType {}
table.relations td.ROOT {}
table.relations td.Document {}
table.relations td.Media {}
table.relations td.MemberType {}
table.relations td.Template {}
table.relations td.MemberGroup {}
table.relations td.ContentItem {}
table.relations td.MediaType {}
table.relations td.DocumentType {}
table.relations td.RecycleBin {}
table.relations td.Stylesheet {}
table.relations td.Member {}
table.relations td.DataType {}
/* direction icons */
table.relations td.parentToChild { background-image: url('../../developer/RelationTypes/Images/ParentToChild.png'); }
table.relations td.bidirectional { background-image: url('../../developer/RelationTypes/Images/Bidirectional.png'); }
</style>
</asp:Content>
<asp:Content ID="bodyContent" ContentPlaceHolderID="body" runat="server">
<umb:TabView runat="server" ID="tabControl" Width="200" />
<umb:Pane ID="idPane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="idPropertyPanel" Text="Id">
<asp:Literal ID="idLiteral" runat="server" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="nameAliasPane" runat="server" Text="">
<umb:PropertyPanel runat="server" ID="nameProperyPanel" Text="Name">
<asp:TextBox ID="nameTextBox" runat="server" Columns="40" ></asp:TextBox>
<asp:RequiredFieldValidator ID="nameRequiredFieldValidator" runat="server" ControlToValidate="nameTextBox" ValidationGroup="RelationType" ErrorMessage="Name Required" Display="Dynamic" />
</umb:PropertyPanel>
<umb:PropertyPanel runat="server" id="aliasPropertyPanel" Text="Alias">
<asp:TextBox ID="aliasTextBox" runat="server" Columns="40"></asp:TextBox>
<asp:RequiredFieldValidator ID="aliasRequiredFieldValidator" runat="server" ControlToValidate="aliasTextBox" ValidationGroup="RelationType" ErrorMessage="Alias Required" Display="Dynamic" />
<asp:CustomValidator ID="aliasCustomValidator" runat="server" ControlToValidate="aliasTextBox" ValidationGroup="RelationType" onservervalidate="AliasCustomValidator_ServerValidate" ErrorMessage="Duplicate Alias" Display="Dynamic" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="directionPane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="dualPropertyPanel" Text="Direction">
<asp:RadioButtonList ID="dualRadioButtonList" runat="server" RepeatDirection="Vertical">
<asp:ListItem Enabled="true" Selected="False" Text="Parent to Child" Value="0" />
<asp:ListItem Enabled="true" Selected="False" Text="Bidirectional" Value="1"/>
</asp:RadioButtonList>
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="objectTypePane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="parentPropertyPanel" Text="Parent">
<asp:Literal ID="parentLiteral" runat="server" />
</umb:PropertyPanel>
<umb:PropertyPanel runat="server" id="childPropertyPanel" Text="Child">
<asp:Literal ID="childLiteral" runat="server" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="relationsCountPane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="relationsCountPropertyPanel" Text="Count">
<asp:Literal ID="relationsCountLiteral" runat="server" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="relationsPane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="relationsPropertyPanel" Text="Relations">
<asp:Repeater ID="relationsRepeater" runat="server">
<HeaderTemplate>
<table class="table relations">
<thead>
<tr>
<th class="objectTypeIcon">&nbsp;</th>
<th>Parent</th>
<th class="directionIcon">&nbsp;</th>
<th class="objectTypeIcon">&nbsp;</th>
<th>Child</th>
<th>Created</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td class="<%= this.ParentObjectType %>">&nbsp;</td>
<td><a href="<%# GetEditUrl(this.ParentObjectType, (int)DataBinder.Eval(Container.DataItem, "ParentId")) %>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "ParentText") %></a></td>
<td class="<%= this.RelationTypeDirection %>">&nbsp;</td>
<td class="<%= this.ChildObjectType %>">&nbsp;</td>
<td><a href="<%# GetEditUrl(this.ChildObjectType, (int)DataBinder.Eval(Container.DataItem, "ChildId")) %>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "ChildText") %></a></td>
<td><%# DataBinder.Eval(Container.DataItem, "DateTime") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "Comment") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</umb:PropertyPanel>
</umb:Pane>
</asp:Content>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1,50 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewRelationType.aspx.cs" Inherits="umbraco.cms.presentation.developer.RelationTypes.NewRelationType" MasterPageFile="../../masterpages/umbracoDialog.Master"%>
<%@ Register TagPrefix="umb" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ID="bodyContent" ContentPlaceHolderID="body" runat="server">
<umb:Pane ID="nameAliasPane" runat="server" Text="">
<umb:PropertyPanel runat="server" ID="nameProperyPanel" Text="Name">
<asp:TextBox ID="descriptionTextBox" runat="server" Columns="40" AutoCompleteType="Disabled" style="width:200px;" />
<asp:RequiredFieldValidator ID="descriptionRequiredFieldValidator" runat="server" ControlToValidate="descriptionTextBox" ValidationGroup="NewRelationType" ErrorMessage="Name Required" Display="Dynamic" />
</umb:PropertyPanel>
<umb:PropertyPanel runat="server" id="aliasPropertyPanel" Text="Alias">
<asp:TextBox ID="aliasTextBox" runat="server" Columns="40" AutoCompleteType="Disabled" style="width:200px;" />
<asp:RequiredFieldValidator ID="aliasRequiredFieldValidator" runat="server" ControlToValidate="aliasTextBox" ValidationGroup="NewRelationType" ErrorMessage="Alias Required" Display="Dynamic" />
<asp:CustomValidator ID="aliasCustomValidator" runat="server" ControlToValidate="aliasTextBox" ValidationGroup="NewRelationType" onservervalidate="AliasCustomValidator_ServerValidate" ErrorMessage="Duplicate Alias" Display="Dynamic" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="directionPane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="PropertyPanel1" Text="Direction">
<asp:RadioButtonList ID="dualRadioButtonList" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Enabled="true" Selected="True" Text="Parent to Child" Value="0"/>
<asp:ListItem Enabled="true" Selected="False" Text="Bidirectional" Value="1"/>
</asp:RadioButtonList>
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane ID="objectTypePane" runat="server" Text="">
<umb:PropertyPanel runat="server" id="PropertyPanel2" Text="Parent">
<asp:DropDownList ID="parentDropDownList" runat="server" />
</umb:PropertyPanel>
<umb:PropertyPanel runat="server" id="PropertyPanel3" Text="Child">
<asp:DropDownList ID="childDropDownList" runat="server" />
</umb:PropertyPanel>
</umb:Pane>
<umb:Pane runat="server" CssClass="btn-toolbar umb-btn-toolbar">
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("cancel")%></a>
<asp:Button ID="addButton" runat="server" Text="Create" cssclass="btn btn-primary" onclick="AddButton_Click" CausesValidation="true" ValidationGroup="NewRelationType" />
</umb:Pane>
</asp:Content>

View File

@@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="RelationTypesWebService.asmx.cs" Class="umbraco.cms.presentation.developer.RelationTypes.RelationTypesWebService" %>

View File

@@ -1,120 +0,0 @@
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master"Codebehind="ChangeDocType.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Dialogs.ChangeDocType" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<style type="text/css">
#propertyMapping thead tr th{border-bottom:1px solid #ccc; padding: 4px; padding-right: 25px;
background-image: url(<%= Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.UmbracoClient) %>/tableSorting/img/bg.gif);
cursor: pointer;
font-weight: bold;
background-repeat: no-repeat;
background-position: center right;
}
#propertyMapping tbody tr td{border-bottom:1px solid #efefef}
#propertyMapping td{padding: 4px; ;}
body.umbracoDialog { overflow: auto; }
.umb-dialog .umb-control-group .umb-el-wrap { overflow: hidden; }
.umb-dialog .umb-control-group .umb-el-wrap label { float: left; width: 140px; font-weight: bold; }
.umb-dialog .umb-control-group .umb-el-wrap label:after { content:":"; }
.umb-dialog .umb-control-group .umb-el-wrap .controls-row { float: left; width: 280px; padding-bottom: 8px; }
.umb-dialog .umb-control-group .umb-el-wrap .controls-row select { width: auto; }
</style>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc1:Pane runat="server" ID="ChangeDocTypePane">
<p class="help">
<%= Services.TextService.Localize("changeDocType/changeDocTypeInstruction") %>
</p>
<cc1:PropertyPanel ID="ContentNamePropertyPanel" runat="server">
<asp:Label ID="ContentNameLabel" runat="server" />
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="CurrentTypePropertyPanel" runat="server">
<asp:Label ID="CurrentTypeLabel" runat="server" />
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="NewTypePropertyPanel" runat="server">
<asp:DropDownList ID="NewDocumentTypeList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="NewDocumentTypeList_SelectedIndexChanged" />
<asp:RequiredFieldValidator ControlToValidate="NewDocumentTypeList" ErrorMessage="*" ID="NewDocumentTypeValidator" runat="server" Display="Dynamic" />
<br /><small><%=Services.TextService.Localize("changeDocType/validDocTypesNote") %></small>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="NewTemplatePropertyPanel" runat="server">
<asp:DropDownList ID="NewTemplateList" runat="server" />
</cc1:PropertyPanel>
<asp:PlaceHolder ID="NotAvailablePlaceholder" runat="server" Visible="false">
<div class="propertyItem notice" style="padding-top: 10px">
<p><%=Services.TextService.Localize("changeDocType/docTypeCannotBeChanged") %></p>
</div>
</asp:PlaceHolder>
</cc1:Pane>
<cc1:Pane runat="server" ID="ChangeDocTypePropertyMappingPane">
<p class="help">
<%= Services.TextService.Localize("changeDocType/changeDocTypeInstruction2") %>
</p>
<asp:Repeater ID="PropertyMappingRepeater" runat="server">
<HeaderTemplate>
<table id="propertyMapping">
<thead>
<tr>
<th><%= Services.TextService.Localize("changeDocType/currentProperty") %></th>
<th><%= Services.TextService.Localize("changeDocType/mapToProperty") %></th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container, "DataItem.Name") %>
<asp:HiddenField ID="Alias" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.Alias")%>' />
<asp:HiddenField ID="Name" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.Name")%>' />
<asp:HiddenField ID="PropertyEditorAlias" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.PropertyEditorAlias")%>' />
</td>
<td><asp:DropDownList id="DestinationProperty" runat="server" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</cc1:Pane>
<asp:PlaceHolder ID="SuccessPlaceholder" runat="server" Visible="false">
<p><%=Services.TextService.Localize("changeDocType/docTypeChanged") %></p>
<p>
<asp:Literal ID="SuccessMessage" runat="server" />
<asp:Literal ID="PropertiesMappedMessage" runat="server" />
<asp:Literal ID="ContentPublishedMessage" runat="server" />
<br /><br />
<a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("defaultdialogs/closeThisWindow") %></a>
</p>
</asp:PlaceHolder>
<asp:PlaceHolder ID="ValidationPlaceholder" runat="server" Visible="false">
<br />
<div class="notice" style="padding: 10px">
<asp:Literal id="ValidationError" runat="server" />
</div>
</asp:PlaceHolder>
<div class="btn-toolbar umb-btn-toolbar">
<asp:PlaceHolder ID="SaveAndCancelPlaceholder" runat="server">
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("general/cancel")%></a>
<asp:PlaceHolder ID="SavePlaceholder" runat="server">
<asp:Button ID="ValidateAndSave" runat="server" CssClass="btn btn-primary" Text="Create" OnClick="ValidateAndSave_Click"></asp:Button>
</asp:PlaceHolder>
</asp:Placeholder>
</div>
</asp:Content>

View File

@@ -1,346 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Core.Models;
using Umbraco.Web.UI.Pages;
namespace Umbraco.Web.UI.Umbraco.Dialogs
{
public partial class ChangeDocType : UmbracoEnsuredPage
{
class PropertyMapping
{
public string FromName { get; set; }
public string ToName { get; set; }
public string ToAlias { get; set; }
public object Value { get; set; }
}
private IContent _content;
protected void Page_Load(object sender, EventArgs e)
{
var contentNodeId = int.Parse(Request.QueryString["id"]);
_content = Services.ContentService.GetById(contentNodeId);
LocalizeTexts();
if (!Page.IsPostBack)
{
DisplayContentDetails();
if (PopulateListOfValidAlternateDocumentTypes())
{
PopulateListOfTemplates();
PopulatePropertyMappingWithSources();
PopulatePropertyMappingWithDestinations();
}
else
{
DisplayNotAvailable();
}
}
}
private void LocalizeTexts()
{
ChangeDocTypePane.Text = Services.TextService.Localize("changeDocType/selectNewDocType");
ContentNamePropertyPanel.Text = Services.TextService.Localize("changeDocType/selectedContent");
CurrentTypePropertyPanel.Text = Services.TextService.Localize("changeDocType/currentType");
NewTypePropertyPanel.Text = Services.TextService.Localize("changeDocType/newType");
NewTemplatePropertyPanel.Text = Services.TextService.Localize("changeDocType/newTemplate");
ChangeDocTypePropertyMappingPane.Text = Services.TextService.Localize("changeDocType/mapProperties");
ValidateAndSave.Text = Services.TextService.Localize("buttons/save");
}
private void DisplayContentDetails()
{
ContentNameLabel.Text = _content.Name;
CurrentTypeLabel.Text = _content.ContentType.Name;
}
private bool PopulateListOfValidAlternateDocumentTypes()
{
// Start with all content types
var documentTypes = Services.ContentTypeService.GetAll().ToArray();
// Remove invalid ones from list of potential alternatives
documentTypes = RemoveCurrentDocumentTypeFromAlternatives(documentTypes).ToArray();
documentTypes = RemoveInvalidByParentDocumentTypesFromAlternatives(documentTypes).ToArray();
documentTypes = RemoveInvalidByChildrenDocumentTypesFromAlternatives(documentTypes).ToArray();
// If we have at least one, bind to list and return true
if (documentTypes.Any())
{
NewDocumentTypeList.DataSource = documentTypes.OrderBy(x => x.Name);
NewDocumentTypeList.DataValueField = "Id";
NewDocumentTypeList.DataTextField = "Name";
NewDocumentTypeList.DataBind();
return true;
}
return false;
}
private IEnumerable<IContentType> RemoveCurrentDocumentTypeFromAlternatives(IEnumerable<IContentType> documentTypes)
{
return documentTypes
.Where(x => x.Id != _content.ContentType.Id);
}
private IEnumerable<IContentType> RemoveInvalidByParentDocumentTypesFromAlternatives(IEnumerable<IContentType> documentTypes)
{
if (_content.ParentId == -1)
{
// Root content, only include those that have been selected as allowed at root
return documentTypes
.Where(x => x.AllowedAsRoot);
}
else
{
// Below root, so only include those allowed as sub-nodes for the parent
var parentNode = Services.ContentService.GetById(_content.ParentId);
return documentTypes
.Where(x => parentNode.ContentType.AllowedContentTypes
.Select(y => y.Id.Value)
.Contains(x.Id));
}
}
private IEnumerable<IContentType> RemoveInvalidByChildrenDocumentTypesFromAlternatives(IEnumerable<IContentType> documentTypes)
{
//fixme Should do proper paging here ... when this is refactored we will
var docTypeIdsOfChildren = Services.ContentService.GetPagedChildren(_content.Id, 0, int.MaxValue, out var total)
.Select(x => x.ContentType.Id)
.Distinct()
.ToList();
return documentTypes
.Where(x => x.AllowedContentTypes
.Select(y => y.Id.Value)
.ContainsAll(docTypeIdsOfChildren));
}
private void PopulateListOfTemplates()
{
// Get selected new document type
var contentType = GetSelectedDocumentType();
// Populate template list
NewTemplateList.DataSource = contentType.AllowedTemplates;
NewTemplateList.DataValueField = "Id";
NewTemplateList.DataTextField = "Name";
NewTemplateList.DataBind();
NewTemplateList.Items.Add(new ListItem("<" + Services.TextService.Localize("changeDocType/none") + ">", "0"));
// Set default template
if (contentType.DefaultTemplate != null)
{
var itemToSelect = NewTemplateList.Items.FindByValue(contentType.DefaultTemplate.Id.ToString());
if (itemToSelect != null)
{
itemToSelect.Selected = true;
}
}
}
private void PopulatePropertyMappingWithSources()
{
PropertyMappingRepeater.DataSource = GetPropertiesOfContentType(_content.ContentType);
PropertyMappingRepeater.DataBind();
}
private void PopulatePropertyMappingWithDestinations()
{
// Get selected new document type
var contentType = GetSelectedDocumentType();
// Get properties of new document type (including any from parent types)
var properties = GetPropertiesOfContentType(contentType);
// Loop through list of source properties and populate destination options with all those of same property type
foreach (RepeaterItem ri in PropertyMappingRepeater.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
{
// Get data type from hidden field
var propEdAlias = ((HiddenField)ri.FindControl("PropertyEditorAlias")).Value;
// Bind destination list with properties that match data type
var ddl = (DropDownList)ri.FindControl("DestinationProperty");
ddl.DataSource = properties.Where(x => x.PropertyEditorAlias == propEdAlias);
ddl.DataValueField = "Alias";
ddl.DataTextField = "Name";
ddl.DataBind();
ddl.Items.Insert(0, new ListItem("<" + Services.TextService.Localize("changeDocType/none") + ">", string.Empty));
// Set default selection to be one with matching alias
var alias = ((HiddenField)ri.FindControl("Alias")).Value;
var item = ddl.Items.FindByValue(alias);
if (item != null)
{
item.Selected = true;
}
}
}
}
private IContentType GetSelectedDocumentType()
{
return Services.ContentTypeService.Get(int.Parse(NewDocumentTypeList.SelectedItem.Value));
}
private IEnumerable<PropertyType> GetPropertiesOfContentType(IContentType contentType)
{
return contentType.CompositionPropertyTypes;
}
private void DisplayNotAvailable()
{
NewTypePropertyPanel.Visible = false;
NewTemplatePropertyPanel.Visible = false;
SavePlaceholder.Visible = false;
NotAvailablePlaceholder.Visible = true;
ChangeDocTypePropertyMappingPane.Visible = false;
}
protected void NewDocumentTypeList_SelectedIndexChanged(object sender, EventArgs e)
{
PopulateListOfTemplates();
PopulatePropertyMappingWithDestinations();
}
protected void ValidateAndSave_Click(object sender, EventArgs e)
{
if (IsPropertyMappingValid())
{
// For all properties to be mapped, save the values to a temporary list
var propertyMappings = SavePropertyMappings();
// Get flag for if content already published
var wasPublished = _content.Published;
// Change the document type passing flag to clear the properties
var newContentType = GetSelectedDocumentType();
_content.ChangeContentType(newContentType, true);
// Set the template if one has been selected
if (NewTemplateList.SelectedItem != null)
{
var templateId = int.Parse(NewTemplateList.SelectedItem.Value);
_content.Template = templateId > 0 ? Services.FileService.GetTemplate(templateId) : null;
}
// Set the property values
var propertiesMappedMessageBuilder = new StringBuilder("<ul>");
foreach (var propertyMapping in propertyMappings)
{
propertiesMappedMessageBuilder.AppendFormat("<li>{0} {1} {2}</li>",
propertyMapping.FromName, Services.TextService.Localize("changeDocType/to"), propertyMapping.ToName);
_content.SetValue(propertyMapping.ToAlias, propertyMapping.Value);
}
propertiesMappedMessageBuilder.Append("</ul>");
// Save
var user = Security.CurrentUser;
Services.ContentService.Save(_content, user.Id);
// Publish if the content was already published
if (wasPublished)
{
// no values to publish, really
Services.ContentService.SaveAndPublish(_content, userId: user.Id);
}
// Sync the tree
ClientTools.SyncTree(_content.Path, true);
// Reload the page if the content was already being viewed
ClientTools.ReloadLocation();
// Display success message
SuccessMessage.Text = Services.TextService.Localize("changeDocType/successMessage").Replace("[new type]", "<strong>" + newContentType.Name + "</strong>");
PropertiesMappedMessage.Text = propertiesMappedMessageBuilder.ToString();
if (wasPublished)
{
ContentPublishedMessage.Text = Services.TextService.Localize("changeDocType/contentRepublished");
ContentPublishedMessage.Visible = true;
}
else
{
ContentPublishedMessage.Visible = false;
}
SuccessPlaceholder.Visible = true;
SaveAndCancelPlaceholder.Visible = false;
ValidationPlaceholder.Visible = false;
ChangeDocTypePane.Visible = false;
ChangeDocTypePropertyMappingPane.Visible = false;
}
else
{
ValidationPlaceholder.Visible = true;
}
}
private bool IsPropertyMappingValid()
{
// Check whether any properties have been mapped to more than once
var mappedPropertyAliases = new List<string>();
foreach (RepeaterItem ri in PropertyMappingRepeater.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
{
var ddl = (DropDownList)ri.FindControl("DestinationProperty");
var mappedPropertyAlias = ddl.SelectedItem.Value;
if (!string.IsNullOrEmpty(mappedPropertyAlias))
{
if (mappedPropertyAliases.Contains(mappedPropertyAlias))
{
ValidationError.Text = Services.TextService.Localize("changeDocType/validationErrorPropertyWithMoreThanOneMapping");
return false;
}
mappedPropertyAliases.Add(mappedPropertyAlias);
}
}
}
return true;
}
private IList<PropertyMapping> SavePropertyMappings()
{
// Create list of mapped property values for assignment after the document type is changed
var mappedPropertyValues = new List<PropertyMapping>();
foreach (RepeaterItem ri in PropertyMappingRepeater.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
{
// Get property alias to map to
var ddl = (DropDownList)ri.FindControl("DestinationProperty");
var mappedAlias = ddl.SelectedItem.Value;
if (!string.IsNullOrEmpty(mappedAlias))
{
// If mapping property, get current property value from alias
var sourceAlias = ((HiddenField)ri.FindControl("Alias")).Value;
var sourcePropertyValue = _content.GetValue(sourceAlias);
// Add to list
mappedPropertyValues.Add(new PropertyMapping
{
FromName = ((HiddenField)ri.FindControl("Name")).Value,
ToName = ddl.SelectedItem.Text,
ToAlias = mappedAlias,
Value = sourcePropertyValue
});
}
}
}
return mappedPropertyValues;
}
}
}

View File

@@ -1,213 +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.Web.UI.Umbraco.Dialogs {
public partial class ChangeDocType {
/// <summary>
/// ChangeDocTypePane control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePane;
/// <summary>
/// ContentNamePropertyPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel ContentNamePropertyPanel;
/// <summary>
/// ContentNameLabel 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.Label ContentNameLabel;
/// <summary>
/// CurrentTypePropertyPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel CurrentTypePropertyPanel;
/// <summary>
/// CurrentTypeLabel 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.Label CurrentTypeLabel;
/// <summary>
/// NewTypePropertyPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTypePropertyPanel;
/// <summary>
/// NewDocumentTypeList 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.DropDownList NewDocumentTypeList;
/// <summary>
/// NewDocumentTypeValidator 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 NewDocumentTypeValidator;
/// <summary>
/// NewTemplatePropertyPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTemplatePropertyPanel;
/// <summary>
/// NewTemplateList 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.DropDownList NewTemplateList;
/// <summary>
/// NotAvailablePlaceholder 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.PlaceHolder NotAvailablePlaceholder;
/// <summary>
/// ChangeDocTypePropertyMappingPane control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePropertyMappingPane;
/// <summary>
/// PropertyMappingRepeater 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.Repeater PropertyMappingRepeater;
/// <summary>
/// SuccessPlaceholder 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.PlaceHolder SuccessPlaceholder;
/// <summary>
/// SuccessMessage 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 SuccessMessage;
/// <summary>
/// PropertiesMappedMessage 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 PropertiesMappedMessage;
/// <summary>
/// ContentPublishedMessage 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 ContentPublishedMessage;
/// <summary>
/// ValidationPlaceholder 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.PlaceHolder ValidationPlaceholder;
/// <summary>
/// ValidationError 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 ValidationError;
/// <summary>
/// SaveAndCancelPlaceholder 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.PlaceHolder SaveAndCancelPlaceholder;
/// <summary>
/// SavePlaceholder 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.PlaceHolder SavePlaceholder;
/// <summary>
/// ValidateAndSave 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 ValidateAndSave;
}
}

View File

@@ -1,41 +0,0 @@
<%@ Page Language="c#" Codebehind="republish.aspx.cs" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="True" Inherits="umbraco.cms.presentation.republish" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function showProgress(button, elementId) {
var img = document.getElementById(elementId);
img.style.visibility = "visible";
button.style.display = "none";
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<asp:Panel ID="p_republish" runat="server">
<div class="propertyDiv">
<p><%= Services.TextService.Localize("defaultdialogs/siterepublishHelp")%> </p>
</div>
<div id="buttons" class="btn-toolbar umb-btn-toolbar">
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow();"><%=Services.TextService.Localize("cancel")%></a>
<asp:Button ID="bt_go" cssclass="btn btn-primary" OnClick="go" OnClientClick="showProgress(document.getElementById('buttons'),'progress'); return true;" runat="server" Text="Republish" />
</div>
<div id="progress" style="visibility: hidden;">
<div class="umb-loader-wrapper">
<cc1:ProgressBar ID="progbar" runat="server" Title="Please wait..." />
</div>
</div>
</asp:Panel>
<asp:Panel ID="p_done" Visible="false" runat="server">
<div class="success">
<p><%= Services.TextService.Localize("defaultdialogs/siterepublished")%></p>
</div>
<input type="button" class="btn btn-primary" onclick="UmbClientMgr.closeModalWindow();" value="Ok" />
</asp:Panel>
</asp:Content>

View File

@@ -5,16 +5,17 @@ using Umbraco.Web.UI.Pages;
namespace Umbraco.Web.Actions
{
/// <summary>
/// This action is invoked when the document type of a piece of content is changed
/// </summary>
public class ActionChangeDocType : IAction
{
public char Letter => '7';
public string Alias => "changeDocType";
public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory;
public string Icon => "axis-rotation-2";
public bool ShowInNotifier => true;
public bool CanBePermissionAssigned => true;
}
//TODO: Add this back in when we support this functionality again
///// <summary>
///// This action is invoked when the document type of a piece of content is changed
///// </summary>
//public class ActionChangeDocType : IAction
//{
// public char Letter => '7';
// public string Alias => "changeDocType";
// public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory;
// public string Icon => "axis-rotation-2";
// public bool ShowInNotifier => true;
// public bool CanBePermissionAssigned => true;
//}
}

View File

@@ -16,19 +16,16 @@ namespace Umbraco.Web.Scheduling
public abstract class BackgroundTaskRunner
{
/// <summary>
/// Creates a hook, to hook the task runner into the main domain.
/// Represents a MainDom hook.
/// </summary>
public class MainDomHook
{
/// <summary>
/// Initializes a new instance of the <see cref="MainDomHook"/> class.
/// </summary>
/// <param name="mainDom">The <see cref="IMainDom"/> object.</param>
/// <param name="install">A method to execute when hooking into the main domain.</param>
/// <param name="release">A method to execute when the main domain releases.</param>
/// <returns></returns>
public MainDomHook CreateMainDomHook(IMainDom mainDom, Action install, Action release)
{
return new MainDomHook(mainDom, install, release);
}
public class MainDomHook
{
public MainDomHook(IMainDom mainDom, Action install, Action release)
{
MainDom = mainDom;
@@ -36,8 +33,19 @@ namespace Umbraco.Web.Scheduling
Release = release;
}
/// <summary>
/// Gets the <see cref="IMainDom"/> object.
/// </summary>
public IMainDom MainDom { get; }
/// <summary>
/// Gets the method to execute when hooking into the main domain.
/// </summary>
public Action Install { get; }
/// <summary>
/// Gets the method to execute when the main domain releases.
/// </summary>
public Action Release { get; }
internal bool Register()

View File

@@ -141,8 +141,6 @@ namespace Umbraco.Web.Trees
}
// add default actions for *all* users
// fixme - temp disable RePublish as the page itself (republish.aspx) has been temp disabled
//menu.Items.Add<ActionRePublish>(Services.TextService.Localize("actions", ActionRePublish.Instance.Alias)).ConvertLegacyMenuItem(null, "content", "content");
menu.Items.Add(new RefreshNode(Services.TextService, true));
return menu;

View File

@@ -1124,27 +1124,16 @@
<Compile Include="Trees\PartialViewsTreeController.cs" />
<Compile Include="UI\IAssignedApp.cs" />
<Compile Include="_Legacy\Controls\BaseTreePicker.cs" />
<Compile Include="_Legacy\Controls\DataAttributes.cs" />
<Compile Include="_Legacy\Controls\feedback.cs" />
<Compile Include="_Legacy\Controls\FieldDropDownList.cs" />
<Compile Include="_Legacy\Controls\MenuButton.cs" />
<Compile Include="_Legacy\Controls\MenuButtonI.cs" />
<Compile Include="_Legacy\Controls\MenuIcon.cs" />
<Compile Include="_Legacy\Controls\MenuIconI.cs" />
<Compile Include="_Legacy\Controls\pane.cs" />
<Compile Include="_Legacy\Controls\Panel.cs" />
<Compile Include="_Legacy\Controls\ProgressBar.cs" />
<Compile Include="_Legacy\Controls\PropertyPanel.cs" />
<Compile Include="_Legacy\Controls\Splitter.cs" />
<Compile Include="_Legacy\Controls\TabPage.cs" />
<Compile Include="_Legacy\Controls\TabView.cs" />
<Compile Include="_Legacy\PackageActions\addApplication.cs" />
<Compile Include="_Legacy\PackageActions\addApplicationTree.cs" />
<Compile Include="_Legacy\PackageActions\addDashboardSection.cs" />
<Compile Include="_Legacy\PackageActions\addProxyFeedHost.cs" />
<Compile Include="_Legacy\PackageActions\addStringToHtmlElement.cs" />
<Compile Include="_Legacy\PackageActions\allowDoctype.cs" />
<Compile Include="_Legacy\PackageActions\moveRootDocument.cs" />
<Compile Include="_Legacy\PackageActions\PackageHelper.cs" />
<Compile Include="_Legacy\PackageActions\publishRootDocument.cs" />
<Compile Include="_Legacy\PackageActions\removeStringFromTemplate.cs" />
@@ -1183,9 +1172,6 @@
<Compile Include="umbraco.presentation\umbraco\masterpages\default.Master.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\umbracoField.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\masterpages\umbracoPage.master.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@@ -1242,7 +1228,6 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\controls\ContentPicker.cs" />
<Compile Include="umbraco.presentation\umbraco\controls\dualSelectBox.cs" />
<Compile Include="umbraco.presentation\umbraco\create\CreatedPackageTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\create\macroTasks.cs" />
<Compile Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx.cs">
@@ -1252,26 +1237,6 @@
<Compile Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx.designer.cs">
<DependentUpon>FeedProxy.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\insertMasterpageContent.aspx.cs">
<DependentUpon>insertMasterpageContent.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\insertMasterpageContent.aspx.designer.cs">
<DependentUpon>insertMasterpageContent.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\insertMasterpagePlaceholder.aspx.cs">
<DependentUpon>insertMasterpagePlaceholder.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\insertMasterpagePlaceholder.aspx.designer.cs">
<DependentUpon>insertMasterpagePlaceholder.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\republish.aspx.cs">
<DependentUpon>republish.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\dialogs\republish.aspx.designer.cs">
<DependentUpon>republish.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx.cs">
<DependentUpon>editPackage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -1324,15 +1289,6 @@
<!--<Content Include="umbraco.presentation\umbraco\users\PermissionEditor.aspx" />-->
<Content Include="PublishedCache\NuCache\notes.txt" />
<Content Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx" />
<Content Include="umbraco.presentation\umbraco\dialogs\insertMasterpageContent.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\dialogs\insertMasterpagePlaceholder.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\dialogs\republish.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\developer\Packages\editPackage.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>

View File

@@ -1,15 +0,0 @@
using System.Collections.Generic;
using System.Web.UI.WebControls;
namespace Umbraco.Web._Legacy.Controls
{
internal class DataAttributes : Dictionary<string,string>
{
public void AppendTo(WebControl c)
{
foreach (var keyval in this)
c.Attributes.Add("data-" + keyval.Key, keyval.Value);
}
}
}

View File

@@ -1,72 +0,0 @@
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Umbraco.Web._Legacy.Controls
{
public class FieldDropDownList : DropDownList
{
private bool _customOptionsStarted;
private bool _standardOptionsStarted;
public string CustomPropertiesLabel { get; set; }
public string StandardPropertiesLabel { get; set; }
public string ChooseText { get; set; }
protected override void RenderContents(HtmlTextWriter writer)
{
if (Items.Count > 0 && Items[0].Text.StartsWith("#"))
{
Items.Insert(0, new ListItem(ChooseText, ""));
SelectedIndex = 0;
base.RenderContents(writer);
return;
}
writer.Write("<option value=\"\">{0}</option>", ChooseText);
foreach (ListItem item in Items)
{
if (!_customOptionsStarted)
{
RenderOptionGroupBeginTag(CustomPropertiesLabel, writer);
_customOptionsStarted = true;
}
else if (item.Text.StartsWith("@") && !_standardOptionsStarted)
{
_standardOptionsStarted = true;
RenderOptionGroupEndTag(writer);
RenderOptionGroupBeginTag(StandardPropertiesLabel, writer);
}
writer.WriteBeginTag("option");
writer.WriteAttribute("value", item.Value, true);
foreach (string key in item.Attributes.Keys)
writer.WriteAttribute(key, item.Attributes[key]);
writer.Write(HtmlTextWriter.TagRightChar);
HttpUtility.HtmlEncode(item.Text.Replace("@", ""), writer);
writer.WriteEndTag("option");
writer.WriteLine();
}
RenderOptionGroupEndTag(writer);
}
private void RenderOptionGroupBeginTag(string name, HtmlTextWriter writer)
{
writer.WriteBeginTag("optgroup");
writer.WriteAttribute("label", name);
writer.Write(HtmlTextWriter.TagRightChar);
writer.WriteLine();
}
private void RenderOptionGroupEndTag(HtmlTextWriter writer)
{
writer.WriteEndTag("optgroup");
writer.WriteLine();
}
}
}

View File

@@ -1,70 +0,0 @@
using System;
using Umbraco.Core.IO;
namespace Umbraco.Web._Legacy.Controls
{
public class MenuButton : System.Web.UI.WebControls.LinkButton
{
public MenuButtonType ButtonType { get; set; }
internal DataAttributes Data { get; private set; }
public string Hotkey { get; set; }
public string Icon { get; set; }
public MenuButton()
{
Data = new DataAttributes();
CssClass = "btn";
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
//setup a hotkey if present
if (ButtonType == MenuButtonType.Primary && String.IsNullOrEmpty(Hotkey))
Data.Add("hotkey", "ctrl+" + this.Text.ToLower()[0]);
else if (!string.IsNullOrEmpty(Hotkey))
Data.Add("shortcut", Hotkey);
Data.AppendTo(this);
string cssClass = "btn";
if (Icon != null)
{
cssClass = "btn editorIcon";
var i = Icon.Trim('.');
if (!string.IsNullOrEmpty(i))
{
this.ToolTip = this.Text;
if (i.Contains("."))
this.Text = "<img src='" + IOHelper.ResolveUrl(Icon) + "' alt='" + this.ToolTip + "'/> " + this.ToolTip;
else
this.Text = "<i class='icon icon-" + Icon.Replace("icon-", "") + "'></i> " + this.ToolTip;
}
}
cssClass += " btn-" + Enum.GetName(ButtonType.GetType(), ButtonType).ToLower() + " " + CssClass;
this.CssClass = cssClass.Trim();
base.Render(writer);
}
}
public enum MenuButtonType
{
Default,
Primary,
Info,
Success,
Warning,
Danger,
Inverse,
Link
}
}

View File

@@ -1,61 +0,0 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ClientDependency.Core;
namespace Umbraco.Web._Legacy.Controls
{
public class MenuImageButton : System.Web.UI.WebControls.ImageButton, MenuIconI {
private string _OnClickCommand = "";
public string AltText {
get { return this.AlternateText; }
set {
this.AlternateText = value;
this.Attributes.Add("title", value);
}
}
public int IconWidth {
get { return (int)this.Width.Value; }
set { this.Width = value; }
}
public int IconHeight {
get { return (int)this.Height.Value; }
set { this.Height = value; }
}
public string ImageURL {
get { return base.ImageUrl; }
set { base.ImageUrl = value; }
}
public string OnClickCommand {
get { return _OnClickCommand; }
set { _OnClickCommand = value; }
}
protected override void CreateChildControls()
{
this.Width = Unit.Pixel(20);
this.Height = Unit.Pixel(20);
this.Style.Clear();
this.Attributes.Add("class", "btn btn-default editorIcon");
if (_OnClickCommand != "")
{
this.Attributes.Add("onClick", OnClickCommand);
}
base.CreateChildControls();
}
}
}

View File

@@ -1,70 +0,0 @@
using System.ComponentModel;
using System.Web.UI;
using ClientDependency.Core;
namespace Umbraco.Web._Legacy.Controls
{
[ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")]
internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI
{
private string _OnClickCommand = "";
private string _AltText = "init";
public string AltText {
get { return this.AlternateText; }
set {
_AltText = value;
this.AlternateText = value;
this.Attributes.Add("title", value);
}
}
public int IconWidth {
get { return (int)this.Width.Value; }
set { this.Width = value; }
}
public int IconHeight {
get { return (int)this.Height.Value; }
set { this.Height = value; }
}
public string ImageURL {
get { return this.ImageUrl; }
set { this.ImageUrl = value; }
}
public string OnClickCommand {
get { return _OnClickCommand; }
set { _OnClickCommand = value; }
}
protected override void OnLoad(System.EventArgs EventArguments) {
// NH 17-01-2007. Trying to avoid inline styling soup
// Me.Width = WebControls.Unit.Pixel(22)
// Me.Height = WebControls.Unit.Pixel(23)
//Me.Style.Add("border", "0px")
this.Attributes.Add("class", "editorIcon");
this.Attributes.Add("onMouseover", "this.className='editorIconOver'");
string holder = "";
// if (this.ID != "") {
//holder = this.ID.Substring(0, this.ID.LastIndexOf("_")) + "_menu";
this.Attributes.Add("onMouseout", "hoverIconOut('" + holder + "','" + this.ID + "');");
this.Attributes.Add("onMouseup", "hoverIconOut('" + holder + "','" + this.ID + "');");
// } else {
this.Attributes.Add("onMouseout", "this.className='editorIcon'");
this.Attributes.Add("onMouseup", "this.className='editorIcon'");
// }
this.Attributes.Add("onMouseDown", "this.className='editorIconDown'; return false;");
this.AlternateText = _AltText;
this.Attributes.Add("title", _AltText);
if (_OnClickCommand != "") {
this.Attributes.Add("onClick", OnClickCommand);
}
}
}
}

View File

@@ -1,29 +0,0 @@
namespace Umbraco.Web._Legacy.Controls
{
public interface MenuIconI {
string ImageURL {
get;
set;
}
string ID {
get;
set;
}
string OnClickCommand {
get;
set;
}
string AltText {
get;
set;
}
int IconWidth {
get;
set;
}
int IconHeight {
get;
set;
}
}
}

View File

@@ -1,24 +0,0 @@
using System;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
namespace Umbraco.Web._Legacy.Controls
{
[Obsolete("Use Umbraco.Web.UI.Controls.ProgressBar")]
public class ProgressBar : System.Web.UI.WebControls.Panel
{
private string _title = Current.Services.TextService.Localize("publish/inProgress");
public string Title { get; set; }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if(!string.IsNullOrEmpty(Title))
_title = Title;
base.CssClass = "umb-loader";
base.Render(writer);
}
}
}

View File

@@ -1,16 +0,0 @@
using System.ComponentModel;
using System.Web.UI;
using Umbraco.Core.IO;
namespace Umbraco.Web._Legacy.Controls
{
internal class Splitter : System.Web.UI.WebControls.Image {
protected override void OnLoad(System.EventArgs EventArguments) {
this.Height = System.Web.UI.WebControls.Unit.Pixel(21);
this.Style.Add("border", "0px");
this.Attributes.Add("class", "editorIconSplit");
this.ImageUrl = "/menuicon/images/split.gif";
}
}
}

View File

@@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using ClientDependency.Core;
namespace Umbraco.Web._Legacy.Controls
{
[ClientDependency(ClientDependencyType.Css, "ui/default.css", "UmbracoClient")]
public class Feedback : System.Web.UI.WebControls.Panel
{
public Feedback() {
}
protected override void OnInit(EventArgs e) {
}
protected override void OnLoad(System.EventArgs EventArguments) {
}
public feedbacktype type { get; set; }
private string _text = string.Empty;
public string Text {
get {
return _text;
}
set { _text = value; }
}
public enum feedbacktype{
notice,
error,
success
}
protected override void Render(System.Web.UI.HtmlTextWriter writer) {
if (_text != string.Empty) {
base.CreateChildControls();
string styleString = "";
foreach (string key in this.Style.Keys) {
styleString += key + ":" + this.Style[key] + ";";
}
writer.WriteLine("<div id=\"" + this.ClientID + "\" style=\"" + styleString + "\" class=\"alert alert-" + type.ToString() + "\"><p>");
writer.WriteLine(_text);
writer.WriteLine("</p></div>");
}
}
}
}

View File

@@ -7,7 +7,7 @@ using Umbraco.Core.Xml;
namespace Umbraco.Web._Legacy.PackageActions
{
public class PackageHelper
internal class PackageHelper
{
//Helper method to replace umbraco tags that breaks the xml format..
public static string ParseToValidXml(ITemplate templateObj, ref bool hasAspNetContentBeginning, string template, bool toValid)

View File

@@ -1,83 +0,0 @@
using System.Xml;
using Umbraco.Core;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Web.Composing;
namespace Umbraco.Web._Legacy.PackageActions
{
/*Build in standard actions */
/// <summary>
/// This class implements the IPackageAction Interface, used to execute code when packages are installed.
/// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode.
/// </summary>
public class addApplicationTree : IPackageAction
{
#region IPackageAction Members
/// <summary>
/// Executes the specified package action.
/// </summary>
/// <param name="packageName">Name of the package.</param>
/// <param name="xmlData">The XML data.</param>
/// <returns></returns>
/// <example><code>
/// <Action runat="install" [undo="false"] alias="addApplicationTree" silent="[true/false]" initialize="[true/false]" sortOrder="1"
/// applicationAlias="appAlias" treeAlias="myTree" treeTitle="My Tree" iconOpened="folder_o.gif" iconClosed="folder.gif"
/// assemblyName="umbraco" treeHandlerType="treeClass" action="alert('you clicked my tree')"/>
/// </code></example>
public bool Execute(string packageName, XmlNode xmlData)
{
bool initialize = bool.Parse(xmlData.Attributes["initialize"].Value);
byte sortOrder = byte.Parse(xmlData.Attributes["sortOrder"].Value);
string applicationAlias = xmlData.Attributes["applicationAlias"].Value;
string treeAlias = xmlData.Attributes["treeAlias"].Value;
string treeTitle = xmlData.Attributes["treeTitle"].Value;
string iconOpened = xmlData.Attributes["iconOpened"].Value;
string iconClosed = xmlData.Attributes["iconClosed"].Value;
string type = xmlData.Attributes["treeHandlerType"].Value;
Current.Services.ApplicationTreeService.MakeNew(initialize, sortOrder, applicationAlias, treeAlias, treeTitle, iconClosed, iconOpened, type);
return true;
}
/// <summary>
/// Undoes the action
/// </summary>
/// <param name="packageName">Name of the package.</param>
/// <param name="xmlData">The XML data.</param>
/// <returns></returns>
public bool Undo(string packageName, XmlNode xmlData)
{
string treeAlias = xmlData.Attributes["treeAlias"].Value;
var found = Current.Services.ApplicationTreeService.GetByAlias(treeAlias);
if (found != null)
{
Current.Services.ApplicationTreeService.DeleteTree(found);
}
return true;
}
/// <summary>
/// Action alias.
/// </summary>
/// <returns></returns>
public string Alias()
{
return "addApplicationTree";
}
#endregion
public XmlNode SampleXml()
{
string sample = "<Action runat=\"install\" undo=\"true/false\" alias=\"addApplicationTree\" silent=\"true/false\" initialize=\"true/false\" sortOrder=\"1\" applicationAlias=\"appAlias\" treeAlias=\"myTree\" treeTitle=\"My Tree\" iconOpened=\"folder_o.gif\" iconClosed=\"folder.gif\" assemblyName=\"umbraco\" treeHandlerType=\"treeClass\" action=\"alert('you clicked my tree')\"/>";
return PackageHelper.ParseStringToXmlNode(sample);
}
}
}

View File

@@ -1,102 +0,0 @@

//TODO: MIgrate this to core: http://issues.umbraco.org/issue/U4-5857
//using System;
//using System.Xml;
//namespace umbraco.cms.businesslogic.packager.standardPackageActions
//{
// /// <summary>
// /// This class implements the IPackageAction Interface, used to execute code when packages are installed.
// /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode.
// /// </summary>
// public class moveRootDocument : umbraco.interfaces.IPackageAction
// {
// #region IPackageAction Members
// /// <summary>
// /// Executes the specified package action.
// /// </summary>
// /// <param name="packageName">Name of the package.</param>
// /// <param name="xmlData">The XML data.</param>
// /// <example><code>
// /// <Action runat="install" alias="moveRootDocument" documentName="News" parentDocumentType="Home" />
// /// </code></example>
// /// <returns>True if executed succesfully</returns>
// public bool Execute(string packageName, XmlNode xmlData)
// {
// string documentName = xmlData.Attributes["documentName"].Value;
// string parentDocumentType = xmlData.Attributes["parentDocumentType"].Value;
// string parentDocumentName = "";
// if (xmlData.Attributes["parentDocumentName"] != null)
// parentDocumentName = xmlData.Attributes["parentDocumentName"].Value;
// int parentDocid = 0;
// ContentType ct = ContentType.GetByAlias(parentDocumentType);
// Content[] docs = web.Document.getContentOfContentType(ct);
// if (docs.Length > 0)
// {
// if (String.IsNullOrEmpty(parentDocumentName))
// parentDocid = docs[0].Id;
// else
// {
// foreach (Content doc in docs)
// {
// if (doc.Text == parentDocumentName)
// parentDocid = doc.Id;
// }
// }
// }
// if (parentDocid > 0)
// {
// web.Document[] rootDocs = web.Document.GetRootDocuments();
// foreach (web.Document rootDoc in rootDocs)
// {
// if (rootDoc.Text == documentName)
// {
// rootDoc.Move(parentDocid);
// rootDoc.PublishWithSubs(new umbraco.BusinessLogic.User(0));
// }
// }
// }
// return true;
// }
// //this has no undo.
// /// <summary>
// /// This action has no undo.
// /// </summary>
// /// <param name="packageName">Name of the package.</param>
// /// <param name="xmlData">The XML data.</param>
// /// <returns></returns>
// public bool Undo(string packageName, XmlNode xmlData)
// {
// return true;
// }
// /// <summary>
// /// Action alias
// /// </summary>
// /// <returns></returns>
// public string Alias()
// {
// return "moveRootDocument";
// }
// #endregion
// public XmlNode SampleXml()
// {
// throw new NotImplementedException();
// }
// }
//}

View File

@@ -1,153 +0,0 @@
using System;
using System.Web.Razor;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ClientDependency.Core;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web;
using Umbraco.Web.Composing;
namespace umbraco.controls
{
/// <summary>
/// Summary description for dualSelectbox.
/// </summary>
[ClientDependency(ClientDependencyType.Javascript, "js/dualSelectBox.js", "UmbracoRoot")]
public class DualSelectbox : System.Web.UI.WebControls.WebControl, System.Web.UI.INamingContainer
{
private ListItemCollection _items = new ListItemCollection();
private ListBox _possibleValues = new ListBox();
private ListBox _selectedValues = new ListBox();
private HtmlInputHidden _value = new HtmlInputHidden();
private HtmlInputButton _add = new HtmlInputButton();
private HtmlInputButton _remove = new HtmlInputButton();
private int _rows = 8;
public ListItemCollection Items
{
get
{
EnsureChildControls();
return _items;
}
}
public new int Width
{
set
{
_possibleValues.Width = new Unit(value);
_selectedValues.Width = new Unit(value);
}
}
public new int Height
{
set
{
_possibleValues.Height = new Unit(value);
_selectedValues.Height = new Unit(value);
}
}
protected override void CreateChildControls()
{
_possibleValues.ID = "posVals";
_selectedValues.ID = "selVals";
_possibleValues.SelectionMode = ListSelectionMode.Multiple;
_selectedValues.SelectionMode = ListSelectionMode.Multiple;
_possibleValues.CssClass = "guiInputTextStandard";
_selectedValues.CssClass = "guiInputTextStandard";
_possibleValues.Rows = _rows;
_selectedValues.Rows = _rows;
_value.ID = "theValue";
HtmlTable table = new HtmlTable();
table.CellPadding = 5;
table.CellSpacing = 0;
table.Border = 0;
HtmlTableRow header = new HtmlTableRow();
header.Controls.Add(new HtmlTableCell { InnerHtml = Current.Services.TextService.Localize("content/notmemberof") });
header.Controls.Add(new HtmlTableCell { InnerHtml= "&nbsp;" });
header.Controls.Add(new HtmlTableCell { InnerHtml = Current.Services.TextService.Localize("content/memberof") });
table.Controls.Add(header);
HtmlTableRow row = new HtmlTableRow();
table.Controls.Add(row);
HtmlTableCell cFirst = new HtmlTableCell();
cFirst.Controls.Add(_possibleValues);
row.Controls.Add(cFirst);
HtmlTableCell cButtons = new HtmlTableCell();
_add.Value = ">>";
_add.Attributes.Add("class", "guiInputButton");
_remove.Value = "<<";
_remove.Attributes.Add("class", "guiInputButton");
cButtons.Controls.Add(_add);
cButtons.Controls.Add(new LiteralControl("<br/><br/>"));
cButtons.Controls.Add(_remove);
row.Controls.Add(cButtons);
HtmlTableCell cSecond = new HtmlTableCell();
cSecond.Controls.Add(_selectedValues);
row.Controls.Add(cSecond);
this.Controls.Add(table);
this.Controls.Add(_value);
}
public string Value
{
get
{
return _value.Value;
}
set
{
_value.Value = value;
}
}
public int Rows
{
set
{
_rows = value;
}
}
public DualSelectbox()
{
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
_selectedValues.Items.Clear();
_possibleValues.Items.Clear();
foreach(ListItem li in _items)
{
if (((string) (","+ this.Value +",")).IndexOf(","+li.Value+",") > -1)
_selectedValues.Items.Add(li);
else
_possibleValues.Items.Add(li);
}
// add js to buttons here to ensure full clientids
_add.Attributes.Add("onClick", "dualSelectBoxShift('" + this.ClientID + "');");
_remove.Attributes.Add("onClick", "dualSelectBoxShift('" + this.ClientID + "');");
}
}
}

View File

@@ -1,32 +0,0 @@
<%@ Page Title="" Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="insertMasterpageContent.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.insertMasterpageContent" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function insertCode() {
var idDD = document.getElementById("<%= dd_detectedAlias.ClientID %>");
var id = idDD.options[idDD.selectedIndex].value;
top.right.insertContentElement(id);
UmbClientMgr.closeModalWindow();
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
<cc1:Pane ID="pane_insert" runat="server">
<cc1:PropertyPanel runat="server">
<p>
<%= Services.TextService.Localize("defaultdialogs/templateContentPlaceHolderHelp")%>
</p>
</cc1:PropertyPanel>
<cc1:PropertyPanel runat="server" id="pp_placeholder" text="Placeholder ID">
<asp:DropDownList ID="dd_detectedAlias" Width="350px" CssClass="bigInput input-block-level" runat="server" />
</cc1:PropertyPanel>
</cc1:Pane>
<cc1:Pane runat="server" CssClass="btn-toolbar umb-btn-toolbar">
<a class="btn btn-link" onclick="UmbClientMgr.closeModalWindow(); return false;"><%=Services.TextService.Localize("general/cancel")%></a>
<input type="button" onclick="insertCode(); return false;" Class="btn btn-primary" value="<%= Services.TextService.Localize("insert") %>" />
</cc1:Pane>
</asp:Content>

View File

@@ -1,52 +0,0 @@
using Umbraco.Core.Services;
using System;
using System.Linq;
using System.Web.UI.WebControls;
using Umbraco.Core;
using Umbraco.Core.IO;
namespace umbraco.presentation.umbraco.dialogs
{
public partial class insertMasterpageContent : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public insertMasterpageContent()
{
CurrentApp = Constants.Applications.Settings.ToString();
}
protected void Page_Load(object sender, EventArgs e)
{
//labels
pp_placeholder.Text = Services.TextService.Localize("placeHolderID");
//Add a default Item
var li = new ListItem("Choose ID...");
li.Selected = true;
dd_detectedAlias.Items.Add(li);
//var t = new cms.businesslogic.template.Template(int.Parse(Request["id"]));
var t = Services.FileService.GetTemplate(int.Parse(Request["id"]));
//if (t.MasterTemplate > 0)
if (string.IsNullOrWhiteSpace(t.MasterTemplateAlias) != true)
{
//t = new cms.businesslogic.template.Template(t.MasterTemplate);
t = Services.FileService.GetTemplate(t.MasterTemplateAlias);
}
//foreach (string cpId in t.contentPlaceholderIds())
foreach (string cpId in MasterPageHelper.GetContentPlaceholderIds(t))
{
dd_detectedAlias.Items.Add(cpId);
}
if (dd_detectedAlias.Items.Count == 1)
dd_detectedAlias.Items.Add("ContentPlaceHolderDefault");
}
}
}

View File

@@ -1,42 +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.presentation.umbraco.dialogs {
public partial class insertMasterpageContent {
/// <summary>
/// pane_insert control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane pane_insert;
/// <summary>
/// pp_placeholder control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_placeholder;
/// <summary>
/// dd_detectedAlias 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.DropDownList dd_detectedAlias;
}
}

View File

@@ -1,34 +0,0 @@
<%@ Page Title="" Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="insertMasterpagePlaceholder.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.insertMasterpagePlaceholder" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function insertCode() {
var idtb = document.getElementById("<%= tb_alias.ClientID %>");
var id = idtb.value;
top.right.insertPlaceHolderElement(id);
UmbClientMgr.closeModalWindow();
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
<cc1:Pane ID="pane_insert" runat="server">
<cc1:PropertyPanel runat="server">
<p>
<%= Services.TextService.Localize("defaultdialogs/templateContentAreaHelp")%>
</p>
</cc1:PropertyPanel>
<cc1:PropertyPanel runat="server" id="pp_placeholder" text="Placeholder ID">
<asp:TextBox ID="tb_alias" Width="350px" CssClass="bigInput input-block-level" runat="server" />
</cc1:PropertyPanel>
</cc1:Pane>
<cc1:Pane runat="server" CssClass="btn-toolbar umb-btn-toolbar">
<a class="btn btn-link" onclick="UmbClientMgr.closeModalWindow(); return false;"><%=Services.TextService.Localize("general/cancel")%></a>
<input type="button" onclick="insertCode(); return false;" Class="btn btn-primary" value="<%= Services.TextService.Localize("insert") %>" />
</cc1:Pane>
</asp:Content>

View File

@@ -1,18 +0,0 @@
using Umbraco.Core.Services;
using System;
using Umbraco.Core;
namespace umbraco.presentation.umbraco.dialogs {
public partial class insertMasterpagePlaceholder : Umbraco.Web.UI.Pages.UmbracoEnsuredPage {
public insertMasterpagePlaceholder()
{
CurrentApp = Constants.Applications.Settings.ToString();
}
protected void Page_Load(object sender, EventArgs e) {
//labels
pp_placeholder.Text = Services.TextService.Localize("placeHolderID");
}
}
}

View File

@@ -1,26 +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.presentation.umbraco.dialogs {
public partial class insertMasterpagePlaceholder {
/// <summary>
/// tb_alias 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 tb_alias;
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_placeholder;
}
}

View File

@@ -1,40 +0,0 @@
<%@ Page Language="c#" Codebehind="republish.aspx.cs" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="True" Inherits="umbraco.cms.presentation.republish" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function showProgress(button, elementId) {
var img = document.getElementById(elementId);
img.style.visibility = "visible";
button.style.display = "none";
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<asp:Panel ID="p_republish" runat="server">
<div class="propertyDiv">
<p><%= Services.TextService.Localize("defaultdialogs/siterepublishHelp")%> </p>
</div>
<div id="buttons">
<asp:Button ID="bt_go" OnClick="go" OnClientClick="showProgress(document.getElementById('buttons'),'progress'); return true;" runat="server" Text="Republish" />
<em><%= Services.TextService.Localize("or") %></em>
<a href="#" onclick="UmbClientMgr.closeModalWindow();"><%=Services.TextService.Localize("cancel")%></a>
</div>
<div id="progress" style="visibility: hidden;">
<cc1:ProgressBar ID="progbar" runat="server" Title="Please wait..." />
</div>
</asp:Panel>
<asp:Panel ID="p_done" Visible="false" runat="server">
<div class="success">
<p><%= Services.TextService.Localize("defaultdialogs/siterepublished")%></p>
</div>
<input type="button" class="guiInputButton" onclick="UmbClientMgr.closeModalWindow();" value="Ok" />
</asp:Panel>
</asp:Content>

View File

@@ -1,68 +0,0 @@
//TODO: Re-create this in angular and new APIS! then remove it
//using System;
//using System.Collections;
//using System.ComponentModel;
//using System.Data;
//using System.Drawing;
//using System.Web;
//using System.Web.SessionState;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using System.Web.UI.HtmlControls;
//using Umbraco.Web;
//namespace umbraco.cms.presentation
//{
// /// <summary>
// /// Summary description for republish.
// /// </summary>
// public partial class republish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
// {
// public republish()
// {
// CurrentApp = Constants.Applications.Content.ToString();
// }
// protected void go(object sender, EventArgs e) {
// // re-create xml
// if (Request.GetItemAsString("xml") != "")
// {
// Server.ScriptTimeout = 100000;
// Services.ContentService.RePublishAll();
// }
// else if (Request.GetItemAsString("previews") != "")
// {
// Server.ScriptTimeout = 100000;
// umbraco.cms.businesslogic.web.Document.RegeneratePreviews();
// }
// else if (Request.GetItemAsString("refreshNodes") != "")
// {
// Server.ScriptTimeout = 100000;
// System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
// var doc = new cms.businesslogic.web.Document(int.Parse(Request.GetItemAsString("refreshNodes")));
// foreach (cms.businesslogic.web.Document d in doc.Children)
// {
// d.XmlGenerate(xd);
// Response.Write("<li>Creating xml for " + d.Text + "</li>");
// Response.Flush();
// }
// }
// //PPH changed this to a general library call for load balancing support
// library.RefreshContent();
// p_republish.Visible = false;
// p_done.Visible = true;
// }
// protected void Page_Load(object sender, System.EventArgs e)
// {
// bt_go.Text = Services.TextService.Localize("republish");
// }
// }
//}

View File

@@ -1,51 +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 {
public partial class republish {
/// <summary>
/// p_republish 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 p_republish;
/// <summary>
/// bt_go 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 bt_go;
/// <summary>
/// progbar control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.ProgressBar progbar;
/// <summary>
/// p_done 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 p_done;
}
}

View File

@@ -1,251 +0,0 @@
using System.Linq;
using System.Web.UI.WebControls;
using Umbraco.Core.Configuration;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web;
using Umbraco.Web.Composing;
namespace umbraco.dialogs
{
/// <summary>
/// Summary description for umbracoField.
/// </summary>
public partial class umbracoField : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" };
bool m_IsDictionaryMode = false;
public umbracoField()
{
CurrentApp = Constants.Applications.Settings.ToString();
}
protected void Page_Load(object sender, System.EventArgs e)
{
//set labels on properties...
pp_insertAltField.Text = Services.TextService.Localize("templateEditor/alternativeField");
pp_insertAltText.Text = Services.TextService.Localize("templateEditor/alternativeText");
pp_insertBefore.Text = Services.TextService.Localize("templateEditor/preContent");
pp_insertAfter.Text = Services.TextService.Localize("templateEditor/postContent");
pp_FormatAsDate.Text = Services.TextService.Localize("templateEditor/formatAsDate");
pp_casing.Text = Services.TextService.Localize("templateEditor/casing");
pp_encode.Text = Services.TextService.Localize("templateEditor/encoding");
tagName.Value = "umbraco:Item";
using (var scope = Current.ScopeProvider.CreateScope())
{
// either get page fields or dictionary items
string fieldSql = "";
if (Request.GetItemAsString("tagName") == "UMBRACOGETDICTIONARY")
{
fieldSql = "select '#'+[key] as alias from cmsDictionary order by alias";
m_IsDictionaryMode = true;
pp_insertField.Text = "Insert Dictionary Item";
}
else
{
//exclude built-in memberhip properties from showing up here
var exclude = Constants.Conventions.Member.GetStandardPropertyTypeStubs()
.Select(x => Current.SqlContext.SqlSyntax.GetQuotedValue(x.Key)).ToArray();
fieldSql = string.Format(
"select distinct alias from cmsPropertyType where alias not in ({0}) order by alias",
string.Join(",", exclude));
pp_insertField.Text = Services.TextService.Localize("templateEditor/chooseField");
}
fieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField");
fieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields");
fieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields");
var dataTypes = scope.Database.Fetch<dynamic>(fieldSql);
fieldPicker.DataTextField = "alias";
fieldPicker.DataValueField = "alias";
fieldPicker.DataSource = dataTypes;
fieldPicker.DataBind();
fieldPicker.Attributes.Add("onChange", "document.forms[0].field.value = document.forms[0]." + fieldPicker.ClientID + "[document.forms[0]." + fieldPicker.ClientID + ".selectedIndex].value;");
altFieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField");
altFieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields");
altFieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields");
var dataTypes2 = scope.Database.Fetch<dynamic>(fieldSql);
altFieldPicker.DataTextField = "alias";
altFieldPicker.DataValueField = "alias";
altFieldPicker.DataSource = dataTypes2;
altFieldPicker.DataBind();
altFieldPicker.Attributes.Add("onChange", "document.forms[0].useIfEmpty.value = document.forms[0]." + altFieldPicker.ClientID + "[document.forms[0]." + altFieldPicker.ClientID + ".selectedIndex].value;");
scope.Complete();
}
// Pre values
if (!m_IsDictionaryMode)
{
foreach (string s in preValuesSource)
{
fieldPicker.Items.Add(new ListItem(s, s.Replace("@", "")));
altFieldPicker.Items.Add(new ListItem(s, s.Replace("@", "")));
}
}
}
/// <summary>
/// JsInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
/// <summary>
/// JsInclude2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude2;
/// <summary>
/// tagName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden tagName;
/// <summary>
/// pane_form control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.Pane pane_form;
/// <summary>
/// pp_insertField control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertField;
/// <summary>
/// fieldPicker control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList fieldPicker;
/// <summary>
/// pp_insertAltField control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltField;
/// <summary>
/// altFieldPicker control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList altFieldPicker;
/// <summary>
/// pp_insertAltText control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltText;
/// <summary>
/// pp_recursive control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_recursive;
/// <summary>
/// pp_insertBefore control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertBefore;
/// <summary>
/// pp_insertAfter control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAfter;
/// <summary>
/// pp_FormatAsDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_FormatAsDate;
/// <summary>
/// pp_casing control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_casing;
/// <summary>
/// pp_encode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_encode;
/// <summary>
/// pp_convertLineBreaks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_convertLineBreaks;
/// <summary>
/// pp_removePTags control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_removePTags;
}
}