Fixes: 26782, 18390

[TFS Changeset #65842]
This commit is contained in:
Shandem
2010-04-29 13:46:53 +00:00
parent 9e6c5682df
commit 5f825d624c
6 changed files with 35 additions and 11 deletions

View File

@@ -1,3 +1,7 @@
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.template;
using System.Web.UI;
using System;
using System.Collections;
using System.Data;
@@ -218,7 +222,7 @@ namespace umbraco.cms.businesslogic.web
private IEnumerable<Document> _children = null;
// special for passing httpcontext object
private HttpContext _httpContext;
//private HttpContext _httpContext;
// special for tree performance
private int _userId = -1;
@@ -268,6 +272,7 @@ namespace umbraco.cms.businesslogic.web
// }
//}
/// <summary>
/// Gets a value indicating whether the document was constructed for the optimized mode
/// </summary>
@@ -312,17 +317,21 @@ namespace umbraco.cms.businesslogic.web
get { return _writer; }
}
/// <summary>
/// The current HTTPContext
/// </summary>
[Obsolete("DO NOT USE THIS! Get the HttpContext via regular ASP.Net methods instead")]
public HttpContext HttpContext
{
set { _httpContext = value; }
set { /*THERE IS NO REASON TO DO THIS. _httpContext = value; */}
get
{
if (_httpContext == null)
_httpContext = HttpContext.Current;
return _httpContext;
//if (_httpContext == null)
// _httpContext = HttpContext.Current;
//return _httpContext;
return HttpContext.Current;
}
}

View File

@@ -33,7 +33,7 @@ namespace umbraco.presentation
{
try
{
d.HttpContext = (HttpContext)sender;
//d.HttpContext = (HttpContext)sender;
d.ReleaseDate = DateTime.MinValue; //new DateTime(1, 1, 1); // Causes release date to be null
@@ -52,7 +52,7 @@ namespace umbraco.presentation
}
foreach(Document d in Document.GetDocumentsForExpiration())
{
d.HttpContext = (HttpContext)sender;
//d.HttpContext = (HttpContext)sender;
//d.Published = false;
library.UnPublishSingleNode(d.Id);
}

View File

@@ -4,8 +4,12 @@
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<asp:Content ID="header1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function openItem(url) {
UmbClientMgr.contentFrame("../" + url);
function openItem(id) {
var url = "editContent.aspx?id=" + id;
if (UmbClientMgr.mainWindow().UmbClientMgr.appActions().getCurrApp() == "media") {
url = "editMedia.aspx?id=" + id;
}
UmbClientMgr.contentFrame(url);
UmbClientMgr.closeModalWindow();
}
</script>

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -67,6 +67,17 @@ namespace umbraco.cms.presentation
//_document = new cms.businesslogic.web.Document(int.Parse(Request.QueryString["id"]));
_document = new Document(true, id);
//check if the doc exists
if (string.IsNullOrEmpty(_document.Path))
{
//if this is invalid show an error
this.DisplayFatalError("No document found with id " + m_ContentId);
//reset the content id to null so processing doesn't continue on OnLoad
m_ContentId = null;
return;
}
// we need to check if there's a published version of this document
_documentHasPublishedVersion = _document.HasPublishedVersion();

View File

@@ -9,7 +9,7 @@
<xsl:for-each select="/results/result">
<li>
<h4>
<a href="#" onClick="openItem('editContent.aspx?id={@id}');">
<a href="#" onClick="openItem('{@id}');">
<!-- add accesskey support for the first 9 results -->
<xsl:if test="position() &lt; 10">
<xsl:attribute name="accesskey">