diff --git a/components/editorControls/SettingControls/Pickers/Content.cs b/components/editorControls/SettingControls/Pickers/Content.cs index 66df17812d..509dcf6cf1 100644 --- a/components/editorControls/SettingControls/Pickers/Content.cs +++ b/components/editorControls/SettingControls/Pickers/Content.cs @@ -159,7 +159,7 @@ namespace umbraco.editorControls.SettingControls.Pickers if (_showXPath && tb.Text != string.Empty) return tb.Text; else - return cc.Text; + return cc.Value; } set { @@ -170,7 +170,7 @@ namespace umbraco.editorControls.SettingControls.Pickers int nodeId; if (int.TryParse(_val, out nodeId)) - cc.Text = _val; + cc.Value = _val; else if (ShowXPath) tb.Text = _val; } diff --git a/components/editorControls/ultimatepicker/ultimatePickerDataEditor.cs b/components/editorControls/ultimatepicker/ultimatePickerDataEditor.cs index 5792a0c1ea..865c7c3364 100644 --- a/components/editorControls/ultimatepicker/ultimatePickerDataEditor.cs +++ b/components/editorControls/ultimatepicker/ultimatePickerDataEditor.cs @@ -77,7 +77,6 @@ namespace umbraco.editorControls.ultimatepicker break; case "dropdownlist": return dropdownlistNodes.SelectedValue; - break; case "listbox": foreach (ListItem item in listboxNodes.Items) { diff --git a/components/editorControls/userControlWrapper/usercontrolDataEditor.cs b/components/editorControls/userControlWrapper/usercontrolDataEditor.cs index 1174508fbb..fe088c1cca 100644 --- a/components/editorControls/userControlWrapper/usercontrolDataEditor.cs +++ b/components/editorControls/userControlWrapper/usercontrolDataEditor.cs @@ -78,7 +78,7 @@ namespace umbraco.editorControls.userControlGrapper } } - catch (MissingMethodException ex) { } + catch (MissingMethodException) { } } } diff --git a/components/macroRenderings/tabPicker.cs b/components/macroRenderings/tabPicker.cs index 8ad2ac1465..2a9fa4140f 100644 --- a/components/macroRenderings/tabPicker.cs +++ b/components/macroRenderings/tabPicker.cs @@ -19,7 +19,6 @@ namespace umbraco.macroRenderings { string _value = ""; bool _multiple = false; - private static ISqlHelper _sqlHelper; public bool ShowCaption { diff --git a/components/umbraco.controls/TreePicker/BaseTreePicker.cs b/components/umbraco.controls/TreePicker/BaseTreePicker.cs index b1718d952a..6fbfa3bac2 100644 --- a/components/umbraco.controls/TreePicker/BaseTreePicker.cs +++ b/components/umbraco.controls/TreePicker/BaseTreePicker.cs @@ -76,7 +76,7 @@ namespace umbraco.uicontrols.TreePicker { return new CMSNode(int.Parse(ItemIdValue.Value)).Text; } - catch (ArgumentException ex) { /*the node does not exist! we will ignore*/ } + catch (ArgumentException) { /*the node does not exist! we will ignore*/ } } return ""; } diff --git a/umbraco.MacroEngines.Juno/RazorCore/UmbracoCultureDictionary.cs b/umbraco.MacroEngines.Juno/RazorCore/UmbracoCultureDictionary.cs index 3089a27346..34954946d8 100644 --- a/umbraco.MacroEngines.Juno/RazorCore/UmbracoCultureDictionary.cs +++ b/umbraco.MacroEngines.Juno/RazorCore/UmbracoCultureDictionary.cs @@ -11,7 +11,7 @@ namespace umbraco.MacroEngines { get { try { return new Dictionary.DictionaryItem(key).Value(Language.id); - } catch (Exception errDictionary) { } + } catch (Exception) { } return string.Empty; } } diff --git a/umbraco/businesslogic/BasePages/UmbracoEnsuredPage.cs b/umbraco/businesslogic/BasePages/UmbracoEnsuredPage.cs index 6ea1e06e2c..c5be92d7ab 100644 --- a/umbraco/businesslogic/BasePages/UmbracoEnsuredPage.cs +++ b/umbraco/businesslogic/BasePages/UmbracoEnsuredPage.cs @@ -94,7 +94,7 @@ namespace umbraco.BasePages throw new UserAuthorizationException(String.Format("The current user doesn't have access to the section/app '{0}'", CurrentApp)); } } - catch (UserAuthorizationException ex) + catch (UserAuthorizationException) { Log.Add(LogTypes.Error, CurrentUser, -1, String.Format("Tried to access '{0}'", CurrentApp)); throw; diff --git a/umbraco/businesslogic/UserType.cs b/umbraco/businesslogic/UserType.cs index bec238a49f..4881b03029 100644 --- a/umbraco/businesslogic/UserType.cs +++ b/umbraco/businesslogic/UserType.cs @@ -151,7 +151,7 @@ namespace umbraco.BusinessLogic public void Save() { //ensure that this object has an ID specified (it exists in the database) - if (m_id == null || m_id <= 0) + if (m_id <= 0) throw new Exception("The current UserType object does not exist in the database. New UserTypes should be created with the MakeNew method"); SqlHelper.ExecuteNonQuery(@" @@ -173,7 +173,7 @@ namespace umbraco.BusinessLogic public void Delete() { //ensure that this object has an ID specified (it exists in the database) - if (m_id == null || m_id <= 0) + if (m_id <= 0) throw new Exception("The current UserType object does not exist in the database. New UserTypes should be created with the MakeNew method"); SqlHelper.ExecuteNonQuery(@" diff --git a/umbraco/cms/Actions/ActionAssignDomain.cs b/umbraco/cms/Actions/ActionAssignDomain.cs index b8f472bf7f..934f6f9ced 100644 --- a/umbraco/cms/Actions/ActionAssignDomain.cs +++ b/umbraco/cms/Actions/ActionAssignDomain.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionAssignDomain : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionAssignDomain m_instance = new ActionAssignDomain(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionAudit.cs b/umbraco/cms/Actions/ActionAudit.cs index 5db17d8c5b..8d3809ef49 100644 --- a/umbraco/cms/Actions/ActionAudit.cs +++ b/umbraco/cms/Actions/ActionAudit.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionAudit : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionAudit m_instance = new ActionAudit(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionCopy.cs b/umbraco/cms/Actions/ActionCopy.cs index be9ee95074..0512775524 100644 --- a/umbraco/cms/Actions/ActionCopy.cs +++ b/umbraco/cms/Actions/ActionCopy.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionCopy : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionCopy m_instance = new ActionCopy(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionDelete.cs b/umbraco/cms/Actions/ActionDelete.cs index 467eca8096..3bd66285cf 100644 --- a/umbraco/cms/Actions/ActionDelete.cs +++ b/umbraco/cms/Actions/ActionDelete.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionDelete : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionDelete m_instance = new ActionDelete(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionDisable.cs b/umbraco/cms/Actions/ActionDisable.cs index 2c45629571..ca017a7d8b 100644 --- a/umbraco/cms/Actions/ActionDisable.cs +++ b/umbraco/cms/Actions/ActionDisable.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionDisable : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionDisable m_instance = new ActionDisable(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionEmptyTranscan.cs b/umbraco/cms/Actions/ActionEmptyTranscan.cs index 3f0ece0d86..c00f42cd62 100644 --- a/umbraco/cms/Actions/ActionEmptyTranscan.cs +++ b/umbraco/cms/Actions/ActionEmptyTranscan.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionEmptyTranscan : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionEmptyTranscan m_instance = new ActionEmptyTranscan(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionExport.cs b/umbraco/cms/Actions/ActionExport.cs index 7f7d3f9dbb..2abb37ae2a 100644 --- a/umbraco/cms/Actions/ActionExport.cs +++ b/umbraco/cms/Actions/ActionExport.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionExport : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionExport m_instance = new ActionExport(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionImport.cs b/umbraco/cms/Actions/ActionImport.cs index 618fad42f4..fb4391a2c7 100644 --- a/umbraco/cms/Actions/ActionImport.cs +++ b/umbraco/cms/Actions/ActionImport.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionImport : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionImport m_instance = new ActionImport(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionMove.cs b/umbraco/cms/Actions/ActionMove.cs index 820f90004e..959d30f9f7 100644 --- a/umbraco/cms/Actions/ActionMove.cs +++ b/umbraco/cms/Actions/ActionMove.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionMove : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionMove m_instance = new ActionMove(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionNew.cs b/umbraco/cms/Actions/ActionNew.cs index 51d8eae408..ec07d8096a 100644 --- a/umbraco/cms/Actions/ActionNew.cs +++ b/umbraco/cms/Actions/ActionNew.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionNew : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionNew m_instance = new ActionNew(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionNewFolder.cs b/umbraco/cms/Actions/ActionNewFolder.cs index c90072eb38..f758259e0b 100644 --- a/umbraco/cms/Actions/ActionNewFolder.cs +++ b/umbraco/cms/Actions/ActionNewFolder.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionNewFolder : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionNewFolder m_instance = new ActionNewFolder(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionNotify.cs b/umbraco/cms/Actions/ActionNotify.cs index 9d7efb3517..f31e1a6f26 100644 --- a/umbraco/cms/Actions/ActionNotify.cs +++ b/umbraco/cms/Actions/ActionNotify.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionNotify : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionNotify m_instance = new ActionNotify(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionPackage.cs b/umbraco/cms/Actions/ActionPackage.cs index a3be894ab6..2a3009a089 100644 --- a/umbraco/cms/Actions/ActionPackage.cs +++ b/umbraco/cms/Actions/ActionPackage.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionPackage : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionPackage m_instance = new ActionPackage(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionPackageCreate.cs b/umbraco/cms/Actions/ActionPackageCreate.cs index 91347680b7..5caa013cc4 100644 --- a/umbraco/cms/Actions/ActionPackageCreate.cs +++ b/umbraco/cms/Actions/ActionPackageCreate.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionPackageCreate : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionPackageCreate m_instance = new ActionPackageCreate(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionProtect.cs b/umbraco/cms/Actions/ActionProtect.cs index d7021afa5a..eff3ac225c 100644 --- a/umbraco/cms/Actions/ActionProtect.cs +++ b/umbraco/cms/Actions/ActionProtect.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionProtect : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionProtect m_instance = new ActionProtect(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionPublish.cs b/umbraco/cms/Actions/ActionPublish.cs index dfdccade7f..383ed035fb 100644 --- a/umbraco/cms/Actions/ActionPublish.cs +++ b/umbraco/cms/Actions/ActionPublish.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionPublish : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionPublish m_instance = new ActionPublish(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionQuit.cs b/umbraco/cms/Actions/ActionQuit.cs index 05f8ff7e89..e9213ed7b5 100644 --- a/umbraco/cms/Actions/ActionQuit.cs +++ b/umbraco/cms/Actions/ActionQuit.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionQuit : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionQuit m_instance = new ActionQuit(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionRePublish.cs b/umbraco/cms/Actions/ActionRePublish.cs index 93f55b3481..8e32ed2f4c 100644 --- a/umbraco/cms/Actions/ActionRePublish.cs +++ b/umbraco/cms/Actions/ActionRePublish.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionRePublish : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionRePublish m_instance = new ActionRePublish(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionRefresh.cs b/umbraco/cms/Actions/ActionRefresh.cs index 3bc2287b30..2db8e6d317 100644 --- a/umbraco/cms/Actions/ActionRefresh.cs +++ b/umbraco/cms/Actions/ActionRefresh.cs @@ -12,7 +12,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionRefresh : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionRefresh m_instance = new ActionRefresh(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionRights.cs b/umbraco/cms/Actions/ActionRights.cs index c37cff2fa8..6ce84504fe 100644 --- a/umbraco/cms/Actions/ActionRights.cs +++ b/umbraco/cms/Actions/ActionRights.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionRights : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionRights m_instance = new ActionRights(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionRollback.cs b/umbraco/cms/Actions/ActionRollback.cs index a86c1a5229..69355ae306 100644 --- a/umbraco/cms/Actions/ActionRollback.cs +++ b/umbraco/cms/Actions/ActionRollback.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionRollback : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionRollback m_instance = new ActionRollback(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionSave.cs b/umbraco/cms/Actions/ActionSave.cs index 4ee7c5d1c0..888c3a2a5d 100644 --- a/umbraco/cms/Actions/ActionSave.cs +++ b/umbraco/cms/Actions/ActionSave.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionSave : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionSave m_instance = new ActionSave(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionSendToTranslate.cs b/umbraco/cms/Actions/ActionSendToTranslate.cs index bf3569fbf3..1421c865d0 100644 --- a/umbraco/cms/Actions/ActionSendToTranslate.cs +++ b/umbraco/cms/Actions/ActionSendToTranslate.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionSendToTranslate : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionSendToTranslate m_instance = new ActionSendToTranslate(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionSort.cs b/umbraco/cms/Actions/ActionSort.cs index f0eed4431d..de58c7d369 100644 --- a/umbraco/cms/Actions/ActionSort.cs +++ b/umbraco/cms/Actions/ActionSort.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionSort : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionSort m_instance = new ActionSort(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionToPublish.cs b/umbraco/cms/Actions/ActionToPublish.cs index 4d158b3a02..5d1fdd9324 100644 --- a/umbraco/cms/Actions/ActionToPublish.cs +++ b/umbraco/cms/Actions/ActionToPublish.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionToPublish : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionToPublish m_instance = new ActionToPublish(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionTranslate.cs b/umbraco/cms/Actions/ActionTranslate.cs index 759c729d84..cd56afdb8a 100644 --- a/umbraco/cms/Actions/ActionTranslate.cs +++ b/umbraco/cms/Actions/ActionTranslate.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionTranslate : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionTranslate m_instance = new ActionTranslate(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionUnPublish.cs b/umbraco/cms/Actions/ActionUnPublish.cs index 0722fe6cc6..fa45ffee91 100644 --- a/umbraco/cms/Actions/ActionUnPublish.cs +++ b/umbraco/cms/Actions/ActionUnPublish.cs @@ -13,7 +13,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionUnPublish : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionUnPublish m_instance = new ActionUnPublish(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/Actions/ActionUpdate.cs b/umbraco/cms/Actions/ActionUpdate.cs index 32f7ef5e05..de6c0cebbb 100644 --- a/umbraco/cms/Actions/ActionUpdate.cs +++ b/umbraco/cms/Actions/ActionUpdate.cs @@ -10,7 +10,9 @@ namespace umbraco.BusinessLogic.Actions public class ActionUpdate : IAction { //create singleton +#pragma warning disable 612,618 private static readonly ActionUpdate m_instance = new ActionUpdate(); +#pragma warning restore 612,618 /// /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. diff --git a/umbraco/cms/businesslogic/Packager/PackageActions/StandardPackageActions.cs b/umbraco/cms/businesslogic/Packager/PackageActions/StandardPackageActions.cs index e213275b6f..46e8b85d31 100644 --- a/umbraco/cms/businesslogic/Packager/PackageActions/StandardPackageActions.cs +++ b/umbraco/cms/businesslogic/Packager/PackageActions/StandardPackageActions.cs @@ -6,859 +6,976 @@ using System.Xml; using System.Linq; using umbraco.IO; -namespace umbraco.cms.businesslogic.packager.standardPackageActions { - /*Build in standard actions */ - - /// - /// 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. - /// - public class addApplicationTree : umbraco.interfaces.IPackageAction { - - #region IPackageAction Members - - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// - public bool Execute(string packageName, XmlNode xmlData) { - bool silent = bool.Parse(xmlData.Attributes["silent"].Value); - 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 assemblyName = xmlData.Attributes["assemblyName"].Value; - string type = xmlData.Attributes["treeHandlerType"].Value; - string action = xmlData.Attributes["action"].Value; - - - BusinessLogic.ApplicationTree.MakeNew(silent, initialize, sortOrder, applicationAlias, treeAlias, treeTitle, iconClosed, iconOpened, assemblyName, type, action); - - return true; - } - - /// - /// Undoes the action - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) { - string treeAlias = xmlData.Attributes["treeAlias"].Value; - BusinessLogic.ApplicationTree.getByAlias(treeAlias).Delete(); - return true; - } - - /// - /// Action alias. - /// - /// - public string Alias() { - return "addApplicationTree"; - } - - #endregion - - - public XmlNode SampleXml() { - - string sample = ""; - return helper.parseStringToXmlNode(sample); - } - } - - /// - /// 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. - /// - public class addApplication : umbraco.interfaces.IPackageAction { - - #region IPackageAction Members - - /// - /// Installs a new application in umbraco. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// true if successfull - public bool Execute(string packageName, XmlNode xmlData) { - string name = xmlData.Attributes["appName"].Value; - string alias = xmlData.Attributes["appAlias"].Value; - string icon = xmlData.Attributes["appIcon"].Value; - - BusinessLogic.Application.MakeNew(name, alias, icon); - - return true; - } - - public bool Undo(string packageName, XmlNode xmlData) { - string alias = xmlData.Attributes["appAlias"].Value; - BusinessLogic.Application.getByAlias(alias).Delete(); - return true; - } - /// - /// Action alias. - /// - /// - public string Alias() { - return "addApplication"; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - /// - /// - /// - public class addDashboardSection : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - /// - /// Installs a dashboard section. This action reuses the action XML, so it has to be valid dashboard markup. - /// - /// Name of the package. - /// The XML data. - /// true if successfull - /// - /// - /// - ///
- /// - /// default - /// content - /// - /// - /// /usercontrols/dashboard/latestEdits.ascx - /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx - /// - /// - /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx - /// - ///
- ///
- ///
- ///
- public bool Execute(string packageName, XmlNode xmlData) { - //this will need a complete section node to work... - - if (xmlData.HasChildNodes) { - string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; - string dbConfig = SystemFiles.DashboardConfig; - - XmlNode section = xmlData.SelectSingleNode("./section"); - XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig); - - XmlNode importedSection = dashboardFile.ImportNode(section, true); - - XmlAttribute alias = xmlHelper.addAttribute(dashboardFile, "alias", sectionAlias); - importedSection.Attributes.Append(alias); - - dashboardFile.DocumentElement.AppendChild(importedSection); - - dashboardFile.Save(IOHelper.MapPath(dbConfig)); - - return true; - } - - return false; - } - - - public string Alias() { - return "addDashboardSection"; - } - - public bool Undo(string packageName, XmlNode xmlData) { - - string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; - string dbConfig = SystemFiles.DashboardConfig; - XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig); - - XmlNode section = dashboardFile.SelectSingleNode("//section [@alias = '" + sectionAlias + "']"); - - if(section != null){ - - dashboardFile.SelectSingleNode("/dashBoard").RemoveChild(section); - dashboardFile.Save(IOHelper.MapPath(dbConfig)); - } - - return true; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - /// - /// 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. - /// - public class allowDoctype : umbraco.interfaces.IPackageAction { - - #region IPackageAction Members - - /// - /// Allows a documentType to be created below another documentType. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// Returns true on success - public bool Execute(string packageName, XmlNode xmlData) { - string doctypeName = xmlData.Attributes["documentTypeAlias"].Value; - string parentDoctypeName = xmlData.Attributes["parentDocumentTypeAlias"].Value; - - cms.businesslogic.ContentType ct = cms.businesslogic.ContentType.GetByAlias(doctypeName); - cms.businesslogic.ContentType parentct = cms.businesslogic.ContentType.GetByAlias(parentDoctypeName); - - if (ct != null && parentct != null) { - bool containsId = false; - ArrayList tmp = new ArrayList(); - - foreach (int i in parentct.AllowedChildContentTypeIDs.ToList()) { - tmp.Add(i); - if (i == ct.Id) - containsId = true; - } - - if (!containsId) { - - int[] ids = new int[tmp.Count + 1]; - for (int i = 0; i < tmp.Count; i++) ids[i] = (int)tmp[i]; - ids[ids.Length - 1] = ct.Id; - - parentct.AllowedChildContentTypeIDs = ids; - parentct.Save(); - return true; - } - } - return false; - } - - //this has no undo. - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) { - return true; - } - - /// - /// Action Alias. - /// - /// - public string Alias() { - return "allowDocumenttype"; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - public class addXsltExtension : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - public bool Execute(string packageName, XmlNode xmlData) { - - string _assembly = xmlData.Attributes["assembly"].Value; - string _type = xmlData.Attributes["type"].Value; - string _alias = xmlData.Attributes["extensionAlias"].Value; - string xeConfig = SystemFiles.XsltextensionsConfig; - - XmlDocument xdoc = new XmlDocument(); - xdoc.PreserveWhitespace = true; - xdoc = xmlHelper.OpenAsXmlDocument(xeConfig); - - XmlNode xn = xdoc.SelectSingleNode("//XsltExtensions"); - - if (xn != null) { - bool insertExt = true; - if (xn.HasChildNodes) { - foreach (XmlNode ext in xn.SelectNodes("//ext")) { - if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) - insertExt = false; - } - } - if (insertExt) { - XmlNode newExt = umbraco.xmlHelper.addTextNode(xdoc, "ext", ""); - newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "assembly", _assembly.Replace("/bin/",""))); - newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "type", _type)); - newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "alias", _alias)); - xn.AppendChild(newExt); - - - xdoc.Save(IOHelper.MapPath(xeConfig)); - return true; - } - } - return false; - } - - public string Alias() { - return "addXsltExtension"; - } - - public bool Undo(string packageName, XmlNode xmlData) { - string _assembly = xmlData.Attributes["assembly"].Value; - string _type = xmlData.Attributes["type"].Value; - string _alias = xmlData.Attributes["extensionAlias"].Value; - string xeConfig = SystemFiles.XsltextensionsConfig; - - XmlDocument xdoc = new XmlDocument(); - xdoc.PreserveWhitespace = true; - xdoc = xmlHelper.OpenAsXmlDocument(xeConfig); - - XmlNode xn = xdoc.SelectSingleNode("//XsltExtensions"); - - if (xn != null) { - bool inserted = false; - if (xn.HasChildNodes) { - foreach (XmlNode ext in xn.SelectNodes("//ext")) { - if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) { - xn.RemoveChild(ext); - inserted = true; - } - } - } - - if (inserted) { - xdoc.Save(IOHelper.MapPath(xeConfig)); - return true; - } - } - return false; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - public class addRestExtension : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - public bool Execute(string packageName, XmlNode xmlData) { - - XmlNodeList _newExts = xmlData.SelectNodes("//ext"); - - if (_newExts.Count > 0) { - - string reConfig = SystemFiles.RestextensionsConfig; - - XmlDocument xdoc = new XmlDocument(); - xdoc.PreserveWhitespace = true; - xdoc = xmlHelper.OpenAsXmlDocument(reConfig); - - - XmlNode xn = xdoc.SelectSingleNode("//RestExtensions"); - - if (xn != null) { - for (int i = 0; i < _newExts.Count; i++) { - XmlNode newExt = _newExts[i]; - string _alias = newExt.Attributes["alias"].Value; - - bool insertExt = true; - if (xn.HasChildNodes) { - foreach (XmlNode ext in xn.SelectNodes("//ext")) { - if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) - insertExt = false; - } - } - - if (insertExt) { - xn.AppendChild(xdoc.ImportNode(newExt, true)); - } - } - - xdoc.Save(IOHelper.MapPath(reConfig)); - return true; - } - } - return false; - } - - public string Alias() { - return "addRestExtension"; - } - - public bool Undo(string packageName, XmlNode xmlData) { - - XmlNodeList _newExts = xmlData.SelectNodes("//ext"); - - if (_newExts.Count > 0) { - string reConfig = SystemFiles.RestextensionsConfig; - - XmlDocument xdoc = new XmlDocument(); - xdoc.PreserveWhitespace = true; - xdoc.Load(reConfig); - - XmlNode xn = xdoc.SelectSingleNode("//RestExtensions"); - - if (xn != null) { - bool inserted = false; - - for (int i = 0; i < _newExts.Count; i++) { - XmlNode newExt = _newExts[i]; - string _alias = newExt.Attributes["alias"].Value; - if (xn.HasChildNodes) { - foreach (XmlNode ext in xn.SelectNodes("//ext")) { - if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) { - xn.RemoveChild(ext); - inserted = true; - } - } - } - } - - if (inserted) { - xdoc.Save(IOHelper.MapPath(reConfig)); - return true; - } - } - } - return false; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - /// - /// 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. - /// - public class moveRootDocument : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed succesfully - 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. - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) { - return true; - } - - /// - /// Action alias - /// - /// - public string Alias() { - return "moveRootDocument"; - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - /// - /// 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. - /// - public class publishRootDocument : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed succesfully - public bool Execute(string packageName, XmlNode xmlData) { - - string documentName = xmlData.Attributes["documentName"].Value; - - int parentDocid = 0; - - web.Document[] rootDocs = web.Document.GetRootDocuments(); - - foreach (web.Document rootDoc in rootDocs) { - if (rootDoc.Text.Trim() == documentName.Trim() && rootDoc != null && rootDoc.ContentType != null) { - - rootDoc.PublishWithChildrenWithResult(umbraco.BusinessLogic.User.GetUser(0)); - - - break; - } - } - return true; - } - - //this has no undo. - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) { - return true; - } - - /// - /// Action alias - /// - /// - public string Alias() { - return "publishRootDocument"; - } - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - /// - /// 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. - /// addStringToHtmlElement adds a string to specific HTML element in a specific template, and can either append or prepend it. - /// It uses the action xml node to do this, exemple action xml node: - /// - /// The above will add the string "hello world!" to the first html element with the id "newsSection" in the template "news" - /// - public class addStringToHtmlElement : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed successfully - public bool Execute(string packageName, XmlNode xmlData) { - - BusinessLogic.Log.Add(BusinessLogic.LogTypes.Error, BusinessLogic.User.GetUser(0), -1, "executing addStringToHtmlElement"); - - string templateAlias = xmlData.Attributes["templateAlias"].Value; - string htmlElementId = xmlData.Attributes["htmlElementId"].Value; - string position = xmlData.Attributes["position"].Value; - string value = xmlHelper.GetNodeValue(xmlData); - template.Template tmp = template.Template.GetByAlias(templateAlias); - - if (UmbracoSettings.UseAspNetMasterPages) - value = tmp.EnsureMasterPageSyntax(value); - - _addStringToHtmlElement(tmp, value, templateAlias, htmlElementId, position); - - return true; - } - - - /// - /// Undoes the addStringToHtml Execute() method, by removing the same string from the same template. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) { - string templateAlias = xmlData.Attributes["templateAlias"].Value; - string htmlElementId = xmlData.Attributes["htmlElementId"].Value; - string value = xmlHelper.GetNodeValue(xmlData); - template.Template tmp = template.Template.GetByAlias(templateAlias); - - if (UmbracoSettings.UseAspNetMasterPages) - value = tmp.EnsureMasterPageSyntax(value); - - _removeStringFromHtmlElement(tmp, value, templateAlias, htmlElementId); - return true; - } - - /// - /// Action alias. - /// - /// - public string Alias() { - return "addStringToHtmlElement"; - } - - private void _addStringToHtmlElement(template.Template tmp, string value, string templateAlias, string htmlElementId, string position) { - bool hasAspNetContentBeginning = false; - string design = ""; - string directive = ""; - - if (tmp != null) { - try { - XmlDocument templateXml = new XmlDocument(); - templateXml.PreserveWhitespace = true; - - //Make sure that directive is remove before hacked non html4 compatiple replacement action... - design = tmp.Design; - - - splitDesignAndDirective(ref design, ref directive); - - //making sure that the template xml has a root node... - if (tmp.MasterTemplate > 0) - templateXml.LoadXml( helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); - else - templateXml.LoadXml(helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); - - XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); - - if (xmlElement != null) { - - if (position == "beginning") { - xmlElement.InnerXml = "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n" + xmlElement.InnerXml; - } else { - xmlElement.InnerXml = xmlElement.InnerXml + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n"; - } - } - - tmp.Design = directive + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); - tmp.Save(); - } catch (Exception ex) { - umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, ex.ToString()); - } - } else { - umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "template not found"); - } - } - - private void _removeStringFromHtmlElement(template.Template tmp, string value, string templateAlias, string htmlElementId) { - bool hasAspNetContentBeginning = false; - string design = ""; - string directive = ""; - - - if (tmp != null) { - try { - XmlDocument templateXml = new XmlDocument(); - templateXml.PreserveWhitespace = true; - - //Make sure that directive is remove before hacked non html4 compatiple replacement action... - design = tmp.Design; - splitDesignAndDirective(ref design, ref directive); - - //making sure that the template xml has a root node... - if (tmp.MasterTemplate > 0) - templateXml.LoadXml( helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); - else - templateXml.LoadXml( helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); - - XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); - - - - if (xmlElement != null) { - string repValue = helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true); - xmlElement.InnerXml = xmlElement.InnerXml.Replace(repValue , ""); - } - - tmp.Design = directive + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); - tmp.Save(); - } catch (Exception ex) { - umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, ex.ToString() ); - } - } else { - umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "template not found"); - } - } - - - - private void splitDesignAndDirective(ref string design, ref string directive) { - if (design.StartsWith("<%@")) { - directive = design.Substring(0, design.IndexOf("%>") + 2).Trim(Environment.NewLine.ToCharArray()); - design = design.Substring(design.IndexOf("%>") + 3).Trim(Environment.NewLine.ToCharArray()); - } - } - - #endregion - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - } - - public class removeStringFromTemplate : umbraco.interfaces.IPackageAction { - #region IPackageAction Members - - public bool Execute(string packageName, XmlNode xmlData) { - addStringToHtmlElement ast = new addStringToHtmlElement(); - return ast.Undo(packageName, xmlData); - } - - public string Alias() { - return "removeStringFromHtmlElement"; - } - - public bool Undo(string packageName, XmlNode xmlData) { - return true; - } - - public XmlNode SampleXml() { - throw new NotImplementedException(); - } - - #endregion - } - - - public class helper { - //Helper method to replace umbraco tags that breaks the xml format.. - public static string parseToValidXml(template.Template templateObj, ref bool hasAspNetContentBeginning, string template, bool toValid) { - string retVal = template; - if (toValid) { - // test for asp:content as the first part of the design - if (retVal.StartsWith("") + 1); - retVal = retVal.Substring(0, retVal.Length - 14); - } - //shorten empty macro tags.. - retVal = retVal.Replace(">", " />"); - retVal = retVal.Replace(">", " />"); - - retVal = retVal.Replace("", ""); - retVal = retVal.Replace("", ""); - retVal = retVal.Replace("", ""); - - // add asp content element - if (hasAspNetContentBeginning) { - retVal = templateObj.GetMasterContentElement(templateObj.MasterTemplate) + retVal + ""; - } - } - - return retVal; - } - - public static XmlNode parseStringToXmlNode(string value) { - XmlDocument doc = new XmlDocument(); - XmlNode node = xmlHelper.addTextNode(doc, "error", ""); - - try { - doc.LoadXml(value); - return doc.SelectSingleNode("."); - } catch { - return node; - } - - return node; - } - } +namespace umbraco.cms.businesslogic.packager.standardPackageActions +{ + /*Build in standard actions */ + + /// + /// 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. + /// + public class addApplicationTree : umbraco.interfaces.IPackageAction + { + + #region IPackageAction Members + + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// + public bool Execute(string packageName, XmlNode xmlData) + { + bool silent = bool.Parse(xmlData.Attributes["silent"].Value); + 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 assemblyName = xmlData.Attributes["assemblyName"].Value; + string type = xmlData.Attributes["treeHandlerType"].Value; + string action = xmlData.Attributes["action"].Value; + + + BusinessLogic.ApplicationTree.MakeNew(silent, initialize, sortOrder, applicationAlias, treeAlias, treeTitle, iconClosed, iconOpened, assemblyName, type, action); + + return true; + } + + /// + /// Undoes the action + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + string treeAlias = xmlData.Attributes["treeAlias"].Value; + BusinessLogic.ApplicationTree.getByAlias(treeAlias).Delete(); + return true; + } + + /// + /// Action alias. + /// + /// + public string Alias() + { + return "addApplicationTree"; + } + + #endregion + + + public XmlNode SampleXml() + { + + string sample = ""; + return helper.parseStringToXmlNode(sample); + } + } + + /// + /// 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. + /// + public class addApplication : umbraco.interfaces.IPackageAction + { + + #region IPackageAction Members + + /// + /// Installs a new application in umbraco. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// true if successfull + public bool Execute(string packageName, XmlNode xmlData) + { + string name = xmlData.Attributes["appName"].Value; + string alias = xmlData.Attributes["appAlias"].Value; + string icon = xmlData.Attributes["appIcon"].Value; + + BusinessLogic.Application.MakeNew(name, alias, icon); + + return true; + } + + public bool Undo(string packageName, XmlNode xmlData) + { + string alias = xmlData.Attributes["appAlias"].Value; + BusinessLogic.Application.getByAlias(alias).Delete(); + return true; + } + /// + /// Action alias. + /// + /// + public string Alias() + { + return "addApplication"; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + /// + /// + /// + public class addDashboardSection : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + /// + /// Installs a dashboard section. This action reuses the action XML, so it has to be valid dashboard markup. + /// + /// Name of the package. + /// The XML data. + /// true if successfull + /// + /// + /// + ///
+ /// + /// default + /// content + /// + /// + /// /usercontrols/dashboard/latestEdits.ascx + /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx + /// + /// + /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx + /// + ///
+ ///
+ ///
+ ///
+ public bool Execute(string packageName, XmlNode xmlData) + { + //this will need a complete section node to work... + + if (xmlData.HasChildNodes) + { + string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; + string dbConfig = SystemFiles.DashboardConfig; + + XmlNode section = xmlData.SelectSingleNode("./section"); + XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig); + + XmlNode importedSection = dashboardFile.ImportNode(section, true); + + XmlAttribute alias = xmlHelper.addAttribute(dashboardFile, "alias", sectionAlias); + importedSection.Attributes.Append(alias); + + dashboardFile.DocumentElement.AppendChild(importedSection); + + dashboardFile.Save(IOHelper.MapPath(dbConfig)); + + return true; + } + + return false; + } + + + public string Alias() + { + return "addDashboardSection"; + } + + public bool Undo(string packageName, XmlNode xmlData) + { + + string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; + string dbConfig = SystemFiles.DashboardConfig; + XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig); + + XmlNode section = dashboardFile.SelectSingleNode("//section [@alias = '" + sectionAlias + "']"); + + if (section != null) + { + + dashboardFile.SelectSingleNode("/dashBoard").RemoveChild(section); + dashboardFile.Save(IOHelper.MapPath(dbConfig)); + } + + return true; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + /// + /// 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. + /// + public class allowDoctype : umbraco.interfaces.IPackageAction + { + + #region IPackageAction Members + + /// + /// Allows a documentType to be created below another documentType. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// Returns true on success + public bool Execute(string packageName, XmlNode xmlData) + { + string doctypeName = xmlData.Attributes["documentTypeAlias"].Value; + string parentDoctypeName = xmlData.Attributes["parentDocumentTypeAlias"].Value; + + cms.businesslogic.ContentType ct = cms.businesslogic.ContentType.GetByAlias(doctypeName); + cms.businesslogic.ContentType parentct = cms.businesslogic.ContentType.GetByAlias(parentDoctypeName); + + if (ct != null && parentct != null) + { + bool containsId = false; + ArrayList tmp = new ArrayList(); + + foreach (int i in parentct.AllowedChildContentTypeIDs.ToList()) + { + tmp.Add(i); + if (i == ct.Id) + containsId = true; + } + + if (!containsId) + { + + int[] ids = new int[tmp.Count + 1]; + for (int i = 0; i < tmp.Count; i++) ids[i] = (int)tmp[i]; + ids[ids.Length - 1] = ct.Id; + + parentct.AllowedChildContentTypeIDs = ids; + parentct.Save(); + return true; + } + } + return false; + } + + //this has no undo. + /// + /// This action has no undo. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } + + /// + /// Action Alias. + /// + /// + public string Alias() + { + return "allowDocumenttype"; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + public class addXsltExtension : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + public bool Execute(string packageName, XmlNode xmlData) + { + + string _assembly = xmlData.Attributes["assembly"].Value; + string _type = xmlData.Attributes["type"].Value; + string _alias = xmlData.Attributes["extensionAlias"].Value; + string xeConfig = SystemFiles.XsltextensionsConfig; + + XmlDocument xdoc = new XmlDocument(); + xdoc.PreserveWhitespace = true; + xdoc = xmlHelper.OpenAsXmlDocument(xeConfig); + + XmlNode xn = xdoc.SelectSingleNode("//XsltExtensions"); + + if (xn != null) + { + bool insertExt = true; + if (xn.HasChildNodes) + { + foreach (XmlNode ext in xn.SelectNodes("//ext")) + { + if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) + insertExt = false; + } + } + if (insertExt) + { + XmlNode newExt = umbraco.xmlHelper.addTextNode(xdoc, "ext", ""); + newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "assembly", _assembly.Replace("/bin/", ""))); + newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "type", _type)); + newExt.Attributes.Append(umbraco.xmlHelper.addAttribute(xdoc, "alias", _alias)); + xn.AppendChild(newExt); + + + xdoc.Save(IOHelper.MapPath(xeConfig)); + return true; + } + } + return false; + } + + public string Alias() + { + return "addXsltExtension"; + } + + public bool Undo(string packageName, XmlNode xmlData) + { + string _assembly = xmlData.Attributes["assembly"].Value; + string _type = xmlData.Attributes["type"].Value; + string _alias = xmlData.Attributes["extensionAlias"].Value; + string xeConfig = SystemFiles.XsltextensionsConfig; + + XmlDocument xdoc = new XmlDocument(); + xdoc.PreserveWhitespace = true; + xdoc = xmlHelper.OpenAsXmlDocument(xeConfig); + + XmlNode xn = xdoc.SelectSingleNode("//XsltExtensions"); + + if (xn != null) + { + bool inserted = false; + if (xn.HasChildNodes) + { + foreach (XmlNode ext in xn.SelectNodes("//ext")) + { + if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) + { + xn.RemoveChild(ext); + inserted = true; + } + } + } + + if (inserted) + { + xdoc.Save(IOHelper.MapPath(xeConfig)); + return true; + } + } + return false; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + public class addRestExtension : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + public bool Execute(string packageName, XmlNode xmlData) + { + + XmlNodeList _newExts = xmlData.SelectNodes("//ext"); + + if (_newExts.Count > 0) + { + + string reConfig = SystemFiles.RestextensionsConfig; + + XmlDocument xdoc = new XmlDocument(); + xdoc.PreserveWhitespace = true; + xdoc = xmlHelper.OpenAsXmlDocument(reConfig); + + + XmlNode xn = xdoc.SelectSingleNode("//RestExtensions"); + + if (xn != null) + { + for (int i = 0; i < _newExts.Count; i++) + { + XmlNode newExt = _newExts[i]; + string _alias = newExt.Attributes["alias"].Value; + + bool insertExt = true; + if (xn.HasChildNodes) + { + foreach (XmlNode ext in xn.SelectNodes("//ext")) + { + if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) + insertExt = false; + } + } + + if (insertExt) + { + xn.AppendChild(xdoc.ImportNode(newExt, true)); + } + } + + xdoc.Save(IOHelper.MapPath(reConfig)); + return true; + } + } + return false; + } + + public string Alias() + { + return "addRestExtension"; + } + + public bool Undo(string packageName, XmlNode xmlData) + { + + XmlNodeList _newExts = xmlData.SelectNodes("//ext"); + + if (_newExts.Count > 0) + { + string reConfig = SystemFiles.RestextensionsConfig; + + XmlDocument xdoc = new XmlDocument(); + xdoc.PreserveWhitespace = true; + xdoc.Load(reConfig); + + XmlNode xn = xdoc.SelectSingleNode("//RestExtensions"); + + if (xn != null) + { + bool inserted = false; + + for (int i = 0; i < _newExts.Count; i++) + { + XmlNode newExt = _newExts[i]; + string _alias = newExt.Attributes["alias"].Value; + if (xn.HasChildNodes) + { + foreach (XmlNode ext in xn.SelectNodes("//ext")) + { + if (ext.Attributes["alias"] != null && ext.Attributes["alias"].Value == _alias) + { + xn.RemoveChild(ext); + inserted = true; + } + } + } + } + + if (inserted) + { + xdoc.Save(IOHelper.MapPath(reConfig)); + return true; + } + } + } + return false; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + /// + /// 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. + /// + public class moveRootDocument : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// True if executed succesfully + 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. + /// + /// This action has no undo. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } + + /// + /// Action alias + /// + /// + public string Alias() + { + return "moveRootDocument"; + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + /// + /// 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. + /// + public class publishRootDocument : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// True if executed succesfully + public bool Execute(string packageName, XmlNode xmlData) + { + + string documentName = xmlData.Attributes["documentName"].Value; + + int parentDocid = 0; + + web.Document[] rootDocs = web.Document.GetRootDocuments(); + + foreach (web.Document rootDoc in rootDocs) + { + if (rootDoc.Text.Trim() == documentName.Trim() && rootDoc != null && rootDoc.ContentType != null) + { + + rootDoc.PublishWithChildrenWithResult(umbraco.BusinessLogic.User.GetUser(0)); + + + break; + } + } + return true; + } + + //this has no undo. + /// + /// This action has no undo. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } + + /// + /// Action alias + /// + /// + public string Alias() + { + return "publishRootDocument"; + } + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + /// + /// 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. + /// addStringToHtmlElement adds a string to specific HTML element in a specific template, and can either append or prepend it. + /// It uses the action xml node to do this, exemple action xml node: + /// + /// The above will add the string "hello world!" to the first html element with the id "newsSection" in the template "news" + /// + public class addStringToHtmlElement : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// True if executed successfully + public bool Execute(string packageName, XmlNode xmlData) + { + + BusinessLogic.Log.Add(BusinessLogic.LogTypes.Error, BusinessLogic.User.GetUser(0), -1, "executing addStringToHtmlElement"); + + string templateAlias = xmlData.Attributes["templateAlias"].Value; + string htmlElementId = xmlData.Attributes["htmlElementId"].Value; + string position = xmlData.Attributes["position"].Value; + string value = xmlHelper.GetNodeValue(xmlData); + template.Template tmp = template.Template.GetByAlias(templateAlias); + + if (UmbracoSettings.UseAspNetMasterPages) + value = tmp.EnsureMasterPageSyntax(value); + + _addStringToHtmlElement(tmp, value, templateAlias, htmlElementId, position); + + return true; + } + + + /// + /// Undoes the addStringToHtml Execute() method, by removing the same string from the same template. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + string templateAlias = xmlData.Attributes["templateAlias"].Value; + string htmlElementId = xmlData.Attributes["htmlElementId"].Value; + string value = xmlHelper.GetNodeValue(xmlData); + template.Template tmp = template.Template.GetByAlias(templateAlias); + + if (UmbracoSettings.UseAspNetMasterPages) + value = tmp.EnsureMasterPageSyntax(value); + + _removeStringFromHtmlElement(tmp, value, templateAlias, htmlElementId); + return true; + } + + /// + /// Action alias. + /// + /// + public string Alias() + { + return "addStringToHtmlElement"; + } + + private void _addStringToHtmlElement(template.Template tmp, string value, string templateAlias, string htmlElementId, string position) + { + bool hasAspNetContentBeginning = false; + string design = ""; + string directive = ""; + + if (tmp != null) + { + try + { + XmlDocument templateXml = new XmlDocument(); + templateXml.PreserveWhitespace = true; + + //Make sure that directive is remove before hacked non html4 compatiple replacement action... + design = tmp.Design; + + + splitDesignAndDirective(ref design, ref directive); + + //making sure that the template xml has a root node... + if (tmp.MasterTemplate > 0) + templateXml.LoadXml(helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); + else + templateXml.LoadXml(helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); + + XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); + + if (xmlElement != null) + { + + if (position == "beginning") + { + xmlElement.InnerXml = "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n" + xmlElement.InnerXml; + } + else + { + xmlElement.InnerXml = xmlElement.InnerXml + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n"; + } + } + + tmp.Design = directive + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); + tmp.Save(); + } + catch (Exception ex) + { + umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, ex.ToString()); + } + } + else + { + umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "template not found"); + } + } + + private void _removeStringFromHtmlElement(template.Template tmp, string value, string templateAlias, string htmlElementId) + { + bool hasAspNetContentBeginning = false; + string design = ""; + string directive = ""; + + + if (tmp != null) + { + try + { + XmlDocument templateXml = new XmlDocument(); + templateXml.PreserveWhitespace = true; + + //Make sure that directive is remove before hacked non html4 compatiple replacement action... + design = tmp.Design; + splitDesignAndDirective(ref design, ref directive); + + //making sure that the template xml has a root node... + if (tmp.MasterTemplate > 0) + templateXml.LoadXml(helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); + else + templateXml.LoadXml(helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); + + XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); + + + + if (xmlElement != null) + { + string repValue = helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, value, true); + xmlElement.InnerXml = xmlElement.InnerXml.Replace(repValue, ""); + } + + tmp.Design = directive + "\n" + helper.parseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); + tmp.Save(); + } + catch (Exception ex) + { + umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, ex.ToString()); + } + } + else + { + umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "template not found"); + } + } + + + + private void splitDesignAndDirective(ref string design, ref string directive) + { + if (design.StartsWith("<%@")) + { + directive = design.Substring(0, design.IndexOf("%>") + 2).Trim(Environment.NewLine.ToCharArray()); + design = design.Substring(design.IndexOf("%>") + 3).Trim(Environment.NewLine.ToCharArray()); + } + } + + #endregion + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + } + + public class removeStringFromTemplate : umbraco.interfaces.IPackageAction + { + #region IPackageAction Members + + public bool Execute(string packageName, XmlNode xmlData) + { + addStringToHtmlElement ast = new addStringToHtmlElement(); + return ast.Undo(packageName, xmlData); + } + + public string Alias() + { + return "removeStringFromHtmlElement"; + } + + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } + + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + + #endregion + } + + + public class helper + { + //Helper method to replace umbraco tags that breaks the xml format.. + public static string parseToValidXml(template.Template templateObj, ref bool hasAspNetContentBeginning, string template, bool toValid) + { + string retVal = template; + if (toValid) + { + // test for asp:content as the first part of the design + if (retVal.StartsWith("") + 1); + retVal = retVal.Substring(0, retVal.Length - 14); + } + //shorten empty macro tags.. + retVal = retVal.Replace(">", " />"); + retVal = retVal.Replace(">", " />"); + + retVal = retVal.Replace("", ""); + retVal = retVal.Replace("", ""); + retVal = retVal.Replace("", ""); + + // add asp content element + if (hasAspNetContentBeginning) + { + retVal = templateObj.GetMasterContentElement(templateObj.MasterTemplate) + retVal + ""; + } + } + + return retVal; + } + + public static XmlNode parseStringToXmlNode(string value) + { + XmlDocument doc = new XmlDocument(); + XmlNode node = xmlHelper.addTextNode(doc, "error", ""); + + try + { + doc.LoadXml(value); + return doc.SelectSingleNode("."); + } + catch + { + return node; + } + + } + } } diff --git a/umbraco/cms/businesslogic/datatype/BaseDataType.cs b/umbraco/cms/businesslogic/datatype/BaseDataType.cs index 58efadb850..ae92b0d646 100644 --- a/umbraco/cms/businesslogic/datatype/BaseDataType.cs +++ b/umbraco/cms/businesslogic/datatype/BaseDataType.cs @@ -157,7 +157,7 @@ namespace umbraco.cms.businesslogic.datatype this.GetType().InvokeMember(setting.Key, System.Reflection.BindingFlags.SetProperty, null, this, new object[] { setting.Value }); } - catch (MissingMethodException ex) { } + catch (MissingMethodException) { } } } diff --git a/umbraco/cms/businesslogic/macro/Macro.cs b/umbraco/cms/businesslogic/macro/Macro.cs index 95c98fd4a1..4f2e71ae00 100644 --- a/umbraco/cms/businesslogic/macro/Macro.cs +++ b/umbraco/cms/businesslogic/macro/Macro.cs @@ -486,7 +486,6 @@ namespace umbraco.cms.businesslogic.macro ///
/// The alias of the macro /// If the macro with the given alias exists, it returns the macro, else null - [Obsolete("Use the alias constructor")] public static Macro GetByAlias(string Alias) { try diff --git a/umbraco/cms/businesslogic/member/MemberGroup.cs b/umbraco/cms/businesslogic/member/MemberGroup.cs index 83c7a39caf..d7f22456ec 100644 --- a/umbraco/cms/businesslogic/member/MemberGroup.cs +++ b/umbraco/cms/businesslogic/member/MemberGroup.cs @@ -209,14 +209,14 @@ namespace umbraco.cms.businesslogic.member /// /// Occurs when a language is saved. /// - public static event SaveEventHandler BeforeSave; + public new static event SaveEventHandler BeforeSave; protected virtual void FireBeforeSave(SaveEventArgs e) { if (BeforeSave != null) BeforeSave(this, e); } - public static event SaveEventHandler AfterSave; - protected virtual void FireAfterSave(SaveEventArgs e) { + public new static event SaveEventHandler AfterSave; + protected new virtual void FireAfterSave(SaveEventArgs e) { if (AfterSave != null) AfterSave(this, e); } diff --git a/umbraco/cms/businesslogic/web/StylesheetProperty.cs b/umbraco/cms/businesslogic/web/StylesheetProperty.cs index 118b89b7c5..05d5b15d13 100644 --- a/umbraco/cms/businesslogic/web/StylesheetProperty.cs +++ b/umbraco/cms/businesslogic/web/StylesheetProperty.cs @@ -184,12 +184,12 @@ namespace umbraco.cms.businesslogic.web /// /// Occurs when [new]. /// - new public static event NewEventHandler New; + public static event NewEventHandler New; /// /// Raises the event. /// /// The instance containing the event data. - new protected virtual void OnNew(NewEventArgs e) { + protected virtual void OnNew(NewEventArgs e) { if (New != null) New(this, e); } diff --git a/umbraco/presentation/UmbracoContext.cs b/umbraco/presentation/UmbracoContext.cs index 629c460255..9a42041f50 100644 --- a/umbraco/presentation/UmbracoContext.cs +++ b/umbraco/presentation/UmbracoContext.cs @@ -21,7 +21,6 @@ namespace umbraco.presentation private UmbracoRequest m_Request; private UmbracoResponse m_Response; private HttpContext m_HttpContext; - private XmlDocument previewDocument; private PreviewContent _previewContent; /// diff --git a/umbraco/presentation/config/Dashboard.config b/umbraco/presentation/config/Dashboard.config index 8121bfda4c..a6127b3b83 100644 --- a/umbraco/presentation/config/Dashboard.config +++ b/umbraco/presentation/config/Dashboard.config @@ -83,4 +83,12 @@ +
+ + courier + + + /umbraco/plugins/courier/dashboard/CourierDashboard.ascx + +
\ No newline at end of file diff --git a/umbraco/presentation/config/tinyMceConfig.config b/umbraco/presentation/config/tinyMceConfig.config index 6c06a243a3..2438825b51 100644 --- a/umbraco/presentation/config/tinyMceConfig.config +++ b/umbraco/presentation/config/tinyMceConfig.config @@ -2,226 +2,227 @@ - - - code - images/editor/code.gif - code - 1 - - - removeformat - images/editor/removeformat.gif - removeformat - 2 - + + + code + images/editor/code.gif + code + 1 + + + removeformat + images/editor/removeformat.gif + removeformat + 2 + - - Undo - images/editor/undo.gif - undo - 11 - - - Redo - images/editor/redo.gif - redo - 12 - - - Cut - images/editor/cut.gif - cut - 13 - - - Copy - images/editor/copy.gif - copy - 14 - - - mcePasteWord - images/editor/paste.gif - pasteword - 15 - + + Undo + images/editor/undo.gif + undo + 11 + + + Redo + images/editor/redo.gif + redo + 12 + + + Cut + images/editor/cut.gif + cut + 13 + + + Copy + images/editor/copy.gif + copy + 14 + + + mcePasteWord + images/editor/paste.gif + pasteword + 15 + - - stylePicker - images/editor/showStyles.png - umbracocss - 20 - - - bold - images/editor/bold.gif - bold - 21 - - - italic - images/editor/italic.gif - italic - 22 - - - Underline - images/editor/underline.gif - underline - 23 - - - Strikethrough - images/editor/strikethrough.gif - strikethrough - 24 - + + stylePicker + images/editor/showStyles.png + umbracocss + 20 + + + bold + images/editor/bold.gif + bold + 21 + + + italic + images/editor/italic.gif + italic + 22 + + + Underline + images/editor/underline.gif + underline + 23 + + + Strikethrough + images/editor/strikethrough.gif + strikethrough + 24 + - - JustifyLeft - images/editor/justifyleft.gif - justifyleft - 31 - - - JustifyCenter - images/editor/justifycenter.gif - justifycenter - 32 - - - JustifyRight - images/editor/justifyright.gif - justifyright - 33 - - - JustifyFull - images/editor/justifyfull.gif - justifyfull - 34 - + + JustifyLeft + images/editor/justifyleft.gif + justifyleft + 31 + + + JustifyCenter + images/editor/justifycenter.gif + justifycenter + 32 + + + JustifyRight + images/editor/justifyright.gif + justifyright + 33 + + + JustifyFull + images/editor/justifyfull.gif + justifyfull + 34 + - - bullist - images/editor/bullist.gif - bullist - 41 - - - numlist - images/editor/numlist.gif - numlist - 42 - - - Outdent - images/editor/outdent.gif - outdent - 43 - - - Indent - images/editor/indent.gif - indent - 44 - + + bullist + images/editor/bullist.gif + bullist + 41 + + + numlist + images/editor/numlist.gif + numlist + 42 + + + Outdent + images/editor/outdent.gif + outdent + 43 + + + Indent + images/editor/indent.gif + indent + 44 + - - mceLink - images/editor/link.gif - link - 51 - - - unlink - images/editor/unLink.gif - unlink - 52 - - - mceInsertAnchor - images/editor/anchor.gif - anchor - 53 - + + mceLink + images/editor/link.gif + link + 51 + + + unlink + images/editor/unLink.gif + unlink + 52 + + + mceInsertAnchor + images/editor/anchor.gif + anchor + 53 + - - mceImage - images/editor/image.gif - image - 61 - - - - umbracomacro - images/editor/insMacro.gif - umbracomacro - 62 - - - mceInsertTable - images/editor/table.gif - table - 63 - - - media - images/editor/media.gif - media - 65 - + + mceImage + images/editor/image.gif + image + 61 + - - inserthorizontalrule - images/editor/hr.gif - hr - 71 - - - subscript - images/editor/sub.gif - sub - 72 - - - - superscript - images/editor/sup.gif - sup - 73 - - - - mceCharMap - images/editor/charmap.gif - charmap - 74 - - - - mceSpellCheck - images/editor/spellchecker.gif - spellchecker - 75 - - - - paste - inlinepopups - noneditable - table - umbracomacro - - advlink - umbracocss - media - umbracoimg - spellchecker - - - + umbracomacro + images/editor/insMacro.gif + umbracomacro + 62 + + + mceInsertTable + images/editor/table.gif + table + 63 + + + media + images/editor/media.gif + media + 65 + + + + inserthorizontalrule + images/editor/hr.gif + hr + 71 + + + subscript + images/editor/sub.gif + sub + 72 + + + + superscript + images/editor/sup.gif + sup + 73 + + + + mceCharMap + images/editor/charmap.gif + charmap + 74 + + + + mceSpellCheck + images/editor/spellchecker.gif + spellchecker + 75 + + + + paste + inlinepopups + noneditable + table + umbracomacro + + advlink + umbracocss + media + umbracoimg + spellchecker + umbracoshortcut + + + - font - - - - - raw - GoogleSpellChecker.ashx - +param[name|value|_value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,button]]> + + font + + + + + raw + GoogleSpellChecker.ashx + \ No newline at end of file diff --git a/umbraco/presentation/default.aspx.cs b/umbraco/presentation/default.aspx.cs index 71f42ee330..dd70c09918 100644 --- a/umbraco/presentation/default.aspx.cs +++ b/umbraco/presentation/default.aspx.cs @@ -237,7 +237,7 @@ namespace umbraco System.Web.HttpContext.Current.Items.Add("pageElements", m_umbPage.Elements); } - catch (ArgumentException aex) + catch (ArgumentException) { System.Web.HttpContext.Current.Items.Remove("pageElements"); diff --git a/umbraco/presentation/helper.cs b/umbraco/presentation/helper.cs index 01adff021f..6cd4cbc824 100644 --- a/umbraco/presentation/helper.cs +++ b/umbraco/presentation/helper.cs @@ -6,6 +6,7 @@ using System.Web; using umbraco.BusinessLogic; using System.Xml; using System.Web.UI; +using umbraco.presentation; namespace umbraco { @@ -25,14 +26,14 @@ namespace umbraco return umbraco.BasePages.UmbracoEnsuredPage.CurrentUser; } - [Obsolete("Use umbraco.Presentation.UmbracoContext.Current.Request[key]", false)] public static string Request(string text) { - string temp = string.Empty; - if (HttpContext.Current.Request[text.ToLower()] != null) - if (HttpContext.Current.Request[text] != string.Empty) - temp = HttpContext.Current.Request[text]; - return temp; + + if (UmbracoContext.Current.Request[text.ToLower()] != null) + if (UmbracoContext.Current.Request[text] != string.Empty) + return UmbracoContext.Current.Request[text]; + + return String.Empty; } public static Hashtable ReturnAttributes(String tag) diff --git a/umbraco/presentation/install/steps/theend.ascx.cs b/umbraco/presentation/install/steps/theend.ascx.cs index 760e71bc1c..5bea489744 100644 --- a/umbraco/presentation/install/steps/theend.ascx.cs +++ b/umbraco/presentation/install/steps/theend.ascx.cs @@ -22,7 +22,7 @@ namespace umbraco.presentation.install.steps GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion; Application["umbracoNeedConfiguration"] = false; } - catch (Exception ex) + catch (Exception) { //errorLiteral.Text = ex.ToString(); } diff --git a/umbraco/presentation/macro.cs b/umbraco/presentation/macro.cs index e75659b7ea..6cf0b3afa4 100644 --- a/umbraco/presentation/macro.cs +++ b/umbraco/presentation/macro.cs @@ -1475,7 +1475,7 @@ namespace umbraco // Release the HttpWebResponse Resource. myHttpWebResponse.Close(); } - catch (Exception ee) + catch (Exception) { retVal = showNoMacroContent(currentMacro); } diff --git a/umbraco/presentation/publishingService.cs b/umbraco/presentation/publishingService.cs index 5f0644884c..444c1139f6 100644 --- a/umbraco/presentation/publishingService.cs +++ b/umbraco/presentation/publishingService.cs @@ -38,7 +38,7 @@ namespace umbraco.presentation d.ReleaseDate = DateTime.MinValue; //new DateTime(1, 1, 1); // Causes release date to be null d.Publish(d.User); - library.PublishSingleNode(d.Id); + library.UpdateDocumentCache(d.Id); } catch(Exception ee) diff --git a/umbraco/presentation/umbraco.presentation.csproj b/umbraco/presentation/umbraco.presentation.csproj index 6e63c710f4..21baeee5f7 100644 --- a/umbraco/presentation/umbraco.presentation.csproj +++ b/umbraco/presentation/umbraco.presentation.csproj @@ -1662,6 +1662,7 @@ + @@ -1909,6 +1910,7 @@ + diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs index 19d34dc7a3..18b0e22a72 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs @@ -132,7 +132,7 @@ namespace umbraco.presentation.LiveEditing.Modules.CreateModule DocumentType typeToCreate = new DocumentType(Convert.ToInt32(m_AllowedDocTypesDropdown.SelectedValue)); Document newDoc = Document.MakeNew(m_NameTextBox.Text, typeToCreate, new global::umbraco.BusinessLogic.User(userid), (int)UmbracoContext.Current.PageId); newDoc.Publish(new global::umbraco.BusinessLogic.User(userid)); - library.PublishSingleNode(newDoc.Id); + library.UpdateDocumentCache(newDoc.Id); Page.Response.Redirect(library.NiceUrl(newDoc.Id), false); break; } diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs index a0f30a3e7c..390ec99040 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs @@ -97,7 +97,7 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing { Document document = new Document(NodeId.Value); document.Publish(UmbracoEnsuredPage.CurrentUser); - library.PublishSingleNode(NodeId.Value); + library.UpdateDocumentCache(NodeId.Value); publishedDocuments.Add(NodeId.Value); } diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs index eae6e8b5ec..c44814b571 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs @@ -163,7 +163,7 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { System.Drawing.Image newImage = System.Drawing.Image.FromFile(filename); } - catch (OutOfMemoryException ex) + catch (OutOfMemoryException) { // Image.FromFile will throw this if file is invalid. diff --git a/umbraco/presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs b/umbraco/presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs index 0ed902b697..532cf9e639 100644 --- a/umbraco/presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs +++ b/umbraco/presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs @@ -76,7 +76,7 @@ namespace umbraco.presentation.channels if (publish) { doc.Publish(new User(username)); - library.PublishSingleNode(doc.Id); + library.UpdateDocumentCache(doc.Id); } return true; } @@ -381,7 +381,7 @@ namespace umbraco.presentation.channels if (publish) { doc.Publish(new User(username)); - library.PublishSingleNode(doc.Id); + library.UpdateDocumentCache(doc.Id); } return doc.Id.ToString(); } diff --git a/umbraco/presentation/umbraco/config/create/UI.xml b/umbraco/presentation/umbraco/config/create/UI.xml index 2e26746d75..3f14b18051 100644 --- a/umbraco/presentation/umbraco/config/create/UI.xml +++ b/umbraco/presentation/umbraco/config/create/UI.xml @@ -16,7 +16,6 @@ -
Template
/create/simple.ascx @@ -369,7 +368,6 @@
-
Xslt
/create/xslt.ascx @@ -377,4 +375,12 @@
+ +
Revisions
+ /create/simple.ascx + + + + +
\ No newline at end of file diff --git a/umbraco/presentation/umbraco/config/lang/en.xml b/umbraco/presentation/umbraco/config/lang/en.xml index d84df094bd..252bdf9af7 100644 --- a/umbraco/presentation/umbraco/config/lang/en.xml +++ b/umbraco/presentation/umbraco/config/lang/en.xml @@ -1,4 +1,4 @@ - + umbraco @@ -50,21 +50,13 @@ Remove Macro Click to add a Macro Macro Settings - - Set a placeholder id by setting an ID on your placeholder you can inject content into this template from child templates, - by refering this ID using a <asp:content /> element.]]> - - - - Select a placeholder id from the list below. You can only - choose Id's from the current template's master.]]> - + Set a placeholder id by setting an ID on your placeholder you can inject content into this template from child templates, + by refering this ID using a <asp:content /> element.]]> + Select a placeholder id from the list below. You can only + choose Id's from the current template's master.]]> Search for a regular expression to add validation to a form field. Exemple: 'email, 'zip-code' 'url' regexlib.com's webservice is currently experiencing some problems, which we have no control over. We are very sorry for this inconvenience.]]> - - - - + Properties @@ -156,14 +148,14 @@ Retry Next Previous - Search - Renew - Locked + Search + Renew + Locked + + + You've been idle and logout will automatically occur in + Renew now to save your work - - You've been idle and logout will automatically occur in - Renew now to save your work - Welcome has opened in a new window @@ -282,11 +274,9 @@ Username Login Password - User type User permissions User types - Language Start Node in Content Start Node in Media Library @@ -298,18 +288,14 @@ Disable User Redirect to canvas on login Search all children - Description field Category field Excerpt field Document Type Content Channel - Select pages to modify their permissions Replace child node permssions - - Change Your Password You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button Enter your new password @@ -400,26 +386,21 @@ Xslt not saved Xslt could not be saved, check file permissions Xslt contained an error - Python script saved No errors in python script Python script not saved Python script could not be saved due to error - Template saved Template saved without any errors! Template not saved Please make sure that you do not have 2 templates with the same alias - Stylesheet saved Stylesheet saved without any errors Stylesheet not saved - File not saved file could not be saved. Please check file permissions File saved File saved without any errors - Document Type saved Tab created Tab deleted @@ -443,7 +424,6 @@ Error saving user (check log) Sent For Approval Changes have been sent for approval - Dictionary item saved Language saved @@ -471,9 +451,7 @@ Rollback to View Red text will not be shown in the selected version. , green means added]]> - - - + Select version Document has been rolled back @@ -489,11 +467,9 @@ Publishing in progress - please wait... %0% out of %1% pages have been published... Include unpublished child pages - - ok to publish %0% and thereby making it's content publicly available.

