From 76463d1820c698f0e6b340afe528ba30a7e89672 Mon Sep 17 00:00:00 2001 From: arknu Date: Mon, 2 Mar 2015 00:00:30 +0100 Subject: [PATCH] 1.0 beta release --- .gitignore | 7 +- .../Arknu.Umbraco.Relations.Editor.csproj | 114 +++++++ ...knu.umbraco.relations.config.controller.js | 7 + .../arknu.umbraco.relations.config.html | 4 + .../arknu.umbraco.relations.controller.js | 48 +++ .../arknu.umbraco.relations.html | 25 ++ .../arknu.umbraco.relations.resource.js | 24 ++ .../Arknu.Umbraco.Relations/package.manifest | 33 ++ .../Properties/AssemblyInfo.cs | 35 +++ .../Web.Debug.config | 30 ++ .../Web.Release.config | 31 ++ Arknu.Umbraco.Relations.Editor/Web.config | 11 + .../App_Browsers/Form.browser | 10 + .../App_Browsers/w3cvalidator.browser | 26 ++ ...knu.umbraco.relations.config.controller.js | 7 + .../arknu.umbraco.relations.config.html | 4 + .../arknu.umbraco.relations.controller.js | 48 +++ .../arknu.umbraco.relations.html | 25 ++ .../arknu.umbraco.relations.resource.js | 24 ++ .../Arknu.Umbraco.Relations/package.manifest | 33 ++ .../arknu.umbraco.relations.config.html | 3 + .../App_Plugins/arknu.umbraco.relations.html | 3 + .../App_Plugins/package.manifest | 18 ++ .../Arknu.Umbraco.Relations.Web.csproj | 297 ++++++++++++++++++ .../Config/404handlers.config | 7 + .../Config/BaseRestExtensions.config | 19 ++ .../Config/ClientDependency.config | 56 ++++ .../Config/Dashboard.config | 88 ++++++ .../Config/EmbeddedMedia.config | 71 +++++ .../Config/ExamineIndex.config | 28 ++ .../Config/ExamineSettings.config | 41 +++ .../Config/FileSystemProviders.config | 11 + .../Config/UrlRewriting.config | 33 ++ .../Config/applications.config | 11 + .../Config/feedProxy.config | 11 + .../Config/grid.editors.config.js | 46 +++ .../Config/log4net.config | 28 ++ .../Config/metablogConfig.config | 3 + .../Config/scripting.config | 11 + .../Config/splashes/booting.aspx | 26 ++ .../Config/splashes/noNodes.aspx | 68 ++++ .../Config/tinyMceConfig.config | 243 ++++++++++++++ .../Config/trees.config | 41 +++ .../Config/umbracoSettings.config | 141 +++++++++ Arknu.Umbraco.Relations.Web/Global.asax | 2 + .../Properties/AssemblyInfo.cs | 35 +++ .../Views/Partials/Grid/Bootstrap2.cshtml | 84 +++++ .../Views/Partials/Grid/Bootstrap3.cshtml | 84 +++++ .../Views/Partials/Grid/Editors/Base.cshtml | 24 ++ .../Views/Partials/Grid/Editors/Embed.cshtml | 3 + .../Views/Partials/Grid/Editors/Macro.cshtml | 17 + .../Views/Partials/Grid/Editors/Media.cshtml | 23 ++ .../Views/Partials/Grid/Editors/Rte.cshtml | 4 + .../Partials/Grid/Editors/Textstring.cshtml | 20 ++ Arknu.Umbraco.Relations.Web/Views/Text.cshtml | 4 + Arknu.Umbraco.Relations.Web/Views/Web.config | 55 ++++ Arknu.Umbraco.Relations.Web/Web.Debug.config | 30 ++ .../Web.Release.config | 31 ++ Arknu.Umbraco.Relations.Web/Web.config | 280 +++++++++++++++++ Arknu.Umbraco.Relations.Web/default.aspx | 2 + .../created-packages/Relations_Picker_1.0.zip | Bin 0 -> 8529 bytes Arknu.Umbraco.Relations.Web/packages.config | 27 ++ Arknu.Umbraco.Relations.sln | 34 ++ .../Arknu.Umbraco.Relations.csproj | 210 +++++++++++++ .../Controllers/RelationsApiController.cs | 88 ++++++ Arknu.Umbraco.Relations/Events.cs | 38 +++ Arknu.Umbraco.Relations/Models/Relation.cs | 19 ++ .../Models/RelationType.cs | 15 + .../Properties/AssemblyInfo.cs | 36 +++ Arknu.Umbraco.Relations/app.config | 19 ++ Arknu.Umbraco.Relations/packages.config | 26 ++ Arknu.Umbraco.Relations/readme.txt | 11 + 72 files changed, 3070 insertions(+), 1 deletion(-) create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations.Editor.csproj create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.html create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js create mode 100644 Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/package.manifest create mode 100644 Arknu.Umbraco.Relations.Editor/Properties/AssemblyInfo.cs create mode 100644 Arknu.Umbraco.Relations.Editor/Web.Debug.config create mode 100644 Arknu.Umbraco.Relations.Editor/Web.Release.config create mode 100644 Arknu.Umbraco.Relations.Editor/Web.config create mode 100644 Arknu.Umbraco.Relations.Web/App_Browsers/Form.browser create mode 100644 Arknu.Umbraco.Relations.Web/App_Browsers/w3cvalidator.browser create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/Arknu.Umbraco.Relations/package.manifest create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.config.html create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/arknu.umbraco.relations.html create mode 100644 Arknu.Umbraco.Relations.Web/App_Plugins/package.manifest create mode 100644 Arknu.Umbraco.Relations.Web/Arknu.Umbraco.Relations.Web.csproj create mode 100644 Arknu.Umbraco.Relations.Web/Config/404handlers.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/BaseRestExtensions.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/ClientDependency.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/Dashboard.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/EmbeddedMedia.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/ExamineIndex.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/ExamineSettings.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/FileSystemProviders.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/UrlRewriting.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/applications.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/feedProxy.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/grid.editors.config.js create mode 100644 Arknu.Umbraco.Relations.Web/Config/log4net.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/metablogConfig.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/scripting.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/splashes/booting.aspx create mode 100644 Arknu.Umbraco.Relations.Web/Config/splashes/noNodes.aspx create mode 100644 Arknu.Umbraco.Relations.Web/Config/tinyMceConfig.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/trees.config create mode 100644 Arknu.Umbraco.Relations.Web/Config/umbracoSettings.config create mode 100644 Arknu.Umbraco.Relations.Web/Global.asax create mode 100644 Arknu.Umbraco.Relations.Web/Properties/AssemblyInfo.cs create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap2.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Bootstrap3.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Base.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Embed.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Macro.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Media.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Rte.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Partials/Grid/Editors/Textstring.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Text.cshtml create mode 100644 Arknu.Umbraco.Relations.Web/Views/Web.config create mode 100644 Arknu.Umbraco.Relations.Web/Web.Debug.config create mode 100644 Arknu.Umbraco.Relations.Web/Web.Release.config create mode 100644 Arknu.Umbraco.Relations.Web/Web.config create mode 100644 Arknu.Umbraco.Relations.Web/default.aspx create mode 100644 Arknu.Umbraco.Relations.Web/media/created-packages/Relations_Picker_1.0.zip create mode 100644 Arknu.Umbraco.Relations.Web/packages.config create mode 100644 Arknu.Umbraco.Relations.sln create mode 100644 Arknu.Umbraco.Relations/Arknu.Umbraco.Relations.csproj create mode 100644 Arknu.Umbraco.Relations/Controllers/RelationsApiController.cs create mode 100644 Arknu.Umbraco.Relations/Events.cs create mode 100644 Arknu.Umbraco.Relations/Models/Relation.cs create mode 100644 Arknu.Umbraco.Relations/Models/RelationType.cs create mode 100644 Arknu.Umbraco.Relations/Properties/AssemblyInfo.cs create mode 100644 Arknu.Umbraco.Relations/app.config create mode 100644 Arknu.Umbraco.Relations/packages.config create mode 100644 Arknu.Umbraco.Relations/readme.txt 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 0000000000000000000000000000000000000000..94b8a8b660c642e56dbccc3989fbbf0894e18215 GIT binary patch literal 8529 zcmch7RZv|Ewk__kfdIkXb>k4+2@)*0yE_DTcMIzS ze)n{B*IgfL{;fG`dX2FZWual1ARr(RASyZxB{8cA0-t|AN)T8OyvD4ioTj{HOx)bY zJWL$i#zsuMKyDr;UJf&$si6^&iL6r#>Ui%*~%Fb0v*Bu@`t}4&*&cpA|zHmwjYQhc`dz6R-sXZc@B#nHM^V# z%`ixw)LxvyQA21RfKHPME0w_@SBRrUN!d9T*JIw(vzB@0>Jpk?%=QYbY16ZyF@C-+ zdI_7-3FHl{Y6Lu;VO)tpA-PE6pF;|csmo`_vSw7PVt2{w7OVFuhgq9qKKdh}U@crd zYjBA^P)P#SQw?n^0%VPL{iW>Oj)7&>uL!wS&M!^Mlp=Xc%rko>&Avm)rw3)t9K23r zb$QG(&uo=+Lz1B|qjsAbk@CBRSNuyTw*!ZjeuYx{zZ6Of7h9WuM6mB?#6HUR@*ePOPXm* zENanmRf=hjJumO@i>g{_JCv*jLFawZ99eGL2Kz+sfwehZdsEwoh~f z#A91JG{1;;J z*Ltdj`y&kWP=DCuw|$XIK=dw_Lm`B@Ak>-^y%(Mcyhp`M9Y^Kw3#608#S^+HD{}>f<7#E5%hGmVfnSN%$tPB#@Wu1oMsRFk9>wq|^G>S)%)S z5339`La)1_voOMl_q~PUQ;u;Z(h|stwGgnNC$;F|+nU~$r!_;C#&}JKBf?mNs9-g*DSEd}}7LfsCd5SBs?>Bkf!HbHZ9-Gk2bM zI!u%zp8h#=Y=r{+OsQj*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.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.