Merge branch '1.8.x' into 1.x

This commit is contained in:
Sebastien Ros
2014-06-12 10:22:55 -07:00
10 changed files with 67 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Microsoft.ApplicationServer.Caching;
using Orchard.Azure.Services.Environment.Configuration;
using Orchard.Caching;
@@ -122,12 +123,27 @@ namespace Orchard.Azure.Services.Caching.Output {
return function.Invoke();
}
catch (DataCacheException) {
DataCacheFactory cacheFactory;
Logger.Debug("Retrying cache operation");
if (_dataCacheFactories.TryRemove(CacheConfiguration, out cacheFactory)) {
cacheFactory.Dispose();
// applying http://blogs.msdn.com/b/cie/archive/2014/04/29/cache-retry-fails-what-next.aspx
try {
DataCacheFactory cacheFactory;
Logger.Debug("Retrying cache operation");
if (_dataCacheFactories.TryRemove(CacheConfiguration, out cacheFactory)) {
lock (_dataCacheFactories) {
cacheFactory.Dispose();
// Clear DataCacheFactory._connectionPool
var coreAssembly = typeof(DataCacheItem).Assembly;
var simpleSendReceiveModulePoolType = coreAssembly.
GetType("Microsoft.ApplicationServer.Caching.SimpleSendReceiveModulePool", throwOnError: true);
var connectionPoolField = typeof(DataCacheFactory).GetField("_connectionPool", BindingFlags.Static | BindingFlags.NonPublic);
connectionPoolField.SetValue(null, Activator.CreateInstance(simpleSendReceiveModulePoolType));
}
}
return Retry(function, times--);
}
catch (Exception e) {
Logger.Error(e, "An unexpected error occured while releasing a DataCacheFactory.");
return default(T);
}
return Retry(function, times--);
}
}

View File

@@ -7,6 +7,7 @@ using Orchard.ContentManagement.Handlers;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Security;
using System.Configuration;
namespace Orchard.Email.Handlers {
[UsedImplicitly]
@@ -47,6 +48,8 @@ namespace Orchard.Email.Handlers {
var encryptedPassword = String.IsNullOrWhiteSpace(value) ? String.Empty : Convert.ToBase64String(_encryptionService.Encode(Encoding.UTF8.GetBytes(value)));
part.Store(x => x.Password, encryptedPassword);
});
part.AddressPlaceholderField.Loader(value => (string)((dynamic)ConfigurationManager.GetSection("system.net/mailSettings/smtp")).From);
}
public Localizer T { get; set; }

View File