+ ok to publish %0% and thereby making it's content publicly available.

You can publish this page and all it's sub-pages by checking publish all children below. - ]]> -
+ ]]>
%0% could not be published, due to a 3rd party extension cancelling the action. @@ -559,11 +535,9 @@ Insert umbraco page field - - %0%' below
You can add additional languages under the 'languages' in the menu on the left - ]]> -
+ ]]> Culture Name @@ -617,24 +591,18 @@ Choose how to restict access to this page - Single user protection If you just want to setup simple protection using a single login and password - Role based protection using umbraco's member groups.]]> role-based authentication.]]> - Login Page Error Page - Select the pages that contain login form and error messages Choose the page that has the login formular Used when people are logged on, but do not have access - Pick the roles who have access to this page Set the login and password for this page - %0% is now protected Protection removed from %0% Remove Protection @@ -659,8 +627,7 @@ Cheers from the umbraco robot - - Hi %0%

+ Hi %0%

This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' @@ -690,8 +657,7 @@

Have a nice day!

Cheers from the umbraco robot -

]]> -
+

]]>
The page '%0%' has been send to translation @@ -717,27 +683,20 @@ Cheers from the umbraco robot Tasks assigned to you - - assigned to you. To see a detailed view including comments, click on "Details" or just the page name. + assigned to you. To see a detailed view including comments, click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
To close a translation task, please go to the Details view and click the "Close" button. - ]]> -
+ ]]>
Tasks created by you - - created by you. To see a detailed view including comments, + created by you. To see a detailed view including comments, click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link. To close a translation task, please go to the Details view and click the "Close" button. - ]]> - - + ]]> Download xml Download all translation tasks as xml - Download xml DTD close task Upload translation xml - Task opened Assigned by Total words @@ -753,41 +712,31 @@ Package name Package version Author - Documentation Demonstration Package repository - Package readme Package options View package website Uninstall package - - + Notice: any documents, media etc depending on the items you remove, will stop working, and could lead to system instability, - so uninstall with caution. If in doubt, contact the package author.]]> - + so uninstall with caution. If in doubt, contact the package author.]]> Confirm uninstall Package was uninstalled The package was successfully uninstalled - Package doesn't contain any items - -
- You can safely remove this from the system by clicking "uninstall package" below.]]> -
- +
+ You can safely remove this from the system by clicking "uninstall package" below.]]>
Upgrade package There's an upgrade available for this package. You can download it directly from the umbraco package repository. No upgrades available Upgrade instructions Download update from the repository - - button and locating the package. umbraco packages usually have a ".umb" or ".zip" extension. - ]]> - + ]]> Thank you for choosing umbraco @@ -795,95 +744,67 @@

