Switched DMU web service to support XML and JSON so can be used by media dashboard aswell

Added dmu.ashx file in old plugin folder to add backwards compatability
This commit is contained in:
Matt@MBP13-PC
2012-08-08 08:37:07 -01:00
parent 872ef1fadc
commit a989ea77ff
5 changed files with 160 additions and 56 deletions

View File

@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using ClientDependency.Core;
using umbraco.BasePages;
using umbraco.BusinessLogic;
using umbraco.IO;
using umbraco.cms.businesslogic.media;
@@ -113,7 +116,7 @@ namespace Umbraco.Web.UI.Controls
sb.Append("<div class='filter'>Filter: <input type='text' data-bind=\"value: filterTerm, valueUpdate: 'afterkeydown'\" /></div>");
// Create thumbnails container
sb.Append("<ul class='items' data-bind='foreach: items'>" +
sb.Append("<ul class='items' data-bind='foreach: filtered'>" +
"<li data-bind=\"attr: { 'data-id': Id, 'data-order': $index() }, css: { selected: selected() }, event: { mousedown: toggleSelected, contextmenu: toggleSelected }\"><div><span class='img'><img data-bind='attr: { src: ThumbnailUrl }' /></span><span data-bind='text: Name'></span></div></li>" +
"</ul>");
@@ -121,11 +124,21 @@ namespace Umbraco.Web.UI.Controls
Controls.Add(panel);
var user = User.GetCurrent();
var ticket = new FormsAuthenticationTicket(1,
user != null ? user.LoginName : "",
DateTime.Now,
DateTime.Now,
false,
"");
Page.ClientScript.RegisterStartupScript(typeof(FolderBrowser),
"RegisterFolderBrowsers",
string.Format("$(function () {{ $(\".umbFolderBrowser\").folderBrowser({{ umbracoPath : '{0}', basePath : '{1}' }}); }});",
string.Format("$(function () {{ $(\".umbFolderBrowser\").folderBrowser({{ umbracoPath : '{0}', basePath : '{1}', username: '{2}', ticket: '{3}' }}); }});",
IOHelper.ResolveUrl(SystemDirectories.Umbraco),
IOHelper.ResolveUrl(SystemDirectories.Base)),
IOHelper.ResolveUrl(SystemDirectories.Base),
user != null ? user.LoginName : "",
FormsAuthentication.Encrypt(ticket)),
true);
}