diff --git a/.gitignore b/.gitignore index 7964536..d9f17f4 100644 --- a/.gitignore +++ b/.gitignore @@ -186,4 +186,9 @@ FakesAssemblies/ # LightSwitch generated files GeneratedArtifacts/ _Pvt_Extensions/ -ModelManifest.xml \ No newline at end of file +ModelManifest.xml + +# Umbraco folders +/Arknu.Umbraco.Relations.Web/umbraco/* +/Arknu.Umbraco.Relations.Web/umbraco_client/* +/Arknu.Umbraco.Relations.Web/App_Data \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations.Editor.csproj b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations.Editor.csproj new file mode 100644 index 0000000..28f0632 --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations.Editor.csproj @@ -0,0 +1,114 @@ + + + + + Debug + AnyCPU + + + 2.0 + {67EDA72B-2BA7-497F-BD4E-DCD508D535BF} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Arknu.Umbraco.Relations.Editor + Arknu.Umbraco.Relations.Editor + v4.5 + true + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 51933 + / + http://localhost:51933/ + False + False + + + False + + + + + + xcopy "$(ProjectDir)Arknu.Umbraco.Relations\*" "$(SolutionDir)\Arknu.Umbraco.Relations.Web\App_Plugins\Arknu.Umbraco.Relations\" /E /Y + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js new file mode 100644 index 0000000..9f0dcee --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js @@ -0,0 +1,7 @@ +angular.module("umbraco") + .controller("Arknu.Umbraco.Relations.Config.Controller", function ($scope, arknuRelationsResource, editorState) { + $scope.model.relationTypes = []; + arknuRelationsResource.getRelationTypes(editorState.current.id).then(function (response) { + $scope.model.relationTypes = response.data; + }); + }); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html new file mode 100644 index 0000000..381756e --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html @@ -0,0 +1,4 @@ +
+ +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js new file mode 100644 index 0000000..f73670b --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js @@ -0,0 +1,48 @@ +angular.module("umbraco") + .controller("Arknu.Umbraco.Relations.Controller", function ($scope, arknuRelationsResource, editorState, dialogService) { + var type = $scope.model.config.relationTypeAlias; + + arknuRelationsResource.getRelations(editorState.current.id, type).then(function (response) { + $scope.model.items = response.data; + }); + + var dialogOptions = { + multiPicker: true, + entityType: "content", + filterCssClass: "not-allowed not-published", + startNodeId: null, + callback: function (data) { + if (angular.isArray(data)) { + _.each(data, function (item, i) { + $scope.add(item); + }); + } else { + $scope.clear(); + $scope.add(data); + } + }, + treeAlias: "content", + section: "content" + }; + + //dialog + $scope.openContentPicker = function () { + var d = dialogService.treePicker(dialogOptions); + }; + + $scope.remove = function (index) { + var item = $scope.model.items[index]; + arknuRelationsResource.deleteRelation(item.relationId).then(function (response) { + $scope.model.items.splice(index, 1); + }); + + }; + + $scope.add = function (item) { + arknuRelationsResource.saveRelation(editorState.current.id, item.id, type).then(function (response) { + $scope.model.items.push(response.data); + }); + + + }; + }); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.html b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.html new file mode 100644 index 0000000..18a6a56 --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.html @@ -0,0 +1,25 @@ +
+ + + +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js new file mode 100644 index 0000000..e752bae --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js @@ -0,0 +1,24 @@ +angular.module('umbraco.resources').factory('arknuRelationsResource', + function ($q, $http) { + //the factory object returned + return { + //this cals the Api Controller we setup earlier + getRelations: function (id, type) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.get(baseurl + "GetRelations/" + id + "?type=" + type); + }, + getRelationTypes: function (id) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.get(baseurl + "GetRelationTypes"); + }, + saveRelation: function (sourceid, targetid, type) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.post(baseurl + "SaveRelation?sourceid=" + sourceid + "&targetid=" + targetid + "&type=" + type); + }, + deleteRelation: function (relationid) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.delete(baseurl + "DeleteRelation?relationid=" + relationid); + } + }; + } +); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/package.manifest b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/package.manifest new file mode 100644 index 0000000..4b3debc --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/package.manifest @@ -0,0 +1,33 @@ +{ + //you can define multiple editors + propertyEditors: [ + { + alias: "Arknu.Umbraco.Relations", + name: "Relations Picker", + editor: { + view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html" + }, + prevalues: { + fields: [ + { + label: "Relation type", + description: "Select the relation type to use", + key: "relationTypeAlias", + view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html" + + } + ] + } + + } + ] + , + //array of files we want to inject into the application on app_start + javascript: [ + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js", + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js", + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js" + ], + css: [ + ] +} diff --git a/Arknu.Umbraco.Relations.Editor/Properties/AssemblyInfo.cs b/Arknu.Umbraco.Relations.Editor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fee4fe0 --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Arknu.Umbraco.Relations.Editor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Arknu.Umbraco.Relations.Editor")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65754a0d-bd49-4597-b7ff-f6ef6fb68abc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Arknu.Umbraco.Relations.Editor/Web.Debug.config b/Arknu.Umbraco.Relations.Editor/Web.Debug.config new file mode 100644 index 0000000..2e302f9 --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Web.Release.config b/Arknu.Umbraco.Relations.Editor/Web.Release.config new file mode 100644 index 0000000..c358444 --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Editor/Web.config b/Arknu.Umbraco.Relations.Editor/Web.config new file mode 100644 index 0000000..bfb640d --- /dev/null +++ b/Arknu.Umbraco.Relations.Editor/Web.config @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Browsers/Form.browser b/Arknu.Umbraco.Relations.Web/App_Browsers/Form.browser new file mode 100644 index 0000000..a15cd2c --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Browsers/Form.browser @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Browsers/w3cvalidator.browser b/Arknu.Umbraco.Relations.Web/App_Browsers/w3cvalidator.browser new file mode 100644 index 0000000..ab466c8 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Browsers/w3cvalidator.browser @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js new file mode 100644 index 0000000..9f0dcee --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js @@ -0,0 +1,7 @@ +angular.module("umbraco") + .controller("Arknu.Umbraco.Relations.Config.Controller", function ($scope, arknuRelationsResource, editorState) { + $scope.model.relationTypes = []; + arknuRelationsResource.getRelationTypes(editorState.current.id).then(function (response) { + $scope.model.relationTypes = response.data; + }); + }); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html new file mode 100644 index 0000000..381756e --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html @@ -0,0 +1,4 @@ +
+ +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js new file mode 100644 index 0000000..f73670b --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js @@ -0,0 +1,48 @@ +angular.module("umbraco") + .controller("Arknu.Umbraco.Relations.Controller", function ($scope, arknuRelationsResource, editorState, dialogService) { + var type = $scope.model.config.relationTypeAlias; + + arknuRelationsResource.getRelations(editorState.current.id, type).then(function (response) { + $scope.model.items = response.data; + }); + + var dialogOptions = { + multiPicker: true, + entityType: "content", + filterCssClass: "not-allowed not-published", + startNodeId: null, + callback: function (data) { + if (angular.isArray(data)) { + _.each(data, function (item, i) { + $scope.add(item); + }); + } else { + $scope.clear(); + $scope.add(data); + } + }, + treeAlias: "content", + section: "content" + }; + + //dialog + $scope.openContentPicker = function () { + var d = dialogService.treePicker(dialogOptions); + }; + + $scope.remove = function (index) { + var item = $scope.model.items[index]; + arknuRelationsResource.deleteRelation(item.relationId).then(function (response) { + $scope.model.items.splice(index, 1); + }); + + }; + + $scope.add = function (item) { + arknuRelationsResource.saveRelation(editorState.current.id, item.id, type).then(function (response) { + $scope.model.items.push(response.data); + }); + + + }; + }); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html new file mode 100644 index 0000000..18a6a56 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html @@ -0,0 +1,25 @@ +
+ + + +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js new file mode 100644 index 0000000..e752bae --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js @@ -0,0 +1,24 @@ +angular.module('umbraco.resources').factory('arknuRelationsResource', + function ($q, $http) { + //the factory object returned + return { + //this cals the Api Controller we setup earlier + getRelations: function (id, type) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.get(baseurl + "GetRelations/" + id + "?type=" + type); + }, + getRelationTypes: function (id) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.get(baseurl + "GetRelationTypes"); + }, + saveRelation: function (sourceid, targetid, type) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.post(baseurl + "SaveRelation?sourceid=" + sourceid + "&targetid=" + targetid + "&type=" + type); + }, + deleteRelation: function (relationid) { + var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; + return $http.delete(baseurl + "DeleteRelation?relationid=" + relationid); + } + }; + } +); \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/package.manifest b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/package.manifest new file mode 100644 index 0000000..4b3debc --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/package.manifest @@ -0,0 +1,33 @@ +{ + //you can define multiple editors + propertyEditors: [ + { + alias: "Arknu.Umbraco.Relations", + name: "Relations Picker", + editor: { + view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html" + }, + prevalues: { + fields: [ + { + label: "Relation type", + description: "Select the relation type to use", + key: "relationTypeAlias", + view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html" + + } + ] + } + + } + ] + , + //array of files we want to inject into the application on app_start + javascript: [ + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js", + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js", + "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js" + ], + css: [ + ] +} diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.config.html b/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.config.html new file mode 100644 index 0000000..f03d467 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.config.html @@ -0,0 +1,3 @@ +
+ Relations +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.html b/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.html new file mode 100644 index 0000000..9ac5ffa --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.html @@ -0,0 +1,3 @@ +
+ Relations picker +
\ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/App_Plugins/package.manifest b/Arknu.Umbraco.Relations.Web/App_Plugins/package.manifest new file mode 100644 index 0000000..2955dd7 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/App_Plugins/package.manifest @@ -0,0 +1,18 @@ +{ + //you can define multiple editors + propertyEditors: [ + { + alias: "Arknu.Umbraco.Relations", + name: "Relations Picker", + editor: { + view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html" + } + } + ] + , + //array of files we want to inject into the application on app_start + javascript: [ + ], + css: [ + ] +} diff --git a/Arknu.Umbraco.Relations.Web/Arknu.Umbraco.Relations.Web.csproj b/Arknu.Umbraco.Relations.Web/Arknu.Umbraco.Relations.Web.csproj new file mode 100644 index 0000000..8d61562 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Arknu.Umbraco.Relations.Web.csproj @@ -0,0 +1,297 @@ + + + + + + Debug + AnyCPU + + + 2.0 + {B58E4C4A-18CD-45E8-BA7D-EC1281463E08} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Arknu.Umbraco.Relations.Web + Arknu.Umbraco.Relations.Web + v4.5 + true + + + + + 08cc9310 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll + + + ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\businesslogic.dll + + + ..\packages\ClientDependency.1.8.2.1\lib\net45\ClientDependency.Core.dll + + + ..\packages\ClientDependency-Mvc.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\cms.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\controls.dll + + + ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll + + + ..\packages\Examine.0.1.60.2941\lib\Examine.dll + + + ..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll + + + False + ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + + + ..\packages\ImageProcessor.1.9.5.0\lib\ImageProcessor.dll + + + ..\packages\ImageProcessor.Web.3.3.1.0\lib\net45\ImageProcessor.Web.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\interfaces.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\log4net.dll + + + ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Microsoft.ApplicationBlocks.Data.dll + + + + True + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll + + + ..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll + + + ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll + + + False + ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\SQLCE4Umbraco.dll + + + True + ..\packages\UmbracoCms.Core.7.2.2\lib\System.Data.SqlServerCe.dll + + + True + ..\packages\UmbracoCms.Core.7.2.2\lib\System.Data.SqlServerCe.Entity.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll + + + + + + + + + + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll + + + False + ..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll + + + True + ..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll + + + + + + + + + + ..\packages\UmbracoCms.Core.7.2.2\lib\TidyNet.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Umbraco.Core.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.DataLayer.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.editorControls.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.MacroEngines.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.providers.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Umbraco.Web.UI.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\UmbracoExamine.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\UrlRewritingNet.UrlRewriter.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + {a66a26e5-a2bc-4939-9598-6474ed2dd42b} + Arknu.Umbraco.Relations + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 56113 + / + http://localhost:56113/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/404handlers.config b/Arknu.Umbraco.Relations.Web/Config/404handlers.config new file mode 100644 index 0000000..97e017b --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/404handlers.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/BaseRestExtensions.config b/Arknu.Umbraco.Relations.Web/Config/BaseRestExtensions.config new file mode 100644 index 0000000..8e9c4ad --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/BaseRestExtensions.config @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/ClientDependency.config b/Arknu.Umbraco.Relations.Web/Config/ClientDependency.config new file mode 100644 index 0000000..efca2de --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/ClientDependency.config @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/Dashboard.config b/Arknu.Umbraco.Relations.Web/Config/Dashboard.config new file mode 100644 index 0000000..9223d5f --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/Dashboard.config @@ -0,0 +1,88 @@ + + + +
+ + settings + + + + views/dashboard/settings/settingsdashboardintro.html + + +
+ +
+ + forms + + + + views/dashboard/forms/formsdashboardintro.html + + +
+ +
+ + developer + + + + views/dashboard/developer/developerdashboardvideos.html + + + + + views/dashboard/developer/examinemanagement.html + + +
+ +
+ + media + + + + views/dashboard/media/mediafolderbrowser.html + + + +
+ +
+ + translator + + + content + + + + admin + + + + views/dashboard/default/startupdashboardintro.html + + + + + + views/dashboard/ChangePassword.html + + +
+ +
+ + member + + + + views/dashboard/members/membersdashboardvideos.html + + +
+
diff --git a/Arknu.Umbraco.Relations.Web/Config/EmbeddedMedia.config b/Arknu.Umbraco.Relations.Web/Config/EmbeddedMedia.config new file mode 100644 index 0000000..ece2a0b --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/EmbeddedMedia.config @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + xml + + + + + + + + + + + + + + + + + + 1 + xml + https + + + + + + + + + + + + + + xml + + + + + + + + xml + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/ExamineIndex.config b/Arknu.Umbraco.Relations.Web/Config/ExamineIndex.config new file mode 100644 index 0000000..4a1b572 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/ExamineIndex.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/ExamineSettings.config b/Arknu.Umbraco.Relations.Web/Config/ExamineSettings.config new file mode 100644 index 0000000..346fd09 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/ExamineSettings.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/FileSystemProviders.config b/Arknu.Umbraco.Relations.Web/Config/FileSystemProviders.config new file mode 100644 index 0000000..1f038f6 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/FileSystemProviders.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/UrlRewriting.config b/Arknu.Umbraco.Relations.Web/Config/UrlRewriting.config new file mode 100644 index 0000000..3c04583 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/UrlRewriting.config @@ -0,0 +1,33 @@ + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/applications.config b/Arknu.Umbraco.Relations.Web/Config/applications.config new file mode 100644 index 0000000..7f88f58 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/applications.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/feedProxy.config b/Arknu.Umbraco.Relations.Web/Config/feedProxy.config new file mode 100644 index 0000000..bc9a916 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/feedProxy.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/grid.editors.config.js b/Arknu.Umbraco.Relations.Web/Config/grid.editors.config.js new file mode 100644 index 0000000..7686de5 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/grid.editors.config.js @@ -0,0 +1,46 @@ +[ + { + "name": "Rich text editor", + "alias": "rte", + "view": "rte", + "icon": "icon-article" + }, + { + "name": "Image", + "alias": "media", + "view": "media", + "icon": "icon-picture" + }, + { + "name": "Macro", + "alias": "macro", + "view": "macro", + "icon": "icon-settings-alt" + }, + { + "name": "Embed", + "alias": "embed", + "view": "embed", + "icon": "icon-movie-alt" + }, + { + "name": "Headline", + "alias": "headline", + "view": "textstring", + "icon": "icon-coin", + "config": { + "style": "font-size: 36px; line-height: 45px; font-weight: bold", + "markup": "

#value#

" + } + }, + { + "name": "Quote", + "alias": "quote", + "view": "textstring", + "icon": "icon-quote", + "config": { + "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px", + "markup": "
#value#
" + } + } +] \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/log4net.config b/Arknu.Umbraco.Relations.Web/Config/log4net.config new file mode 100644 index 0000000..15d2e0a --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/log4net.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Config/metablogConfig.config b/Arknu.Umbraco.Relations.Web/Config/metablogConfig.config new file mode 100644 index 0000000..a2c80c9 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/metablogConfig.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/scripting.config b/Arknu.Umbraco.Relations.Web/Config/scripting.config new file mode 100644 index 0000000..085856c --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/scripting.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/splashes/booting.aspx b/Arknu.Umbraco.Relations.Web/Config/splashes/booting.aspx new file mode 100644 index 0000000..65447c4 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/splashes/booting.aspx @@ -0,0 +1,26 @@ +<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> + +<% + // NH: Adds this inline check to avoid a simple codebehind file in the legacy project! + if (Request["url"].ToLower().Contains("booting.aspx") || !umbraco.cms.helpers.url.ValidateProxyUrl(Request["url"], Request.Url.AbsoluteUri)) + { + throw new ArgumentException("Can't redirect to the requested url - it's not local or an approved proxy url", + "url"); + } +%> + + + + The website is restarting + "> + + +

The website is restarting

+

Please wait for 10s while we prepare to serve the page you have requested...

+ +

+ You can modify the design of this page by editing /config/splashes/booting.aspx +

+ + + diff --git a/Arknu.Umbraco.Relations.Web/Config/splashes/noNodes.aspx b/Arknu.Umbraco.Relations.Web/Config/splashes/noNodes.aspx new file mode 100644 index 0000000..39184ec --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/splashes/noNodes.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Config.Splashes.NoNodes" CodeBehind="NoNodes.aspx.cs" %> +<%@ Import Namespace="Umbraco.Core.Configuration" %> +<%@ Import Namespace="Umbraco.Core.IO" %> + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +

Welcome to your Umbraco installation

+

You're seeing the wonderful page because your website doesn't contain any published content yet.

+ + + + +
+
+

Easy start with Umbraco.tv

+

We have created a bunch of 'how-to' videos, to get you easily started with Umbraco. Learn how to build projects in just a couple of minutes. Easiest CMS in the world.

+ + Umbraco.tv → +
+ +
+

Be a part of the community

+

The Umbraco community is the best of its kind, be sure to visit, and if you have any questions, we’re sure that you can get your answers from the community.

+ + our.Umbraco → +
+
+ +
+
+ +
+ + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/tinyMceConfig.config b/Arknu.Umbraco.Relations.Web/Config/tinyMceConfig.config new file mode 100644 index 0000000..91ffbaa --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/tinyMceConfig.config @@ -0,0 +1,243 @@ + + + + + + + code + images/editor/code.gif + code + 1 + + + removeformat + images/editor/removeformat.gif + removeformat + 2 + + + + Undo + images/editor/undo.gif + undo + 11 + + + Redo + images/editor/redo.gif + redo + 12 + + + Cut + images/editor/cut.gif + cut + 13 + + + Copy + images/editor/copy.gif + copy + 14 + + + + styleselect + images/editor/showStyles.png + styleselect + 20 + + + bold + images/editor/bold.gif + bold + 21 + + + italic + images/editor/italic.gif + italic + 22 + + + Underline + images/editor/underline.gif + underline + 23 + + + Strikethrough + images/editor/strikethrough.gif + strikethrough + 24 + + + + JustifyLeft + images/editor/justifyleft.gif + justifyleft + 31 + + + JustifyCenter + images/editor/justifycenter.gif + justifycenter + 32 + + + JustifyRight + images/editor/justifyright.gif + justifyright + 33 + + + JustifyFull + images/editor/justifyfull.gif + alignjustify + 34 + + + + bullist + images/editor/bullist.gif + bullist + 41 + + + numlist + images/editor/numlist.gif + numlist + 42 + + + Outdent + images/editor/outdent.gif + outdent + 43 + + + Indent + images/editor/indent.gif + indent + 44 + + + + mceLink + images/editor/link.gif + link + 51 + + + unlink + images/editor/unLink.gif + unlink + 52 + + + mceInsertAnchor + images/editor/anchor.gif + anchor + 53 + + + + mceImage + images/editor/image.gif + image + 61 + + + + umbracomacro + images/editor/insMacro.gif + umbracomacro + 62 + + + + + + mceInsertTable + images/editor/table.gif + table + 63 + + + + umbracoembed + images/editor/media.gif + umbracoembed + 66 + + + inserthorizontalrule + images/editor/hr.gif + hr + 71 + + + subscript + images/editor/sub.gif + subscript + 72 + + + + superscript + images/editor/sup.gif + superscript + 73 + + + + mceCharMap + images/editor/charmap.gif + charmap + 74 + + + + + code + paste + umbracolink + anchor + charmap + table + lists + + + + + font + + + + + raw + + { + "indentOnInit": false, + "path": "../../../../../umbraco_client/CodeMirror/Js", + "config": { + }, + "jsFiles": [ + ], + "cssFiles": [ + ] + } + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/trees.config b/Arknu.Umbraco.Relations.Web/Config/trees.config new file mode 100644 index 0000000..a27f1a5 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/trees.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Config/umbracoSettings.config b/Arknu.Umbraco.Relations.Web/Config/umbracoSettings.config new file mode 100644 index 0000000..5f98d53 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Config/umbracoSettings.config @@ -0,0 +1,141 @@ + + + + + + + + + 1 + + + + + + your@email.here + + + + text + + + + In Preview Mode - click to end]]> + + + + 1800 + + + inline + + + ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,html,htm,svg,php,htaccess + + + Textstring + + + + + false + + false + + + + + false + + true + + + + + Mvc + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/Global.asax b/Arknu.Umbraco.Relations.Web/Global.asax new file mode 100644 index 0000000..53d2d54 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Global.asax @@ -0,0 +1,2 @@ +<%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %> + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Properties/AssemblyInfo.cs b/Arknu.Umbraco.Relations.Web/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a268989 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Arknu.Umbraco.Relations.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Arknu.Umbraco.Relations.Web")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("328e92a8-22a4-462b-9a65-36c959440a5d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap2.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap2.cshtml new file mode 100644 index 0000000..5027348 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap2.cshtml @@ -0,0 +1,84 @@ +@inherits UmbracoViewPage +@using Umbraco.Web.Templates +@using Newtonsoft.Json.Linq + +@* + Razor helpers located at the bottom of this file +*@ + +@if (Model != null && Model.sections != null) +{ + var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; + +
+ @if (oneColumn) + { + foreach (var section in Model.sections) { +
+ @foreach (var row in section.rows) { + @renderRow(row, true); + } +
+ } + }else { +
+
+ @foreach (var s in Model.sections) { +
+
+ @foreach (var row in s.rows) { + @renderRow(row, false); + } +
+
+ } +
+
+ } +
+} + +@helper renderRow(dynamic row, bool singleColumn){ +
+ @Umbraco.If(singleColumn, "
") +
+ @foreach ( var area in row.areas ) { +
+
+ @foreach (var control in area.controls) { + if (control !=null && control.editor != null && control.editor.view != null ) { + @Html.Partial("grid/editors/base", (object)control) + } + } +
+
} +
+ @Umbraco.If(singleColumn, "
") +
+} + +@functions { + public static MvcHtmlString RenderElementAttributes(dynamic contentItem) + { + var attrs = new List(); + JObject cfg = contentItem.config; + + if(cfg != null) + foreach (JProperty property in cfg.Properties()) { + attrs.Add(property.Name + "='" + property.Value.ToString() + "'"); + } + + JObject style = contentItem.styles; + + if (style != null) { + var cssVals = new List(); + foreach (JProperty property in style.Properties()) + cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); + + if (cssVals.Any()) + attrs.Add("style='" + string.Join(" ", cssVals) + "'"); + } + + return new MvcHtmlString(string.Join(" ", attrs)); + } +} \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap3.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap3.cshtml new file mode 100644 index 0000000..a752042 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap3.cshtml @@ -0,0 +1,84 @@ +@inherits UmbracoViewPage +@using Umbraco.Web.Templates +@using Newtonsoft.Json.Linq + +@* + Razor helpers located at the bottom of this file +*@ + +@if (Model != null && Model.sections != null) +{ + var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; + +
+ @if (oneColumn) + { + foreach (var section in Model.sections) { +
+ @foreach (var row in section.rows) { + @renderRow(row, true); + } +
+ } + }else { +
+
+ @foreach (var s in Model.sections) { +
+
+ @foreach (var row in s.rows) { + @renderRow(row, false); + } +
+
+ } +
+
+ } +
+} + +@helper renderRow(dynamic row, bool singleColumn){ +
+ @Umbraco.If(singleColumn, "
") +
+ @foreach ( var area in row.areas ) { +
+
+ @foreach (var control in area.controls) { + if (control !=null && control.editor != null && control.editor.view != null ) { + @Html.Partial("grid/editors/base", (object)control) + } + } +
+
} +
+ @Umbraco.If(singleColumn, "
") +
+} + +@functions { + public static MvcHtmlString RenderElementAttributes(dynamic contentItem) + { + var attrs = new List(); + JObject cfg = contentItem.config; + + if(cfg != null) + foreach (JProperty property in cfg.Properties()) { + attrs.Add(property.Name + "='" + property.Value.ToString() + "'"); + } + + JObject style = contentItem.styles; + + if (style != null) { + var cssVals = new List(); + foreach (JProperty property in style.Properties()) + cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); + + if (cssVals.Any()) + attrs.Add("style='" + string.Join(" ", cssVals) + "'"); + } + + return new MvcHtmlString(string.Join(" ", attrs)); + } +} \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Base.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Base.cshtml new file mode 100644 index 0000000..a86c048 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Base.cshtml @@ -0,0 +1,24 @@ +@model dynamic +@using Umbraco.Web.Templates + +@functions { + public static string EditorView(dynamic contentItem) + { + string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); + view = view.ToLower().Replace(".html", ".cshtml"); + + if (!view.Contains("/")) { + view = "grid/editors/" + view; + } + + return view; + } +} +@try +{ + string editor = EditorView(Model); + @Html.Partial(editor, (object)Model) +} +catch (Exception ex) { +
@ex.ToString()
+} \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Embed.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Embed.cshtml new file mode 100644 index 0000000..4fd66dd --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Embed.cshtml @@ -0,0 +1,3 @@ +@model dynamic +@using Umbraco.Web.Templates +@Html.Raw(Model.value) diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Macro.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Macro.cshtml new file mode 100644 index 0000000..e082280 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Macro.cshtml @@ -0,0 +1,17 @@ +@inherits UmbracoViewPage +@using Umbraco.Web.Templates + + +@if (Model.value != null) +{ + string macroAlias = Model.value.macroAlias.ToString(); + ViewDataDictionary parameters = new ViewDataDictionary(); + foreach (dynamic mpd in Model.value.macroParamsDictionary) + { + parameters.Add(mpd.Name, mpd.Value); + } + + + @Umbraco.RenderMacro(macroAlias, parameters) + +} diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Media.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Media.cshtml new file mode 100644 index 0000000..09d0421 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Media.cshtml @@ -0,0 +1,23 @@ +@model dynamic +@using Umbraco.Web.Templates + +@if (Model.value != null) +{ + var url = Model.value.image; + if(Model.editor.config != null && Model.editor.config.size != null){ + url += "?width=" + Model.editor.config.size.width; + url += "&height=" + Model.editor.config.size.height; + + if(Model.value.focalPoint != null){ + url += "¢er=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left; + url += "&mode=crop"; + } + } + + @Model.value.caption + + if (Model.value.caption != null) + { +

@Model.value.caption

+ } +} diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Rte.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Rte.cshtml new file mode 100644 index 0000000..d132e10 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Rte.cshtml @@ -0,0 +1,4 @@ +@model dynamic +@using Umbraco.Web.Templates + +@Html.Raw(TemplateUtilities.ParseInternalLinks(Model.value.ToString())) diff --git a/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Textstring.cshtml b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Textstring.cshtml new file mode 100644 index 0000000..0cac4eb --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Textstring.cshtml @@ -0,0 +1,20 @@ +@model dynamic +@using Umbraco.Web.Templates + +@if (Model.editor.config.markup != null) +{ + string markup = Model.editor.config.markup.ToString(); + + markup = markup.Replace("#value#", Model.value.ToString()); + markup = markup.Replace("#style#", Model.editor.config.style.ToString()); + + + @Html.Raw(markup) + +} +else +{ + +
@Model.value
+
+} diff --git a/Arknu.Umbraco.Relations.Web/Views/Text.cshtml b/Arknu.Umbraco.Relations.Web/Views/Text.cshtml new file mode 100644 index 0000000..08fed63 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Text.cshtml @@ -0,0 +1,4 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +@{ + Layout = null; +} \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Views/Web.config b/Arknu.Umbraco.Relations.Web/Views/Web.config new file mode 100644 index 0000000..43f61a9 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Views/Web.config @@ -0,0 +1,55 @@ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Web.Debug.config b/Arknu.Umbraco.Relations.Web/Web.Debug.config new file mode 100644 index 0000000..2e302f9 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Web.Release.config b/Arknu.Umbraco.Relations.Web/Web.Release.config new file mode 100644 index 0000000..c358444 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.Web/Web.config b/Arknu.Umbraco.Relations.Web/Web.config new file mode 100644 index 0000000..06bb9ea --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/Web.config @@ -0,0 +1,280 @@ + + + +
+
+
+
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Arknu.Umbraco.Relations.Web/default.aspx b/Arknu.Umbraco.Relations.Web/default.aspx new file mode 100644 index 0000000..75b0e5d --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/default.aspx @@ -0,0 +1,2 @@ +<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="True" Inherits="umbraco.UmbracoDefault" trace="true" validateRequest="false" %> + diff --git a/Arknu.Umbraco.Relations.Web/media/created-packages/Relations_Picker_1.0.zip b/Arknu.Umbraco.Relations.Web/media/created-packages/Relations_Picker_1.0.zip new file mode 100644 index 0000000..94b8a8b Binary files /dev/null and b/Arknu.Umbraco.Relations.Web/media/created-packages/Relations_Picker_1.0.zip differ diff --git a/Arknu.Umbraco.Relations.Web/packages.config b/Arknu.Umbraco.Relations.Web/packages.config new file mode 100644 index 0000000..647ee80 --- /dev/null +++ b/Arknu.Umbraco.Relations.Web/packages.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations.sln b/Arknu.Umbraco.Relations.sln new file mode 100644 index 0000000..6d450c0 --- /dev/null +++ b/Arknu.Umbraco.Relations.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arknu.Umbraco.Relations.Web", "Arknu.Umbraco.Relations.Web\Arknu.Umbraco.Relations.Web.csproj", "{B58E4C4A-18CD-45E8-BA7D-EC1281463E08}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arknu.Umbraco.Relations.Editor", "Arknu.Umbraco.Relations.Editor\Arknu.Umbraco.Relations.Editor.csproj", "{67EDA72B-2BA7-497F-BD4E-DCD508D535BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arknu.Umbraco.Relations", "Arknu.Umbraco.Relations\Arknu.Umbraco.Relations.csproj", "{A66A26E5-A2BC-4939-9598-6474ED2DD42B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B58E4C4A-18CD-45E8-BA7D-EC1281463E08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B58E4C4A-18CD-45E8-BA7D-EC1281463E08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B58E4C4A-18CD-45E8-BA7D-EC1281463E08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B58E4C4A-18CD-45E8-BA7D-EC1281463E08}.Release|Any CPU.Build.0 = Release|Any CPU + {67EDA72B-2BA7-497F-BD4E-DCD508D535BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67EDA72B-2BA7-497F-BD4E-DCD508D535BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67EDA72B-2BA7-497F-BD4E-DCD508D535BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67EDA72B-2BA7-497F-BD4E-DCD508D535BF}.Release|Any CPU.Build.0 = Release|Any CPU + {A66A26E5-A2BC-4939-9598-6474ED2DD42B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A66A26E5-A2BC-4939-9598-6474ED2DD42B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A66A26E5-A2BC-4939-9598-6474ED2DD42B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A66A26E5-A2BC-4939-9598-6474ED2DD42B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Arknu.Umbraco.Relations/Arknu.Umbraco.Relations.csproj b/Arknu.Umbraco.Relations/Arknu.Umbraco.Relations.csproj new file mode 100644 index 0000000..f040cea --- /dev/null +++ b/Arknu.Umbraco.Relations/Arknu.Umbraco.Relations.csproj @@ -0,0 +1,210 @@ + + + + + Debug + AnyCPU + {A66A26E5-A2BC-4939-9598-6474ED2DD42B} + Library + Properties + Arknu.Umbraco.Relations + Arknu.Umbraco.Relations + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll + + + ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\businesslogic.dll + + + ..\packages\ClientDependency.1.8.2.1\lib\net45\ClientDependency.Core.dll + + + ..\packages\ClientDependency-Mvc.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\cms.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\controls.dll + + + ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll + + + ..\packages\Examine.0.1.60.2941\lib\Examine.dll + + + ..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll + + + False + ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + + + ..\packages\ImageProcessor.1.9.5.0\lib\ImageProcessor.dll + + + ..\packages\ImageProcessor.Web.3.3.1.0\lib\net45\ImageProcessor.Web.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\interfaces.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\log4net.dll + + + ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Microsoft.ApplicationBlocks.Data.dll + + + True + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll + + + ..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll + + + ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll + + + False + ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\SQLCE4Umbraco.dll + + + + + True + ..\packages\UmbracoCms.Core.7.2.2\lib\System.Data.SqlServerCe.dll + + + True + ..\packages\UmbracoCms.Core.7.2.2\lib\System.Data.SqlServerCe.Entity.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll + + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll + + + True + ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll + + + False + ..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll + + + True + ..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll + + + + + + + + ..\packages\UmbracoCms.Core.7.2.2\lib\TidyNet.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Umbraco.Core.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.DataLayer.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.editorControls.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.MacroEngines.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\umbraco.providers.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\Umbraco.Web.UI.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\UmbracoExamine.dll + + + ..\packages\UmbracoCms.Core.7.2.2\lib\UrlRewritingNet.UrlRewriter.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations/Controllers/RelationsApiController.cs b/Arknu.Umbraco.Relations/Controllers/RelationsApiController.cs new file mode 100644 index 0000000..366c7a9 --- /dev/null +++ b/Arknu.Umbraco.Relations/Controllers/RelationsApiController.cs @@ -0,0 +1,88 @@ +using a = Arknu.Umbraco.Relations.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core.Models; +using Umbraco.Web.Editors; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi; + +namespace Arknu.Umbraco.Relations.Controllers +{ + [PluginController("ArknuRelations")] + public class RelationsApiController : UmbracoAuthorizedJsonController + { + public IEnumerable GetRelationTypes() + { + var result = new List(); + + var relations = ApplicationContext.Services.RelationService.GetAllRelationTypes(); + foreach (var r in relations) + { + result.Add(new a.RelationType() + { + Id = r.Id, + Alias = r.Alias, + Name = r.Name + }); + } + + return result; + } + + public IEnumerable GetRelations(int id, string type) + { + var result = new List(); + + var reltype = ApplicationContext.Services.RelationService.GetRelationTypeByAlias(type); + + IEnumerable relations = null; + if (reltype.IsBidirectional) + { + relations = ApplicationContext.Services.RelationService.GetByParentOrChildId(id); + } + else + { + relations = ApplicationContext.Services.RelationService.GetByParentId(id); + } + foreach (var r in relations.Where(x => x.RelationType.Alias == type)) + { + var c = Umbraco.TypedContent(r.ChildId); + result.Add(new a.Relation() + { + Name = c.Name, + RelationId = r.Id, + ContentId = r.ChildId + }); + } + + return result; + } + + public a.Relation SaveRelation(int sourceid, int targetid, string type) + { + var source = ApplicationContext.Services.ContentService.GetById(sourceid); + var target = ApplicationContext.Services.ContentService.GetById(targetid); + + var r = ApplicationContext.Services.RelationService.Relate(source, target, type); + + return new a.Relation() + { + ContentId = targetid, + Name = target.Name, + RelationId = r.Id + }; + } + + public void DeleteRelation(int relationid) + { + + var r = ApplicationContext.Services.RelationService.GetById(relationid); + ApplicationContext.Services.RelationService.Delete(r); + + + } + } +} diff --git a/Arknu.Umbraco.Relations/Events.cs b/Arknu.Umbraco.Relations/Events.cs new file mode 100644 index 0000000..db9e383 --- /dev/null +++ b/Arknu.Umbraco.Relations/Events.cs @@ -0,0 +1,38 @@ +using Arknu.Umbraco.Relations.Controllers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Umbraco.Core; +using Umbraco.Web; +using Umb = Umbraco.Web; + +namespace Arknu.Umbraco.Relations +{ + public class Events : ApplicationEventHandler + { + protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) + { + Umb.UI.JavaScript.ServerVariablesParser.Parsing += ServerVariablesParser_Parsing; + + } + + void ServerVariablesParser_Parsing(object sender, Dictionary dictionary) + { + if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null"); + var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData())); + + var url = urlHelper.GetUmbracoApiServiceBaseUrl("GetRelations"); + + dictionary.Add("arknuRelations", new Dictionary + { + {"relationsApiBase", url} + }); + + } + } +} diff --git a/Arknu.Umbraco.Relations/Models/Relation.cs b/Arknu.Umbraco.Relations/Models/Relation.cs new file mode 100644 index 0000000..388a719 --- /dev/null +++ b/Arknu.Umbraco.Relations/Models/Relation.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace Arknu.Umbraco.Relations.Models +{ + public class Relation + { + [JsonProperty("relationId")] + public int RelationId { get; set; } + [JsonProperty("contentId")] + public int ContentId { get; set; } + [JsonProperty("name")] + public string Name { get; set; } + } +} diff --git a/Arknu.Umbraco.Relations/Models/RelationType.cs b/Arknu.Umbraco.Relations/Models/RelationType.cs new file mode 100644 index 0000000..80a9a44 --- /dev/null +++ b/Arknu.Umbraco.Relations/Models/RelationType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Arknu.Umbraco.Relations.Models +{ + public class RelationType + { + public int Id { get; set; } + public string Alias { get; set; } + public string Name { get; set; } + } +} diff --git a/Arknu.Umbraco.Relations/Properties/AssemblyInfo.cs b/Arknu.Umbraco.Relations/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..feccd69 --- /dev/null +++ b/Arknu.Umbraco.Relations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Arknu.Umbraco.Relations")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Arknu.Umbraco.Relations")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d6e58992-5e26-43d0-a988-52b78626e3c6")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Arknu.Umbraco.Relations/app.config b/Arknu.Umbraco.Relations/app.config new file mode 100644 index 0000000..8f82841 --- /dev/null +++ b/Arknu.Umbraco.Relations/app.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations/packages.config b/Arknu.Umbraco.Relations/packages.config new file mode 100644 index 0000000..bf1885b --- /dev/null +++ b/Arknu.Umbraco.Relations/packages.config @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arknu.Umbraco.Relations/readme.txt b/Arknu.Umbraco.Relations/readme.txt new file mode 100644 index 0000000..884d533 --- /dev/null +++ b/Arknu.Umbraco.Relations/readme.txt @@ -0,0 +1,11 @@ +Umbraco Relations Picker (beta) +version 1.0 +by Asbjørn Riis-Knudsen + +This is a relations picker for Umbraco v7 (only tested on v. 7.2.2 at the moment). The UI is identical to the Umbraco Content Picker - it just saves as a relation instead. + +Once you have installed the package, go to Developer > Data Types and create a new data type to use it. Remember to pick a relation type here. + +--- + +This is a beta. It works in my testing, but there could be potential issues. For example, the error handling is insufficient at the moment. This will be fixed in the next version.