WORK IN PROGRESS, GET STABLE SOURCE FROM DOWNLOAD TAB
Fixes 26258: Issues with insert macro dialog in tiny [TFS Changeset #64073]
This commit is contained in:
@@ -81,14 +81,15 @@ namespace umbraco.presentation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the current user is in a preview mode
|
||||
/// Determines whether the current user is in a preview mode and browsing the site (ie. not in the admin UI)
|
||||
/// </summary>
|
||||
public virtual bool InPreviewMode
|
||||
{
|
||||
get
|
||||
{
|
||||
string currentUrl = Request.Url.AbsolutePath;
|
||||
return !String.IsNullOrEmpty(StateHelper.GetCookieValue("PreviewSet")) &&
|
||||
UmbracoUser != null;
|
||||
UmbracoUser != null && !currentUrl.StartsWith(IO.IOHelper.ResolveUrl(IO.SystemDirectories.Umbraco));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1398,7 +1398,7 @@ namespace umbraco
|
||||
// Create a new 'HttpWebRequest' Object to the mentioned URL.
|
||||
string retVal = string.Empty;
|
||||
string url = "http://" + HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + ":" +
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_PORT"] + SystemDirectories.Umbraco +
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_PORT"] + IOHelper.ResolveUrl( SystemDirectories.Umbraco ) +
|
||||
"/macroResultWrapper.aspx?" +
|
||||
querystring;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace umbraco.presentation.dialogs
|
||||
pc.SavePreviewSet();
|
||||
docLit.Text = d.Text;
|
||||
changeSetUrl.Text = pc.PreviewsetPath;
|
||||
StateHelper.SetCookieValue("PreviewSet", pc.PreviewSet.ToString());
|
||||
pc.ActivatePreviewCookie();
|
||||
Response.Redirect("../../" + d.Id.ToString() + ".aspx", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ using umbraco.BusinessLogic.Actions;
|
||||
using umbraco.cms.helpers;
|
||||
using umbraco.IO;
|
||||
using umbraco.uicontrols.DatePicker;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.presentation.preview;
|
||||
|
||||
|
||||
namespace umbraco.cms.presentation
|
||||
@@ -62,6 +64,11 @@ namespace umbraco.cms.presentation
|
||||
//if (helper.Request("frontEdit") != "")
|
||||
// syncScript.Visible = false;
|
||||
|
||||
// clear preview cookie
|
||||
if (!String.IsNullOrEmpty(StateHelper.GetCookieValue(PreviewContent.PREVIEW_COOKIE_KEY))) {
|
||||
PreviewContent.ClearPreviewCookie();
|
||||
}
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//SyncPath.Text = _document.Path;
|
||||
|
||||
@@ -488,8 +488,8 @@ namespace umbraco.presentation.nodeFactory
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new ArgumentNullException("Node xml source is null");
|
||||
// else
|
||||
// throw new ArgumentNullException("Node xml source is null");
|
||||
}
|
||||
|
||||
public static Node GetCurrent()
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace umbraco.presentation.tinymce3
|
||||
pane_insert.Text = ui.Text("insertMacro");
|
||||
Page.Title = ui.Text("insertMacro");
|
||||
|
||||
if (reqMacroID != "" || reqMacroAlias != "")
|
||||
if (!String.IsNullOrEmpty(reqMacroID) || !String.IsNullOrEmpty(reqMacroAlias))
|
||||
{
|
||||
|
||||
pane_edit.Visible = true;
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace umbraco.presentation.preview
|
||||
{
|
||||
public class PreviewContent
|
||||
{
|
||||
public const string PREVIEW_COOKIE_KEY = "PreviewSet";
|
||||
public XmlDocument XmlContent { get; set; }
|
||||
public Guid PreviewSet { get; set; }
|
||||
public string PreviewsetPath { get; set; }
|
||||
@@ -83,5 +84,14 @@ namespace umbraco.presentation.preview
|
||||
|
||||
XmlContent.Save(PreviewsetPath);
|
||||
}
|
||||
|
||||
public void ActivatePreviewCookie() {
|
||||
StateHelper.SetCookieValue(PREVIEW_COOKIE_KEY, PreviewSet.ToString());
|
||||
}
|
||||
|
||||
public static void ClearPreviewCookie() {
|
||||
StateHelper.ClearCookie(PREVIEW_COOKIE_KEY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user