示例#1
0
        public bool AddHeaders()
        {
            var wrapLog = Log.Call <bool>();

            // ensure we only do this once
            if (MarkAddedAndReturnIfAlreadyDone())
            {
                return(wrapLog("already", false));
            }
            var siteRoot = ServicesFramework.GetServiceFrameworkRoot();

            if (string.IsNullOrEmpty(siteRoot))
            {
                return(wrapLog("no path", false));
            }

            var dnnVersion = DotNetNukeContext.Current.Application.Version.Major;
            var apiRoot    = siteRoot + (dnnVersion < 9
                ? $"desktopmodules/{InpageCms.ExtensionPlaceholder}/api/"
                : $"api/{InpageCms.ExtensionPlaceholder}/");

            var portal = PortalSettings.Current;
            var json   = InpageCms.JsApiJson(
                portal.ActiveTab.TabID,
                siteRoot,
                apiRoot,
                AntiForgeryToken(),
                VirtualPathUtility.ToAbsolute("~/desktopmodules/tosic_sexycontent/"));

            HtmlPage.AddMeta(InpageCms.MetaName, json);
            return(wrapLog("added", true));
        }
示例#2
0
        public string ContextMetaContents()
        {
            var wrapLog = Log.Call <string>();

            var pageId   = Parent?.Page.PageId ?? -1;
            var siteRoot = OqtConstants.SiteRoot;
            var idPart   = Parent?.Site.SiteId + "/";
            var apiRoot  = siteRoot + idPart + WebApiConstants.WebApiRoot + "/";
            var result   = InpageCms.JsApiJson(pageId, siteRoot, apiRoot, AntiForgeryToken(), OqtConstants.UiRoot + "/");

            return(wrapLog("ok", result));
        }
示例#3
0
        public string ContextHeader()
        {
            var wrapLog = Log.Call <string>();

            var pageId   = 0;
            var siteRoot = MvcConstants.SiteRoot;
            var apiRoot  = siteRoot + WebApi.WebApiConstants.WebApiRoot + "/";
            var json     = InpageCms.JsApiJson(pageId, siteRoot, apiRoot, AntiForgeryToken(), MvcConstants.UiRoot);

            var meta = Tag.Meta().Name(InpageCms.MetaName).Content(json).ToString();

            return(wrapLog(meta, meta));
        }