Press "next" to start the wizard.]]> Get a great start, watch our introduction videos - Watch - Step 1/5 Accept license By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this umbraco distribution consists of two different licenses, the open source MIT license for the framework and the umbraco freeware license that covers the UI. - Step 2/5: Database configuration Database configuration - - + Please contact your ISP if necessary. - If you're installing on a local machine or server you might need information from your system administrator.]]> - + If you're installing on a local machine or server you might need information from your system administrator.]]> Your database has been found and is identified as next to continue the configuration wizard]]> - - Press the upgrade button to upgrade your database to Umbraco %0%

Don't worry - no content will be deleted and everything will continue working afterwards!

- ]]> -
- - + install button to install the Umbraco %0% database - ]]> - - - Database not found! Please check that the information in the "connection string" of the “web.config” file is correct.

+ ]]>
+ Database not found! Please check that the information in the "connection string" of the “web.config” file is correct.

To proceed, please edit the "web.config" file (using Visual Studio or your favourite text editor), scroll to the bottom, add the connection string for your database in the key named "umbracoDbDSN" and save the file.

Click the retry button when done.
- More information on editing web.config here.

]]> -
+ More information on editing web.config here.

]]> Next to proceed.]]> - - Press Next to - proceed. ]]> - + Press Next to + proceed. ]]> The installer cannot connect to the database. Could not save the web.config file. Please modify the connection string manually. Connection to database failed. Not installed yet. Umbraco Version 3 Umbraco Version 4 - Step 3/5: Validating File Permissions umbraco needs write/modify access to certain directories in order to store files like pictures and PDF's. It also stores temporary data (aka: cache) for enhancing the performance of your website. - - Your permission settings are perfect!

