From 8c9e19c0b757b897dfd29cfa9e3b5025941f1327 Mon Sep 17 00:00:00 2001 From: "shannon@ShandemVaio" Date: Thu, 19 Jul 2012 21:45:55 +0600 Subject: [PATCH] Ensures language files are included in solution --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 45 +- .../umbraco/config/lang/he.xml | 0 .../umbraco/config/lang/ja.xml | 0 .../umbraco/config/lang/zh.xml | 0 .../install/steps/database.ascx.resx | 109 --- .../install/steps/defaultUser.ascx.resx | 109 --- .../install/steps/theend.ascx.resx | 42 - .../install/steps/welcome.ascx.resx | 42 - .../umbraco/templateControls/ItemRenderer.cs | 0 src/Umbraco.Web/umbraco/Trees/XmlTree.xsx | 3 - .../DeveloperDashboardIntro.ascx.designer.cs | 15 - .../DeveloperDashboardVideos.ascx.designer.cs | 15 - .../MediaDashboardIntro.ascx.designer.cs | 15 - .../dashboard/MediaDashboardVideos.ascx | 119 --- .../MediaDashboardVideos.ascx.designer.cs | 15 - .../MembersDashboardIntro.ascx.designer.cs | 15 - .../MembersDashboardVideos.ascx.designer.cs | 15 - .../SettingsDashboardIntro.ascx.designer.cs | 15 - .../SettingsDashboardVideos.ascx.designer.cs | 15 - .../StartupDashboardIntro.ascx.designer.cs | 15 - .../umbraco/masterpages/default.Master | 3 - .../umbraco/masterpages/default.Master.cs | 69 -- .../masterpages/default.Master.designer.cs | 25 - .../umbraco/masterpages/umbracoDialog.Master | 35 - .../masterpages/umbracoDialog.Master.cs | 36 - .../umbracoDialog.Master.designer.cs | 123 --- .../umbraco/masterpages/umbracoPage.Master | 46 - .../umbraco/masterpages/umbracoPage.Master.cs | 46 - .../umbracoPage.Master.designer.cs | 177 ---- src/Umbraco.Web/umbraco/schemas/umbraco.xsc | 1 - .../templateControls/Resources.Designer.cs | 84 -- .../umbraco/xslt/eXslt/ExsltCommon.cs | 63 -- .../umbraco/xslt/eXslt/ExsltDatesAndTimes.cs | 794 ------------------ .../umbraco/xslt/eXslt/ExsltMath.cs | 363 -------- .../umbraco/xslt/eXslt/ExsltNodeList.cs | 193 ----- .../xslt/eXslt/ExsltRegularExpressions.cs | 228 ----- .../umbraco/xslt/eXslt/ExsltSets.cs | 195 ----- .../umbraco/xslt/eXslt/ExsltStrings.cs | 250 ------ 38 files changed, 44 insertions(+), 3291 deletions(-) rename src/{Umbraco.Web/umbraco.presentation => Umbraco.Web.UI}/umbraco/config/lang/he.xml (100%) rename src/{Umbraco.Web/umbraco.presentation => Umbraco.Web.UI}/umbraco/config/lang/ja.xml (100%) rename src/{Umbraco.Web/umbraco.presentation => Umbraco.Web.UI}/umbraco/config/lang/zh.xml (100%) delete mode 100644 src/Umbraco.Web/install/steps/database.ascx.resx delete mode 100644 src/Umbraco.Web/install/steps/defaultUser.ascx.resx delete mode 100644 src/Umbraco.Web/install/steps/theend.ascx.resx delete mode 100644 src/Umbraco.Web/install/steps/welcome.ascx.resx rename src/Umbraco.Web/{ => umbraco.presentation}/umbraco/templateControls/ItemRenderer.cs (100%) delete mode 100644 src/Umbraco.Web/umbraco/Trees/XmlTree.xsx delete mode 100644 src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardIntro.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardVideos.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/MediaDashboardIntro.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx delete mode 100644 src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/MembersDashboardIntro.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/MembersDashboardVideos.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/SettingsDashboardIntro.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/SettingsDashboardVideos.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/dashboard/StartupDashboardIntro.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/default.Master delete mode 100644 src/Umbraco.Web/umbraco/masterpages/default.Master.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/default.Master.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.cs delete mode 100644 src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.designer.cs delete mode 100644 src/Umbraco.Web/umbraco/schemas/umbraco.xsc delete mode 100644 src/Umbraco.Web/umbraco/templateControls/Resources.Designer.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltCommon.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltDatesAndTimes.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltMath.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltNodeList.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltRegularExpressions.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltSets.cs delete mode 100644 src/Umbraco.Web/umbraco/xslt/eXslt/ExsltStrings.cs diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index e1b28e1d11..8bf7ea497d 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -293,10 +293,12 @@ UI.xml + + - + @@ -324,12 +326,16 @@ + + + + @@ -338,11 +344,15 @@ + + + + @@ -380,6 +390,8 @@ + + @@ -395,6 +407,8 @@ + + @@ -433,7 +447,16 @@ + + + + + + + + + @@ -447,6 +470,8 @@ + + @@ -463,6 +488,8 @@ + + @@ -473,6 +500,8 @@ + + @@ -488,6 +517,8 @@ + + @@ -497,6 +528,8 @@ + + @@ -508,15 +541,23 @@ + + + + + + + + @@ -544,6 +585,8 @@ + + diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/he.xml b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml similarity index 100% rename from src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/he.xml rename to src/Umbraco.Web.UI/umbraco/config/lang/he.xml diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml similarity index 100% rename from src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/ja.xml rename to src/Umbraco.Web.UI/umbraco/config/lang/ja.xml diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml similarity index 100% rename from src/Umbraco.Web/umbraco.presentation/umbraco/config/lang/zh.xml rename to src/Umbraco.Web.UI/umbraco/config/lang/zh.xml diff --git a/src/Umbraco.Web/install/steps/database.ascx.resx b/src/Umbraco.Web/install/steps/database.ascx.resx deleted file mode 100644 index c31621308d..0000000000 --- a/src/Umbraco.Web/install/steps/database.ascx.resx +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - True - - \ No newline at end of file diff --git a/src/Umbraco.Web/install/steps/defaultUser.ascx.resx b/src/Umbraco.Web/install/steps/defaultUser.ascx.resx deleted file mode 100644 index c31621308d..0000000000 --- a/src/Umbraco.Web/install/steps/defaultUser.ascx.resx +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - True - - \ No newline at end of file diff --git a/src/Umbraco.Web/install/steps/theend.ascx.resx b/src/Umbraco.Web/install/steps/theend.ascx.resx deleted file mode 100644 index dd0ea4d8e3..0000000000 --- a/src/Umbraco.Web/install/steps/theend.ascx.resx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.0.0.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/src/Umbraco.Web/install/steps/welcome.ascx.resx b/src/Umbraco.Web/install/steps/welcome.ascx.resx deleted file mode 100644 index dd0ea4d8e3..0000000000 --- a/src/Umbraco.Web/install/steps/welcome.ascx.resx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.0.0.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/src/Umbraco.Web/umbraco/templateControls/ItemRenderer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ItemRenderer.cs similarity index 100% rename from src/Umbraco.Web/umbraco/templateControls/ItemRenderer.cs rename to src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ItemRenderer.cs diff --git a/src/Umbraco.Web/umbraco/Trees/XmlTree.xsx b/src/Umbraco.Web/umbraco/Trees/XmlTree.xsx deleted file mode 100644 index ff71343be3..0000000000 --- a/src/Umbraco.Web/umbraco/Trees/XmlTree.xsx +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardIntro.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardIntro.ascx.designer.cs deleted file mode 100644 index 486df4e421..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardIntro.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardIntro { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardVideos.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardVideos.ascx.designer.cs deleted file mode 100644 index 01be3f80e1..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/DeveloperDashboardVideos.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardVideos { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardIntro.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/MediaDashboardIntro.ascx.designer.cs deleted file mode 100644 index 486df4e421..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardIntro.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardIntro { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx b/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx deleted file mode 100644 index 6567a0fd6e..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx +++ /dev/null @@ -1,119 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" %> -<%@ Register Namespace="umbraco.uicontrols" Assembly="controls" TagPrefix="umb" %> - - - - -
-

Watch and learn

- Videos -

Hours of Umbraco training videos are only a click away

-

- Want to master Umbraco? Spend a couple of minutes learning some best practices - by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

-

To get you started:

-
- Loading... -
-
\ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx.designer.cs deleted file mode 100644 index 01be3f80e1..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/MediaDashboardVideos.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardVideos { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/MembersDashboardIntro.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/MembersDashboardIntro.ascx.designer.cs deleted file mode 100644 index 486df4e421..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/MembersDashboardIntro.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardIntro { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/MembersDashboardVideos.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/MembersDashboardVideos.ascx.designer.cs deleted file mode 100644 index 01be3f80e1..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/MembersDashboardVideos.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardVideos { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardIntro.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardIntro.ascx.designer.cs deleted file mode 100644 index 486df4e421..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardIntro.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardIntro { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardVideos.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardVideos.ascx.designer.cs deleted file mode 100644 index 01be3f80e1..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/SettingsDashboardVideos.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardVideos { - } -} diff --git a/src/Umbraco.Web/umbraco/dashboard/StartupDashboardIntro.ascx.designer.cs b/src/Umbraco.Web/umbraco/dashboard/StartupDashboardIntro.ascx.designer.cs deleted file mode 100644 index 486df4e421..0000000000 --- a/src/Umbraco.Web/umbraco/dashboard/StartupDashboardIntro.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace dashboardUtilities { - - - public partial class StartupDashboardIntro { - } -} diff --git a/src/Umbraco.Web/umbraco/masterpages/default.Master b/src/Umbraco.Web/umbraco/masterpages/default.Master deleted file mode 100644 index 45285fe986..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/default.Master +++ /dev/null @@ -1,3 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="default.master.cs" Inherits="umbraco.presentation.masterpages._default" %> - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/masterpages/default.Master.cs b/src/Umbraco.Web/umbraco/masterpages/default.Master.cs deleted file mode 100644 index 37c72aa310..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/default.Master.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Diagnostics; -using System.Web.UI; -using umbraco.presentation.LiveEditing; -using umbraco.presentation.LiveEditing.Controls; -using System.IO; - -namespace umbraco.presentation.masterpages -{ - public partial class _default : System.Web.UI.MasterPage - { - protected ILiveEditingContext m_LiveEditingContext = UmbracoContext.Current.LiveEditingContext; - - protected void Page_Load(object sender, EventArgs e) - { - try - { - AddLiveEditingSupport(); - } - catch (Exception ex) - { - throw new ApplicationException("Error adding Canvas support.", ex); - } - } - - protected override void Render(HtmlTextWriter writer) - { - if (!m_LiveEditingContext.Enabled) - { - base.Render(writer); - } - else - { - // get base output - StringWriter baseWriter = new StringWriter(); - base.Render(new HtmlTextWriter(baseWriter)); - string baseOutput = baseWriter.ToString(); - - // add custom umbraco namespace (required for events on custom tags in IE) - baseOutput = baseOutput.Replace(" -// 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. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.masterpages { - - - public partial class _default { - - /// - /// ContentPlaceHolderDefault control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolderDefault; - } -} diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master b/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master deleted file mode 100644 index 9ef237a548..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master +++ /dev/null @@ -1,35 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="umbracoDialog.master.cs" Inherits="umbraco.presentation.masterpages.umbracoDialog" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.cs b/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.cs deleted file mode 100644 index b718c80986..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace umbraco.presentation.masterpages { - public partial class umbracoDialog : System.Web.UI.MasterPage { - - public bool reportModalSize { get; set; } - public static new event MasterPageLoadHandler Load; - public new static event MasterPageLoadHandler Init; - - protected void Page_Load(object sender, EventArgs e) - { - ClientLoader.DataBind(); - ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setRoot", "UmbClientMgr.setUmbracoPath(\"" + IO.IOHelper.ResolveUrl( IO.SystemDirectories.Umbraco ) + "\");", true); - FireOnLoad(e); - } - - protected override void OnInit(EventArgs e) { - base.OnInit(e); - - if (Init != null) { - Init(this, e); - } - } - - - protected virtual void FireOnLoad(EventArgs e) { - if (Load != null) { - Load(this, e); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.designer.cs b/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.designer.cs deleted file mode 100644 index 0ba245e476..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoDialog.Master.designer.cs +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.masterpages { - - - public partial class umbracoDialog { - - /// - /// Head1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoClientDependencyLoader ClientLoader; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// head control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder head; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// ScriptManager1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager ScriptManager1; - - /// - /// body control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder body; - - /// - /// footer control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder footer; - } -} diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master b/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master deleted file mode 100644 index a8f60b9bbb..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master +++ /dev/null @@ -1,46 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="umbracoPage.master.cs" - Inherits="umbraco.presentation.masterpages.umbracoPage" %> - -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.cs b/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.cs deleted file mode 100644 index 906c433220..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -//This is only in case an upgrade goes wrong and the the /masterpages/ files are not copied over -//which would result in an error. so we have kept the old namespaces intact with references to new ones -using mp = umbraco.presentation.masterpages; -namespace umbraco.presentation.umbraco.masterpages { - public class umbracoPage : mp.umbracoPage { } - public class umbracoDialog : mp.umbracoDialog { } -} - -namespace umbraco.presentation.masterpages -{ - public delegate void MasterPageLoadHandler(object sender, System.EventArgs e); - - public partial class umbracoPage : System.Web.UI.MasterPage - { - - public new static event MasterPageLoadHandler Load; - public new static event MasterPageLoadHandler Init; - - protected void Page_Load(object sender, EventArgs e) - { - ClientLoader.DataBind(); - FireOnLoad(e); - } - - protected override void OnInit(EventArgs e) { - base.OnInit(e); - - if (Init != null) { - Init(this, e); - } - } - - - protected virtual void FireOnLoad(EventArgs e) { - if (Load != null) { - Load(this, e); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.designer.cs b/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.designer.cs deleted file mode 100644 index 16d1820c83..0000000000 --- a/src/Umbraco.Web/umbraco/masterpages/umbracoPage.Master.designer.cs +++ /dev/null @@ -1,177 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.masterpages { - - - public partial class umbracoPage { - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoClientDependencyLoader ClientLoader; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude8 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude8; - - /// - /// JsInclude9 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude9; - - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - - /// - /// JsInclude5 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude5; - - /// - /// JsInclude6 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - - /// - /// JsInclude7 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude7; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - 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. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder head; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// ScriptManager1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager ScriptManager1; - - /// - /// body control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder body; - - /// - /// footer control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder footer; - } -} diff --git a/src/Umbraco.Web/umbraco/schemas/umbraco.xsc b/src/Umbraco.Web/umbraco/schemas/umbraco.xsc deleted file mode 100644 index 5f282702bb..0000000000 --- a/src/Umbraco.Web/umbraco/schemas/umbraco.xsc +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/templateControls/Resources.Designer.cs b/src/Umbraco.Web/umbraco/templateControls/Resources.Designer.cs deleted file mode 100644 index 4b3ca8ce0b..0000000000 --- a/src/Umbraco.Web/umbraco/templateControls/Resources.Designer.cs +++ /dev/null @@ -1,84 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.544 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.umbraco.templateControls { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Web.umbraco.templateControls.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?> - ///<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> - ///<xsl:stylesheet - /// version="1.0" - /// xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - /// xmlns:msxml="urn:schemas-microsoft-com:xslt" - /// xmlns:umbraco.library="urn:umbraco.library" - /// {3} - /// exclude-result-prefixes="msxml umbraco.library {2}"> - ///<xsl:output method="xml" omit-xml-declaration="yes"/> - ///<xsl:param name="currentPage"/> - ///<xsl:param name="itemData"/> - ///<xsl:template match="/"><xsl:value-of select="{0}" disa [rest of string was truncated]";. - /// - internal static string InlineXslt { - get { - return ResourceManager.GetString("InlineXslt", resourceCulture); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltCommon.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltCommon.cs deleted file mode 100644 index 2f2b025b1c..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltCommon.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Xml.Xsl; -using System.Xml.XPath; -using System.Xml; -using System.Reflection; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// This class implements the EXSLT functions in the http://exslt.org/common namespace. - /// - public class ExsltCommon - { - -/// -/// Implements the following function -/// string exsl:objecttype(object) -/// -/// -/// - public static string objecttype(object o){ - - if(o is System.String){ - return "string"; - }else if(o is System.Boolean){ - return "boolean"; - }else if(o is Double || o is Int16 || o is UInt16 || o is Int32 - || o is UInt32 || o is Int64 || o is UInt64 || o is Single || o is Decimal){ - return "number"; - }else if(o is System.Xml.XPath.XPathNavigator){ - return "RTF"; - }else if(o is System.Xml.XPath.XPathNodeIterator){ - return "node-set"; - }else{ - return "external"; - } - - }/* objecttype(object) */ - -/// -/// This method converts an ExsltNodeList to an XPathNodeIterator over the nodes in the list. -/// -/// The list to convert -/// An XPathNodeIterator over the nodes in the original list -/// Known Issues: A node list containing multiple instances of an attribute -/// with the same namespace name and local name will cause an error. - internal static XPathNodeIterator ExsltNodeListToXPathNodeIterator(ExsltNodeList list){ - - - Assembly systemXml = typeof(XPathNodeIterator).Assembly; - Type arrayIteratorType = systemXml.GetType("System.Xml.XPath.XPathArrayIterator"); - - return (XPathNodeIterator) Activator.CreateInstance( arrayIteratorType, - BindingFlags.Instance | BindingFlags.Public | - BindingFlags.CreateInstance, null, new object[]{ list.innerList}, null ); - - } - - - - - } -} diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltDatesAndTimes.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltDatesAndTimes.cs deleted file mode 100644 index 53cbe12e66..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltDatesAndTimes.cs +++ /dev/null @@ -1,794 +0,0 @@ -using System; -using System.Globalization; -using System.Xml; -using System.Xml.XPath; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// This class implements the EXSLT functions in the http://exslt.org/dates-and-times namespace. - /// - public class ExsltDatesAndTimes - { - - /// - /// Implements the following function - /// string date:date-time() - /// - /// The current time - public static string datetime(){ - return DateTime.Now.ToString("s"); - } - - /// - /// Implements the following function - /// string date:date-time() - /// - /// The current date and time or the empty string if the - /// date is invalid - public static string datetime(string d){ - try{ - return DateTime.Parse(d).ToString("s"); - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string date:date() - /// - /// The current date - public static string date(){ - string date = DateTime.Now.ToString("s"); - string[] dateNtime = date.Split(new Char[]{'T'}); - return dateNtime[0]; - } - - /// - /// Implements the following function - /// string date:date(string) - /// - /// The date part of the specified date or the empty string if the - /// date is invalid - public static string date(string d){ - try{ - string[] dateNtime = DateTime.Parse(d).ToString("s").Split(new Char[]{'T'}); - return dateNtime[0]; - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string date:time() - /// - /// The current time - public static string time(){ - string date = DateTime.Now.ToString("s"); - string[] dateNtime = date.Split(new Char[]{'T'}); - return dateNtime[1]; - } - - /// - /// Implements the following function - /// string date:time(string) - /// - /// The time part of the specified date or the empty string if the - /// date is invalid - public static string time(string d){ - try{ - string[] dateNtime = DateTime.Parse(d).ToString("s").Split(new Char[]{'T'}); - return dateNtime[1]; - }catch(FormatException){ - return ""; - } - } - - - /// - /// Implements the following function - /// number date:year() - /// - /// The current year - public static double year(){ - return DateTime.Now.Year; - } - - /// - /// Implements the following function - /// number date:year(string) - /// - /// The year part of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types - public static double year(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Year; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Helper method for calculating whether a year is a leap year. Algorithm - /// obtained from http://mindprod.com/jglossleapyear.html - /// - private static bool IsLeapYear ( int year) { - - return CultureInfo.CurrentCulture.Calendar.IsLeapYear(year); - } - - - /// - /// Implements the following function - /// boolean date:leap-year() - /// - /// True if the current year is a leap year - public static bool leapyear(){ - return IsLeapYear(DateTime.Now.Year); - } - - /// - /// Implements the following function - /// boolean date:leap-year(string) - /// - /// True if the specified year is a leap year - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types - public static bool leapyear(string d){ - try{ - DateTime date = DateTime.Parse(d); - return IsLeapYear(date.Year); - }catch(FormatException){ - return false; - } - } - - /// - /// Implements the following function - /// number date:month-in-year() - /// - /// The current month - public static double monthinyear(){ - return DateTime.Now.Month; - } - - /// - /// Implements the following function - /// number date:month-in-year(string) - /// - /// The month part of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types - public static double monthinyear(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Month; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Helper method uses local culture information. - /// - /// - /// - private static double weekinyear(DateTime d){ - Calendar calendar = CultureInfo.CurrentCulture.Calendar; - return calendar.GetWeekOfYear(d,CultureInfo.CurrentCulture.DateTimeFormat.CalendarWeekRule, - CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek); - } - - /// - /// Implements the following function - /// number date:week-in-year() - /// - /// The current week. This method uses the Calendar.GetWeekOfYear() method - /// with the CalendarWeekRule and FirstDayOfWeek of the current culture. - /// THE RESULTS OF CALLING THIS FUNCTION VARIES ACROSS CULTURES - public static double weekinyear(){ - return weekinyear(DateTime.Now); - } - - /// - /// Implements the following function - /// number date:week-in-year(string) - /// - /// The week part of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types. This method uses the Calendar.GetWeekOfYear() method - /// with the CalendarWeekRule and FirstDayOfWeek of the current culture. - /// THE RESULTS OF CALLING THIS FUNCTION VARIES ACROSS CULTURES - public static double weekinyear(string d){ - try{ - DateTime date = DateTime.Parse(d); - return weekinyear(date); - }catch(FormatException){ - return System.Double.NaN; - } - } - - - /// - /// Implements the following function - /// number date:day-in-year() - /// - /// The current day. - public static double dayinyear(){ - return DateTime.Now.DayOfYear; - } - - /// - /// Implements the following function - /// number date:day-in-year(string) - /// - /// The day part of the specified date or the empty string if the - /// date is invalid - public static double dayinyear(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.DayOfYear; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Implements the following function - /// number date:day-in-week() - /// - /// The current day in the week. 1=Sunday, 2=Monday,...,7=Saturday - public static double dayinweek(){ - return ((int) DateTime.Now.DayOfWeek) + 1; - } - - /// - /// Implements the following function - /// number date:day-in-week(string) - /// - /// The day in the week of the specified date or the empty string if the - /// date is invalid. The current day in the week. 1=Sunday, 2=Monday,...,7=Saturday - /// - public static double dayinweek(string d){ - try{ - DateTime date = DateTime.Parse(d); - return ((int)date.DayOfWeek) + 1; - }catch(FormatException){ - return System.Double.NaN; - } - } - - - /// - /// Implements the following function - /// number date:day-in-month() - /// - /// The current day. - public static double dayinmonth(){ - return DateTime.Now.Day; - } - - /// - /// Implements the following function - /// number date:day-in-month(string) - /// - /// The day part of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:MonthDay or - /// xs:gDay types - public static double dayinmonth(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Day; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Helper method. - /// - /// - /// - private static double dayofweekinmonth(int day){ - - int toReturn = 0; - - do{ - toReturn++; - day-= 7; - }while(day > 0); - - return toReturn; - } - - /// - /// Implements the following function - /// number date:day-of-week-in-month() - /// - /// The current day of week in the month as a number. For instance - /// the third Tuesday of the month returns 3 - public static double dayofweekinmonth(){ - return dayofweekinmonth(DateTime.Now.Day); - } - - /// - /// Implements the following function - /// number date:day-of-week-in-month(string) - /// - /// The day part of the specified date or the empty string if the - /// date is invalid - - public static double dayofweekinmonth(string d){ - try{ - DateTime date = DateTime.Parse(d); - return dayofweekinmonth(date.Day); - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Implements the following function - /// number date:hour-in-day() - /// - /// The current hour of the day as a number. - public static double hourinday(){ - return DateTime.Now.Hour; - } - - /// - /// Implements the following function - /// number date:hour-in-day(string) - /// - /// The current hour of the specified time or the empty string if the - /// date is invalid - - public static double hourinday(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Hour; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Implements the following function - /// number date:minute-in-hour() - /// - /// The minute of the current hour as a number. - public static double minuteinhour(){ - return DateTime.Now.Minute; - } - - /// - /// Implements the following function - /// number date:minute-in-hour(string) - /// - /// The minute of the hour of the specified time or the empty string if the - /// date is invalid - - public static double minuteinhour(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Minute; - }catch(FormatException){ - return System.Double.NaN; - } - } - - - /// - /// Implements the following function - /// number date:second-in-minute() - /// - /// The seconds of the current minute as a number. - public static double secondinminute(){ - return DateTime.Now.Second; - } - - /// - /// Implements the following function - /// number date:second-in-minute(string) - /// - /// The seconds of the minute of the specified time or the empty string if the - /// date is invalid - - public static double secondinminute(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.Second; - }catch(FormatException){ - return System.Double.NaN; - } - } - - - /// - /// Implements the following function - /// string date:day-name() - /// - /// The name of the current day - public static string dayname(){ - return DateTime.Now.DayOfWeek.ToString(); - } - - /// - /// Implements the following function - /// string date:day-name(string) - /// - /// The name of the day of the specified date or the empty string if the - /// date is invalid - public static string dayname(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.DayOfWeek.ToString(); - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string date:day-abbreviation() - /// - /// The abbreviated name of the current day - public static string dayabbreviation(){ - return DateTime.Now.DayOfWeek.ToString().Substring(0,3); - } - - /// - /// Implements the following function - /// string date:day-abbreviation(string) - /// - /// The abbreviated name of the day of the specified date or the empty string if the - /// date is invalid - public static string dayabbreviation(string d){ - try{ - DateTime date = DateTime.Parse(d); - return date.DayOfWeek.ToString().Substring(0,3); - }catch(FormatException){ - return ""; - } - } - - - /// - /// Implements the following function - /// string date:month-name() - /// - /// The name of the current month - public static string monthname(){ - string month = DateTime.Now.ToString("MMMM"); - string[] splitmonth = month.Split(new Char[]{' '}); - return splitmonth[0]; - } - - /// - /// Implements the following function - /// string date:month-name(string) - /// - /// The name of the month of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types - public static string monthname(string d){ - try{ - DateTime date = DateTime.Parse(d); - string month = date.ToString("MMMM"); - string[] splitmonth = month.Split(new Char[]{' '}); - return splitmonth[0]; - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string date:month-abbreviation() - /// - /// The abbreviated name of the current month - public static string monthabbreviation(){ - string month = DateTime.Now.ToString("MMM"); - string[] splitmonth = month.Split(new Char[]{' '}); - return splitmonth[0].Substring(0,3); - } - - /// - /// Implements the following function - /// string date:month-abbreviation(string) - /// - /// The abbreviated name of the month of the specified date or the empty string if the - /// date is invalid - /// Does not support dates in the format of the xs:yearMonth or - /// xs:gYear types - public static string monthabbreviation(string d){ - try{ - DateTime date = DateTime.Parse(d); - string month = date.ToString("MMM"); - string[] splitmonth = month.Split(new Char[]{' '}); - return splitmonth[0].Substring(0, 3);; - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string date:format-date(string, string) - /// - /// The date to format - /// One of the format strings understood by the - /// DateTime.ToString(string) method. - /// The formated date - public static string formatdate(string d, string format){ - try{ - DateTime date = DateTime.Parse(d); - return date.ToString(format); - }catch(FormatException){ - return ""; - } - } - - - /// - /// Implements the following function - /// string date:parse-date(string, string) - /// - /// The date to parse - /// One of the format strings understood by the - /// DateTime.ToString(string) method. - /// The parsed date - public static string parsedate(string d, string format){ - try{ - DateTime date = DateTime.ParseExact(d, format, CultureInfo.CurrentCulture); - return XmlConvert.ToString(date, XmlDateTimeSerializationMode.Unspecified); - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string:date:difference(string, string) - /// - /// The start date - /// The end date - /// A positive difference if start is before end otherwise a negative - /// difference. The difference is in the format [-][d.]hh:mm:ss[.ff] - public static string difference(string start, string end){ - - try{ - DateTime startdate = DateTime.Parse(start); - DateTime enddate = DateTime.Parse(end); - return XmlConvert.ToString(enddate.Subtract(startdate)); - }catch(FormatException){ - return ""; - } - } - - /// - /// Implements the following function - /// string:date:add(string, string) - /// - /// A date/time - /// the duration to add - /// The new time - public static string add(string datetime, string duration){ - - try{ - DateTime date = DateTime.Parse(datetime); - TimeSpan timespan = System.Xml.XmlConvert.ToTimeSpan(duration); - return XmlConvert.ToString(date.Add(timespan), XmlDateTimeSerializationMode.Unspecified); - }catch(FormatException){ - return ""; - } - - } - - - /// - /// Implements the following function - /// string:date:add-duration(string, string) - /// - /// A date/time - /// the duration to add - /// The new time - public static string addduration(string duration1, string duration2){ - - try{ - TimeSpan timespan1 = XmlConvert.ToTimeSpan(duration1); - TimeSpan timespan2 = XmlConvert.ToTimeSpan(duration2); - return XmlConvert.ToString(timespan1.Add(timespan2)); - }catch(FormatException){ - return ""; - } - - } - - /// - /// Implements the following function - /// number date:seconds() - /// - /// The amount of seconds since the epoch (1970-01-01T00:00:00Z) - public static double seconds(){ - - try{ - - DateTime epoch = new DateTime(1970, 1, 1, 0,0,0,0, CultureInfo.CurrentCulture.Calendar); - TimeSpan duration = DateTime.Now.Subtract(epoch); - return duration.TotalSeconds; - - }catch(Exception){ - return System.Double.NaN; - } - } - - - /// - /// Implements the following function - /// number date:seconds(string) - /// - /// The amount of seconds between the specified date and the - /// epoch (1970-01-01T00:00:00Z) - public static double seconds(string datetime){ - - try{ - - DateTime epoch = new DateTime(1970, 1, 1, 0,0,0,0, CultureInfo.CurrentCulture.Calendar); - DateTime date = DateTime.Parse(datetime);; - return date.Subtract(epoch).TotalSeconds; - - }catch(FormatException){ ; } //might be a duration - - try{ - TimeSpan duration = XmlConvert.ToTimeSpan(datetime); - return duration.TotalSeconds; - }catch(FormatException){ - return System.Double.NaN; - } - } - - /// - /// Implements the following function - /// string date:sum(node-set) - /// - /// The nodeset - /// The sum of the values within the node set treated as - public static string sum(XPathNodeIterator iterator){ - - TimeSpan sum = new TimeSpan(0,0,0,0); - - if(iterator.Count == 0){ - return ""; - } - - try{ - while(iterator.MoveNext()){ - sum = XmlConvert.ToTimeSpan(iterator.Current.Value).Add(sum); - } - - }catch(FormatException){ - return ""; - } - - return XmlConvert.ToString(sum) ; //XmlConvert.ToString(sum); - } - - - - /// - /// Implements the following function - /// string date:duration(number) - /// - /// - /// - public static string duration(double seconds){ - - return XmlConvert.ToString(new TimeSpan(0,0,(int)seconds)); - } - - - /// - /// Implements the following function - /// string date:avg(node-set) - /// - /// - /// - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static string avg(XPathNodeIterator iterator){ - - TimeSpan sum = new TimeSpan(0,0,0,0); - int count = iterator.Count; - - if(count == 0){ - return ""; - } - - try{ - while(iterator.MoveNext()){ - sum = XmlConvert.ToTimeSpan(iterator.Current.Value).Add(sum); - } - - }catch(FormatException){ - return ""; - } - - return duration(sum.TotalSeconds / count); - } - - /// - /// Implements the following function - /// string date:min(node-set) - /// - /// - /// - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static string min(XPathNodeIterator iterator){ - - TimeSpan min, t; - - if(iterator.Count == 0){ - return ""; - } - - try{ - - iterator.MoveNext(); - min = XmlConvert.ToTimeSpan(iterator.Current.Value); - - while(iterator.MoveNext()){ - t = XmlConvert.ToTimeSpan(iterator.Current.Value); - min = (t < min)? t : min; - } - - }catch(FormatException){ - return ""; - } - - return XmlConvert.ToString(min); - } - - - /// - /// Implements the following function - /// string date:max(node-set) - /// - /// - /// - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static string max(XPathNodeIterator iterator){ - - TimeSpan max, t; - - if(iterator.Count == 0){ - return ""; - } - - try{ - - iterator.MoveNext(); - max = XmlConvert.ToTimeSpan(iterator.Current.Value); - - - while(iterator.MoveNext()){ - t = XmlConvert.ToTimeSpan(iterator.Current.Value); - max = (t > max)? t : max; - } - - }catch(FormatException){ - return ""; - } - - return XmlConvert.ToString(max); - } - } -} diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltMath.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltMath.cs deleted file mode 100644 index 9756e018fd..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltMath.cs +++ /dev/null @@ -1,363 +0,0 @@ -using System; -using System.Xml; -using System.Xml.XPath; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// This class implements the EXSLT functions in the http://exslt.org/math namespace. - /// - public class ExsltMath { - /// - /// Implements the following function - /// number min(node-set) - /// - /// - /// - public static double min(XPathNodeIterator iterator){ - - double min, t; - - if(iterator.Count == 0){ - return Double.NaN; - } - - try{ - - iterator.MoveNext(); - min = XmlConvert.ToDouble(iterator.Current.Value); - - - while(iterator.MoveNext()){ - t = XmlConvert.ToDouble(iterator.Current.Value); - min = (t < min)? t : min; - } - - }catch(Exception){ - return Double.NaN; - } - - return min; - } - - - /// - /// Implements the following function - /// number max(node-set) - /// - /// - /// - public static double max(XPathNodeIterator iterator){ - - double max, t; - - if(iterator.Count == 0){ - return Double.NaN; - } - - try{ - - iterator.MoveNext(); - max = XmlConvert.ToDouble(iterator.Current.Value); - - - while(iterator.MoveNext()){ - t = XmlConvert.ToDouble(iterator.Current.Value); - max = (t > max)? t : max; - } - - }catch(Exception){ - return Double.NaN; - } - - return max; - } - - - /// - /// Implements the following function - /// node-set highest(node-set) - /// - /// The input nodeset - /// All the nodes that contain the max value in the nodeset - public static XPathNodeIterator highest(XPathNodeIterator iterator){ - - ExsltNodeList newList = new ExsltNodeList(); - double max, t; - - if(iterator.Count == 0){ - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - - try{ - - iterator.MoveNext(); - max = XmlConvert.ToDouble(iterator.Current.Value); - newList.Add(iterator.Current.Clone()); - - while (iterator.MoveNext()){ - t = XmlConvert.ToDouble(iterator.Current.Value); - - if(t > max){ - max = t; - newList.Clear(); - newList.Add(iterator.Current.Clone()); - }else if( t == max){ - newList.Add(iterator.Current.Clone()); - } - } - - }catch(Exception){ //return empty node set - newList.Clear(); - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - - /// - /// Implements the following function - /// node-set lowest(node-set) - /// - /// The input nodeset - /// All the nodes that contain the min value in the nodeset - public static XPathNodeIterator lowest(XPathNodeIterator iterator){ - - ExsltNodeList newList = new ExsltNodeList(); - double min, t; - - if(iterator.Count == 0){ - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - - try{ - - iterator.MoveNext(); - min = XmlConvert.ToDouble(iterator.Current.Value); - newList.Add(iterator.Current.Clone()); - - while (iterator.MoveNext()){ - t = XmlConvert.ToDouble(iterator.Current.Value); - - if(t < min){ - min = t; - newList.Clear(); - newList.Add(iterator.Current.Clone()); - }else if( t == min){ - newList.Add(iterator.Current.Clone()); - } - } - - }catch(Exception){ //return empty node set - newList.Clear(); - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); - } - - /// - /// Implements the following function - /// number abs(number) - /// - /// - /// - public static double abs(double number){ - - return Math.Abs(number); - } - - /// - /// Implements the following function - /// number sqrt(number) - /// - /// - /// - public static double sqrt(double number){ - - return Math.Sqrt(number); - } - - /// - /// Implements the following function - /// number power(number, number) - /// - /// - /// - /// - public double power(double x, double y){ - - return Math.Pow(x, y); - } - - /// - /// Implements the following function - /// number log(number) - /// - /// - /// - public static double log(double x){ - - return Math.Log(x); - } - - /// - /// Implements the following function - /// number constant(string, number) - /// - /// - /// The specified constant or NaN - /// This method only supports the constants - /// E and PI. Also the precision parameter is ignored. - public static double constant(string c, double precision){ - - switch(c){ - - case "E": - return Math.E; - - case "PI": - return Math.PI; - - default: - return Double.NaN; - } - } - - /// - /// Implements the following function - /// number random() - /// - /// - /// - public static double random(){ - - Random rand = new Random((int) DateTime.Now.Ticks); - return rand.NextDouble(); - } - - /// - /// Implements the following function - /// number sin(number) - /// - /// - /// - public static double sin(double x){ - - return Math.Sin(x); - } - - /// - /// Implements the following function - /// number asin(number) - /// - /// - /// - public static double asin(double x){ - - return Math.Asin(x); - } - - - /// - /// Implements the following function - /// number cos(number) - /// - /// - /// - public static double cos(double x){ - - return Math.Cos(x); - } - - /// - /// Implements the following function - /// number acos(number) - /// - /// - /// - public static double acos(double x){ - - return Math.Acos(x); - } - - /// - /// Implements the following function - /// number tan(number) - /// - /// - /// - public static double tan(double x){ - - return Math.Tan(x); - } - - /// - /// Implements the following function - /// number atan(number) - /// - /// - /// - public static double atan(double x){ - - return Math.Atan(x); - } - - /// - /// Implements the following function - /// number atan2(number, number) - /// - /// - /// - /// - public static double atan2(double x, double y){ - - return Math.Atan2(x,y); - } - - /// - /// Implements the following function - /// number exp(number) - /// - /// - /// - public static double exp(double x){ - - return Math.Exp(x); - } - - - /// - /// Implements the following function - /// number avg(node-set) - /// - /// - /// The average of all the value of all the nodes in the - /// node set - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static double avg(XPathNodeIterator iterator){ - - double sum = 0; - int count = iterator.Count; - - if(count == 0){ - return Double.NaN; - } - - try{ - while(iterator.MoveNext()){ - sum += XmlConvert.ToDouble(iterator.Current.Value); - } - - }catch(FormatException){ - return Double.NaN; - } - - return sum / count; - } - } -} - diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltNodeList.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltNodeList.cs deleted file mode 100644 index 8edde7434a..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltNodeList.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections; -using System.Xml.XPath; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// A list that holds XPathNavigator objects - /// - internal class ExsltNodeList - { - - #region Private Fields and Properties - - /// - /// The inner arraylist used by this class. - /// - internal ArrayList innerList = new ArrayList(); - - #endregion - - - #region Public Fields and Properties - - /// - /// Gets or sets the element at the specified index - /// - public XPathNavigator this[int index] { - get {return (XPathNavigator) this.innerList[index];} - set { this.innerList[index] = value; } - } - - /// - /// Gets the number of items in the list - /// - public int Count {get { return this.innerList.Count;}} - - #endregion - - - #region Constructors - - public ExsltNodeList(){} - - - /// - /// Initializes the ExsltNodeList with the specified XPathNodeIterator. All nodes - /// in the iterator are placed in the list. - /// - /// The iterator to load the nodelist from - public ExsltNodeList(XPathNodeIterator iterator): this(iterator, false){;} - - - - /// - /// Initializes the ExsltNodeList with the specified XPathNodeIterator. All nodes - /// in the iterator are placed in the list. - /// - /// The iterator to load the nodelist from - /// A flag that indicates whether duplicate nodes - /// should be loaded into the nodelist or only node with unique identity should - /// be added - public ExsltNodeList(XPathNodeIterator iterator, bool removeDuplicates){ - - XPathNodeIterator it = iterator.Clone(); - - while(it.MoveNext()){ - - if(removeDuplicates){ - if(this.Contains(it.Current)){ - continue; - } - } - - this.Add(it.Current.Clone()); - } - - } - - #endregion - - - #region Public Methods - - - /// - /// Returns an enumerator for the entire list. - /// - /// An enumerator for the entire list - public IEnumerator GetEnumerator(){ - return this.innerList.GetEnumerator(); - } - - /// - /// Adds an item to the list - /// - /// The item to add - /// The position into which the new element was inserted - public int Add( XPathNavigator nav){ - - return this.innerList.Add(nav); - } - - - /// - /// Removes all items from the list. - /// - public void Clear(){ - this.innerList.Clear(); - } - - /// - /// Determines whether the list contains a navigator positioned at the same - /// location as the specified XPathNavigator. This - /// method relies on the IsSamePositon() method of the XPathNavightor. - /// - /// The object to locate in the list. - /// true if the object is found in the list; otherwise, false. - public bool Contains(XPathNavigator value){ - - foreach(XPathNavigator nav in this.innerList){ - if(nav.IsSamePosition(value)){ - return true; - } - } - return false; - } - - /// - /// Determines whether the list contains a navigator whose Value property matches - /// the target value - /// - /// The value to locate in the list. - /// true if the value is found in the list; otherwise, false. - public bool ContainsValue(string value){ - - foreach(XPathNavigator nav in this.innerList){ - if(nav.Value.Equals(value)){ - return true; - } - } - return false; - } - - /// - /// Determines the index of a specific item in the list. - /// - /// The object to locate in the list - /// The index of value if found in the list; otherwise, -1. - public int IndexOf( object value ){ - - return this.innerList.IndexOf(value); - } - - /// - /// Inserts an item to the list at the specified position. - /// - /// The zero-based index at which value should be inserted. - /// The object to insert into the list - public void Insert(int index,XPathNavigator nav ){ - - this.innerList.Insert(index, nav); - } - - - /// - /// Removes the first occurrence of a specific object from the list. - /// - /// The object to remove from the list. - public void Remove(XPathNavigator nav){ - - for(int i = 0; i < this.Count; i++){ - if(nav.IsSamePosition((XPathNavigator) this.innerList[i])){ - this.innerList.RemoveAt(i); - return; - } - } - } - - /// - /// Removes the list item at the specified index. - /// - /// The zero-based index of the item to remove. - public void RemoveAt(int index){ - - this.innerList.RemoveAt(index); - } - - - #endregion - - } -} diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltRegularExpressions.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltRegularExpressions.cs deleted file mode 100644 index 7142f35843..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltRegularExpressions.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.XPath; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// This class implements the EXSLT functions in the http://exslt.org/regular-expressions namespace. - /// - public class ExsltRegularExpressions { - - /// - /// Implements the following function - /// boolean test(string, string) - /// - /// - /// - /// - public static bool test(string str, string regexp){ - - RegexOptions options = RegexOptions.ECMAScript; - - Regex regex = new Regex(regexp, options); - return regex.IsMatch(str); - - } - - /// - /// Implements the following function - /// boolean test(string, string, string) - /// - /// - /// - /// One of 'i', 'g' or 'm' - /// - /// Supports the string 'm' as a flag which indicates multiline mode - public static bool test(string str, string regexp, string flags){ - - RegexOptions options = RegexOptions.ECMAScript; - - if(flags.IndexOf("m")!= -1){ - options |= RegexOptions.Multiline; - } - - if(flags.IndexOf("i")!= -1){ - options |= RegexOptions.IgnoreCase; - } - - - Regex regex = new Regex(regexp, options); - return regex.IsMatch(str); - - } - - /// - /// Implements the following function - /// node-set tokenize(string, string) - /// - /// - /// - /// This function breaks the input string into a sequence of strings, - /// treating any substring that matches the regexp as a separator. - /// The separators themselves are not returned. - /// The matching strings are returned as a set of 'match' elements. - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static XPathNodeIterator tokenize(string str, string regexp){ - - RegexOptions options = RegexOptions.ECMAScript; - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - Regex regex = new Regex(regexp, options); - - foreach(string match in regex.Split(str)){ - - XmlElement elem = doc.CreateElement("match"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - - return doc.CreateNavigator().Select("//match"); - } - - /// - /// Implements the following function - /// node-set tokenize(string, string, string) - /// - /// - /// - /// - /// This function breaks the input string into a sequence of strings, - /// treating any substring that matches the regexp as a separator. - /// The separators themselves are not returned. - /// The matching strings are returned as a set of 'match' elements. - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static XPathNodeIterator tokenize(string str, string regexp, string flags){ - - RegexOptions options = RegexOptions.ECMAScript; - - if(flags.IndexOf("m")!= -1){ - options |= RegexOptions.Multiline; - } - - if(flags.IndexOf("i")!= -1){ - options |= RegexOptions.IgnoreCase; - } - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - Regex regex = new Regex(regexp, options); - - foreach(string match in regex.Split(str)){ - - XmlElement elem = doc.CreateElement("match"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - - return doc.CreateNavigator().Select("//match"); - } - - - /// - /// Implements the following function - /// node-set match(string, string) - /// - /// - /// - /// The matching strings are returned as a set of 'match' elements. - public static XPathNodeIterator match(string str, string regexp){ - - RegexOptions options = RegexOptions.ECMAScript; - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - Regex regex = new Regex(regexp, options); - - foreach(Group g in regex.Match(str).Groups){ - - XmlElement elem = doc.CreateElement("match"); - elem.InnerText = g.Value; - doc.DocumentElement.AppendChild(elem); - } - - - return doc.CreateNavigator().Select("//match"); - } - - /// - /// Implements the following function - /// node-set match(string, string, string) - /// - /// - /// - /// - /// The matching strings are returned as a set of 'match' elements. - public static XPathNodeIterator match(string str, string regexp, string flags){ - - RegexOptions options = RegexOptions.ECMAScript; - - if(flags.IndexOf("m")!= -1){ - options |= RegexOptions.Multiline; - } - - if(flags.IndexOf("i")!= -1){ - options |= RegexOptions.IgnoreCase; - } - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - Regex regex = new Regex(regexp, options); - - if(flags.IndexOf("g")!= -1){ - - foreach(Match m in regex.Matches(str)){ - - XmlElement elem = doc.CreateElement("match"); - elem.InnerText = m.Value; - doc.DocumentElement.AppendChild(elem); - - }//foreach(match m...) - - }else{ - - foreach(Group g in regex.Match(str).Groups){ - - XmlElement elem = doc.CreateElement("match"); - elem.InnerText = g.Value; - doc.DocumentElement.AppendChild(elem); - } - - } - - return doc.CreateNavigator().Select("//match"); - } - - /// - /// Implements the following function - /// string replace(string, string, string, string) - /// - /// - /// - /// - /// - /// - public static string replace(string input, string regexp, string flags, string replacement){ - - RegexOptions options = RegexOptions.ECMAScript; - - if(flags.IndexOf("i")!= -1){ - options |= RegexOptions.IgnoreCase; - } - - Regex regex = new Regex(regexp, options); - - if(flags.IndexOf("g")!= -1){ - return regex.Replace(input, replacement, 1); - }else{ - return regex.Replace(input, replacement); - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltSets.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltSets.cs deleted file mode 100644 index 17dca05f6f..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltSets.cs +++ /dev/null @@ -1,195 +0,0 @@ - using System; - using System.Xml.XPath; - using System.Xml; - - - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// This class implements the EXSLT functions in the http://exslt.org/sets namespace. - /// - public class ExsltSets { - - /// - /// Implements the following function - /// node-set subset(node-set, node-set) - /// - /// An input nodeset - /// Another input nodeset - /// True if all the nodes in the first nodeset are contained - /// in the second nodeset - /// THIS FUNCTION IS NOT PART OF EXSLT!!! - public static bool subset(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - ExsltNodeList nodelist1 = new ExsltNodeList(nodeset1, true); - ExsltNodeList nodelist2 = new ExsltNodeList(nodeset2, true); - - foreach(XPathNavigator nav in nodelist1){ - if(!nodelist2.Contains(nav)){ - return false; - } - } - - - return true; - } - - /// - /// Implements the following function - /// node-set difference(node-set, node-set) - /// - /// An input nodeset - /// Another input nodeset - /// The those nodes that are in the node set - /// passed as the first argument that are not in the node set - /// passed as the second argument. - public static XPathNodeIterator difference(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - ExsltNodeList nodelist1 = new ExsltNodeList(nodeset1, true); - ExsltNodeList nodelist2 = new ExsltNodeList(nodeset2); - - - for(int i = 0; i < nodelist1.Count; i++){ - - XPathNavigator nav = nodelist1[i]; - - if(nodelist2.Contains(nav)){ - nodelist1.RemoveAt(i); - i--; - } - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist1); - } - - /// - /// Implements the following function - /// node-set distinct(node-set) - /// - /// The input nodeset - /// Returns the nodes in the nodeset whose string value is - /// distinct - public static XPathNodeIterator distinct(XPathNodeIterator nodeset){ - - ExsltNodeList nodelist = new ExsltNodeList(); - - while(nodeset.MoveNext()){ - if(!nodelist.ContainsValue(nodeset.Current.Value)){ - nodelist.Add(nodeset.Current.Clone()); - } - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist); - - } - - /// - /// Implements - /// boolean hassamenode(node-set, node-set) - /// - /// - /// - /// true if both nodeset contain at least one of the same node - public static bool hassamenode(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - ExsltNodeList nodelist1 = new ExsltNodeList(nodeset1, true); - ExsltNodeList nodelist2 = new ExsltNodeList(nodeset2, true); - - foreach(XPathNavigator nav in nodelist1){ - if(nodelist2.Contains(nav)){ - return true; - } - } - - return false; - } - - /// - /// Implements the following function - /// node-set intersection(node-set, node-set) - /// - /// - /// - public static XPathNodeIterator intersection(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - ExsltNodeList nodelist1 = new ExsltNodeList(nodeset1, true); - ExsltNodeList nodelist2 = new ExsltNodeList(nodeset2); - - - for(int i = 0; i < nodelist1.Count; i++){ - - XPathNavigator nav = nodelist1[i]; - - if(!nodelist2.Contains(nav)){ - nodelist1.RemoveAt(i); - i--; - } - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist1); - - } - - /// - /// Implements the following function - /// node-set leading(node-set, node-set) - /// - /// - /// - /// returns the nodes in the node set passed as the - /// first argument that precede, in document order, the first node - /// in the node set passed as the second argument - public static XPathNodeIterator leading(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - XPathNavigator leader = null; - - if(nodeset2.MoveNext()){ - leader = nodeset2.Current; - }else{ - return nodeset1; - } - - ExsltNodeList nodelist1 = new ExsltNodeList(); - - while(nodeset1.MoveNext()){ - if(nodeset1.Current.ComparePosition(leader) == XmlNodeOrder.Before){ - nodelist1.Add(nodeset1.Current.Clone()); - } - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist1); - } - - /// - /// Implements the following function - /// node-set trailing(node-set, node-set) - /// - /// - /// - /// returns the nodes in the node set passed as the - /// first argument that follow, in document order, the first node - /// in the node set passed as the second argument - public static XPathNodeIterator trailing(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2){ - - XPathNavigator leader = null; - - if(nodeset2.MoveNext()){ - leader = nodeset2.Current; - }else{ - return nodeset1; - } - - ExsltNodeList nodelist1 = new ExsltNodeList(); - - while(nodeset1.MoveNext()){ - if(nodeset1.Current.ComparePosition(leader) == XmlNodeOrder.After){ - nodelist1.Add(nodeset1.Current.Clone()); - } - } - - return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist1); - } - } - - } diff --git a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltStrings.cs b/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltStrings.cs deleted file mode 100644 index 2ad8c515f6..0000000000 --- a/src/Umbraco.Web/umbraco/xslt/eXslt/ExsltStrings.cs +++ /dev/null @@ -1,250 +0,0 @@ -using System; -using System.Xml.XPath; -using System.Xml; -using System.Text; -using System.Text.RegularExpressions; - -namespace umbraco.presentation.xslt.Exslt -{ - /// - /// Implements the functions in the http://exslt.org/strings namespace - /// - public class ExsltStrings { - /// - /// Implements the following function - /// node-set tokenize(string, string) - /// - /// - /// - /// - /// This function breaks the input string into a sequence of strings, - /// treating any character in the list of delimiters as a separator. - /// The separators themselves are not returned. - /// The tokens are returned as a set of 'token' elements. - public static XPathNodeIterator tokenize(string str, string delimiters){ - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - foreach(string token in str.Split(delimiters.ToCharArray())){ - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = token; - doc.DocumentElement.AppendChild(elem); - } - - return doc.CreateNavigator().Select("//token"); - } - - - /// - /// Implements the following function - /// node-set tokenize(string) - /// - /// - /// - /// - /// This function breaks the input string into a sequence of strings, - /// using the whitespace characters as a delimiter. - /// The separators themselves are not returned. - /// The tokens are returned as a set of 'token' elements. - public static XPathNodeIterator tokenize(string str){ - - Regex regex = new Regex("\\s+"); - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - foreach(string token in regex.Split(str)){ - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = token; - doc.DocumentElement.AppendChild(elem); - } - - return doc.CreateNavigator().Select("//token"); - } - -/// -/// Implements the following function -/// string replace(string, string, string) -/// -/// -/// -/// -/// -/// This function has completely diffeerent semantics from the EXSLT function. -/// The description of the EXSLT function is confusing and furthermore no one has implemented -/// the described semantics which implies that others find the method problematic. Instead -/// this function is straightforward, it replaces all occurrences of oldValue with -/// newValue - public static string replace(string str, string oldValue, string newValue){ - - return str.Replace(oldValue, newValue); - } - -/// -/// Implements the following function -/// string padding(number) -/// -/// -/// - public static string padding(int number){ - - - string s = String.Empty; - - if(number < 0){ - return s; - }else{ - return s.PadLeft(number); - } - } - - /// - /// Implements the following function - /// string padding(number, string) - /// - /// - /// - public static string padding(int number, string s){ - - if(number < 0){ - return String.Empty; - }else{ - StringBuilder sb = new StringBuilder(s); - - while(sb.Length < number){ - sb.Append(s); - } - - if(sb.Length > number){ - return sb.Remove(number, sb.Length - number).ToString(); - }else{ - return sb.ToString(); - } - } - } - - - /// - /// Implements the following function - /// string uppercase(string) - /// - /// - /// - /// THIS FUNCTION IS NOT IN EXSLT!!! - public static string uppercase(string str){ - return str.ToUpper(); - } - - /// - /// Implements the following function - /// string lowercase(string) - /// - /// - /// - /// THIS FUNCTION IS NOT IN EXSLT!!! - public static string lowercase(string str){ - return str.ToLower(); - } - - /// - /// Implements the following function - /// node-set split(string) - /// - /// - /// This function breaks the input string into a sequence of strings, - /// using the space character as a delimiter. - /// The space character itself is never returned not even when there are - /// adjacent space characters. - /// - /// The tokens are returned as a set of 'token' elements - public static XPathNodeIterator split(string str){ - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - - foreach(string match in str.Split(new char[]{' '})){ - - if(!match.Equals(String.Empty)){ - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - } - - return doc.CreateNavigator().Select("//token"); - - } - - /// - /// Implements the following function - /// node-set split(string, string) - /// - /// - /// - /// This function breaks the input string into a sequence of strings, - /// using the space character as a delimiter. - /// The space character itself is never returned not even when there are - /// adjacent space characters. - /// - /// The tokens are returned as a set of 'token' elements - public static XPathNodeIterator split(string str, string delimiter){ - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - - - if(delimiter.Equals(String.Empty)){ - foreach(char match in str){ - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match.ToString(); - doc.DocumentElement.AppendChild(elem); - } - }else{ - //since there is no String.Split(string) method we use the Regex class - //and escape special characters. - //. $ ^ { [ ( | ) * + ? \ - delimiter = delimiter.Replace("\\","\\\\").Replace("$", "\\$").Replace("^", "\\^"); - delimiter = delimiter.Replace("{", "\\{").Replace("[", "\\[").Replace("(", "\\("); - delimiter = delimiter.Replace("*","\\*").Replace(")", "\\)").Replace("|", "\\|"); - delimiter = delimiter.Replace("+", @"\+").Replace("?", "\\?").Replace(".", "\\."); - - Regex regex = new Regex(delimiter); - - - foreach(string match in regex.Split(str)){ - - if((!match.Equals(String.Empty)) && (!match.Equals(delimiter))){ - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - } - } - - return doc.CreateNavigator().Select("//token"); - } - - /// - /// Implements the following function - /// string concat(node-set) - /// - /// - /// - public static string concat(XPathNodeIterator nodeset){ - - StringBuilder sb = new StringBuilder(); - - while(nodeset.MoveNext()){ - sb.Append(nodeset.Current.Value); - } - - return sb.ToString(); - } - } -} -