Fixes: #U4-1360 - full names of tree types in config.
Updates: #U4-1303 - basic UI support for partial view macros.
This commit is contained in:
@@ -296,5 +296,24 @@ namespace Umbraco.Core
|
||||
var attrs = propertyInfo.GetCustomAttributes(typeof(TAttribute), inherit);
|
||||
return (attrs.Length > 0 ? attrs.ToList().ConvertAll(input => (TAttribute)input) : null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the full type name with the assembly but without all of the assembly specific version information.
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// This method is like an 'inbetween' of Type.FullName and Type.AssemblyQualifiedName which returns the type and the assembly separated
|
||||
/// by a comma.
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// The output of this class would be:
|
||||
///
|
||||
/// Umbraco.Core.TypeExtensions, Umbraco.Core
|
||||
/// </example>
|
||||
public static string GetFullNameWithAssembly(this Type type)
|
||||
{
|
||||
return string.Concat(type.FullName, ", ", type.Assembly.GetName().Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,48 +2,49 @@
|
||||
<trees>
|
||||
|
||||
<!--Content-->
|
||||
<add application="content" alias="content" title="Content" assembly="umbraco" type="loadContent" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
|
||||
<add application="content" alias="contentRecycleBin" title="RecycleBin" assembly="umbraco" type="cms.presentation.Trees.ContentRecycleBin" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<add application="content" alias="content" title="Content" type="umbraco.loadContent, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
|
||||
<add application="content" alias="contentRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
|
||||
<!--Media-->
|
||||
<add application="media" alias="media" title="Media" assembly="umbraco" type="loadMedia" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="media" alias="mediaRecycleBin" title="RecycleBin" assembly="umbraco" type="cms.presentation.Trees.MediaRecycleBin" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<add application="media" alias="media" title="Media" type="umbraco.loadMedia, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="media" alias="mediaRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
|
||||
<!--Settings-->
|
||||
<add application="settings" alias="stylesheets" title="Stylesheets" assembly="umbraco" type="loadStylesheets" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" assembly="umbraco" type="loadStylesheetProperty" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
|
||||
<add application="settings" alias="templates" title="Templates" assembly="umbraco" type="loadTemplates" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="settings" alias="scripts" title="Scripts" assembly="umbraco" type="loadScripts" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="settings" alias="dictionary" title="Dictionary" assembly="umbraco" type="loadDictionary" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" action="openDictionary()" sortOrder="3" />
|
||||
<add application="settings" alias="languages" title="Languages" assembly="umbraco" type="loadLanguages" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="settings" alias="mediaTypes" title="Media Types" assembly="umbraco" type="loadMediaTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="settings" alias="nodeTypes" title="Document Types" assembly="umbraco" type="loadNodeTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="6" />
|
||||
<add application="settings" alias="stylesheets" title="Stylesheets" type="umbraco.loadStylesheets, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
|
||||
<add application="settings" alias="templates" title="Templates" type="umbraco.loadTemplates, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="settings" alias="partialViews" title="Partial Views" silent="false" initialize="true" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="Umbraco.Web.Trees.PartialViewsTree, umbraco" sortOrder="2" />
|
||||
<add application="settings" alias="scripts" title="Scripts" type="umbraco.loadScripts, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="3" />
|
||||
<add application="settings" alias="dictionary" title="Dictionary" type="umbraco.loadDictionary, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" action="openDictionary()" sortOrder="4" />
|
||||
<add application="settings" alias="languages" title="Languages" type="umbraco.loadLanguages, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="settings" alias="mediaTypes" title="Media Types" type="umbraco.loadMediaTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="6" />
|
||||
<add application="settings" alias="nodeTypes" title="Document Types" type="umbraco.loadNodeTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="7" />
|
||||
|
||||
<!--Developer-->
|
||||
<add application="developer" alias="datatype" title="Data Types" assembly="umbraco" type="loadDataTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="developer" alias="macros" title="Macros" assembly="umbraco" type="loadMacros" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="developer" alias="packager" title="Packages" assembly="umbraco" type="loadPackager" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
|
||||
<add application="developer" alias="packagerPackages" title="Packager Packages" assembly="umbraco" type="loadPackages" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" assembly="umbraco" type="loadRelationTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="developer" alias="python" title="Scripting Files" assembly="umbraco" type="loadPython" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="4" />
|
||||
<add application="developer" alias="xslt" title="XSLT Files" assembly="umbraco" type="loadXslt" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="developer" alias="datatype" title="Data Types" type="umbraco.loadDataTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
|
||||
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="developer" alias="python" title="Scripting Files" type="umbraco.loadPython, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="4" />
|
||||
<add application="developer" alias="xslt" title="XSLT Files" type="umbraco.loadXslt, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
|
||||
<!--Users-->
|
||||
<add application="users" alias="users" title="Users" assembly="umbraco" type="loadUsers" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="users" alias="userTypes" title="User Types" assembly="umbraco" type="cms.presentation.Trees.UserTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="users" alias="userPermissions" title="User Permissions" assembly="umbraco" type="cms.presentation.Trees.UserPermissions" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="users" alias="users" title="Users" type="umbraco.loadUsers, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="users" alias="userTypes" title="User Types" type="umbraco.cms.presentation.Trees.UserTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="users" alias="userPermissions" title="User Permissions" type="umbraco.cms.presentation.Trees.UserPermissions, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
|
||||
<!--Members-->
|
||||
<add application="member" alias="member" title="Members" assembly="umbraco" type="loadMembers" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="member" alias="memberGroup" title="Member Groups" assembly="umbraco" type="loadMemberGroups" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="member" alias="memberType" title="Member Types" assembly="umbraco" type="loadMemberTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="member" alias="member" title="Members" type="umbraco.loadMembers, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="member" alias="memberGroup" title="Member Groups" type="umbraco.loadMemberGroups, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="member" alias="memberType" title="Member Types" type="umbraco.loadMemberTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
|
||||
<!--Translation-->
|
||||
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" assembly="umbraco" type="loadOpenTasks" action="" />
|
||||
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" assembly="umbraco" type="loadYourTasks" action="" />
|
||||
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="umbraco.loadOpenTasks, umbraco" action="" />
|
||||
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="umbraco.loadYourTasks, umbraco" action="" />
|
||||
|
||||
<!-- Custom -->
|
||||
<!--<add application="myApplication" alias="myTree" title="Me Tree" assembly="myPackage" type="myTree"
|
||||
<!--<add application="myApplication" alias="myTree" title="Me Tree" type="MyNamespace.myTree, MyAssembly"
|
||||
iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="10" />-->
|
||||
|
||||
</trees>
|
||||
@@ -1,39 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<trees>
|
||||
<!--Content-->
|
||||
<add application="content" alias="content" title="Content" assembly="umbraco" type="loadContent" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
|
||||
<add application="content" alias="contentRecycleBin" title="RecycleBin" assembly="umbraco" type="cms.presentation.Trees.ContentRecycleBin" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<add application="content" alias="content" title="Content" type="umbraco.loadContent, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
|
||||
<add application="content" alias="contentRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<!--Media-->
|
||||
<add application="media" alias="media" title="Media" assembly="umbraco" type="loadMedia" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="media" alias="mediaRecycleBin" title="RecycleBin" assembly="umbraco" type="cms.presentation.Trees.MediaRecycleBin" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<add application="media" alias="media" title="Media" type="umbraco.loadMedia, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="media" alias="mediaRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
|
||||
<!--Settings-->
|
||||
<add application="settings" alias="stylesheets" title="Stylesheets" assembly="umbraco" type="loadStylesheets" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" assembly="umbraco" type="loadStylesheetProperty" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
|
||||
<add application="settings" alias="templates" title="Templates" assembly="umbraco" type="loadTemplates" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="settings" alias="scripts" title="Scripts" assembly="umbraco" type="loadScripts" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="settings" alias="dictionary" title="Dictionary" assembly="umbraco" type="loadDictionary" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" action="openDictionary()" sortOrder="3" />
|
||||
<add application="settings" alias="languages" title="Languages" assembly="umbraco" type="loadLanguages" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="settings" alias="mediaTypes" title="Media Types" assembly="umbraco" type="loadMediaTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="settings" alias="nodeTypes" title="Document Types" assembly="umbraco" type="loadNodeTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="6" />
|
||||
<add application="settings" alias="stylesheets" title="Stylesheets" type="umbraco.loadStylesheets, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
|
||||
<add application="settings" alias="templates" title="Templates" type="umbraco.loadTemplates, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="settings" alias="partialViews" title="Partial Views" silent="false" initialize="true" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="Umbraco.Web.Trees.PartialViewsTree, umbraco" sortOrder="2" />
|
||||
<add application="settings" alias="scripts" title="Scripts" type="umbraco.loadScripts, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="3" />
|
||||
<add application="settings" alias="dictionary" title="Dictionary" type="umbraco.loadDictionary, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" action="openDictionary()" sortOrder="4" />
|
||||
<add application="settings" alias="languages" title="Languages" type="umbraco.loadLanguages, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="settings" alias="mediaTypes" title="Media Types" type="umbraco.loadMediaTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="6" />
|
||||
<add application="settings" alias="nodeTypes" title="Document Types" type="umbraco.loadNodeTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="7" />
|
||||
<!--Developer-->
|
||||
<add application="developer" alias="datatype" title="Data Types" assembly="umbraco" type="loadDataTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="developer" alias="macros" title="Macros" assembly="umbraco" type="loadMacros" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="developer" alias="packager" title="Packages" assembly="umbraco" type="loadPackager" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
|
||||
<add application="developer" alias="packagerPackages" title="Packager Packages" assembly="umbraco" type="loadPackages" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" assembly="umbraco" type="loadRelationTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="developer" alias="python" title="Scripting Files" assembly="umbraco" type="loadPython" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="4" />
|
||||
<add application="developer" alias="xslt" title="XSLT Files" assembly="umbraco" type="loadXslt" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<add application="developer" alias="datatype" title="Data Types" type="umbraco.loadDataTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
|
||||
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="4" />
|
||||
<add application="developer" alias="python" title="Scripting Files" type="umbraco.loadPython, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="4" />
|
||||
<add application="developer" alias="xslt" title="XSLT Files" type="umbraco.loadXslt, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="5" />
|
||||
<!--Users-->
|
||||
<add application="users" alias="users" title="Users" assembly="umbraco" type="loadUsers" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="users" alias="userTypes" title="User Types" assembly="umbraco" type="cms.presentation.Trees.UserTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="users" alias="userPermissions" title="User Permissions" assembly="umbraco" type="cms.presentation.Trees.UserPermissions" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="users" alias="users" title="Users" type="umbraco.loadUsers, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="users" alias="userTypes" title="User Types" type="umbraco.cms.presentation.Trees.UserTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="users" alias="userPermissions" title="User Permissions" type="umbraco.cms.presentation.Trees.UserPermissions, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<!--Members-->
|
||||
<add application="member" alias="member" title="Members" assembly="umbraco" type="loadMembers" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="member" alias="memberGroup" title="Member Groups" assembly="umbraco" type="loadMemberGroups" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="member" alias="memberType" title="Member Types" assembly="umbraco" type="loadMemberTypes" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<add application="member" alias="member" title="Members" type="umbraco.loadMembers, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
|
||||
<add application="member" alias="memberGroup" title="Member Groups" type="umbraco.loadMemberGroups, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
|
||||
<add application="member" alias="memberType" title="Member Types" type="umbraco.loadMemberTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
|
||||
<!--Translation-->
|
||||
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="umbraco.loadOpenTasks, umbraco" action="" />
|
||||
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="umbraco.loadYourTasks, umbraco" action="" />
|
||||
<!-- Custom -->
|
||||
<!--<add application="myApplication" alias="myTree" title="Me Tree" assembly="myPackage" type="myTree"
|
||||
<!--<add application="myApplication" alias="myTree" title="Me Tree" type="MyNamespace.myTree, MyAssembly"
|
||||
iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="10" />-->
|
||||
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" assembly="umbraco" type="loadOpenTasks" action="" />
|
||||
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" assembly="umbraco" type="loadYourTasks" action="" />
|
||||
</trees>
|
||||
@@ -14,6 +14,8 @@
|
||||
$(document).ready(function () {
|
||||
//create a new EditView object
|
||||
var editView = new Umbraco.Editors.EditView({
|
||||
editorType: "<%= EditorType.ToString() %>",
|
||||
originalFileName: "<%=OriginalFileName %>",
|
||||
masterPageDropDown: $("#<%= MasterTemplate.ClientID %>"),
|
||||
nameTxtBox: $("#<%= NameTxt.ClientID %>"),
|
||||
aliasTxtBox: $("#<%= AliasTxt.ClientID %>"),
|
||||
@@ -40,6 +42,7 @@
|
||||
|
||||
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<cc1:UmbracoPanel ID="Panel1" runat="server" Width="608px" Height="336px" hasMenu="true">
|
||||
<cc1:Pane ID="Pane7" runat="server" Height="44px" Width="528px">
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Trees;
|
||||
using umbraco;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.IO;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using umbraco.cms.helpers;
|
||||
using umbraco.cms.presentation.Trees;
|
||||
using Umbraco.Core;
|
||||
using umbraco.uicontrols;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Settings.Views
|
||||
@@ -16,78 +20,119 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views
|
||||
public partial class EditView : global::umbraco.BasePages.UmbracoEnsuredPage
|
||||
{
|
||||
private Template _template;
|
||||
|
||||
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude;
|
||||
|
||||
protected global::umbraco.uicontrols.UmbracoPanel Panel1;
|
||||
protected global::umbraco.uicontrols.Pane Pane7;
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_name;
|
||||
protected global::System.Web.UI.WebControls.TextBox NameTxt;
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_alias;
|
||||
protected global::System.Web.UI.WebControls.TextBox AliasTxt;
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_masterTemplate;
|
||||
protected global::System.Web.UI.WebControls.DropDownList MasterTemplate;
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_source;
|
||||
protected global::umbraco.uicontrols.CodeArea editorSource;
|
||||
protected global::System.Web.UI.WebControls.Repeater rpt_codeTemplates;
|
||||
protected global::System.Web.UI.WebControls.Repeater rpt_macros;
|
||||
protected MenuIconI SaveButton;
|
||||
|
||||
protected MenuIconI SaveButton;
|
||||
|
||||
public EditView()
|
||||
{
|
||||
CurrentApp = global::umbraco.BusinessLogic.DefaultApps.settings.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The type of MVC/Umbraco view the editor is editing
|
||||
/// </summary>
|
||||
public enum ViewEditorType
|
||||
{
|
||||
Template,
|
||||
PartialView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the type of view being edited
|
||||
/// </summary>
|
||||
protected ViewEditorType EditorType
|
||||
{
|
||||
get { return _template == null ? ViewEditorType.PartialView : ViewEditorType.Template; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the original file name that the editor was loaded with
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// this is used for editing a partial view
|
||||
/// </remarks>
|
||||
protected string OriginalFileName { get; private set; }
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
MasterTemplate.Items.Add(new ListItem(ui.Text("none"), "0"));
|
||||
var selectedTemplate = string.Empty;
|
||||
|
||||
foreach (Template t in Template.GetAllAsList())
|
||||
//configure screen for editing a template
|
||||
if (_template != null)
|
||||
{
|
||||
if (t.Id == _template.Id) continue;
|
||||
MasterTemplate.Items.Add(new ListItem(ui.Text("none"), "0"));
|
||||
var selectedTemplate = string.Empty;
|
||||
|
||||
var li = new ListItem(t.Text, t.Id.ToString());
|
||||
li.Attributes.Add("id", t.Alias.Replace(" ", "") + ".cshtml");
|
||||
MasterTemplate.Items.Add(li);
|
||||
}
|
||||
foreach (Template t in Template.GetAllAsList())
|
||||
{
|
||||
if (t.Id == _template.Id) continue;
|
||||
|
||||
try
|
||||
{
|
||||
if (_template.MasterTemplate > 0)
|
||||
MasterTemplate.SelectedValue = _template.MasterTemplate.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
var li = new ListItem(t.Text, t.Id.ToString());
|
||||
li.Attributes.Add("id", t.Alias.Replace(" ", "") + ".cshtml");
|
||||
MasterTemplate.Items.Add(li);
|
||||
}
|
||||
|
||||
MasterTemplate.SelectedValue = selectedTemplate;
|
||||
try
|
||||
{
|
||||
if (_template.MasterTemplate > 0)
|
||||
MasterTemplate.SelectedValue = _template.MasterTemplate.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
|
||||
NameTxt.Text = _template.GetRawText();
|
||||
AliasTxt.Text = _template.Alias;
|
||||
editorSource.Text = _template.Design;
|
||||
MasterTemplate.SelectedValue = selectedTemplate;
|
||||
NameTxt.Text = _template.GetRawText();
|
||||
AliasTxt.Text = _template.Alias;
|
||||
editorSource.Text = _template.Design;
|
||||
|
||||
ClientTools
|
||||
.SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree<loadTemplates>().Tree.Alias)
|
||||
ClientTools
|
||||
.SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree<PartialViewsTree>().Tree.Alias)
|
||||
.SyncTree("-1,init," + _template.Path.Replace("-1,", ""), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//configure editor for editing a file....
|
||||
|
||||
NameTxt.Text = OriginalFileName;
|
||||
var file = IOHelper.MapPath(SystemDirectories.MvcViews + "/Partials/" + OriginalFileName);
|
||||
|
||||
using (var sr = File.OpenText(file))
|
||||
{
|
||||
var s = sr.ReadToEnd();
|
||||
editorSource.Text = s;
|
||||
}
|
||||
|
||||
//string path = DeepLink.GetTreePathFromFilePath(file);
|
||||
//ClientTools
|
||||
// .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree<loadPython>().Tree.Alias)
|
||||
// .SyncTree(path, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
_template = new Template(int.Parse(Request.QueryString["templateID"]));
|
||||
//
|
||||
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
|
||||
//
|
||||
InitializeComponent();
|
||||
base.OnInit(e);
|
||||
|
||||
//check if a templateId is assigned, meaning we are editing a template
|
||||
if (!Request.QueryString["templateID"].IsNullOrWhiteSpace())
|
||||
{
|
||||
_template = new Template(int.Parse(Request.QueryString["templateID"]));
|
||||
}
|
||||
else if (!Request.QueryString["file"].IsNullOrWhiteSpace())
|
||||
{
|
||||
//we are editing a view (i.e. partial view)
|
||||
OriginalFileName = Request.QueryString["file"];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Cannot render the editor without a supplied templateId or a file");
|
||||
}
|
||||
|
||||
Panel1.hasMenu = true;
|
||||
|
||||
SaveButton = Panel1.Menu.NewIcon();
|
||||
@@ -129,6 +174,44 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views
|
||||
|
||||
Panel1.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40);
|
||||
|
||||
|
||||
if (_template == null)
|
||||
{
|
||||
InitializeEditorForPartialView();
|
||||
}
|
||||
else
|
||||
{
|
||||
InitializeEditorForTemplate();
|
||||
}
|
||||
|
||||
|
||||
//Spit button
|
||||
Panel1.Menu.InsertSplitter();
|
||||
Panel1.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40);
|
||||
}
|
||||
|
||||
protected override void OnPreRender(EventArgs e)
|
||||
{
|
||||
base.OnPreRender(e);
|
||||
ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/codeEditorSave.asmx"));
|
||||
ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure the editor for partial view editing
|
||||
/// </summary>
|
||||
private void InitializeEditorForPartialView()
|
||||
{
|
||||
pp_masterTemplate.Visible = false;
|
||||
pp_alias.Visible = false;
|
||||
pp_name.Text = "Filename";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure the editor for editing a template
|
||||
/// </summary>
|
||||
private void InitializeEditorForTemplate()
|
||||
{
|
||||
if (UmbracoSettings.UseAspNetMasterPages)
|
||||
{
|
||||
Panel1.Menu.InsertSplitter();
|
||||
@@ -150,40 +233,6 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views
|
||||
IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" +
|
||||
_template.Id, ui.Text("template", "insertContentArea"), 470, 300);
|
||||
}
|
||||
|
||||
|
||||
//Spit button
|
||||
Panel1.Menu.InsertSplitter();
|
||||
Panel1.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40);
|
||||
|
||||
// Help
|
||||
Panel1.Menu.InsertSplitter();
|
||||
|
||||
MenuIconI helpIcon = Panel1.Menu.NewIcon();
|
||||
helpIcon.OnClickCommand =
|
||||
ClientTools.Scripts.OpenModalWindow(
|
||||
IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" +
|
||||
_template.Alias, ui.Text("template", "quickGuide"), 600, 580);
|
||||
helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png";
|
||||
helpIcon.AltText = ui.Text("template", "quickGuide");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void OnPreRender(EventArgs e)
|
||||
{
|
||||
base.OnPreRender(e);
|
||||
ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/codeEditorSave.asmx"));
|
||||
ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,5 +20,95 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views {
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.UmbracoPanel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Pane7 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane Pane7;
|
||||
|
||||
/// <summary>
|
||||
/// pp_name control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_name;
|
||||
|
||||
/// <summary>
|
||||
/// NameTxt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox NameTxt;
|
||||
|
||||
/// <summary>
|
||||
/// pp_alias control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_alias;
|
||||
|
||||
/// <summary>
|
||||
/// AliasTxt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox AliasTxt;
|
||||
|
||||
/// <summary>
|
||||
/// pp_masterTemplate control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_masterTemplate;
|
||||
|
||||
/// <summary>
|
||||
/// MasterTemplate control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList MasterTemplate;
|
||||
|
||||
/// <summary>
|
||||
/// pp_source control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.PropertyPanel pp_source;
|
||||
|
||||
/// <summary>
|
||||
/// editorSource control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.CodeArea editorSource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,17 +30,32 @@
|
||||
},
|
||||
|
||||
doSubmit: function () {
|
||||
/// <summary>Submits the data to the server for saving</summary>
|
||||
var codeVal = UmbClientMgr.contentFrame().UmbEditor.GetCode();
|
||||
var self = this;
|
||||
|
||||
umbraco.presentation.webservices.codeEditorSave.SaveTemplate(
|
||||
this._opts.nameTxtBox.val(),
|
||||
this._opts.aliasTxtBox.val(),
|
||||
codeVal,
|
||||
this._opts.templateId,
|
||||
this._opts.masterPageDropDown.val(),
|
||||
function (t) { self.submitSuccess(t); },
|
||||
function (t) { self.submitFailure(t); });
|
||||
if (this._opts.editorType == "Template") {
|
||||
//saving a template view
|
||||
|
||||
umbraco.presentation.webservices.codeEditorSave.SaveTemplate(
|
||||
this._opts.nameTxtBox.val(),
|
||||
this._opts.aliasTxtBox.val(),
|
||||
codeVal,
|
||||
this._opts.templateId,
|
||||
this._opts.masterPageDropDown.val(),
|
||||
function(t) { self.submitSuccess(t); },
|
||||
function(t) { self.submitFailure(t); });
|
||||
}
|
||||
else {
|
||||
//saving a partial view
|
||||
|
||||
umbraco.presentation.webservices.codeEditorSave.SavePartialView(
|
||||
this._opts.nameTxtBox.val(),
|
||||
this._opts.originalFileName,
|
||||
codeVal,
|
||||
function (t) { self.submitSuccess(t); },
|
||||
function (t) { self.submitFailure(t); });
|
||||
}
|
||||
},
|
||||
|
||||
submitSuccess: function (t) {
|
||||
|
||||
@@ -1,20 +1,62 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.IO;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Umbraco.Core.Configuration;
|
||||
//using Umbraco.Core.IO;
|
||||
//using umbraco.BusinessLogic.Actions;
|
||||
//using umbraco.businesslogic;
|
||||
//using umbraco.cms.presentation.Trees;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.BusinessLogic.Actions;
|
||||
using umbraco.businesslogic;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using umbraco.cms.presentation.Trees;
|
||||
using umbraco.interfaces;
|
||||
|
||||
//namespace Umbraco.Web.Trees
|
||||
//{
|
||||
// [Tree("settings", "partialViews", "Partial Views", sortOrder: 2)]
|
||||
// public class PartialViewsTree : BaseTree
|
||||
// {
|
||||
// public PartialViewsTree(string application) : base(application) { }
|
||||
namespace Umbraco.Web.Trees
|
||||
{
|
||||
[Tree("settings", "partialViews", "Partial Views", sortOrder: 2)]
|
||||
public class PartialViewsTree : FileSystemTree
|
||||
{
|
||||
public PartialViewsTree(string application) : base(application) { }
|
||||
|
||||
public override void RenderJS(ref StringBuilder javascript)
|
||||
{
|
||||
javascript.Append(
|
||||
@"
|
||||
function openPartialView(id) {
|
||||
UmbClientMgr.contentFrame('Settings/Views/EditView.aspx?file=' + id);
|
||||
}
|
||||
");
|
||||
}
|
||||
|
||||
protected override void CreateRootNode(ref XmlTreeNode rootNode)
|
||||
{
|
||||
rootNode.NodeType = "init" + TreeAlias;
|
||||
rootNode.NodeID = "init";
|
||||
}
|
||||
|
||||
protected override string FilePath
|
||||
{
|
||||
get { return SystemDirectories.MvcViews + "/Partials/"; }
|
||||
}
|
||||
|
||||
protected override string FileSearchPattern
|
||||
{
|
||||
get { return "*.*"; }
|
||||
}
|
||||
|
||||
//protected override void OnRenderFolderNode(ref XmlTreeNode xNode)
|
||||
//{
|
||||
// xNode.Menu = new List<IAction>(new IAction[] { ActionDelete.Instance, ContextMenuSeperator.Instance, ActionNew.Instance, ContextMenuSeperator.Instance, ActionRefresh.Instance });
|
||||
// xNode.NodeType = "scriptsFolder";
|
||||
//}
|
||||
|
||||
protected override void OnRenderFileNode(ref XmlTreeNode xNode)
|
||||
{
|
||||
xNode.Action = xNode.Action.Replace("openFile", "openPartialView");
|
||||
xNode.Icon = "settingsScript.gif";
|
||||
xNode.OpenIcon = "settingsScript.gif";
|
||||
}
|
||||
|
||||
// protected override void CreateRootNode(ref XmlTreeNode rootNode)
|
||||
// {
|
||||
@@ -22,6 +64,7 @@
|
||||
// rootNode.NodeID = "init";
|
||||
// }
|
||||
|
||||
// private string _partialViewsFolder = SystemDirectories.MvcViews + "/Partials/";
|
||||
|
||||
// public override void RenderJS(ref StringBuilder Javascript)
|
||||
// {
|
||||
@@ -38,22 +81,19 @@
|
||||
// public override void Render(ref XmlTree tree)
|
||||
// {
|
||||
// string folder = global::umbraco.library.Request("folder");
|
||||
// string folderPath = umbraco.library.Request("folderPath");
|
||||
// string folderPath = global::umbraco.library.Request("folderPath");
|
||||
|
||||
// if (!string.IsNullOrEmpty(folder))
|
||||
// RenderTemplateFolderItems(folder, folderPath, ref tree);
|
||||
// else
|
||||
// {
|
||||
// if (UmbracoSettings.EnableTemplateFolders)
|
||||
// RenderTemplateFolders(ref tree);
|
||||
|
||||
// RenderTemplates(ref tree);
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void RenderTemplateFolderItems(string folder, string folderPath, ref XmlTree tree)
|
||||
// {
|
||||
// string relPath = SystemDirectories.Masterpages + "/" + folder;
|
||||
// string relPath = _partialViewsFolder + folder;
|
||||
// if (!string.IsNullOrEmpty(folderPath))
|
||||
// relPath += folderPath;
|
||||
|
||||
@@ -127,7 +167,7 @@
|
||||
// {
|
||||
// if (base.m_id == -1)
|
||||
// {
|
||||
// foreach (string s in Directory.GetDirectories(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages)))
|
||||
// foreach (string s in Directory.GetDirectories(IOHelper.MapPath(_partialViewsFolder)))
|
||||
// {
|
||||
// var _s = Path.GetFileNameWithoutExtension(s);
|
||||
|
||||
@@ -205,5 +245,6 @@
|
||||
// actions.AddRange(new IAction[] { ActionNew.Instance, ActionDelete.Instance,
|
||||
// ContextMenuSeperator.Instance, ActionRefresh.Instance });
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,9 +328,10 @@
|
||||
<Compile Include="Mvc\SurfaceControllerResolver.cs" />
|
||||
<Compile Include="Strategies\UpdateCacheAfterPublish.cs" />
|
||||
<Compile Include="Strategies\UpdateCacheAfterUnPublish.cs" />
|
||||
<Compile Include="Strategies\EnsureAppsTreesUpdatedOnUpgrade.cs" />
|
||||
<Compile Include="Strategies\EnsureAppsTreesUpdatedOnUpgrade.cs" />
|
||||
<Compile Include="Templates\TemplateRenderer.cs" />
|
||||
<Compile Include="Templates\TemplateUtilities.cs" />
|
||||
<Compile Include="Trees\PartialViewsTree.cs" />
|
||||
<Compile Include="umbraco.presentation\Default.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -2184,9 +2185,7 @@
|
||||
<CachedSettingsPropName>umbraco_org_umbraco_update_CheckForUpgrade</CachedSettingsPropName>
|
||||
</WebReferenceUrl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Strategies\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
@@ -15,6 +15,8 @@ using Umbraco.Web.BaseRest;
|
||||
|
||||
namespace Umbraco.Web.WebServices
|
||||
{
|
||||
//TODO: Can we convert this to MVC please instead of /base?
|
||||
|
||||
[RestExtension("FolderBrowserService")]
|
||||
public class FolderBrowserService
|
||||
{
|
||||
|
||||
@@ -166,8 +166,23 @@ namespace umbraco.cms.presentation.Trees
|
||||
//find the Application tree's who's combination of assembly name and tree type is equal to
|
||||
//the Type that was found's full name.
|
||||
//Since a tree can exist in multiple applications we'll need to register them all.
|
||||
|
||||
//The logic of this has changed in 6.0: http://issues.umbraco.org/issue/U4-1360
|
||||
// we will support the old legacy way but the normal way is to match on assembly qualified names
|
||||
|
||||
var appTreesForType = appTrees.FindAll(
|
||||
tree => (string.Format("{0}.{1}", tree.AssemblyName, tree.Type) == type.FullName)
|
||||
tree =>
|
||||
{
|
||||
//match the type on assembly qualified name if the assembly attribute is empty or if the
|
||||
// tree type contains a comma (meaning it is assembly qualified)
|
||||
if (tree.AssemblyName.IsNullOrWhiteSpace() || tree.Type.Contains(","))
|
||||
{
|
||||
return tree.Type == type.GetFullNameWithAssembly();
|
||||
}
|
||||
|
||||
//otherwise match using legacy match rules
|
||||
return (string.Format("{0}.{1}", tree.AssemblyName, tree.Type).InvariantEquals(type.FullName));
|
||||
}
|
||||
);
|
||||
|
||||
foreach (var appTree in appTreesForType)
|
||||
|
||||
@@ -11,13 +11,13 @@ using System.Web.Services;
|
||||
using System.Web.UI;
|
||||
using System.Xml;
|
||||
using System.Xml.Xsl;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.cms.businesslogic.macro;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.presentation.cache;
|
||||
using System.Net;
|
||||
using umbraco.IO;
|
||||
using System.Collections;
|
||||
using umbraco.NodeFactory;
|
||||
using umbraco.scripting;
|
||||
@@ -34,8 +34,7 @@ namespace umbraco.presentation.webservices
|
||||
public class codeEditorSave : WebService
|
||||
{
|
||||
[WebMethod]
|
||||
public string Save(string fileName, string fileAlias, string fileContents, string fileType, int fileID,
|
||||
int masterID, bool ignoreDebug)
|
||||
public string Save(string fileName, string fileAlias, string fileContents, string fileType, int fileID, int masterID, bool ignoreDebug)
|
||||
{
|
||||
return "Not implemented";
|
||||
}
|
||||
@@ -339,6 +338,49 @@ namespace umbraco.presentation.webservices
|
||||
return "false";
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public string SavePartialView(string filename, string oldName, string contents)
|
||||
{
|
||||
if (BasePage.ValidateUserContextID(BasePage.umbracoUserContextID))
|
||||
{
|
||||
var folderPath = SystemDirectories.MvcViews + "/Partials/";
|
||||
|
||||
// validate file
|
||||
IOHelper.ValidateEditPath(IOHelper.MapPath(folderPath + filename), folderPath);
|
||||
// validate extension
|
||||
IOHelper.ValidateFileExtension(IOHelper.MapPath(folderPath + filename), new[] {"cshtml"}.ToList());
|
||||
|
||||
|
||||
var val = contents;
|
||||
string returnValue;
|
||||
var saveOldPath = oldName.StartsWith("~/") ? IOHelper.MapPath(oldName) : IOHelper.MapPath(folderPath + oldName);
|
||||
var savePath = filename.StartsWith("~/") ? IOHelper.MapPath(filename) : IOHelper.MapPath(folderPath + filename);
|
||||
|
||||
//Directory check.. only allow files in script dir and below to be edited
|
||||
if (savePath.StartsWith(IOHelper.MapPath(folderPath)))
|
||||
{
|
||||
//deletes the old file
|
||||
if (savePath != saveOldPath)
|
||||
{
|
||||
if (File.Exists(saveOldPath))
|
||||
File.Delete(saveOldPath);
|
||||
}
|
||||
using (var sw = File.CreateText(savePath))
|
||||
{
|
||||
sw.Write(val);
|
||||
}
|
||||
returnValue = "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = "illegalPath";
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public string SaveScript(string filename, string oldName, string contents)
|
||||
{
|
||||
|
||||
@@ -404,7 +404,7 @@ namespace umbraco.BusinessLogic
|
||||
addElement.Attribute("title").Value,
|
||||
addElement.Attribute("iconClosed").Value,
|
||||
addElement.Attribute("iconOpen").Value,
|
||||
addElement.Attribute("assembly").Value,
|
||||
(string)addElement.Attribute("assembly"), //this could be empty: http://issues.umbraco.org/issue/U4-1360
|
||||
addElement.Attribute("type").Value,
|
||||
addElement.Attribute("action") != null ? addElement.Attribute("action").Value : ""));
|
||||
}
|
||||
|
||||
@@ -34,10 +34,8 @@ namespace umbraco.BusinessLogic
|
||||
{
|
||||
var type = tuple.Item1;
|
||||
var attr = tuple.Item2;
|
||||
|
||||
var typeParts = type.AssemblyQualifiedName.Split(',');
|
||||
var assemblyName = typeParts[1].Trim();
|
||||
var typeName = typeParts[0].Substring(assemblyName.Length + 1).Trim();
|
||||
|
||||
//Add the new tree that doesn't exist in the config that was found by type finding
|
||||
|
||||
doc.Root.Add(new XElement("add",
|
||||
new XAttribute("silent", attr.Silent),
|
||||
@@ -48,11 +46,17 @@ namespace umbraco.BusinessLogic
|
||||
new XAttribute("title", attr.Title),
|
||||
new XAttribute("iconClosed", attr.IconClosed),
|
||||
new XAttribute("iconOpen", attr.IconOpen),
|
||||
new XAttribute("assembly", assemblyName),
|
||||
new XAttribute("type", typeName),
|
||||
// don't add the assembly, we don't need this:
|
||||
// http://issues.umbraco.org/issue/U4-1360
|
||||
//new XAttribute("assembly", assemblyName),
|
||||
//new XAttribute("type", typeName),
|
||||
// instead, store the assembly type name
|
||||
new XAttribute("type", type.GetFullNameWithAssembly()),
|
||||
new XAttribute("action", attr.Action)));
|
||||
}
|
||||
|
||||
//add any trees that were found in the database that don't exist in the config
|
||||
|
||||
var db = ApplicationContext.Current.DatabaseContext.Database;
|
||||
var exist = db.TableExist("umbracoAppTree");
|
||||
if (exist)
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace umbraco.BusinessLogic.Utils
|
||||
/// The typeresolver is a collection of utillities for finding and determining types and classes with reflection.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[Obsolete("This class is not longer used and will be removed in future versions")]
|
||||
public class TypeResolver : MarshalByRefObject
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user