Compare commits
39 Commits
release-8.0.2
...
v7/7.14
| Author | SHA1 | Date | |
|---|---|---|---|
| 92453c4652 | |||
| 5ddba3e64e | |||
| c72a5c07fe | |||
| 409ae99bf7 | |||
| 969a9c1193 | |||
| 3643e170c5 | |||
| afc872de5a | |||
| 56aef39014 | |||
| ae07b2b299 | |||
| b99cf238e0 | |||
| 68457b7eaf | |||
| 24c74676f6 | |||
| ac1ee2fe0c | |||
| 4f30dd32f1 | |||
| 8f17d6fcd2 | |||
| 1300389ce6 | |||
| ea8d8ba771 | |||
| 1eb6ae10c9 | |||
| 5d3e1fb95f | |||
| 19aae9ffdc | |||
| 218995f9e0 | |||
| 0d167c4f2d | |||
| d44e0d8664 | |||
| 94a4e34e0c | |||
| 7d42583177 | |||
| 77a8697ca7 | |||
| 7462686778 | |||
| 44d5ce4a2e | |||
| 34888f31e6 | |||
| 0994aac656 | |||
| 0e0d38be30 | |||
| 91735e7e3f | |||
| 0d4b3e4173 | |||
| a0f15bba44 | |||
| 007cdeb9ab | |||
| 5716353518 | |||
| 87340d6c2c | |||
| fc742bcf18 | |||
| 4eb4cd8962 |
@@ -1,4 +1,4 @@
|
||||
_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/temp8/.github/V8_GETTING_STARTED.md) to go to the v8 branch_
|
||||
_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/dev-v8/.github/V8_GETTING_STARTED.md) to go to the v8 branch_
|
||||
# Contributing to Umbraco CMS
|
||||
|
||||
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
@ngdoc directive
|
||||
@name umbraco.directives.directive:umbCheckbox
|
||||
@restrict E
|
||||
@scope
|
||||
|
||||
@description
|
||||
<b>Added in Umbraco version 7.14.0</b> Use this directive to render an umbraco checkbox.
|
||||
|
||||
<h3>Markup example</h3>
|
||||
<pre>
|
||||
<div ng-controller="My.Controller as vm">
|
||||
|
||||
<umb-checkbox
|
||||
name="checkboxlist"
|
||||
value="{{key}}"
|
||||
model="true"
|
||||
text="{{text}}">
|
||||
</umb-checkbox>
|
||||
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@param {boolean} model Set to <code>true</code> or <code>false</code> to set the checkbox to checked or unchecked.
|
||||
@param {string} value Set the value of the checkbox.
|
||||
@param {string} name Set the name of the checkbox.
|
||||
@param {string} text Set the text for the checkbox label.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function CheckboxDirective() {
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/forms/umb-checkbox.html',
|
||||
scope: {
|
||||
model: "=",
|
||||
value: "@",
|
||||
name: "@",
|
||||
text: "@",
|
||||
required: "="
|
||||
}
|
||||
};
|
||||
|
||||
return directive;
|
||||
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbCheckbox', CheckboxDirective);
|
||||
|
||||
})();
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
@ngdoc directive
|
||||
@name umbraco.directives.directive:umbRadiobutton
|
||||
@restrict E
|
||||
@scope
|
||||
|
||||
@description
|
||||
<b>Added in Umbraco version 7.14.0</b> Use this directive to render an umbraco radio button.
|
||||
|
||||
<h3>Markup example</h3>
|
||||
<pre>
|
||||
<div ng-controller="My.Controller as vm">
|
||||
|
||||
<umb-radiobutton
|
||||
name="checkboxlist"
|
||||
value="{{key}}"
|
||||
model="true"
|
||||
text="{{text}}">
|
||||
</umb-radiobutton>
|
||||
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@param {boolean} model Set to <code>true</code> or <code>false</code> to set the radiobutton to checked or unchecked.
|
||||
@param {string} value Set the value of the radiobutton.
|
||||
@param {string} name Set the name of the radiobutton.
|
||||
@param {string} text Set the text for the radiobutton label.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function RadiobuttonDirective() {
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/forms/umb-radiobutton.html',
|
||||
scope: {
|
||||
model: "=",
|
||||
value: "@",
|
||||
name: "@",
|
||||
text: "@"
|
||||
}
|
||||
};
|
||||
|
||||
return directive;
|
||||
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbRadiobutton', RadiobuttonDirective);
|
||||
|
||||
})();
|
||||
+1
-1
@@ -232,7 +232,7 @@ angular.module("umbraco.directives")
|
||||
var throttledResizing = _.throttle(function(){
|
||||
resizeImageToScale(scope.dimensions.scale.current);
|
||||
calculateCropBox();
|
||||
}, 100);
|
||||
}, 16);
|
||||
|
||||
|
||||
//happens when we change the scale
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
@import "components/umb-confirm-action.less";
|
||||
@import "components/umb-keyboard-shortcuts-overview.less";
|
||||
@import "components/umb-checkbox-list.less";
|
||||
@import "components/umb-form-check.less";
|
||||
@import "components/umb-locked-field.less";
|
||||
@import "components/umb-tabs.less";
|
||||
@import "components/umb-load-indicator.less";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
@checkboxWidth: 15px;
|
||||
@checkboxHeight: 15px;
|
||||
|
||||
.umb-checkbox-list {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
@checkboxWidth: 15px;
|
||||
@checkboxHeight: 15px;
|
||||
|
||||
.umb-form-check {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
&__text{
|
||||
margin: 0 0 0 26px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
&__input{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
|
||||
&:checked ~ .umb-form-check__state .umb-form-check__check{
|
||||
border-color: @green;
|
||||
}
|
||||
|
||||
&:focus:checked ~ .umb-form-check .umb-form-check__check,
|
||||
&:focus ~ .umb-form-check__state .umb-form-check__check{
|
||||
border-color: @gray-5;
|
||||
}
|
||||
|
||||
&:checked ~ .umb-form-check__state{
|
||||
.umb-form-check__check{
|
||||
// This only happens if the state has a radiobutton modifier
|
||||
.umb-form-check--radiobutton &{
|
||||
&:before{
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
// This only happens if state has the checkbox modifier
|
||||
.umb-form-check--checkbox &{
|
||||
&:before{
|
||||
width: @checkboxWidth;
|
||||
height: @checkboxHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This only happens if state has the checkbox modifier
|
||||
.umb-form-check--checkbox &{
|
||||
.umb-form-check__icon{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__state{
|
||||
height: 17px;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&__check{
|
||||
position: relative;
|
||||
border: 1px solid @gray-7;
|
||||
width: @checkboxWidth;
|
||||
height: @checkboxHeight;
|
||||
|
||||
&:before{
|
||||
content: "";
|
||||
background: @green;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// This only happens if state has the radiobutton modifier
|
||||
.umb-form-check--radiobutton &{
|
||||
border-radius: 100%;
|
||||
|
||||
&:before{
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 100%;
|
||||
opacity: 0;
|
||||
transform: scale(0);
|
||||
transition: .15s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
// This only happens if state has the checkbox modifier
|
||||
.umb-form-check--checkbox &{
|
||||
&:before{
|
||||
width: 0;
|
||||
height: 0;
|
||||
transition: .05s ease-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__icon{
|
||||
color: @white;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
opacity: 0;
|
||||
transition: .2s ease-out;
|
||||
|
||||
&:before{
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,16 @@
|
||||
|
||||
&-push {
|
||||
float:right;
|
||||
}
|
||||
}
|
||||
|
||||
&--list{
|
||||
float: left;
|
||||
}
|
||||
|
||||
&__item{
|
||||
line-height: 1;
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.umb-editor-tiny {
|
||||
@@ -246,7 +255,7 @@ div.umb-codeeditor .umb-btn-toolbar {
|
||||
margin: 24px 0 0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
&-wrap{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<div ng-controller="Umbraco.Overlays.UserController">
|
||||
|
||||
<div class="umb-control-group" ng-if="!showPasswordFields">
|
||||
|
||||
<h5><localize key="user_yourProfile" /></h5>
|
||||
@@ -78,7 +77,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="umb-control-group" ng-if="!showPasswordFields">
|
||||
<div class="umb-control-group" ng-if="!showPasswordFields && history.length">
|
||||
<h5><localize key="user_yourHistory" /></h5>
|
||||
<ul class="umb-tree">
|
||||
<li ng-repeat="item in history | orderBy:'time':true">
|
||||
@@ -126,7 +125,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-control-group">
|
||||
<div class="umb-control-group" ng-if="tab.length">
|
||||
<div ng-repeat="tab in dashboard">
|
||||
<div ng-repeat="property in tab.properties">
|
||||
<div>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<label class="checkbox umb-form-check umb-form-check--checkbox">
|
||||
<input type="checkbox" name="{{name}}"
|
||||
value="{{value}}"
|
||||
ng-model="model"
|
||||
class="umb-form-check__input"
|
||||
ng-required="required" />
|
||||
|
||||
<div class="umb-form-check__state umb-form-check__state" aria-hidden="true">
|
||||
<div class="umb-form-check__check">
|
||||
<i class="umb-form-check__icon icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
<span class="umb-form-check__text">{{text}}</span>
|
||||
</label>
|
||||
@@ -0,0 +1,11 @@
|
||||
<label class="radio umb-form-check umb-form-check--radiobutton">
|
||||
<input type="radio" name="radiobuttons-{{name}}"
|
||||
value="{{value}}"
|
||||
ng-model="model"
|
||||
class="umb-form-check__input" />
|
||||
|
||||
<div class="umb-form-check__state umb-form-check__state" aria-hidden="true">
|
||||
<div class="umb-form-check__check"></div>
|
||||
</div>
|
||||
<span class="umb-form-check__text">{{text}}</span>
|
||||
</label>
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="crop-slider">
|
||||
<div class="crop-slider" ng-if="loaded">
|
||||
<i class="icon-picture"></i>
|
||||
<input
|
||||
type="range"
|
||||
@@ -16,4 +16,4 @@
|
||||
ng-model="dimensions.scale.current" />
|
||||
<i class="icon-picture" style="font-size: 22px"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
<div class="umb-editor umb-checkboxlist" ng-controller="Umbraco.PropertyEditors.CheckboxListController">
|
||||
<div class="umb-editor umb-editor--list" ng-controller="Umbraco.PropertyEditors.CheckboxListController">
|
||||
|
||||
<ul class="unstyled">
|
||||
<li ng-repeat="item in selectedItems">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="checkboxlist"
|
||||
value="{{item.key}}"
|
||||
ng-model="item.checked"
|
||||
ng-required="model.validation.mandatory && !model.value.length" />
|
||||
{{item.val}}
|
||||
</label>
|
||||
<li ng-repeat="item in selectedItems" class="umb-editor__item">
|
||||
<umb-checkbox name="checkboxlist" value="{{item.key}}" model="item.checked" text="{{item.val}}" required="model.validation.mandatory && !model.value.length"></umb-checkbox>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<div class="umb-editor umb-radiobuttons" ng-controller="Umbraco.PropertyEditors.RadioButtonsController">
|
||||
<div class="umb-editor umb-edtitor--list" ng-controller="Umbraco.PropertyEditors.RadioButtonsController">
|
||||
<ul class="unstyled">
|
||||
<li ng-repeat="item in model.config.items">
|
||||
<label class="radio">
|
||||
<input type="radio" name="radiobuttons-{{model.alias}}"
|
||||
value="{{item.id}}"
|
||||
ng-model="model.value" />
|
||||
{{item.value}}
|
||||
</label>
|
||||
|
||||
<li ng-repeat="item in model.config.items" class="umb-editor__item">
|
||||
<umb-radiobutton name="{{model.alias}}" value="{{item.id}}" model="model.value" text="{{item.value}}"></umb-radiobutton>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -622,29 +622,36 @@ namespace Umbraco.Web.Routing
|
||||
}
|
||||
else
|
||||
{
|
||||
// grab the current member
|
||||
var member = membershipHelper.GetCurrentMember();
|
||||
// if the member has the "approved" and/or "locked out" properties, make sure they're correctly set before allowing access
|
||||
var memberIsActive = true;
|
||||
if (member != null)
|
||||
if (membershipHelper.IsUmbracoMembershipProviderActive())
|
||||
{
|
||||
if (member.HasProperty(Constants.Conventions.Member.IsApproved) == false)
|
||||
memberIsActive = member.GetPropertyValue<bool>(Constants.Conventions.Member.IsApproved);
|
||||
// grab the current member
|
||||
var member = membershipHelper.GetCurrentMember();
|
||||
// if the member has the "approved" and/or "locked out" properties, make sure they're correctly set before allowing access
|
||||
var memberIsActive = true;
|
||||
if (member != null)
|
||||
{
|
||||
if (member.HasProperty(Constants.Conventions.Member.IsApproved) == false)
|
||||
memberIsActive = member.GetPropertyValue<bool>(Constants.Conventions.Member.IsApproved);
|
||||
|
||||
if (member.HasProperty(Constants.Conventions.Member.IsLockedOut) == false)
|
||||
memberIsActive = member.GetPropertyValue<bool>(Constants.Conventions.Member.IsLockedOut) == false;
|
||||
}
|
||||
if (member.HasProperty(Constants.Conventions.Member.IsLockedOut) == false)
|
||||
memberIsActive = member.GetPropertyValue<bool>(Constants.Conventions.Member.IsLockedOut) == false;
|
||||
}
|
||||
|
||||
if (memberIsActive == false)
|
||||
{
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Current member is either unapproved or locked out, redirect to error page", () => tracePrefix);
|
||||
var errorPageId = publicAccessAttempt.Result.NoAccessNodeId;
|
||||
if (errorPageId != _pcr.PublishedContent.Id)
|
||||
_pcr.PublishedContent = _routingContext.UmbracoContext.ContentCache.GetById(errorPageId);
|
||||
if (memberIsActive == false)
|
||||
{
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Current member is either unapproved or locked out, redirect to error page", () => tracePrefix);
|
||||
var errorPageId = publicAccessAttempt.Result.NoAccessNodeId;
|
||||
if (errorPageId != _pcr.PublishedContent.Id)
|
||||
_pcr.PublishedContent = _routingContext.UmbracoContext.ContentCache.GetById(errorPageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Current member has access", () => tracePrefix);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Current member has access", () => tracePrefix);
|
||||
ProfilingLogger.Logger.Debug<PublishedContentRequestEngine>("{0}Current custom MembershipProvider member has access", () => tracePrefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.Models.Trees;
|
||||
@@ -31,8 +32,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <param name="onlyInitialized">An optional bool (defaults to true), if set to false it will also load uninitialized trees</param>
|
||||
/// <returns></returns>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public async Task<SectionRootNode> GetApplicationTrees(string application, string tree, FormDataCollection queryStrings, bool onlyInitialized = true)
|
||||
public async Task<SectionRootNode> GetApplicationTrees(string application, string tree, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings, bool onlyInitialized = true)
|
||||
{
|
||||
application = application.CleanForXss();
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ using Umbraco.Web.WebApi.Filters;
|
||||
using umbraco;
|
||||
using umbraco.BusinessLogic.Actions;
|
||||
using System.Globalization;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.Trees
|
||||
@@ -30,8 +31,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <param name="id"></param>
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <returns></returns>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public TreeNode GetTreeNode(string id, FormDataCollection queryStrings)
|
||||
public TreeNode GetTreeNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
|
||||
{
|
||||
int asInt;
|
||||
Guid asGuid = Guid.Empty;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
@@ -53,8 +54,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <param name="id"></param>
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <returns></returns>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public TreeNode GetTreeNode(string id, FormDataCollection queryStrings)
|
||||
public TreeNode GetTreeNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
|
||||
{
|
||||
var node = GetSingleTreeNode(id, queryStrings);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Web.Models.Trees;
|
||||
@@ -43,7 +44,7 @@ namespace Umbraco.Web.Trees
|
||||
/// We are allowing an arbitrary number of query strings to be pased in so that developers are able to persist custom data from the front-end
|
||||
/// to the back end to be used in the query for model data.
|
||||
/// </remarks>
|
||||
protected abstract TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings);
|
||||
protected abstract TreeNodeCollection GetTreeNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the menu structure for the node
|
||||
@@ -51,7 +52,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <param name="id"></param>
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings);
|
||||
protected abstract MenuItemCollection GetMenuForNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings);
|
||||
|
||||
/// <summary>
|
||||
/// The name to display on the root node
|
||||
@@ -68,8 +69,7 @@ namespace Umbraco.Web.Trees
|
||||
/// </summary>
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <returns></returns>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public TreeNode GetRootNode(FormDataCollection queryStrings)
|
||||
public TreeNode GetRootNode([ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
|
||||
{
|
||||
if (queryStrings == null) queryStrings = new FormDataCollection("");
|
||||
var node = CreateRootNode(queryStrings);
|
||||
@@ -108,8 +108,7 @@ namespace Umbraco.Web.Trees
|
||||
/// We are allowing an arbitrary number of query strings to be pased in so that developers are able to persist custom data from the front-end
|
||||
/// to the back end to be used in the query for model data.
|
||||
/// </remarks>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public TreeNodeCollection GetNodes(string id, FormDataCollection queryStrings)
|
||||
public TreeNodeCollection GetNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
|
||||
{
|
||||
if (queryStrings == null) queryStrings = new FormDataCollection("");
|
||||
var nodes = GetTreeNodes(id, queryStrings);
|
||||
@@ -140,8 +139,7 @@ namespace Umbraco.Web.Trees
|
||||
/// <param name="id"></param>
|
||||
/// <param name="queryStrings"></param>
|
||||
/// <returns></returns>
|
||||
[HttpQueryStringFilter("queryStrings")]
|
||||
public MenuItemCollection GetMenu(string id, FormDataCollection queryStrings)
|
||||
public MenuItemCollection GetMenu(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormDataCollection queryStrings)
|
||||
{
|
||||
if (queryStrings == null) queryStrings = new FormDataCollection("");
|
||||
var menu = GetMenuForNode(id, queryStrings);
|
||||
@@ -390,4 +388,4 @@ namespace Umbraco.Web.Trees
|
||||
if (handler != null) handler(instance, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -840,6 +840,7 @@
|
||||
<Compile Include="WebApi\Filters\EnableOverrideAuthorizationAttribute.cs" />
|
||||
<Compile Include="WebApi\Filters\FeatureAuthorizeAttribute.cs" />
|
||||
<Compile Include="WebApi\Filters\FilterGrouping.cs" />
|
||||
<Compile Include="WebApi\Filters\HttpQueryStringModelBinder.cs" />
|
||||
<Compile Include="WebApi\Filters\LegacyTreeAuthorizeAttribute.cs" />
|
||||
<Compile Include="WebApi\Filters\OutgoingEditorModelEventAttribute.cs" />
|
||||
<Compile Include="WebApi\Filters\OutgoingNoHyphenGuidFormatAttribute.cs" />
|
||||
|
||||
@@ -6,13 +6,7 @@ using System.Web.Http.Filters;
|
||||
|
||||
namespace Umbraco.Web.WebApi.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows an Action to execute with an arbitrary number of QueryStrings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Just like you can POST an arbitrary number of parameters to an Action, you can't GET an arbitrary number
|
||||
/// but this will allow you to do it
|
||||
/// </remarks>
|
||||
[Obsolete("Use HttpQueryStringModelBinder to model bind FormDataCollection in a GET request")]
|
||||
public sealed class HttpQueryStringFilterAttribute : ActionFilterAttribute
|
||||
{
|
||||
public string ParameterName { get; private set; }
|
||||
@@ -40,4 +34,4 @@ namespace Umbraco.Web.WebApi.Filters
|
||||
base.OnActionExecuting(actionContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.ModelBinding;
|
||||
|
||||
namespace Umbraco.Web.WebApi.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows an Action to execute with an arbitrary number of QueryStrings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Just like you can POST an arbitrary number of parameters to an Action, you can't GET an arbitrary number
|
||||
/// but this will allow you to do it
|
||||
/// </remarks>
|
||||
public sealed class HttpQueryStringModelBinder : IModelBinder
|
||||
{
|
||||
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
|
||||
{
|
||||
//get the query strings from the request properties
|
||||
if (actionContext.Request.Properties.ContainsKey("MS_QueryNameValuePairs"))
|
||||
{
|
||||
if (actionContext.Request.Properties["MS_QueryNameValuePairs"] is IEnumerable<KeyValuePair<string, string>> queryStrings)
|
||||
{
|
||||
var formData = new FormDataCollection(queryStrings);
|
||||
bindingContext.Model = formData;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,13 @@ using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic.language;
|
||||
using umbraco.cms.businesslogic.property;
|
||||
using umbraco.cms.businesslogic.task;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models;
|
||||
using Language = umbraco.cms.businesslogic.language.Language;
|
||||
using Property = umbraco.cms.businesslogic.property.Property;
|
||||
using Task = umbraco.cms.businesslogic.task.Task;
|
||||
|
||||
namespace umbraco.cms.businesslogic.translation
|
||||
{
|
||||
@@ -32,8 +33,10 @@ namespace umbraco.cms.businesslogic.translation
|
||||
task.Save();
|
||||
|
||||
// Add log entry
|
||||
// Note: not updated to LogHelper as LogTypes.SendToTranslate might be something special, not sure
|
||||
Log.Add(LogTypes.SendToTranslate, user, node.Id, "Translator: " + translator.Name + ", Language: " + language.FriendlyName);
|
||||
ApplicationContext.Current.Services.AuditService.Add(AuditType.SendToTranslate,
|
||||
"Translator: " + translator.Name + ", Language: " + language.FriendlyName,
|
||||
user.Id,
|
||||
node.Id);
|
||||
|
||||
// send it
|
||||
if (sendEmail)
|
||||
@@ -128,4 +131,4 @@ namespace umbraco.cms.businesslogic.translation
|
||||
return collection.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user