mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -23,8 +23,7 @@ namespace Orchard.Core.Common.Services {
|
|||||||
switch (context.Request.MethodName) {
|
switch (context.Request.MethodName) {
|
||||||
case "metaWeblog.newPost":
|
case "metaWeblog.newPost":
|
||||||
MetaWeblogSetCustomCreatedDate(
|
MetaWeblogSetCustomCreatedDate(
|
||||||
GetId(context.Response),
|
Convert.ToInt32(context.Request.Params[0].Value),
|
||||||
Convert.ToString(context.Request.Params[0].Value),
|
|
||||||
Convert.ToString(context.Request.Params[1].Value),
|
Convert.ToString(context.Request.Params[1].Value),
|
||||||
Convert.ToString(context.Request.Params[2].Value),
|
Convert.ToString(context.Request.Params[2].Value),
|
||||||
(XRpcStruct) context.Request.Params[3].Value,
|
(XRpcStruct) context.Request.Params[3].Value,
|
||||||
@@ -33,8 +32,7 @@ namespace Orchard.Core.Common.Services {
|
|||||||
break;
|
break;
|
||||||
case "metaWeblog.editPost":
|
case "metaWeblog.editPost":
|
||||||
MetaWeblogSetCustomCreatedDate(
|
MetaWeblogSetCustomCreatedDate(
|
||||||
GetId(context.Response),
|
Convert.ToInt32(context.Request.Params[0].Value),
|
||||||
Convert.ToString(context.Request.Params[0].Value),
|
|
||||||
Convert.ToString(context.Request.Params[1].Value),
|
Convert.ToString(context.Request.Params[1].Value),
|
||||||
Convert.ToString(context.Request.Params[2].Value),
|
Convert.ToString(context.Request.Params[2].Value),
|
||||||
(XRpcStruct) context.Request.Params[3].Value,
|
(XRpcStruct) context.Request.Params[3].Value,
|
||||||
@@ -44,7 +42,7 @@ namespace Orchard.Core.Common.Services {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MetaWeblogSetCustomCreatedDate(int contentItemId, string appKey, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
|
private void MetaWeblogSetCustomCreatedDate(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
|
||||||
if (!publish)
|
if (!publish)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -60,8 +60,7 @@ namespace Orchard.Tags.Services {
|
|||||||
break;
|
break;
|
||||||
case "metaWeblog.newPost":
|
case "metaWeblog.newPost":
|
||||||
MetaWeblogUpdateTags(
|
MetaWeblogUpdateTags(
|
||||||
GetId(context.Response),
|
Convert.ToInt32(context.Request.Params[0].Value),
|
||||||
Convert.ToString(context.Request.Params[0].Value),
|
|
||||||
Convert.ToString(context.Request.Params[1].Value),
|
Convert.ToString(context.Request.Params[1].Value),
|
||||||
Convert.ToString(context.Request.Params[2].Value),
|
Convert.ToString(context.Request.Params[2].Value),
|
||||||
(XRpcStruct)context.Request.Params[3].Value,
|
(XRpcStruct)context.Request.Params[3].Value,
|
||||||
@@ -70,8 +69,7 @@ namespace Orchard.Tags.Services {
|
|||||||
break;
|
break;
|
||||||
case "metaWeblog.editPost":
|
case "metaWeblog.editPost":
|
||||||
MetaWeblogUpdateTags(
|
MetaWeblogUpdateTags(
|
||||||
GetId(context.Response),
|
Convert.ToInt32(context.Request.Params[0].Value),
|
||||||
Convert.ToString(context.Request.Params[0].Value),
|
|
||||||
Convert.ToString(context.Request.Params[1].Value),
|
Convert.ToString(context.Request.Params[1].Value),
|
||||||
Convert.ToString(context.Request.Params[2].Value),
|
Convert.ToString(context.Request.Params[2].Value),
|
||||||
(XRpcStruct)context.Request.Params[3].Value,
|
(XRpcStruct)context.Request.Params[3].Value,
|
||||||
@@ -113,12 +111,6 @@ namespace Orchard.Tags.Services {
|
|||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int GetId(XRpcMethodResponse response) {
|
|
||||||
return response != null && response.Params.Count == 1 && response.Params[0].Value is int
|
|
||||||
? Convert.ToInt32(response.Params[0].Value)
|
|
||||||
: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private XRpcArray MetaWeblogGetTags(string appKey, string userName, string password) {
|
private XRpcArray MetaWeblogGetTags(string appKey, string userName, string password) {
|
||||||
var user = _membershipService.ValidateUser(userName, password);
|
var user = _membershipService.ValidateUser(userName, password);
|
||||||
_authorizationService.CheckAccess(StandardPermissions.AccessAdminPanel, user, null);
|
_authorizationService.CheckAccess(StandardPermissions.AccessAdminPanel, user, null);
|
||||||
@@ -139,7 +131,7 @@ namespace Orchard.Tags.Services {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MetaWeblogUpdateTags(int contentItemId, string appKey, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
|
private void MetaWeblogUpdateTags(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
|
||||||
var user = _membershipService.ValidateUser(userName, password);
|
var user = _membershipService.ValidateUser(userName, password);
|
||||||
|
|
||||||
var rawTags = content.Optional<string>("mt_keywords");
|
var rawTags = content.Optional<string>("mt_keywords");
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using System.Web.Routing;
|
||||||
using Orchard.DisplayManagement;
|
using Orchard.DisplayManagement;
|
||||||
using Orchard.Mvc.Filters;
|
using Orchard.Mvc.Filters;
|
||||||
using Orchard.UI.Admin;
|
using Orchard.UI.Admin;
|
||||||
@@ -35,8 +36,17 @@ namespace Orchard.UI.Navigation {
|
|||||||
|
|
||||||
IEnumerable<MenuItem> menuItems = _navigationManager.BuildMenu(menuName);
|
IEnumerable<MenuItem> menuItems = _navigationManager.BuildMenu(menuName);
|
||||||
|
|
||||||
|
// adding query string parameters
|
||||||
|
var routeData = new RouteValueDictionary(filterContext.RouteData.Values);
|
||||||
|
var queryString = workContext.HttpContext.Request.QueryString;
|
||||||
|
if (queryString != null) {
|
||||||
|
foreach (var key in from string key in queryString.Keys where key != null && !routeData.ContainsKey(key) let value = queryString[key] select key) {
|
||||||
|
routeData[key] = queryString[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set the currently selected path
|
// Set the currently selected path
|
||||||
Stack<MenuItem> selectedPath = NavigationHelper.SetSelectedPath(menuItems, filterContext.RouteData);
|
Stack<MenuItem> selectedPath = NavigationHelper.SetSelectedPath(menuItems, routeData);
|
||||||
|
|
||||||
// Populate main nav
|
// Populate main nav
|
||||||
dynamic menuShape = _shapeFactory.Menu().MenuName(menuName);
|
dynamic menuShape = _shapeFactory.Menu().MenuName(menuName);
|
||||||
|
@@ -67,6 +67,16 @@ namespace Orchard.UI.Navigation {
|
|||||||
/// <param name="currentRouteData">The current route data.</param>
|
/// <param name="currentRouteData">The current route data.</param>
|
||||||
/// <returns>A stack with the selection path being the last node the currently selected one.</returns>
|
/// <returns>A stack with the selection path being the last node the currently selected one.</returns>
|
||||||
public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, RouteData currentRouteData) {
|
public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, RouteData currentRouteData) {
|
||||||
|
return SetSelectedPath(menuItems, currentRouteData.Values);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Identifies the currently selected path, starting from the selected node.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="menuItems">All the menuitems in the navigation menu.</param>
|
||||||
|
/// <param name="currentRouteData">The current route data.</param>
|
||||||
|
/// <returns>A stack with the selection path being the last node the currently selected one.</returns>
|
||||||
|
public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, RouteValueDictionary currentRouteData) {
|
||||||
if (menuItems == null)
|
if (menuItems == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -78,7 +88,7 @@ namespace Orchard.UI.Navigation {
|
|||||||
return selectedPath;
|
return selectedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RouteMatches(menuItem.RouteValues, currentRouteData.Values)) {
|
if (RouteMatches(menuItem.RouteValues, currentRouteData)) {
|
||||||
menuItem.Selected = true;
|
menuItem.Selected = true;
|
||||||
|
|
||||||
selectedPath = new Stack<MenuItem>();
|
selectedPath = new Stack<MenuItem>();
|
||||||
|
Reference in New Issue
Block a user