- You are ready to run umbraco and install packages!]]> -
- - Your permission settings are almost perfect!

- You can run umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of umbraco.]]> -
- - Your permission settings are not ready for umbraco! + Your permission settings are perfect!

+ You are ready to run umbraco and install packages!]]>
+ Your permission settings are almost perfect!

+ You can run umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of umbraco.]]>
+ Your permission settings are not ready for umbraco!

- In order to run umbraco, you'll need to update your permission settings.]]> -
- - Your permission settings might be an issue! + In order to run umbraco, you'll need to update your permission settings.]]> + Your permission settings might be an issue!

- You can run umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of umbraco.]]> -
- + You can run umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of umbraco.]]>
How to Resolve video tutorial on setting up folder permissions for umbraco or read the text version.]]> Click here to read the text version - Setting up folder permissions Affected files and folders You need to grant ASP.NET modify permissions to the following files/folders More information on setting up permissions for umbraco here - Resolving folder issue Follow this link for more information on problems with ASP.NET and creating folders - - Step 4/5: Check umbraco security - - umbraco creates a default user with a login ('admin') and password ('default'). It's important that the password is changed to something unique. @@ -891,19 +812,16 @@

This step will check the default user's password and suggest if it needs to be changed.

- ]]> -
+ ]]> The password is changed! The Default user has been disabled or has no access to umbraco!

