This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Security; | |
using Umbraco.Core; | |
using Umbraco.Core.Composing; | |
using Umbraco.Core.Events; | |
using Umbraco.Core.Scoping; | |
using Umbraco.Core.Services; | |
using Umbraco.Core.Services.Implement; | |
using System.Linq; | |
using System; | |
using Umbraco.Core.Security; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Umbraco.Web.PublishedModels; | |
namespace MyWebSite.Custom | |
{ | |
public interface ISiteService | |
{ | |
Website GetWebsite(int id); | |
SearchPage GetSearchPage(int id); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using Umbraco.Community.Contentment.DataEditors; | |
using Umbraco.Core.PropertyEditors; | |
using Umbraco.Web; | |
namespace MyWebsite.DataSources | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
static public class IEnumerableHelper | |
{ | |
static public Object<T> TakeFirst<T>(this IEnumerable<T> items) | |
{ | |
return items.Take(1).First(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using MySite.Models.PropEditors; | |
using Umbraco.Core; | |
using Umbraco.Core.Models.PublishedContent; | |
using Umbraco.Core.PropertyEditors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="Custom.ThemaColorPickerController"> | |
<ul style="list-style: none;"> | |
<li ng-repeat="color in colors"> | |
<label > | |
<input type="radio" name="pageNumber" ng-model="model.value" ng-value="color.Name" /> {{color.Name}} | |
<div style="display:block;height:30px;width:30px;background-color:{{color.Code}};border:1px #000 solid;float:left;margin-right:10px;"></div> | |
</label><br/> | |
</li> | |
</ul> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module("umbraco"); | |
angular.module("umbraco").controller("Custom.ThemaColorPickerController", | |
function ($scope, $routeParams, $location, $http) { | |
$http.get("backoffice/Custom/ThemaColorPickerApi/GetAvailableColors?page=" + $routeParams.id).then(function (response) { | |
$scope.colors = response.data; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyWebsite.Controllers.PropEditors | |
{ | |
[Umbraco.Web.Mvc.PluginController("Custom")] | |
public class ThemaColorPickerApiController: UmbracoAuthorizedApiController | |
{ | |
public IEnumerable<Color> GetAvailableColors(int page) { | |
var colors = new List<Color>(); | |
var themePage = Services.ContentService.GetAncestors(page).FirstOrDefault(x => x.HasProperty("theme")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
propertyEditors: [ | |
{ | |
alias: "Custom.ThemaColorPicker", | |
name: "Thema ColorPicker", | |
group: "Pickers", | |
icon: "icon-palette", | |
editor:{ | |
view: "~/App_Plugins/ThemaColorPicker/ThemaColorPicker.html", | |
valueType: "STRING" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationComposer : ComponentComposer<ApplicationComponent>, IUserComposer | |
{ | |
public override void Compose(Composition composition) | |
{ | |
StaticFileHasher.HashFiles(umbracoApplication.Server.MapPath("~/css"), umbracoApplication.Server.MapPath("~/js")); | |
base.Compose(composition); | |
} | |
} |
NewerOlder