@@ -19,6 +19,10 @@ namespace Orchard.Email.Models {
set { this.Store(x => x.Address, value); }
}
private readonly LazyField<string> _addressPlaceholder = new LazyField<string>();
internal LazyField<string> AddressPlaceholderField { get { return _addressPlaceholder; } }
public string AddressPlaceholder { get { return _addressPlaceholder.Value; } }
public string Host {
get { return this.Retrieve(x => x.Host); }
set { this.Store(x => x.Host, value); }

View File

@@ -1,17 +1,14 @@
@using System.Configuration
@using System.Net.Mail
@using System.Net.Mail
@model Orchard.Email.Models.SmtpSettingsPart
@{
var smtpClient = new SmtpClient();
dynamic section = ConfigurationManager.GetSection("system.net/mailSettings/smtp");
}
<fieldset>
<legend>@T("Email")</legend>
<div>
<label for="@Html.FieldIdFor(m => m.Address)">@T("Sender email address")</label>
@Html.TextBoxFor(m => m.Address, new { @class = "text medium", placeholder = (string) section.From })
@Html.TextBoxFor(m => m.Address, new { @class = "text medium", placeholder = Model.AddressPlaceholder })
@Html.ValidationMessage("Address", "*")
<span class="hint">@T("The default email address to use as a sender.")</span>
</div>

View File

@@ -1,5 +1,5 @@
table.media-library-picker tr td:nth-child(1) {
background: url(images/move.gif) no-repeat 12px 14px;
background: url(images/move.gif) no-repeat 12px 14px;
cursor: move;
}
@@ -34,8 +34,7 @@
.overlay {
position: absolute;
top: 70px;
bottom: 32px;
bottom: 20px;
left: 0;
width: 100%;
background-color: black;
@@ -50,16 +49,38 @@
font-size: 12px;
}
.media-thumbnail {
width: 120px;
height: 120px;
}
.media-thumbnail-document {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAA5CAIAAAD/bz8YAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAASZJREFUaEPt2c8NgjAUx3F3cgFO3JmDEZiAGZiARdiCMxNwgRD8RaryR2j72lfBvO+NGl4/QiQk3saTJSBdpwcVRXF3qCxLNYjaAuSoeVdVlZpo3wfU932SJGqkc+RLxQVCNNN3UBRFbduqDwza+zIEEy8I2ZrYQcjK5B+Ec+u6juN4OpwyN7GAcG7TNDQTFwiLNBMjCBFMvCBka2IHIStTCBAyNwUCIUNTOBDamrbvBf5BVm03+jEIrW6cHxAiv9yladp1nZriEYRoptVePkHmHewloGf/BRqGIcuyad2l+a/JCTRfd2lv5vVBp7tlHAlI13+B5Dn06jIgeQ69EpCADhKQruuDQnYdEPL154tVeZ6r7Z8tQCiwaaVBa9DPE5AuAR03jg+0DsulZjOdQAAAAABJRU5ErkJggg==');
background-repeat: no-repeat;
background-position: center;
border: 1px solid #e0e0e0;
width: 120px;
height: 120px;
}
.media-thumbnail-o-embed {
width: 120px;
height: 120px;
overflow:hidden;
}
}
.media-thumbnail-video {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAA8CAIAAABQAItJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAUtJREFUaEPt2rGNg0AQheHriZCEiJw6KIEKqIEK6IAKqICYlApIQIgb2WObQwu71hhrd+59KWM0fzJywM+qCGJ8pT1mGIY0TSOPxXHc9z2vu7GPaZqGf+G9uq556Yc/MV3X8WAg2rbl1W9eMcuyFEXBU4HI83yaJg7YxszznGUZT0VRWZb8YKOqKn58Y5yRcHn/diZJknEc+cFRzG7oyWVGQrgDYk5nJBCDGBJkDHn3LH6EcIfDGKsvxFghxgQxFlfF6DkAR4u6zEgId0DM6YwEYhBDgowh1rNIjDMSLu+/5L+ZDxDjq38Zo+cA7IaeXGYkhDsg5nRGAjGIIUHGkHfP4kcIdziMsfpCjBViTBBjcVWMngNwtKjLjIRwB8SczkggBjEkyBhiPYvEOCPh8n6n06zqQyCi5xOtOz0fz93p+awxaIjxlaKYdf0FZhXqxLZlZI0AAAAASUVORK5CYII=');
background-repeat: no-repeat;
background-position: center;
border: 1px solid #e0e0e0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.media-thumbnail-cloud-video {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAA8CAIAAABQAItJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAUtJREFUaEPt2rGNg0AQheHriZCEiJw6KIEKqIEK6IAKqICYlApIQIgb2WObQwu71hhrd+59KWM0fzJywM+qCGJ8pT1mGIY0TSOPxXHc9z2vu7GPaZqGf+G9uq556Yc/MV3X8WAg2rbl1W9eMcuyFEXBU4HI83yaJg7YxszznGUZT0VRWZb8YKOqKn58Y5yRcHn/diZJknEc+cFRzG7oyWVGQrgDYk5nJBCDGBJkDHn3LH6EcIfDGKsvxFghxgQxFlfF6DkAR4u6zEgId0DM6YwEYhBDgowh1rNIjDMSLu+/5L+ZDxDjq38Zo+cA7IaeXGYkhDsg5nRGAjGIIUHGkHfP4kcIdziMsfpCjBViTBBjcVWMngNwtKjLjIRwB8SczkggBjEkyBhiPYvEOCPh8n6n06zqQyCi5xOtOz0fz93p+awxaIjxlaKYdf0FZhXqxLZlZI0AAAAASUVORK5CYII=');
background-repeat: no-repeat;
background-position: center;
border: 1px solid #e0e0e0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

View File

@@ -2,7 +2,7 @@
$(function () {
$(".select-all").click(function () {
var $checkbox = $(this);
var $allCheckboxes = $checkbox.parent().find(":checkbox");
var $allCheckboxes = $checkbox.closest("ol").find(":checkbox");
if ($checkbox.is(':checked')) {
$allCheckboxes.prop("checked", true);
}

View File

@@ -48,8 +48,9 @@ namespace Orchard.Roles.Activities {
if (UserIsInRole(activityContext)) {
yield return T("Yes");
}
yield return T("No");
else {
yield return T("No");
}
}
private bool UserIsInRole(ActivityContext context) {

View File

@@ -9,8 +9,9 @@
Script.Include("codemirror/mode/css/css.js");
Script.Include("codemirror/mode/htmlmixed/htmlmixed.js");
Script.Include("codemirror/mode/htmlembedded/htmlembedded.js");
Script.Include("template-editor.js", "template-editor.min.js");
Script.Include("template-editor.js");
}
<fieldset>
<div>
@Html.LabelFor(m => m.Name, T("Name"))

View File

@@ -9,7 +9,7 @@
Script.Include("codemirror/mode/css/css.js");
Script.Include("codemirror/mode/htmlmixed/htmlmixed.js");
Script.Include("codemirror/mode/htmlembedded/htmlembedded.js");
Script.Include("template-editor.js", "template-editor.min.js");
Script.Include("template-editor.js");
}
<fieldset>
<div>

View File

@@ -40,7 +40,7 @@ namespace Orchard.Workflows.Tokens {
contentItemId = workflowContext.Content.Id;
}
var url = "~/Orchard.Workflows/Signal/Trigger?nonce=" + HttpUtility.UrlEncode(_signalService.Value.CreateNonce(contentItemId, token));
var url = "~/Workflows/Signal/Trigger?nonce=" + HttpUtility.UrlEncode(_signalService.Value.CreateNonce(contentItemId, token));
return new UrlHelper(_workContextAccessor.GetContext().HttpContext.Request.RequestContext).MakeAbsolute(url);
});
}