From 8a0f68bdcc0cce2c9b30fb643f59c364fa345e01 Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 6 Dec 2010 11:15:43 -0800
Subject: [PATCH 1/6] Fixing the admin menu to not have the "New" group
collapse if there is only one item in there
--HG--
branch : dev
---
src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml b/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml
index 12ddff3ab..ef3d5abf2 100644
--- a/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml
+++ b/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml
@@ -31,7 +31,7 @@
var firstLevelTag = Tag(firstLevelMenuItem, "li");
@firstLevelTag.StartElement
@sectionHeaderMarkup
- if (secondLevelMenuItems.Count() > 1) {
+ if (secondLevelMenuItems.Count() > 1 || !firstLevelMenuItem.LinkToFirstChild) {
@foreach(var secondLevelMenuItem in secondLevelMenuItems) {
From c5fdb792b6445500c76963f42ab367cdf5abc0a4 Mon Sep 17 00:00:00 2001
From: Dave Reed
Date: Mon, 6 Dec 2010 11:27:54 -0800
Subject: [PATCH 2/6] #16919: Setting customErrors to 'RemoteOnly'
--HG--
branch : dev
---
src/Orchard.Specs/Hosting/Orchard.Web/Web.config | 2 +-
src/Orchard.Web/Web.config | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config
index 789634633..a002e025e 100644
--- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config
+++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config
@@ -86,7 +86,7 @@
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
-
+
diff --git a/src/Orchard.Web/Web.config b/src/Orchard.Web/Web.config
index 9b51854ad..b64f7389f 100644
--- a/src/Orchard.Web/Web.config
+++ b/src/Orchard.Web/Web.config
@@ -96,7 +96,7 @@
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
-
+
From b8c23d0f82c3a2be7f8e830cf2850ff585536d0a Mon Sep 17 00:00:00 2001
From: Andre Rodrigues
Date: Mon, 6 Dec 2010 11:43:00 -0800
Subject: [PATCH 3/6] #1694: Moving module / theme install from gallery to
packaging services and changing themes / module modules dependencies.
--HG--
branch : dev
---
.../Controllers/AdminController.cs | 5 +-
.../Orchard.Modules/Views/Admin/Index.cshtml | 2 +-
.../Controllers/GalleryController.cs | 83 +-------------
.../PackagingServicesController.cs | 108 ++++++++++++++++++
.../Orchard.Packaging.csproj | 5 +-
.../AddModule.cshtml | 2 +-
.../AddTheme.cshtml | 2 +-
.../Controllers/AdminController.cs | 3 +-
.../Orchard.Themes/Views/Admin/Index.cshtml | 4 +-
9 files changed, 122 insertions(+), 92 deletions(-)
create mode 100644 src/Orchard.Web/Modules/Orchard.Packaging/Controllers/PackagingServicesController.cs
rename src/Orchard.Web/Modules/Orchard.Packaging/Views/{Gallery => PackagingServices}/AddModule.cshtml (73%)
rename src/Orchard.Web/Modules/Orchard.Packaging/Views/{Gallery => PackagingServices}/AddTheme.cshtml (73%)
diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs
index 812c5cecf..fa8031bff 100644
--- a/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs
+++ b/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs
@@ -50,8 +50,9 @@ namespace Orchard.Modules.Controllers {
var modules = _extensionManager.AvailableExtensions().Where(x => DefaultExtensionTypes.IsModule(x.ExtensionType));
return View(new ModulesIndexViewModel {
- Modules = modules,
- InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "Gallery") != null });
+ Modules = modules,
+ InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null
+ });
}
public ActionResult Features() {
diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Index.cshtml
index 54645d17f..fbfe4d9d9 100644
--- a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Index.cshtml
+++ b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Index.cshtml
@@ -10,7 +10,7 @@
@Html.TitleForPage(T("Install a Module").ToString())
- using (Html.BeginFormAntiForgeryPost(Url.Action("AddModule", new { area = "Orchard.Gallery" }), FormMethod.Post, new { enctype = "multipart/form-data" })) {
+ using (Html.BeginFormAntiForgeryPost(Url.Action("AddModule", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request["returnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data" })) {
Html.ValidationSummary();
if (Model.InstallThemes) {
- @Html.ActionLink(T("Install a new Theme").ToString(), "AddTheme", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })
+ @Html.ActionLink(T("Install a new Theme").ToString(), "AddTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })
}
}
@@ -57,7 +57,7 @@
}
@if (Model.InstallThemes) {
- using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveTheme", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl, retryUrl = HttpContext.Current.Request.RawUrl, themeId = theme.Id }), FormMethod.Post, new { @class = "inline link" })) {
+ using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl, retryUrl = HttpContext.Current.Request.RawUrl, themeId = theme.Id }), FormMethod.Post, new { @class = "inline link" })) {
}
}
From 374020b3ed5f6ae3e1db533745ddac5f88d9c875 Mon Sep 17 00:00:00 2001
From: Dave Reed
Date: Mon, 6 Dec 2010 12:26:03 -0800
Subject: [PATCH 4/6] #16944: Fix null reference error when localizing a
content item and not picking a culture.
--HG--
branch : dev
---
.../Orchard.Localization/Controllers/AdminController.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/Orchard.Web/Modules/Orchard.Localization/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Localization/Controllers/AdminController.cs
index d62b3f2df..06cbe4f94 100644
--- a/src/Orchard.Web/Modules/Orchard.Localization/Controllers/AdminController.cs
+++ b/src/Orchard.Web/Modules/Orchard.Localization/Controllers/AdminController.cs
@@ -119,7 +119,10 @@ namespace Orchard.Localization.Controllers {
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
model.SiteCultures = _cultureManager.ListCultures().Where(s => s != _localizationService.GetContentCulture(contentItem) && s != _cultureManager.GetSiteCulture());
- contentItem.As().Culture.Culture = null;
+ var culture = contentItem.As().Culture;
+ if (culture != null) {
+ culture.Culture = null;
+ }
model.Content = _contentManager.BuildEditor(contentItem);
return View(model);
}
From 948f0a26d0fc83df8c44acbd0eb6d91191c25c4b Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 6 Dec 2010 12:49:57 -0800
Subject: [PATCH 5/6] Fixing the massively tall TinyMCE editor window in Chrome
when the editor has some content on load.
--HG--
branch : dev
---
.../plugins/autoresize/editor_plugin.js | 2 +-
.../plugins/autoresize/editor_plugin_src.js | 221 +++++++++---------
2 files changed, 114 insertions(+), 109 deletions(-)
diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin.js b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin.js
index 1676b154a..08bd75ffe 100644
--- a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin.js
+++ b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin.js
@@ -1 +1 @@
-(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a){var b=true,d=this;if(a.getParam("fullscreen_is_enabled"))return;function c(){var i=a.getDoc(),h=i.body,g=i.documentElement,f=tinymce.DOM,e=d.autoresize_min_height,c;if((tinymce.isIE?h.scrollWidth:g.offsetWidth)==0)return;c=tinymce.isIE?h.scrollHeight:g.offsetHeight;if(c>d.autoresize_min_height)e=c;f.setStyle(f.get(a.id+"_ifr"),"height",e+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(b)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onChange.add(c);a.onSetContent.add(c);a.onPaste.add(c);a.onKeyUp.add(c);a.onPostRender.add(c);if(a.getParam("autoresize_on_init",b)){a.onInit.add(function(a){a.setProgressState(b);d.throbbing=b;a.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(a){c();setTimeout(function(){c();a.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",c)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})()
\ No newline at end of file
diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin_src.js b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin_src.js
index c260b7a24..abe5835ba 100644
--- a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin_src.js
+++ b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/autoresize/editor_plugin_src.js
@@ -8,112 +8,117 @@
* Contributing: http://tinymce.moxiecode.com/contributing
*/
-(function() {
- /**
- * Auto Resize
- *
- * This plugin automatically resizes the content area to fit its content height.
- * It will retain a minimum height, which is the height of the content area when
- * it's initialized.
- */
- tinymce.create('tinymce.plugins.AutoResizePlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
- init : function(ed, url) {
- var t = this;
-
- if (ed.getParam('fullscreen_is_enabled'))
- return;
-
- /**
- * This method gets executed each time the editor needs to resize.
- */
- function resize() {
- var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
-
- // Get height differently depending on the browser used
- myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
-
- // Don't make it smaller than the minimum height
- if (myHeight > t.autoresize_min_height)
- resizeHeight = myHeight;
-
- // Resize content element
- DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
-
- // if we're throbbing, we'll re-throb to match the new size
- if (t.throbbing) {
- ed.setProgressState(false);
- ed.setProgressState(true);
- }
- };
-
- t.editor = ed;
-
- // Define minimum height
- t.autoresize_min_height = ed.getElement().offsetHeight;
-
- // Add appropriate listeners for resizing content area
- ed.onChange.add(resize);
- ed.onSetContent.add(resize);
- ed.onPaste.add(resize);
- ed.onKeyUp.add(resize);
- ed.onPostRender.add(resize);
-
- if (ed.getParam('autoresize_on_init', true)) {
- // Things to do when the editor is ready
- ed.onInit.add(function(ed, l) {
- // Show throbber until content area is resized properly
- ed.setProgressState(true);
- t.throbbing = true;
-
- // Hide scrollbars
- ed.getBody().style.overflowY = "hidden";
- });
-
- ed.onLoadContent.add(function(ed, l) {
- resize();
-
- // Because the content area resizes when its content CSS loads,
- // and we can't easily add a listener to its onload event,
- // we'll just trigger a resize after a short loading period
- setTimeout(function() {
- resize();
-
- // Disable throbber
- ed.setProgressState(false);
- t.throbbing = false;
- }, 1250);
- });
- }
-
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
- ed.addCommand('mceAutoResize', resize);
- },
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Auto Resize',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
+(function () {
+ /**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+ tinymce.create('tinymce.plugins.AutoResizePlugin', {
+ /**
+ * Initializes the plugin, this will be executed after the plugin has been created.
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
+ * of the editor instance to intercept that event.
+ *
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+ * @param {string} url Absolute URL to where the plugin is located.
+ */
+ init: function (ed, url) {
+ var t = this;
+
+ if (ed.getParam('fullscreen_is_enabled'))
+ return;
+
+ /**
+ * This method gets executed each time the editor needs to resize.
+ */
+ function resize() {
+ var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
+
+ // Don't resize if we have no width - a fix for http://orchard.codeplex.com/workitem/16853
+ if ((tinymce.isIE ? b.scrollWidth : de.offsetWidth) == 0) {
+ return;
+ }
+
+ // Get height differently depending on the browser used
+ myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
+
+ // Don't make it smaller than the minimum height
+ if (myHeight > t.autoresize_min_height)
+ resizeHeight = myHeight;
+
+ // Resize content element
+ DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
+
+ // if we're throbbing, we'll re-throb to match the new size
+ if (t.throbbing) {
+ ed.setProgressState(false);
+ ed.setProgressState(true);
+ }
+ };
+
+ t.editor = ed;
+
+ // Define minimum height
+ t.autoresize_min_height = ed.getElement().offsetHeight;
+
+ // Add appropriate listeners for resizing content area
+ ed.onChange.add(resize);
+ ed.onSetContent.add(resize);
+ ed.onPaste.add(resize);
+ ed.onKeyUp.add(resize);
+ ed.onPostRender.add(resize);
+
+ if (ed.getParam('autoresize_on_init', true)) {
+ // Things to do when the editor is ready
+ ed.onInit.add(function (ed, l) {
+ // Show throbber until content area is resized properly
+ ed.setProgressState(true);
+ t.throbbing = true;
+
+ // Hide scrollbars
+ ed.getBody().style.overflowY = "hidden";
+ });
+
+ ed.onLoadContent.add(function (ed, l) {
+ resize();
+
+ // Because the content area resizes when its content CSS loads,
+ // and we can't easily add a listener to its onload event,
+ // we'll just trigger a resize after a short loading period
+ setTimeout(function () {
+ resize();
+
+ // Disable throbber
+ ed.setProgressState(false);
+ t.throbbing = false;
+ }, 1250);
+ });
+ }
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+ ed.addCommand('mceAutoResize', resize);
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ getInfo: function () {
+ return {
+ longname: 'Auto Resize',
+ author: 'Moxiecode Systems AB',
+ authorurl: 'http://tinymce.moxiecode.com',
+ infourl: 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
+ version: tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
})();
\ No newline at end of file
From 4741f33e28343f6811b3b77cd06c2a2619f65ac9 Mon Sep 17 00:00:00 2001
From: Dave Reed
Date: Mon, 6 Dec 2010 13:37:11 -0800
Subject: [PATCH 6/6] #16911: Prevent YSOD when a gallery feed doesn't respond
or responds unexpectedly.
--HG--
branch : dev
---
.../Controllers/GalleryController.cs | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs
index b2fe8d8bd..57654a990 100644
--- a/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs
+++ b/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs
@@ -1,10 +1,12 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Web.Hosting;
using System.Web.Mvc;
using System.Xml.Linq;
using Orchard.Environment.Extensions;
using Orchard.Localization;
+using Orchard.Logging;
using Orchard.Packaging.Services;
using Orchard.Packaging.ViewModels;
using Orchard.Themes;
@@ -30,9 +32,11 @@ namespace Orchard.Packaging.Controllers {
_notifier = notifier;
T = NullLocalizer.Instance;
+ Logger = NullLogger.Instance;
}
public Localizer T { get; set; }
+ public ILogger Logger { get; set; }
public ActionResult Sources() {
return View(new PackagingSourcesViewModel {
@@ -99,8 +103,20 @@ namespace Orchard.Packaging.Controllers {
: _packagingSourceManager.GetSources()
;
+ IEnumerable extensions = null;
+ foreach (var source in sources) {
+ try {
+ var sourceExtensions = _packagingSourceManager.GetModuleList(source).ToArray();
+ extensions = extensions == null ? sourceExtensions : extensions.Concat(sourceExtensions);
+ }
+ catch (Exception ex) {
+ Logger.Error(ex, "Error loading extensions from gallery source '{0}'. {1}.", source.FeedTitle, ex.Message);
+ _notifier.Error(T("Error loading extensions from gallery source '{0}'. {1}.", source.FeedTitle, ex.Message));
+ }
+ }
+
return View("Modules", new PackagingExtensionsViewModel {
- Extensions = sources.SelectMany(source => _packagingSourceManager.GetModuleList(source)),
+ Extensions = extensions ?? new PackagingEntry[] {},
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
SelectedSource = selectedSource
});