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
getEditorScope = $scope => { | |
let editorScope = $scope.$parent; | |
do { | |
editorScope = editorScope.$parent; | |
} while (!Object.prototype.hasOwnProperty.call(editorScope, 'contentForm')); | |
this.editorScope = editorScope; | |
} |
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
-- CREATES THE COMPOSITION FROM THE INHERITED TYPE | |
DECLARE @CompositionId int; | |
DECLARE @CompositionsFolder int; | |
DECLARE @PropertyTab int; | |
DECLARE @CompositionGUID uniqueidentifier; | |
-- Generate a unique guid for the metadata composition | |
SET @CompositionGUID = 'f583bcf5-b007-47d4-992e-c193f225f76c' | |
DECLARE @PropertyTagGUID uniqueidentifier; |
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 ChangeContentTypeController : UmbracoAuthorizedApiController | |
{ | |
private readonly IContentTypeService _contentTypeService; | |
private readonly IContentService _contentService; | |
public ChangeContentTypeController(IContentTypeService contentTypeService, IContentService contentService) { | |
_contentTypeService = contentTypeService; | |
_contentService = contentService; | |
} |
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
private readonly IUmbracoContextFactory _context; | |
private readonly string _pluginPath; | |
public LicensingService(ILogger logger, IUmbracoContextFactory context) : base(logger) | |
{ | |
_context = context ?? throw new ArgumentNullException(nameof(context)); | |
_pluginPath = $"{IOHelper.ResolveUrl(SystemDirectories.AppPlugins).TrimEnd('/')}/plumber/"; | |
} | |
public Tuple<string, string> GetLicenseAndKey() { |
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.Linq; | |
using System.Web.Http.Filters; | |
using Umbraco.Core; | |
using Umbraco.Core.Composing; | |
using Umbraco.Web.Editors; | |
using Umbraco.Web.Models.ContentEditing; | |
namespace Foo.Bar.AppCode | |
{ |
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
this.workflowResource.saveNodeConfig(this.node.id, this.approvalPath, this.variant) | |
.then(() => { | |
this.notificationsService.success('SUCCESS', 'Workflow configuration updated'); | |
this.$rootScope.$broadcast('configUpdated'); | |
this.$scope.contentFlowForm.$setPristine(); | |
// shouldn't need to do this... | |
// check that all child forms of the contentForm are pristine, then reset contentForm | |
let parentPristine = this.$scope.contentFlowForm.$$parentForm.$$controls | |
.filter(c => Object.prototype.hasOwnProperty.call(c, '$submitted')) |
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
// in u7 we could grab scope off any element via angular.element('selector').scope() | |
// not the case in u8, since debugInfoEnabled has been set to false (which is a good thing) | |
// this is happening in the context of a content app controller | |
// but could be refactored to working with an interceptor | |
export class AppController { | |
constructor($scope, $compile, $element) { | |
// from the content app scope, find the content form scope |
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
/// | |
/// Extension on UmbracoHelper to return a processed macro as a string... | |
/// | |
public static IHtmlString RenderMacroScript(this UmbracoHelper helper, string language, string fileLocation, IDictionary<string, object> parameters) | |
{ | |
var ctrl = new umbraco.presentation.templateControls.Macro | |
{ | |
Language = language, | |
FileLocation = fileLocation, | |
}; |
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
angular.module('myModule', []) | |
.config(['$provide', $provide => { | |
$provide.decorator("$rootScope", function ($delegate) { | |
var Scope = $delegate.constructor; | |
var origBroadcast = Scope.prototype.$broadcast; | |
var origEmit = Scope.prototype.$emit; | |
Scope.prototype.$broadcast = function () { | |
console.log("$broadcast was called on $scope " + Scope.$id + " with arguments:", arguments); | |
return origBroadcast.apply(this, arguments); |
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.Net; | |
using System.Web.Http; | |
using Umbraco.Core; | |
using Umbraco.Core.Models; | |
using Umbraco.Core.Services; | |
using Umbraco.Web; | |
using Umbraco.Web.WebApi; |
NewerOlder