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 Alloy.Models.Media; | |
using EPiServer.Core; | |
using EPiServer.Core.Html.StringParsing; | |
using EPiServer.ServiceLocation; | |
using EPiServer.Web; | |
using HtmlAgilityPack; | |
public static class XhtmlExtensions | |
{ | |
public static XhtmlString AdjustAltText(this XhtmlString xhtmlString) |
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 Singleton : Attribute | |
{ | |
} |
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.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using System.Web.UI; | |
/// <summary> | |
/// Shamelessly "inspired" by classes in System.Web.Mvc assembly | |
/// It appears that only a System.Web.UI.Page can be executed | |
/// as a child request. If you try to execute an MvcHandler |
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 IList<string> UserRoles() | |
{ | |
IList<string> roles; | |
using (UserStore<ApplicationUser> store = new UserStore<ApplicationUser>(new ApplicationDbContext<ApplicationUser>("EPiServerDB"))) | |
{ | |
ApplicationUser user = store.FindByNameAsync(PrincipalInfo.CurrentPrincipal.Identity.Name).GetAwaiter().GetResult(); | |
roles = GetUserToRoles(store, user); | |
} | |
return roles; | |
} |
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
DECLARE @pkid int | |
DECLARE db_cursor CURSOR FOR select distinct fkPageID from tblWorkpage where HasBeenPublished= 0 Group by fkpageid having count(fkPageID) = 1 | |
declare @isLeafNode int | |
OPEN db_cursor | |
FETCH NEXT FROM db_cursor INTO @pkid | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN |
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
Declare @VersionsToKeep int = 4 | |
Declare @PublishedVersions int = 1 | |
declare @fkPageID int; | |
declare db_cursor CURSOR FOR select fkPageID from tblWorkpage where HasBeenPublished= @PublishedVersions Group by fkpageid having count(fkPageID) > @PublishedVersions order by count(fkPageID) desc | |
open db_cursor | |
fetch next from db_cursor into @fkPageID | |
while @@FETCH_STATUS = 0 |
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
DECLARE @pkid int | |
DECLARE db_cursor CURSOR FOR SELECT pkid FROM tblContent tbl where deleted = 1 | |
OPEN db_cursor | |
FETCH NEXT FROM db_cursor INTO @pkid | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
EXEC [dbo].editDeletePage @PageID = @pkid, @ForceDelete = 1 |
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
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AZChangePageBranchMasterLanguage]') AND type in (N'P', N'PC')) | |
DROP PROCEDURE [dbo].[AZChangePageBranchMasterLanguage] | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE PROCEDURE [dbo].[AZChangePageBranchMasterLanguage] |
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.Collections.Generic; | |
using EPiServer.Cms.TinyMce.Core; | |
using EPiServer.Framework; | |
using EPiServer.Framework.Initialization; | |
using EPiServer.ServiceLocation; | |
namespace MySite.Business.Initialization | |
{ | |
[ModuleDependency(typeof(TinyMceInitialization))] | |
public class ExtendedTinyMceInitialization : IConfigurableModule |
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
USE [epicms] | |
GO | |
IF OBJECT_ID ( 'AZSwitchLanguageBranch', 'P' ) IS NOT NULL | |
DROP PROCEDURE AZSwitchLanguageBranch; | |
GO | |
CREATE PROCEDURE AZSwitchLanguageBranch | |
@toLanguageBranch varchar(10), | |
@fromLanguageBranch varchar(10) | |
AS |
NewerOlder