No further actions needs to be taken. Click Next to proceed.]]> The Default user's password has been successfully changed since the installation!

No further actions needs to be taken. Click Next to proceed.]]> The Default users’ password needs to be changed!]]> - Step 5/5: Umbraco is ready to get you started You’ve just set up a clean Umbraco platform. What do you want to do next? I want to start with a simple website I want to start from scratch - - "Runway" is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, but you can easily edit, extend or remove it. It’s not necessary and you can perfectly use Umbraco without it. However, @@ -914,74 +832,43 @@ Included with Runway: Home page, Getting Started page, Installing Modules page.
Optional Modules: Top Navigation, Sitemap, Contact, Gallery. - ]]> -
- - + learn how) You can still choose to install Runway later on. Please go to the Developer section and choose Packages. - ]]> - - + ]]> What is Runway Runway is installed - - This is our list of recommended modules, check off the ones you would like to install, or view the full list of modules - ]]> - + ]]> Only recommended for experienced users - Umbraco %0% is installed and ready for use - - /web.config file and update the AppSetting key umbracoConfigurationStatus in the bottom to the value of '%0%'.]]> - - started instantly by clicking the "Launch Umbraco" button below.
If you are new to umbraco, + started instantly by clicking the "Launch Umbraco" button below.
If you are new to umbraco, you can find plenty of resources on our getting started pages.]]>
- - Browse your new site + Browse your new site You installed Runway, so why not see how your new website looks.]]> - - Further help and information + Further help and information Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the umbraco terminology]]> - - Launch Umbraco -To manage your website, simply open the umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> - + Launch Umbraco +To manage your website, simply open the umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + Transfer + Transfer + \ No newline at end of file diff --git a/umbraco/presentation/umbraco/controls/ContentPicker.cs b/umbraco/presentation/umbraco/controls/ContentPicker.cs index 6edbe3f3ae..a8d032f5db 100644 --- a/umbraco/presentation/umbraco/controls/ContentPicker.cs +++ b/umbraco/presentation/umbraco/controls/ContentPicker.cs @@ -60,9 +60,9 @@ namespace umbraco.controls string tempTitle = ""; try { - if (this.Text != "" && this.Text != "-1") + if (Value != "" && Value != "-1") { - tempTitle = new cms.businesslogic.CMSNode(int.Parse(this.Text)).Text; + tempTitle = new cms.businesslogic.CMSNode(int.Parse(Value)).Text; } else { diff --git a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs index f707aa5bd7..96518a9272 100644 --- a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -181,6 +181,7 @@ namespace umbraco.controls Save.ImageUrl = UmbracoPath + "/images/editor/save.gif"; Save.AlternateText = ui.Text("save"); + Save.ID = "save"; var listOfIcons = new List(); // Get icons // nh css file update, add support for css sprites diff --git a/umbraco/presentation/umbraco/controls/Images/UploadMediaImage.ascx.cs b/umbraco/presentation/umbraco/controls/Images/UploadMediaImage.ascx.cs index 5936ed8da9..aefb42e50b 100644 --- a/umbraco/presentation/umbraco/controls/Images/UploadMediaImage.ascx.cs +++ b/umbraco/presentation/umbraco/controls/Images/UploadMediaImage.ascx.cs @@ -66,11 +66,11 @@ namespace umbraco.controls.Images protected void SubmitButton_Click(object sender, EventArgs e) { - int parent = int.Parse(MediaPickerControl.Text); + int parent = int.Parse(MediaPickerControl.Value); if (BusinessLogic.User.GetCurrent().StartMediaId != -1 && parent == -1) parent = BusinessLogic.User.GetCurrent().StartNodeId; - Media m = Media.MakeNew(TextBoxTitle.Text, cms.businesslogic.media.MediaType.GetByAlias("image"), BasePage.Current.getUser(), int.Parse(MediaPickerControl.Text)); + Media m = Media.MakeNew(TextBoxTitle.Text, cms.businesslogic.media.MediaType.GetByAlias("image"), BasePage.Current.getUser(), int.Parse(MediaPickerControl.Value)); var props = m.getProperties; foreach (cms.businesslogic.property.Property p in props) { diff --git a/umbraco/presentation/umbraco/controls/macroParameterControl.cs b/umbraco/presentation/umbraco/controls/macroParameterControl.cs index 5325f77482..1ad137fde9 100644 --- a/umbraco/presentation/umbraco/controls/macroParameterControl.cs +++ b/umbraco/presentation/umbraco/controls/macroParameterControl.cs @@ -154,7 +154,7 @@ namespace umbraco.controls Controls.Add(new LiteralControl("")); } } - catch (Exception fieldException) + catch (Exception) { } } diff --git a/umbraco/presentation/umbraco/create/memberTasks.cs b/umbraco/presentation/umbraco/create/memberTasks.cs index 9c8cf96def..7570bee69a 100644 --- a/umbraco/presentation/umbraco/create/memberTasks.cs +++ b/umbraco/presentation/umbraco/create/memberTasks.cs @@ -14,7 +14,7 @@ namespace umbraco ///

/// The new event handler /// - new public delegate void NewUIMemberEventHandler(Member sender, string unencryptedPassword, NewMemberUIEventArgs e); + public delegate void NewUIMemberEventHandler(Member sender, string unencryptedPassword, NewMemberUIEventArgs e); public static event NewUIMemberEventHandler NewMember; new protected virtual void OnNewMember(NewMemberUIEventArgs e, string unencryptedPassword, Member m) diff --git a/umbraco/presentation/umbraco/create/nodeType.ascx.cs b/umbraco/presentation/umbraco/create/nodeType.ascx.cs index 2d0eaf5a7a..0eabddaae2 100644 --- a/umbraco/presentation/umbraco/create/nodeType.ascx.cs +++ b/umbraco/presentation/umbraco/create/nodeType.ascx.cs @@ -54,8 +54,7 @@ namespace umbraco.cms.presentation.create.controls if (Page.IsValid) { int createTemplateVal = 0; - int nodeId = -1; - if (createTemplate.Checked) + if (createTemplate.Checked) createTemplateVal = 1; // check master type diff --git a/umbraco/presentation/umbraco/dashboard.aspx.cs b/umbraco/presentation/umbraco/dashboard.aspx.cs index 4ed26aa200..6bff08325f 100644 --- a/umbraco/presentation/umbraco/dashboard.aspx.cs +++ b/umbraco/presentation/umbraco/dashboard.aspx.cs @@ -183,13 +183,10 @@ namespace umbraco.cms.presentation return BusinessLogic.User.GetCurrent().LoginName; case "usercontentstartnode": return BusinessLogic.User.GetCurrent().StartNodeId; - break; case "usermediastartnode": return BusinessLogic.User.GetCurrent().StartMediaId; - break; default: return value; - break; } } } diff --git a/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx b/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx index 650ec6fee9..86066a5c63 100644 --- a/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx +++ b/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx @@ -1,23 +1,27 @@ -<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Edit data type" Codebehind="editDatatype.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.developer.editDatatype" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> +<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Edit data type" + CodeBehind="editDatatype.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.developer.editDatatype" %> +<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - \ No newline at end of file + + diff --git a/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx.designer.cs b/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx.designer.cs index afcf0ac1bb..9d1d8fc550 100644 --- a/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx.designer.cs +++ b/umbraco/presentation/umbraco/developer/DataTypes/editDatatype.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx index a746cf8537..46b066cbf1 100644 --- a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx +++ b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx @@ -1,190 +1,208 @@ -<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Edit macro" Codebehind="editMacro.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.developer.editMacro" %> +<%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Edit macro" + CodeBehind="editMacro.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.developer.editMacro" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - + - - + - - - - - - - - - -
- Name -
- Alias -
-
- - - - - - - - - - - - - - - - - - - -
- Xslt Icon - Use XSLT file - - -
- User control Icon - or .NET User Control - - - - -
- Custom Control Icon - or .NET Custom Control - - (Assembly)
- - (Type) - -
- python Icon - or script file - - -
-
- - - - - - - - - - - -
- Use in editor -
- Render content in editor -
-
- - - - - - - - - - - - - - - -
- Cache Period - Seconds
- Cache By Page -
- Cache Personalized -
-
- - - - - +
- - - - - + - - - - - - - - - - - - - - - - - - -
- <%=umbraco.ui.Text("show",this.getUser())%> - - <%=umbraco.ui.Text("general", "alias",this.getUser())%> - - <%=umbraco.ui.Text("general", "name",this.getUser())%> - - <%=umbraco.ui.Text("general", "type",this.getUser())%> - + + Name + + +
- - - - - - - - - - - -
- - - - - - - - - - -
- -
+ + + Alias + + + + + +
-
\ No newline at end of file + + + + + + + + + + + + + + + + + + +
+ Xslt Icon + Use XSLT file + + + + +
+ User control Icon + or .NET User Control + + + + + +
+ Custom Control Icon + or .NET Custom Control + + + (Assembly)
+ + (Type) + +
+ python Icon + or script file + + + + +
+
+ + + + + + + + + + +
+ Use in editor + + +
+ Render content in editor + + +
+
+ + + + + + + + + + + + + + +
+ Cache Period + + Seconds +
+ Cache By Page + + +
+ Cache Personalized + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%=umbraco.ui.Text("show",this.getUser())%> + + <%=umbraco.ui.Text("general", "alias",this.getUser())%> + + <%=umbraco.ui.Text("general", "name",this.getUser())%> + + <%=umbraco.ui.Text("general", "type",this.getUser())%> + +
+ + + + + + + + + + + +
+ + + + + + + + + + +
+ +
+
+ + diff --git a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.cs b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.cs index 853c288b79..41e3bd9f50 100644 --- a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -345,6 +345,7 @@ namespace umbraco.cms.presentation.developer ImageButton save = InfoTabPage.Menu.NewImageButton(); save.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; + save.ID = "save"; ImageButton save2 = Parameters.Menu.NewImageButton(); save2.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; diff --git a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.designer.cs b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.designer.cs index 79713b2c45..efb1c16c2f 100644 --- a/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.designer.cs +++ b/umbraco/presentation/umbraco/developer/Macros/editMacro.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx b/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx index 118f070660..04d4f23748 100644 --- a/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx +++ b/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx @@ -1,215 +1,215 @@ -<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Package and export content" Codebehind="editPackage.aspx.cs" - Inherits="umbraco.presentation.developer.packages._Default" %> +<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master" + Title="Package and export content" CodeBehind="editPackage.aspx.cs" Inherits="umbraco.presentation.developer.packages._Default" %> <%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %> - - + - - * - - - + * + + - * - - - + * + + - * - - + * + - - + + - + - * + * - * + * - + - * - - + * + + - * - + * + - - - - - + + + + - +
- Include all child nodes -
+ + Include all child nodes +
- - + - + - + - + - + - + - + - + - - + - + - - + - + - - - - + + + - - - - - -
- Remember: .xslt and .ascx files for your macros - will be added automaticly, but you will still need to add assemblies, - images and script files manually to the list below. -
-
- - - - - - - - +
- Absolute path to file (ie: /bin/umbraco.bin) - -
- - + - - - - - - -
- - - - + Remember: .xslt and .ascx files for your macros + will be added automaticly, but you will still need to add assemblies, + images and script files manually to the list below. +
- - - - - -
+ +
+ + + + + + + + + + + + + + + + + +
+ Absolute path to file (ie: /bin/umbraco.bin) + +
+ + + +
+ + + + + +
- - - - - - - - -
- Load control after installation (ex: /usercontrols/installer.ascx) -
- - - -
+ + + + + + + +
+ Load control after installation (ex: /usercontrols/installer.ascx) +
+ + + +
- - - - - - + + + + + + + +
-

- Here you can add custom installer / uninstaller events to perform certain tasks during installation and uninstallation. -
- All actions are formed as a xml node, containing data for the action to be performed. + + + - - - - - - - -
+

+ Here you can add custom installer / uninstaller events to perform certain tasks + during installation and uninstallation. +
+ All actions are formed as a xml node, containing data for the action to be performed. + Package actions documentation -

- - - -
- Actions: -
- -
+

+ +
+ Actions: +
+ +
-
\ No newline at end of file + + diff --git a/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx.cs b/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx.cs index 17fe767fc5..5a9a9ae43c 100644 --- a/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx.cs +++ b/umbraco/presentation/umbraco/developer/Packages/editPackage.aspx.cs @@ -381,12 +381,14 @@ namespace umbraco.presentation.developer.packages packageActions = TabView1.NewTabPage("Package Actions"); packageActions.Controls.Add(Pane4); + int count = 1; foreach (uicontrols.TabPage tp in TabView1.GetPanels()) { ImageButton saves = tp.Menu.NewImageButton(); saves.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; saves.CommandName = "save"; saves.AlternateText = "Save package"; saves.Command += new CommandEventHandler(saveOrPublish); + saves.ID = "save_" + count; tp.BorderStyle = BorderStyle.None; tp.Style["background"] = "none !Important"; @@ -396,6 +398,7 @@ namespace umbraco.presentation.developer.packages publishes.CommandName = "publish"; publishes.Command += new CommandEventHandler(saveOrPublish); publishes.AlternateText = "Save and publish the package as a .umb file"; + count++; } diff --git a/umbraco/presentation/umbraco/developer/Python/editPython.aspx b/umbraco/presentation/umbraco/developer/Python/editPython.aspx index 9ecdbea606..1c30cd2645 100644 --- a/umbraco/presentation/umbraco/developer/Python/editPython.aspx +++ b/umbraco/presentation/umbraco/developer/Python/editPython.aspx @@ -3,8 +3,6 @@ <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - + @@ -58,13 +56,17 @@ - - + - - - + - \ No newline at end of file + + diff --git a/umbraco/presentation/umbraco/developer/Python/editPython.aspx.cs b/umbraco/presentation/umbraco/developer/Python/editPython.aspx.cs index 9d7287022f..b50e3da7c3 100644 --- a/umbraco/presentation/umbraco/developer/Python/editPython.aspx.cs +++ b/umbraco/presentation/umbraco/developer/Python/editPython.aspx.cs @@ -66,6 +66,7 @@ namespace umbraco.cms.presentation.developer save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; save.OnClickCommand = "doSubmit()"; save.AltText = "Save scripting File"; + save.ID = "save"; // Add source and filename String file = IOHelper.MapPath(SystemDirectories.MacroScripts + "/" + Request.QueryString["file"]); diff --git a/umbraco/presentation/umbraco/developer/Python/editPython.aspx.designer.cs b/umbraco/presentation/umbraco/developer/Python/editPython.aspx.designer.cs index 31d6df87ff..253bfa28fd 100644 --- a/umbraco/presentation/umbraco/developer/Python/editPython.aspx.designer.cs +++ b/umbraco/presentation/umbraco/developer/Python/editPython.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx b/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx index 8562bc846a..9942fe9498 100644 --- a/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx +++ b/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx @@ -93,6 +93,11 @@ AutoResize="true" OffSetX="47" OffSetY="55" /> + diff --git a/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx.cs b/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx.cs index f9edf29f62..80b6e55f12 100644 --- a/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx.cs +++ b/umbraco/presentation/umbraco/developer/Xslt/editXslt.aspx.cs @@ -57,6 +57,7 @@ namespace umbraco.cms.presentation.developer save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; save.OnClickCommand = "doSubmit()"; save.AltText = "Save Xslt File"; + save.ID = "save"; UmbracoPanel1.Menu.InsertSplitter(); diff --git a/umbraco/presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs b/umbraco/presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs index e8b790445e..6ed994eb94 100644 --- a/umbraco/presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs +++ b/umbraco/presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs @@ -29,7 +29,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt // Check if cookie exists in the current request. // zb-00004 #29956 : refactor cookies names & handling if (cookie.HasValue) - contentPicker.Text = cookie.GetValue(); + contentPicker.Value = cookie.GetValue(); } } @@ -62,7 +62,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt } Dictionary parameters = new Dictionary(1); - parameters.Add("currentPage", library.GetXmlNodeById(contentPicker.Text)); + parameters.Add("currentPage", library.GetXmlNodeById(contentPicker.Value)); // apply the XSLT transformation @@ -92,7 +92,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt // add cookie with current page // zb-00004 #29956 : refactor cookies names & handling - cookie.SetValue(contentPicker.Text); + cookie.SetValue(contentPicker.Value); } } diff --git a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs index 29344d9189..489f226ce8 100644 --- a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs +++ b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs @@ -148,7 +148,7 @@ namespace umbraco.dialogs if (cd.Published) { cd.Publish(new umbraco.BusinessLogic.User(0)); //using library.publish to support load balancing. - umbraco.library.PublishSingleNode(cd.Id); + umbraco.library.UpdateDocumentCache(cd.Id); if (cd.HasChildren) { diff --git a/umbraco/presentation/umbraco/dialogs/protectPage.aspx.cs b/umbraco/presentation/umbraco/dialogs/protectPage.aspx.cs index 0075616741..fb3c51faf7 100644 --- a/umbraco/presentation/umbraco/dialogs/protectPage.aspx.cs +++ b/umbraco/presentation/umbraco/dialogs/protectPage.aspx.cs @@ -79,13 +79,10 @@ namespace umbraco.presentation.umbraco.dialogs Document loginPageObj = new Document(loginPage); if (loginPageObj != null) { - loginPagePicker.Text = loginPage.ToString(); + loginPagePicker.Value = loginPage.ToString(); } Document errorPageObj = new Document(errorPage); - if (errorPageObj != null) - { - errorPagePicker.Text = errorPage.ToString(); - } + errorPagePicker.Value = errorPage.ToString(); } catch { @@ -168,10 +165,10 @@ namespace umbraco.presentation.umbraco.dialogs protected void protect_Click(object sender, CommandEventArgs e) { - if (string.IsNullOrEmpty(errorPagePicker.Text)) + if (string.IsNullOrEmpty(errorPagePicker.Value)) cv_errorPage.IsValid = false; - if (string.IsNullOrEmpty(loginPagePicker.Text)) + if (string.IsNullOrEmpty(loginPagePicker.Value)) cv_loginPage.IsValid = false; @@ -224,13 +221,13 @@ namespace umbraco.presentation.umbraco.dialogs Roles.AddUserToRole(member.UserName, simpleRoleName); } - Access.ProtectPage(true, pageId, int.Parse(loginPagePicker.Text), int.Parse(errorPagePicker.Text)); + Access.ProtectPage(true, pageId, int.Parse(loginPagePicker.Value), int.Parse(errorPagePicker.Value)); Access.AddMembershipRoleToDocument(pageId, simpleRoleName); Access.AddMembershipUserToDocument(pageId, member.UserName); } else if (e.CommandName == "advanced") { - cms.businesslogic.web.Access.ProtectPage(false, pageId, int.Parse(loginPagePicker.Text), int.Parse(errorPagePicker.Text)); + cms.businesslogic.web.Access.ProtectPage(false, pageId, int.Parse(loginPagePicker.Value), int.Parse(errorPagePicker.Value)); foreach (ListItem li in _memberGroups.Items) if (("," + _memberGroups.Value + ",").IndexOf("," + li.Value + ",") > -1) @@ -241,7 +238,7 @@ namespace umbraco.presentation.umbraco.dialogs feedback.Text = ui.Text("publicAccess", "paIsProtected", new cms.businesslogic.CMSNode(pageId).Text, null) + "

" + ui.Text("closeThisWindow") + ""; - ClientTools.ReloadActionNode(true, false); + ClientTools.ReloadActionNode(true, false); feedback.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; } @@ -257,11 +254,11 @@ namespace umbraco.presentation.umbraco.dialogs Access.RemoveProtection(pageId); - feedback.Text = ui.Text("publicAccess", "paIsRemoved", new cms.businesslogic.CMSNode(pageId).Text, null) + "

" + ui.Text("closeThisWindow") + ""; - - ClientTools.ReloadActionNode(true, false); - - feedback.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; + feedback.Text = ui.Text("publicAccess", "paIsRemoved", new cms.businesslogic.CMSNode(pageId).Text, null) + "

" + ui.Text("closeThisWindow") + ""; + + ClientTools.ReloadActionNode(true, false); + + feedback.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; } } } diff --git a/umbraco/presentation/umbraco/dialogs/publish.aspx.cs b/umbraco/presentation/umbraco/dialogs/publish.aspx.cs index c8bca17527..ae94165e7a 100644 --- a/umbraco/presentation/umbraco/dialogs/publish.aspx.cs +++ b/umbraco/presentation/umbraco/dialogs/publish.aspx.cs @@ -82,7 +82,7 @@ namespace umbraco.dialogs { if (doc.Published) { - library.PublishSingleNode(doc.Id); + library.UpdateDocumentCache(doc.Id); } } @@ -106,7 +106,7 @@ namespace umbraco.dialogs { if (d.PublishWithResult(base.getUser())) { - library.PublishSingleNode(d.Id); + library.UpdateDocumentCache(d.Id); feedbackMsg.type = umbraco.uicontrols.Feedback.feedbacktype.success; feedbackMsg.Text = ui.Text("publish", "nodePublish", d.Text, base.getUser()) + "

" + ui.Text("closeThisWindow") + ""; } diff --git a/umbraco/presentation/umbraco/editContent.aspx b/umbraco/presentation/umbraco/editContent.aspx index 950329f9a2..8c7ec1317f 100644 --- a/umbraco/presentation/umbraco/editContent.aspx +++ b/umbraco/presentation/umbraco/editContent.aspx @@ -5,7 +5,6 @@ <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> <%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> - @@ -13,8 +12,8 @@ Priority="0" /> - - +
@@ -25,7 +24,6 @@
- -
diff --git a/umbraco/presentation/umbraco/editMedia.aspx b/umbraco/presentation/umbraco/editMedia.aspx index a1aa73684c..50368f0cd7 100644 --- a/umbraco/presentation/umbraco/editMedia.aspx +++ b/umbraco/presentation/umbraco/editMedia.aspx @@ -1,29 +1,28 @@ <%@ Page Language="c#" CodeBehind="editMedia.aspx.cs" ValidateRequest="false" MasterPageFile="masterpages/umbracoPage.Master" - AutoEventWireup="True" Inherits="umbraco.cms.presentation.editMedia" %> - + AutoEventWireup="True" Inherits="umbraco.cms.presentation.editMedia" %> + + + function invokeSaveHandlers() { + for (var i = 0; i < saveHandlers.length; i++) { + eval(saveHandlers[i]); + } + } + jQuery(document).ready(function () { + UmbClientMgr.appActions().bindSaveShortCut(); + }); + - - - - - + + + diff --git a/umbraco/presentation/umbraco/editMedia.aspx.designer.cs b/umbraco/presentation/umbraco/editMedia.aspx.designer.cs index 788d2ed636..b464383605 100644 --- a/umbraco/presentation/umbraco/editMedia.aspx.designer.cs +++ b/umbraco/presentation/umbraco/editMedia.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/masterpages/umbracoDialog.Master.cs b/umbraco/presentation/umbraco/masterpages/umbracoDialog.Master.cs index d66b3fd29f..b718c80986 100644 --- a/umbraco/presentation/umbraco/masterpages/umbracoDialog.Master.cs +++ b/umbraco/presentation/umbraco/masterpages/umbracoDialog.Master.cs @@ -9,7 +9,7 @@ namespace umbraco.presentation.masterpages { public bool reportModalSize { get; set; } public static new event MasterPageLoadHandler Load; - public static event MasterPageLoadHandler Init; + public new static event MasterPageLoadHandler Init; protected void Page_Load(object sender, EventArgs e) { diff --git a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master index 599d82e33a..a8f60b9bbb 100644 --- a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master +++ b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master @@ -28,6 +28,8 @@ Priority="10" /> + diff --git a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.cs b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.cs index e200a44940..906c433220 100644 --- a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.cs +++ b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.cs @@ -19,8 +19,8 @@ namespace umbraco.presentation.masterpages public partial class umbracoPage : System.Web.UI.MasterPage { - public static event MasterPageLoadHandler Load; - public static event MasterPageLoadHandler Init; + public new static event MasterPageLoadHandler Load; + public new static event MasterPageLoadHandler Init; protected void Page_Load(object sender, EventArgs e) { diff --git a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.designer.cs b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.designer.cs index 8349aba979..16d1820c83 100644 --- a/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.designer.cs +++ b/umbraco/presentation/umbraco/masterpages/umbracoPage.Master.designer.cs @@ -120,6 +120,15 @@ namespace umbraco.presentation.masterpages { /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; + ///

+ /// JsIncludeHotkeys control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsIncludeHotkeys; + /// /// head control. /// diff --git a/umbraco/presentation/umbraco/nodeFactory/UmbracoSiteMapProvider.cs b/umbraco/presentation/umbraco/nodeFactory/UmbracoSiteMapProvider.cs index 94fb18d0cb..6106060ceb 100644 --- a/umbraco/presentation/umbraco/nodeFactory/UmbracoSiteMapProvider.cs +++ b/umbraco/presentation/umbraco/nodeFactory/UmbracoSiteMapProvider.cs @@ -18,7 +18,6 @@ namespace umbraco.presentation.nodeFactory { public sealed class UmbracoSiteMapProvider : System.Web.StaticSiteMapProvider { private SiteMapNode m_root; - private int m_indexID, m_indexTitle, m_indexUrl, m_indexDesc, m_indexRoles, m_indexParent; private Dictionary m_nodes = new Dictionary(16); private string m_defaultDescriptionAlias = ""; private bool m_enableSecurityTrimming; diff --git a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx index 252961be13..09af30fd00 100644 --- a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx +++ b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx @@ -1,8 +1,15 @@ <%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Page language="c#" MasterPageFile="../masterpages/umbracoPage.Master" validateRequest="false" Codebehind="EditDictionaryItem.aspx.cs" AutoEventWireup="True" Inherits="umbraco.settings.EditDictionaryItem" %> + +<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoPage.Master" ValidateRequest="false" + CodeBehind="EditDictionaryItem.aspx.cs" AutoEventWireup="True" Inherits="umbraco.settings.EditDictionaryItem" %> - - + + + diff --git a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.cs b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.cs index 88490c3cc1..20b406281d 100644 --- a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.cs +++ b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.cs @@ -42,6 +42,7 @@ namespace umbraco.settings save.Click += new System.Web.UI.ImageClickEventHandler(save_click); save.AlternateText = ui.Text("save"); save.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; + save.ID = "save"; Literal txt = new Literal(); txt.Text = "

" + ui.Text("dictionaryItem", "description", currentItem.key, base.getUser()) + "


"; diff --git a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs index 9b2dd6d692..15921e7445 100644 --- a/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/settings/EditMediaType.aspx b/umbraco/presentation/umbraco/settings/EditMediaType.aspx index 15e6eeb79e..28a6efe773 100644 --- a/umbraco/presentation/umbraco/settings/EditMediaType.aspx +++ b/umbraco/presentation/umbraco/settings/EditMediaType.aspx @@ -1,7 +1,14 @@ <%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Page language="c#" Codebehind="EditMediaType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="True" Inherits="umbraco.cms.presentation.settings.EditMediaType" %> -<%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %> +<%@ Page Language="c#" CodeBehind="EditMediaType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" + AutoEventWireup="True" Inherits="umbraco.cms.presentation.settings.EditMediaType" %> + +<%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %> - - \ No newline at end of file + + +
diff --git a/umbraco/presentation/umbraco/settings/EditMediaType.aspx.designer.cs b/umbraco/presentation/umbraco/settings/EditMediaType.aspx.designer.cs index 49be1a3de7..e120177439 100644 --- a/umbraco/presentation/umbraco/settings/EditMediaType.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/EditMediaType.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx index 205479aa46..c708ea4f31 100644 --- a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx +++ b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx @@ -17,4 +17,9 @@ runat="server" /> + diff --git a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs index 966379ce83..19f03326bd 100644 --- a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/settings/editLanguage.aspx b/umbraco/presentation/umbraco/settings/editLanguage.aspx index a8cdb7dcd6..2e191230f5 100644 --- a/umbraco/presentation/umbraco/settings/editLanguage.aspx +++ b/umbraco/presentation/umbraco/settings/editLanguage.aspx @@ -1,15 +1,20 @@ <%@ Page Language="c#" CodeBehind="editLanguage.aspx.cs" AutoEventWireup="True" MasterPageFile="../masterpages/umbracoPage.Master" - Inherits="umbraco.settings.editLanguage" %> + Inherits="umbraco.settings.editLanguage" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff --git a/umbraco/presentation/umbraco/settings/editLanguage.aspx.cs b/umbraco/presentation/umbraco/settings/editLanguage.aspx.cs index 974730e66f..f64deae690 100644 --- a/umbraco/presentation/umbraco/settings/editLanguage.aspx.cs +++ b/umbraco/presentation/umbraco/settings/editLanguage.aspx.cs @@ -81,6 +81,7 @@ namespace umbraco.settings save.ImageUrl = UmbracoPath + "/images/editor/save.gif"; save.Click += new System.Web.UI.ImageClickEventHandler(save_click); save.AlternateText = ui.Text("save"); + save.ID = "save"; Panel1.Text = ui.Text("language", "editLanguage"); diff --git a/umbraco/presentation/umbraco/settings/editLanguage.aspx.designer.cs b/umbraco/presentation/umbraco/settings/editLanguage.aspx.designer.cs index 22512c6b91..4647664406 100644 --- a/umbraco/presentation/umbraco/settings/editLanguage.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/editLanguage.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/settings/editTemplate.aspx b/umbraco/presentation/umbraco/settings/editTemplate.aspx index e2579035d8..c4b4eb6f24 100644 --- a/umbraco/presentation/umbraco/settings/editTemplate.aspx +++ b/umbraco/presentation/umbraco/settings/editTemplate.aspx @@ -292,4 +292,9 @@ + diff --git a/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs b/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs index 17474489cb..342aaf55f9 100644 --- a/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs +++ b/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs @@ -1,231 +1,241 @@ using System; -using System.Collections; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Web; -using System.Web.SessionState; +using System.Collections.Generic; +using System.IO; using System.Web.UI; using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using umbraco.cms.presentation.Trees; -using umbraco.IO; +using umbraco.BasePages; +using umbraco.BusinessLogic; using umbraco.cms.businesslogic.skinning; -using System.Collections.Generic; +using umbraco.cms.businesslogic.template; +using umbraco.cms.presentation.Trees; using umbraco.DataLayer; - +using umbraco.IO; +using umbraco.uicontrols; namespace umbraco.cms.presentation.settings { - /// - /// Summary description for editTemplate. - /// - public partial class editTemplate : BasePages.UmbracoEnsuredPage - { - public editTemplate() - { - CurrentApp = BusinessLogic.DefaultApps.settings.ToString(); + /// + /// Summary description for editTemplate. + /// + public partial class editTemplate : UmbracoEnsuredPage + { + private Template _template; - } - private cms.businesslogic.template.Template _template; + public editTemplate() + { + CurrentApp = DefaultApps.settings.ToString(); + } - protected override void OnPreRender(EventArgs e) { - base.OnPreRender(e); + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference( IOHelper.ResolveUrl( SystemDirectories.Webservices + "/codeEditorSave.asmx") )); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference( IOHelper.ResolveUrl( SystemDirectories.Webservices + "/legacyAjaxCalls.asmx") )); - } + ScriptManager.GetCurrent(Page).Services.Add( + new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.Webservices + "/codeEditorSave.asmx"))); + ScriptManager.GetCurrent(Page).Services.Add( + new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.Webservices + "/legacyAjaxCalls.asmx"))); + } - protected void Page_Load(object sender, System.EventArgs e) - { - MasterTemplate.Attributes.Add("onchange", "changeMasterPageFile()"); + protected void Page_Load(object sender, EventArgs e) + { + MasterTemplate.Attributes.Add("onchange", "changeMasterPageFile()"); - if (!IsPostBack) { - + if (!IsPostBack) + { + MasterTemplate.Items.Add(new ListItem(ui.Text("none"), "0")); + foreach (Template t in Template.GetAllAsList()) + { + if (t.Id != _template.Id) + { + var li = new ListItem(t.Text, t.Id.ToString()); - MasterTemplate.Items.Add(new ListItem(ui.Text("none"),"0")); - foreach (cms.businesslogic.template.Template t in cms.businesslogic.template.Template.GetAllAsList()) - { - if (t.Id != _template.Id) - { - ListItem li = new ListItem(t.Text,t.Id.ToString()); + li.Attributes.Add("id", t.Alias.Replace(" ", "")); - li.Attributes.Add("id", t.Alias.Replace(" ", "")); + if (t.Id == _template.MasterTemplate) + { + try + { + li.Selected = true; + } + catch + { + } + } + MasterTemplate.Items.Add(li); + } + } - if (t.Id == _template.MasterTemplate) - { - try - { - li.Selected = true; - } - catch {} - } - MasterTemplate.Items.Add(li); - } - } - - NameTxt.Text = _template.GetRawText(); - AliasTxt.Text = _template.Alias; - editorSource.Text = _template.Design; + NameTxt.Text = _template.GetRawText(); + AliasTxt.Text = _template.Alias; + editorSource.Text = _template.Design; - ClientTools - .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) - .SyncTree(_template.Id.ToString(), false); + ClientTools + .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) + .SyncTree(_template.Id.ToString(), false); LoadScriptingTemplates(); LoadMacros(); - - } - } - - - - override protected void OnInit(EventArgs e) - { - _template = new cms.businesslogic.template.Template(int.Parse(Request.QueryString["templateID"])); - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - Panel1.hasMenu = true; - - uicontrols.MenuIconI save = Panel1.Menu.NewIcon(); - save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; - save.OnClickCommand = "doSubmit()"; - save.AltText = ui.Text("save"); - - Panel1.Text = ui.Text("edittemplate"); - pp_name.Text = ui.Text("name", base.getUser()); - pp_alias.Text = ui.Text("alias", base.getUser()); - pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser()); - - // Editing buttons - Panel1.Menu.InsertSplitter(); - uicontrols.MenuIconI umbField = Panel1.Menu.NewIcon(); - umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; - umbField.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); - umbField.AltText = ui.Text("template", "insertPageField"); - - // TODO: Update icon - uicontrols.MenuIconI umbDictionary = Panel1.Menu.NewIcon(); - umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; - umbDictionary.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550); - umbDictionary.AltText = "Insert umbraco dictionary item"; - - //uicontrols.MenuIconI umbMacro = Panel1.Menu.NewIcon(); - //umbMacro.ImageURL = UmbracoPath + "/images/editor/insMacro.gif"; - //umbMacro.AltText = ui.Text("template", "insertMacro"); - //umbMacro.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530); - - Panel1.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); + } + } - if (UmbracoSettings.UseAspNetMasterPages) { + protected override void OnInit(EventArgs e) + { + _template = new Template(int.Parse(Request.QueryString["templateID"])); + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + Panel1.hasMenu = true; - Panel1.Menu.InsertSplitter(); + MenuIconI save = Panel1.Menu.NewIcon(); + save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; + save.OnClickCommand = "doSubmit()"; + save.AltText = ui.Text("save"); + save.ID = "save"; - uicontrols.MenuIconI umbContainer = Panel1.Menu.NewIcon(); - umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; - umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); - umbContainer.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id.ToString(), ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320); - - uicontrols.MenuIconI umbContent = Panel1.Menu.NewIcon(); - umbContent.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif"; - umbContent.AltText = ui.Text("template", "insertContentArea"); - umbContent.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" + _template.Id.ToString(), ui.Text("template", "insertContentArea"), 470, 300); - } + Panel1.Text = ui.Text("edittemplate"); + pp_name.Text = ui.Text("name", base.getUser()); + pp_alias.Text = ui.Text("alias", base.getUser()); + pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser()); + + // Editing buttons + Panel1.Menu.InsertSplitter(); + MenuIconI umbField = Panel1.Menu.NewIcon(); + umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; + umbField.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); + umbField.AltText = ui.Text("template", "insertPageField"); + + // TODO: Update icon + MenuIconI umbDictionary = Panel1.Menu.NewIcon(); + umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; + umbDictionary.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), + 640, 550); + umbDictionary.AltText = "Insert umbraco dictionary item"; + + //uicontrols.MenuIconI umbMacro = Panel1.Menu.NewIcon(); + //umbMacro.ImageURL = UmbracoPath + "/images/editor/insMacro.gif"; + //umbMacro.AltText = ui.Text("template", "insertMacro"); + //umbMacro.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530); + + Panel1.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); - //Spit button - Panel1.Menu.InsertSplitter(); - Panel1.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40); + if (UmbracoSettings.UseAspNetMasterPages) + { + Panel1.Menu.InsertSplitter(); - if (Skinning.StarterKitGuid(_template.Id).HasValue) - { - Panel1.Menu.InsertSplitter(); - uicontrols.MenuIconI umbContainer = Panel1.Menu.NewIcon(); - umbContainer.ImageURL = UmbracoPath + "/images/editor/skin.gif"; - umbContainer.AltText = ui.Text("template", "modifyTemplateSkin"); - //umbContainer.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/TemplateSkinning.aspx?&id=" + _template.Id.ToString(), ui.Text("template", "modifyTemplateSkin"), 570, 420); - umbContainer.OnClickCommand = "window.open('" + GlobalSettings.Path + "/canvas.aspx?redir=" + this.ResolveUrl("~/") + "&umbSkinning=true&umbSkinningConfigurator=true" + "','canvas')"; - } + MenuIconI umbContainer = Panel1.Menu.NewIcon(); + umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; + umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); + umbContainer.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + + "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id, + ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320); - - + MenuIconI umbContent = Panel1.Menu.NewIcon(); + umbContent.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif"; + umbContent.AltText = ui.Text("template", "insertContentArea"); + umbContent.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" + + _template.Id, ui.Text("template", "insertContentArea"), 470, 300); + } - // Help - Panel1.Menu.InsertSplitter(); - uicontrols.MenuIconI helpIcon = Panel1.Menu.NewIcon(); - helpIcon.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + _template.Alias, ui.Text("template", "quickGuide"), 600, 580); - helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; - helpIcon.AltText = ui.Text("template", "quickGuide"); - } + //Spit button + Panel1.Menu.InsertSplitter(); + Panel1.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40); + + if (Skinning.StarterKitGuid(_template.Id).HasValue) + { + Panel1.Menu.InsertSplitter(); + MenuIconI umbContainer = Panel1.Menu.NewIcon(); + umbContainer.ImageURL = UmbracoPath + "/images/editor/skin.gif"; + umbContainer.AltText = ui.Text("template", "modifyTemplateSkin"); + //umbContainer.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/dialogs/TemplateSkinning.aspx?&id=" + _template.Id.ToString(), ui.Text("template", "modifyTemplateSkin"), 570, 420); + umbContainer.OnClickCommand = "window.open('" + GlobalSettings.Path + "/canvas.aspx?redir=" + + ResolveUrl("~/") + "&umbSkinning=true&umbSkinningConfigurator=true" + + "','canvas')"; + } + + + // Help + Panel1.Menu.InsertSplitter(); + + MenuIconI helpIcon = Panel1.Menu.NewIcon(); + helpIcon.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + + _template.Alias, ui.Text("template", "quickGuide"), 600, 580); + helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; + helpIcon.AltText = ui.Text("template", "quickGuide"); + } private void LoadScriptingTemplates() { + string path = SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; + string abPath = IOHelper.MapPath(path); - string path = IO.SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; - string abPath = IO.IOHelper.MapPath(path); + var files = new List>(); - List> files= new List>(); - - if (System.IO.Directory.Exists(abPath)) + if (Directory.Exists(abPath)) { string extension = ".cshtml"; - foreach (System.IO.FileInfo fi in new System.IO.DirectoryInfo(abPath).GetFiles("*" + extension)) + foreach (FileInfo fi in new DirectoryInfo(abPath).GetFiles("*" + extension)) { - string filename = System.IO.Path.GetFileName(fi.FullName); + string filename = Path.GetFileName(fi.FullName); files.Add(new KeyValuePair( - filename, - helper.SpaceCamelCasing(filename.Replace(extension, "")) - )); - - + filename, + helper.SpaceCamelCasing(filename.Replace(extension, "")) + )); } } rpt_codeTemplates.DataSource = files; rpt_codeTemplates.DataBind(); - } private void LoadMacros() { - - IRecordsReader macroRenderings = SqlHelper.ExecuteReader("select id, macroAlias, macroName from cmsMacro order by macroName"); + IRecordsReader macroRenderings = + SqlHelper.ExecuteReader("select id, macroAlias, macroName from cmsMacro order by macroName"); rpt_macros.DataSource = macroRenderings; rpt_macros.DataBind(); - - macroRenderings.Close(); + macroRenderings.Close(); } public string DoesMacroHaveSettings(string macroId) { - if (SqlHelper.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) == 1) + if ( + SqlHelper.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) == + 1) return "1"; else return "0"; - } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } - - } - -} + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } + } +} \ No newline at end of file diff --git a/umbraco/presentation/umbraco/settings/scripts/editScript.aspx b/umbraco/presentation/umbraco/settings/scripts/editScript.aspx index f92764b213..8d3e1b083c 100644 --- a/umbraco/presentation/umbraco/settings/scripts/editScript.aspx +++ b/umbraco/presentation/umbraco/settings/scripts/editScript.aspx @@ -1,46 +1,51 @@ - -<%@ Page Language="C#" MasterPageFile="../../masterpages/umbracoPage.Master" AutoEventWireup="true" Codebehind="editScript.aspx.cs" Inherits="umbraco.cms.presentation.settings.scripts.editScript" - ValidateRequest="False" %> +<%@ Page Language="C#" MasterPageFile="../../masterpages/umbracoPage.Master" AutoEventWireup="true" + CodeBehind="editScript.aspx.cs" Inherits="umbraco.cms.presentation.settings.scripts.editScript" + ValidateRequest="False" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - + function doSubmit() { + var codeVal = jQuery('#<%= editorSource.ClientID %>').val(); + //if CodeMirror is not defined, then the code editor is disabled. + if (typeof (CodeMirror) != "undefined") { + codeVal = codeEditor.getCode(); + } + umbraco.presentation.webservices.codeEditorSave.SaveScript(jQuery('#<%= NameTxt.ClientID %>').val(), '<%= NameTxt.Text %>', codeVal, submitSucces, submitFailure); + } + + function submitSucces(t) { + if (t != 'true') { + top.UmbSpeechBubble.ShowMessage('error', '<%= umbraco.ui.Text("speechBubbles", "fileErrorHeader") %>', '<%= umbraco.ui.Text("speechBubbles", "fileErrorText") %>'); + } + else { + top.UmbSpeechBubble.ShowMessage('save', '<%= umbraco.ui.Text("speechBubbles", "fileSavedHeader") %>', '') + } + } + function submitFailure(t) { + top.UmbSpeechBubble.ShowMessage('error', '<%= umbraco.ui.Text("speechBubbles", "fileErrorHeader") %>', '<%= umbraco.ui.Text("speechBubbles", "fileErrorText") %>') + } + - - - - - - - - - - - + + + + + + + + + + + - \ No newline at end of file + + diff --git a/umbraco/presentation/umbraco/settings/scripts/editScript.aspx.cs b/umbraco/presentation/umbraco/settings/scripts/editScript.aspx.cs index 2130082cb4..adb5ca97e6 100644 --- a/umbraco/presentation/umbraco/settings/scripts/editScript.aspx.cs +++ b/umbraco/presentation/umbraco/settings/scripts/editScript.aspx.cs @@ -94,6 +94,7 @@ namespace umbraco.cms.presentation.settings.scripts save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; save.OnClickCommand = "doSubmit()"; save.AltText = "Save File"; + save.ID = "save"; if (editorSource.CodeBase == uicontrols.CodeArea.EditorType.HTML) { diff --git a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx index ce06cec225..3db465356d 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx +++ b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx @@ -43,4 +43,10 @@ + + \ No newline at end of file diff --git a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs index c1f278174c..9c7f4993a0 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -1,96 +1,93 @@ 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.BasePages; using umbraco.BusinessLogic; +using umbraco.cms.businesslogic.web; using umbraco.cms.presentation.Trees; using umbraco.IO; +using umbraco.uicontrols; namespace umbraco.cms.presentation.settings.stylesheet { - /// - /// Summary description for editstylesheet. - /// - public partial class editstylesheet : BasePages.UmbracoEnsuredPage - { - public editstylesheet() - { - CurrentApp = BusinessLogic.DefaultApps.settings.ToString(); + /// + /// Summary description for editstylesheet. + /// + public partial class editstylesheet : UmbracoEnsuredPage + { + private StyleSheet stylesheet; - } - private cms.businesslogic.web.StyleSheet stylesheet; + public editstylesheet() + { + CurrentApp = DefaultApps.settings.ToString(); + } - protected void Page_Load(object sender, System.EventArgs e) - { - - if(!IsPostBack) + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) { // editor source - - if (!UmbracoSettings.ScriptDisableEditor) - { - // TODO: Register the some script editor js file if you can find a good one. - } - ClientTools - .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) - .SyncTree(helper.Request("id"), false); + if (!UmbracoSettings.ScriptDisableEditor) + { + // TODO: Register the some script editor js file if you can find a good one. + } + + ClientTools + .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) + .SyncTree(helper.Request("id"), false); } - uicontrols.MenuIconI save = Panel1.Menu.NewIcon(); - save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; - save.OnClickCommand = "doSubmit()"; - save.AltText = "Save stylesheet"; + MenuIconI save = Panel1.Menu.NewIcon(); + save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; + save.OnClickCommand = "doSubmit()"; + save.AltText = "Save stylesheet"; + save.ID = "save"; + Panel1.Text = ui.Text("stylesheet", "editstylesheet", base.getUser()); + pp_name.Text = ui.Text("name", base.getUser()); + pp_path.Text = ui.Text("path", base.getUser()); - Panel1.Text = ui.Text("stylesheet", "editstylesheet", base.getUser()); - pp_name.Text = ui.Text("name", base.getUser()); - pp_path.Text = ui.Text("path", base.getUser()); + stylesheet = new StyleSheet(int.Parse(Request.QueryString["id"])); + string appPath = Request.ApplicationPath; + if (appPath == "/") + appPath = ""; + lttPath.Text = "" + appPath + + "/css/" + stylesheet.Text + ".css"; - stylesheet = new cms.businesslogic.web.StyleSheet(int.Parse(Request.QueryString["id"])); - string appPath = Request.ApplicationPath; - if (appPath == "/") - appPath = ""; - lttPath.Text = "" + appPath + "/css/" + stylesheet.Text + ".css"; - - if (!IsPostBack) - { - NameTxt.Text = stylesheet.Text; + if (!IsPostBack) + { + NameTxt.Text = stylesheet.Text; editorSource.Text = stylesheet.Content; - } - } + } + } - protected override void OnPreRender(EventArgs e) { + protected override void OnPreRender(EventArgs e) + { base.OnPreRender(e); ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/codeEditorSave.asmx")); ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx")); } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // + #region Web Form Designer generated code - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { + protected override void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // - } - #endregion - } -} + InitializeComponent(); + base.OnInit(e); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } + + #endregion + } +} \ No newline at end of file diff --git a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs index 33c4342215..be8d537c96 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx index 6cc2a0e566..708599afb0 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx +++ b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx @@ -57,4 +57,9 @@ + diff --git a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs index d7f60e1a8a..c7722fbb93 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs @@ -46,6 +46,7 @@ namespace umbraco.cms.presentation.settings.stylesheet bt.Click += new System.Web.UI.ImageClickEventHandler(save_click); bt.ImageUrl = UmbracoPath +"/images/editor/save.gif"; bt.AlternateText = ui.Text("save"); + bt.ID = "save"; setupPreView(); } diff --git a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs index 80af600251..a6681cc651 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/templateControls/Item.cs b/umbraco/presentation/umbraco/templateControls/Item.cs index a36e485087..0cc5c7af70 100644 --- a/umbraco/presentation/umbraco/templateControls/Item.cs +++ b/umbraco/presentation/umbraco/templateControls/Item.cs @@ -300,7 +300,7 @@ namespace umbraco.presentation.templateControls /// protected virtual bool FieldSupportsLiveEditing() { - return !(FieldIsRercursive() || FieldIsDictionaryItem() || FieldIsApiLookup()); + return !(FieldIsRercursive() || FieldIsDictionaryItem()); } /// @@ -326,10 +326,11 @@ namespace umbraco.presentation.templateControls /// (if a NodeId attribute is specified and is different from the current page id). /// /// true if API lookup is used; otherwise, false. + [Obsolete("Method never implemented", true)] protected virtual bool FieldIsApiLookup() { // TODO: remove false and add security - return false && GetParsedNodeId().Value != int.Parse(PageElements["pageID"].ToString()); + return false; } /// diff --git a/umbraco/presentation/umbraco/translation/default.aspx.cs b/umbraco/presentation/umbraco/translation/default.aspx.cs index 732a998df0..76c8723cbc 100644 --- a/umbraco/presentation/umbraco/translation/default.aspx.cs +++ b/umbraco/presentation/umbraco/translation/default.aspx.cs @@ -30,53 +30,56 @@ namespace umbraco.presentation.translation } protected void Page_Load(object sender, EventArgs e) { - DataTable tasks = new DataTable(); - tasks.Columns.Add("Id"); - tasks.Columns.Add("Date"); - tasks.Columns.Add("NodeId"); - tasks.Columns.Add("NodeName"); - tasks.Columns.Add("ReferingUser"); - tasks.Columns.Add("Language"); + DataTable tasks = new DataTable(); + tasks.Columns.Add("Id"); + tasks.Columns.Add("Date"); + tasks.Columns.Add("NodeId"); + tasks.Columns.Add("NodeName"); + tasks.Columns.Add("ReferingUser"); + tasks.Columns.Add("Language"); - taskList.Columns[0].HeaderText = ui.Text("nodeName"); - taskList.Columns[1].HeaderText = ui.Text("translation", "taskAssignedBy"); - taskList.Columns[2].HeaderText = ui.Text("date"); + taskList.Columns[0].HeaderText = ui.Text("nodeName"); + taskList.Columns[1].HeaderText = ui.Text("translation", "taskAssignedBy"); + taskList.Columns[2].HeaderText = ui.Text("date"); - ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[3]).Text = ui.Text("translation","details"); - ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[4]).Text = ui.Text("translation", "downloadTaskAsXml"); + ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[3]).Text = ui.Text("translation", "details"); + ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[4]).Text = ui.Text("translation", "downloadTaskAsXml"); - Tasks ts = new Tasks(); - if (Request["mode"] == "owned") { - ts = Task.GetOwnedTasks(base.getUser(), false); - pane_tasks.Text = ui.Text("translation", "ownedTasks"); - Panel2.Text = ui.Text("translation", "ownedTasks"); - } else { - ts = Task.GetTasks(base.getUser(), false); - pane_tasks.Text = ui.Text("translation", "assignedTasks"); - Panel2.Text = ui.Text("translation", "assignedTasks"); - } + Tasks ts = new Tasks(); + if (Request["mode"] == "owned") + { + ts = Task.GetOwnedTasks(base.getUser(), false); + pane_tasks.Text = ui.Text("translation", "ownedTasks"); + Panel2.Text = ui.Text("translation", "ownedTasks"); + } + else + { + ts = Task.GetTasks(base.getUser(), false); + pane_tasks.Text = ui.Text("translation", "assignedTasks"); + Panel2.Text = ui.Text("translation", "assignedTasks"); + } - uploadFile.Text = ui.Text("upload"); - pane_uploadFile.Text = ui.Text("translation", "uploadTranslationXml"); + uploadFile.Text = ui.Text("upload"); + pane_uploadFile.Text = ui.Text("translation", "uploadTranslationXml"); - foreach (Task t in ts) + foreach (Task t in ts) + { + if (t.Type.Alias == "toTranslate") { - if (t.Type.Alias == "toTranslate") - { - DataRow task = tasks.NewRow(); - task["Id"] = t.Id; - task["Date"] = t.Date; - task["NodeId"] = t.Node.Id; - task["NodeName"] = t.Node.Text; - task["ReferingUser"] = t.ParentUser.Name; - tasks.Rows.Add(task); - } + DataRow task = tasks.NewRow(); + task["Id"] = t.Id; + task["Date"] = t.Date; + task["NodeId"] = t.Node.Id; + task["NodeName"] = t.Node.Text; + task["ReferingUser"] = t.ParentUser.Name; + tasks.Rows.Add(task); } - + } + taskList.DataSource = tasks; taskList.DataBind(); feedback.Style.Add("margin-top", "10px"); - + } protected void uploadFile_Click(object sender, EventArgs e) @@ -155,14 +158,15 @@ namespace umbraco.presentation.translation feedback.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; feedback.Text = "

" + ui.Text("translation", "MultipleTranslationDone") + "

" + ui.Text("translation", "translationDoneHelp") + "

    " + sb.ToString() + "
"; } - } + } // clean up File.Delete(tempFileName); } } - private void hideAll() { + private void hideAll() + { pane_uploadFile.Visible = false; pane_tasks.Visible = false; } @@ -180,28 +184,31 @@ namespace umbraco.presentation.translation // Get task xml node XmlNodeList tasks = tf.SelectNodes("//task"); - foreach (XmlNode taskXml in tasks) { + foreach (XmlNode taskXml in tasks) + { string xpath = UmbracoSettings.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; XmlNode taskNode = taskXml.SelectSingleNode(xpath); // validate file Task t = new Task(int.Parse(taskXml.Attributes.GetNamedItem("Id").Value)); - if (t != null) { + if (t != null) + { //user auth and content node validation - if (t.Node.Id == int.Parse(taskNode.Attributes.GetNamedItem("id").Value) && (t.User.Id == base.getUser().Id || t.ParentUser.Id == base.getUser().Id ) ) { - + if (t.Node.Id == int.Parse(taskNode.Attributes.GetNamedItem("id").Value) && (t.User.Id == base.getUser().Id || t.ParentUser.Id == base.getUser().Id)) + { + // update node contents Document d = new Document(t.Node.Id); Document.Import(d.ParentId, getUser(), (XmlElement)taskNode); -/* d.Text = taskNode.Attributes.GetNamedItem("nodeName").Value.Trim(); + /* d.Text = taskNode.Attributes.GetNamedItem("nodeName").Value.Trim(); - // update data elements - foreach (XmlNode data in taskNode.SelectNodes("data")) - if (data.FirstChild != null) - d.getProperty(data.Attributes.GetNamedItem("alias").Value).Value = data.FirstChild.Value; - else - d.getProperty(data.Attributes.GetNamedItem("alias").Value).Value = ""; - */ + // update data elements + foreach (XmlNode data in taskNode.SelectNodes("data")) + if (data.FirstChild != null) + d.getProperty(data.Attributes.GetNamedItem("alias").Value).Value = data.FirstChild.Value; + else + d.getProperty(data.Attributes.GetNamedItem("alias").Value).Value = ""; + */ t.Closed = true; t.Save(); @@ -218,8 +225,6 @@ namespace umbraco.presentation.translation { throw new Exception("Error importing translation file '" + tempFileName + "': " + ee.ToString()); } - - return null; - } } + } } diff --git a/umbraco/presentation/umbraco/users/EditUser.aspx b/umbraco/presentation/umbraco/users/EditUser.aspx index 18d6211d94..63c17e392f 100644 --- a/umbraco/presentation/umbraco/users/EditUser.aspx +++ b/umbraco/presentation/umbraco/users/EditUser.aspx @@ -5,4 +5,10 @@ <%@ Import Namespace="umbraco.cms.presentation.Trees" %> - \ No newline at end of file + + + diff --git a/umbraco/presentation/umbraco/users/EditUser.aspx.cs b/umbraco/presentation/umbraco/users/EditUser.aspx.cs index 4b6c868293..9cb33a8903 100644 --- a/umbraco/presentation/umbraco/users/EditUser.aspx.cs +++ b/umbraco/presentation/umbraco/users/EditUser.aspx.cs @@ -117,9 +117,9 @@ namespace umbraco.cms.presentation.user mediaPicker.TreeAlias = "media"; if (u.StartMediaId > 0) - mediaPicker.Text = u.StartMediaId.ToString(); + mediaPicker.Value = u.StartMediaId.ToString(); else - mediaPicker.Text = "-1"; + mediaPicker.Value = "-1"; medias.Controls.Add(mediaPicker); @@ -128,9 +128,9 @@ namespace umbraco.cms.presentation.user contentPicker.TreeAlias = "content"; if (u.StartNodeId > 0) - contentPicker.Text = u.StartNodeId.ToString(); + contentPicker.Value = u.StartNodeId.ToString(); else - contentPicker.Text = "-1"; + contentPicker.Value = "-1"; content.Controls.Add(contentPicker); @@ -244,9 +244,9 @@ namespace umbraco.cms.presentation.user cMediaPicker.TreeAlias = "media"; if (userChannel.MediaFolder > 0) - cMediaPicker.Text = userChannel.MediaFolder.ToString(); + cMediaPicker.Value = userChannel.MediaFolder.ToString(); else - cMediaPicker.Text = "-1"; + cMediaPicker.Value = "-1"; medias.Controls.Add(cMediaPicker); @@ -255,9 +255,9 @@ namespace umbraco.cms.presentation.user cContentPicker.TreeAlias = "content"; if (userChannel.StartNode > 0) - cContentPicker.Text = userChannel.StartNode.ToString(); + cContentPicker.Value = userChannel.StartNode.ToString(); else - cContentPicker.Text = "-1"; + cContentPicker.Value = "-1"; content.Controls.Add(cContentPicker); @@ -285,7 +285,7 @@ namespace umbraco.cms.presentation.user ImageButton save = channelInfo.Menu.NewImageButton(); save.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; save.Click += new ImageClickEventHandler(saveUser_Click); - + save.ID = "save"; if (!IsPostBack) { cName.Text = userChannel.Name; @@ -322,8 +322,8 @@ namespace umbraco.cms.presentation.user passw.Visible = false; } - contentPicker.Text = u.StartNodeId.ToString(); - mediaPicker.Text = u.StartMediaId.ToString(); + contentPicker.Value = u.StartNodeId.ToString(); + mediaPicker.Value = u.StartMediaId.ToString(); // get the current users applications string currentUserApps = ";"; @@ -421,7 +421,7 @@ namespace umbraco.cms.presentation.user int startNode; - if(!int.TryParse(contentPicker.Text, out startNode)) + if(!int.TryParse(contentPicker.Value, out startNode)) { //set to default if nothing is choosen if (u.StartNodeId > 0) @@ -439,7 +439,7 @@ namespace umbraco.cms.presentation.user int mstartNode; - if (!int.TryParse(mediaPicker.Text, out mstartNode)) + if (!int.TryParse(mediaPicker.Value, out mstartNode)) { //set to default if nothing is choosen if (u.StartMediaId > 0) @@ -469,8 +469,8 @@ namespace umbraco.cms.presentation.user c.Name = cName.Text; c.FullTree = cFulltree.Checked; - c.StartNode = int.Parse(cContentPicker.Text); - c.MediaFolder = int.Parse(cMediaPicker.Text); + c.StartNode = int.Parse(cContentPicker.Value); + c.MediaFolder = int.Parse(cMediaPicker.Value); c.FieldCategoriesAlias = cCategories.SelectedValue; c.FieldDescriptionAlias = cDescription.SelectedValue; c.FieldExcerptAlias = cExcerpt.SelectedValue; diff --git a/umbraco/presentation/umbraco/users/EditUser.aspx.designer.cs b/umbraco/presentation/umbraco/users/EditUser.aspx.designer.cs index d73805cfbb..63efcc2ecb 100644 --- a/umbraco/presentation/umbraco/users/EditUser.aspx.designer.cs +++ b/umbraco/presentation/umbraco/users/EditUser.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/users/EditUserType.aspx b/umbraco/presentation/umbraco/users/EditUserType.aspx index 7ce0783a2c..d8671f0596 100644 --- a/umbraco/presentation/umbraco/users/EditUserType.aspx +++ b/umbraco/presentation/umbraco/users/EditUserType.aspx @@ -1,25 +1,27 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditUserType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" - Inherits="umbraco.cms.presentation.user.EditUserType" %> + Inherits="umbraco.cms.presentation.user.EditUserType" %> <%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/umbraco/presentation/umbraco/users/EditUserType.aspx.cs b/umbraco/presentation/umbraco/users/EditUserType.aspx.cs index f134bd5bee..50ff09376b 100644 --- a/umbraco/presentation/umbraco/users/EditUserType.aspx.cs +++ b/umbraco/presentation/umbraco/users/EditUserType.aspx.cs @@ -32,7 +32,7 @@ namespace umbraco.cms.presentation.user ImageButton save = pnlUmbraco.Menu.NewImageButton(); save.ImageUrl = SystemDirectories.Umbraco + "/images/editor/save.gif"; save.Click += new ImageClickEventHandler(save_Click); - + save.ID = "save"; pp_alias.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("alias", base.getUser()); pp_name.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("name", base.getUser()); diff --git a/umbraco/presentation/umbraco/users/EditUserType.aspx.designer.cs b/umbraco/presentation/umbraco/users/EditUserType.aspx.designer.cs index dd0a0f1b88..ac1fddb9ec 100644 --- a/umbraco/presentation/umbraco/users/EditUserType.aspx.designer.cs +++ b/umbraco/presentation/umbraco/users/EditUserType.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/users/PermissionEditor.aspx b/umbraco/presentation/umbraco/users/PermissionEditor.aspx index f6433ab825..48a2f1acfb 100644 --- a/umbraco/presentation/umbraco/users/PermissionEditor.aspx +++ b/umbraco/presentation/umbraco/users/PermissionEditor.aspx @@ -37,5 +37,10 @@ - + + diff --git a/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs b/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs index 4a8f47a6c0..e0c1494dd4 100644 --- a/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs +++ b/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // 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. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/umbraco/presentation/umbraco/webservices/UltimatePickerAutoCompleteHandler.ashx.cs b/umbraco/presentation/umbraco/webservices/UltimatePickerAutoCompleteHandler.ashx.cs index b0e1cd3596..97bd1934b5 100644 --- a/umbraco/presentation/umbraco/webservices/UltimatePickerAutoCompleteHandler.ashx.cs +++ b/umbraco/presentation/umbraco/webservices/UltimatePickerAutoCompleteHandler.ashx.cs @@ -32,38 +32,37 @@ namespace umbraco.presentation.umbraco.webservices string documentAliasFilter = context.Request.QueryString["filter"]; string[] documentAliasFilters = documentAliasFilter.Split(",".ToCharArray()); - - + + CMSNode parent = new CMSNode(parentNodeId); if (!showGrandChildren) { - nodeCount = 0; + nodeCount = 0; - //store children array here because iterating over an Array property object is very inneficient. - var children = parent.Children; - foreach (CMSNode child in children) - { - - - nodeChildrenCount(child, false,documentAliasFilters); - - } - - output = new string[nodeCount]; + //store children array here because iterating over an Array property object is very inneficient. + var children = parent.Children; + foreach (CMSNode child in children) + { - int i = 0; - Counter = 0; - int level = 1; - //why is there a 2nd iteration of the same thing here? - foreach (CMSNode child in children) - { - - addNode(child, level, showGrandChildren,documentAliasFilters); - } + nodeChildrenCount(child, false, documentAliasFilters); - } + + output = new string[nodeCount]; + + Counter = 0; + int level = 1; + + //why is there a 2nd iteration of the same thing here? + foreach (CMSNode child in children) + { + + addNode(child, level, showGrandChildren, documentAliasFilters); + } + + + } else { nodeCount = 0; @@ -72,7 +71,7 @@ namespace umbraco.presentation.umbraco.webservices var children = parent.Children; foreach (CMSNode child in children) { - nodeChildrenCount(child, true,documentAliasFilters); + nodeChildrenCount(child, true, documentAliasFilters); } output = new string[nodeCount]; @@ -81,10 +80,10 @@ namespace umbraco.presentation.umbraco.webservices foreach (CMSNode child in children) { - addNode(child, level, showGrandChildren,documentAliasFilters); + addNode(child, level, showGrandChildren, documentAliasFilters); } - + } diff --git a/umbraco/presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/umbraco/presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index fe532e121c..20bb22642a 100644 --- a/umbraco/presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/umbraco/presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -188,19 +188,14 @@ namespace umbraco.presentation.webservices { case "xslt": return saveXslt(fileName, fileContents, ignoreDebug); - break; case "python": return "true"; - break; case "css": return saveCss(fileName, fileContents, fileID); - break; case "script": return saveScript(fileName, fileContents); - break; case "template": return saveTemplate(fileName, fileAlias, fileContents, fileID, masterID); - break; default: throw new ArgumentException(String.Format("Invalid fileType passed: '{0}'", fileType)); } diff --git a/umbraco/presentation/umbraco_client/Application/JQuery/jquery.hotkeys.js b/umbraco/presentation/umbraco_client/Application/JQuery/jquery.hotkeys.js new file mode 100644 index 0000000000..fbd71c71ec --- /dev/null +++ b/umbraco/presentation/umbraco_client/Application/JQuery/jquery.hotkeys.js @@ -0,0 +1,99 @@ +/* + * jQuery Hotkeys Plugin + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Based upon the plugin by Tzury Bar Yochay: + * http://github.com/tzuryby/hotkeys + * + * Original idea by: + * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ +*/ + +(function(jQuery){ + + jQuery.hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + + function keyHandler( handleObj ) { + // Only care when a possible input has been specified + if ( typeof handleObj.data !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.toLowerCase().split(" "); + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + event.target.type === "text") ) { + return; + } + + // Keypress represents characters, not special keys + var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], + character = String.fromCharCode( event.which ).toLowerCase(), + key, modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + + } else { + possible[ modif + character ] = true; + possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); + +})( jQuery ); \ No newline at end of file diff --git a/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js b/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js index 8e8aaca448..de837b2456 100644 --- a/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js +++ b/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js @@ -21,6 +21,7 @@ Umbraco.Application.Actions = function () { _isDebug: false, //set to true to enable alert debugging _windowTitle: " - Umbraco CMS - ", _currApp: "", + _isSaving: "", addEventHandler: function (fnName, fn) { /// Adds an event listener to the event name event @@ -85,6 +86,21 @@ Umbraco.Application.Actions = function () { return false; }, + submitDefaultWindow: function () { + if (!this._isSaving) { + this._isSaving = true; + jQuery(".editorIcon[id*=save]:first, .editorIcon:input:image[id*=Save]:first").click(); + } + this._isSaving = false; + return false; + }, + + bindSaveShortCut: function () { + jQuery(document).bind('keydown', 'ctrl+s', function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; }); + jQuery(":input").bind('keydown', 'ctrl+s', function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; }); + jQuery(document).bind('UMBRACO_TINYMCE_SAVE', function (evt, orgEvent) { UmbClientMgr.appActions().submitDefaultWindow(); return false; }); + }, + shiftApp: function (whichApp, appName) { /// Changes the application diff --git a/umbraco/presentation/umbraco_client/CodeArea/javascript.js b/umbraco/presentation/umbraco_client/CodeArea/javascript.js index d217119c14..2d7f547015 100644 --- a/umbraco/presentation/umbraco_client/CodeArea/javascript.js +++ b/umbraco/presentation/umbraco_client/CodeArea/javascript.js @@ -28,6 +28,8 @@ function shortcutCheckKeysDown(e) { keycode = e.keyCode; //save + // uncommented by NH 07-05-11 as it's been replaced by a native bindShortcutkey() method in the ClientManager +/* if (ctrlDown && keycode == 83) { doSubmit(); if (window.addEventListener) { @@ -35,7 +37,7 @@ function shortcutCheckKeysDown(e) { } else return false; } - + */ //snippet if (ctrlDown && keycode == 77) { if (window.umbracoInsertSnippet) { diff --git a/umbraco/presentation/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js b/umbraco/presentation/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js new file mode 100644 index 0000000000..15d669b4e1 --- /dev/null +++ b/umbraco/presentation/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js @@ -0,0 +1,43 @@ + +(function () { + tinymce.create('tinymce.plugins.Umbracoshortcut', { + init: function (ed, url) { + var t = this; + var ctrlPressed = false; + + t.editor = ed; + + ed.onKeyDown.add(function (ed, e) { + if (e.keyCode == 17) + ctrlPressed = true; + + if (ctrlPressed && e.keyCode == 83) { + jQuery(document).trigger("UMBRACO_TINYMCE_SAVE", e); + ctrlPressed = false; + tinymce.dom.Event.cancel(e); + return false; + } + }); + + ed.onKeyUp.add(function (ed, e) { + if (e.keyCode == 17) + ctrlPressed = false; + }); + }, + + getInfo: function () { + return { + longname: 'Umbraco Save short cut key', + author: 'Umbraco HQ', + authorurl: 'http://umbraco.com', + infourl: 'http://our.umbraco.org', + version: "1.0" + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('umbracoshortcut', tinymce.plugins.Umbracoshortcut); +})(); \ No newline at end of file diff --git a/umbraco/presentation/umbracobase/baseHttpModule.cs b/umbraco/presentation/umbracobase/baseHttpModule.cs index fbbb081b2f..458ba63312 100644 --- a/umbraco/presentation/umbracobase/baseHttpModule.cs +++ b/umbraco/presentation/umbracobase/baseHttpModule.cs @@ -18,7 +18,6 @@ namespace umbraco.presentation.umbracobase { public class requestModule : IHttpModule { - private HttpApplication mApp; #region IHttpModule Members