updated Breadcrumb & Orgs Selector & made changes from by comments
This commit is contained in:
parent
e3a18b8665
commit
2648fedafe
7 changed files with 62 additions and 42 deletions
|
@ -314,6 +314,11 @@ namespace WebsitePanel.Portal
|
|||
return (string)HttpContext.GetGlobalResourceObject(className, resourceKey);
|
||||
}
|
||||
|
||||
public static string GetLocalizedString(string virtualPath, string resourceKey)
|
||||
{
|
||||
return (string)HttpContext.GetLocalResourceObject(virtualPath, resourceKey);
|
||||
}
|
||||
|
||||
public static string GetCurrentPageId()
|
||||
{
|
||||
return HttpContext.Current.Request["pid"];
|
||||
|
@ -949,6 +954,32 @@ namespace WebsitePanel.Portal
|
|||
|
||||
return navigateUrl;
|
||||
}
|
||||
|
||||
public static string EditUrl(string keyName, string keyValue, string controlKey, params string[] additionalParams)
|
||||
{
|
||||
List<string> url = new List<string>();
|
||||
|
||||
string pageId = HttpContext.Current.Request[DefaultPage.PAGE_ID_PARAM];
|
||||
|
||||
if (!String.IsNullOrEmpty(pageId))
|
||||
url.Add(String.Concat(DefaultPage.PAGE_ID_PARAM, "=", pageId));
|
||||
|
||||
url.Add(String.Concat(DefaultPage.MODULE_ID_PARAM, "=", HttpContext.Current.Request.QueryString["mid"]));
|
||||
url.Add(String.Concat(DefaultPage.CONTROL_ID_PARAM, "=", controlKey));
|
||||
|
||||
if (!String.IsNullOrEmpty(keyName) && !String.IsNullOrEmpty(keyValue))
|
||||
{
|
||||
url.Add(String.Concat(keyName, "=", keyValue));
|
||||
}
|
||||
|
||||
if (additionalParams != null)
|
||||
{
|
||||
foreach (string additionalParam in additionalParams)
|
||||
url.Add(additionalParam);
|
||||
}
|
||||
|
||||
return "~/Default.aspx?" + String.Join("&", url.ToArray());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,9 +34,6 @@ using System.Text;
|
|||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
|
||||
using System.Web;
|
||||
using WebsitePanel.WebPortal;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
public class ExchangeHelper
|
||||
|
@ -86,41 +83,6 @@ namespace WebsitePanel.Portal
|
|||
return accounts.PageItems;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Utils
|
||||
|
||||
public static string BuildUrl(string keyName, string keyValue, string controlKey, params string[] additionalParams)
|
||||
{
|
||||
List<string> url = new List<string>();
|
||||
|
||||
string pageId = HttpContext.Current.Request[DefaultPage.PAGE_ID_PARAM];
|
||||
|
||||
if (!String.IsNullOrEmpty(pageId))
|
||||
url.Add(String.Concat(DefaultPage.PAGE_ID_PARAM, "=", pageId));
|
||||
|
||||
url.Add(String.Concat(DefaultPage.MODULE_ID_PARAM, "=", HttpContext.Current.Request.QueryString["mid"]));
|
||||
url.Add(String.Concat(DefaultPage.CONTROL_ID_PARAM, "=", controlKey));
|
||||
|
||||
if (!String.IsNullOrEmpty(keyName) && !String.IsNullOrEmpty(keyValue))
|
||||
{
|
||||
url.Add(String.Concat(keyName, "=", keyValue));
|
||||
}
|
||||
|
||||
if (additionalParams != null)
|
||||
{
|
||||
foreach (string additionalParam in additionalParams)
|
||||
url.Add(additionalParam);
|
||||
}
|
||||
|
||||
return "~/Default.aspx?" + String.Join("&", url.ToArray());
|
||||
}
|
||||
|
||||
public static string GetLocalizedString(string virtualPath, string resourceKey)
|
||||
{
|
||||
return (string)HttpContext.GetLocalResourceObject(virtualPath, resourceKey);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
|
||||
|
@ -59,6 +60,19 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
//else
|
||||
//if (gvOrgs.Rows.Count > 0) btnCreate.Enabled = false;
|
||||
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (Request.UrlReferrer != null && PanelSecurity.SelectedUser.Role == UserRole.User)
|
||||
{
|
||||
var queryBuilder = new StringBuilder();
|
||||
queryBuilder.AppendFormat("?pid=Home&UserID={0}", PanelSecurity.SelectedUserId);
|
||||
|
||||
if (Request.UrlReferrer.Query.Equals(queryBuilder.ToString(), StringComparison.InvariantCultureIgnoreCase) && gvOrgs.Rows.Count > 0)
|
||||
{
|
||||
Response.Redirect(((HyperLink)gvOrgs.Rows[0].Cells[1].Controls[1]).NavigateUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnCreate_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -4,4 +4,6 @@
|
|||
<asp:DropDownList ID="ddlSpaceOrgs" runat="server" CssClass="NormalTextBox" Width="150px" style="vertical-align: middle;"
|
||||
OnSelectedIndexChanged="ddlSpaceOrgs_SelectedIndexChanged" EnableViewState="true" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
|
|
||||
<asp:HyperLink ID="lnkOrgnsList" runat="server">Edit</asp:HyperLink>
|
||||
</span>
|
||||
|
|
|
@ -70,6 +70,9 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
ddlSpaceOrgs.DataBind();
|
||||
|
||||
ddlSpaceOrgs.Items.FindByValue(PanelRequest.ItemID.ToString()).Selected = true;
|
||||
|
||||
lnkOrgnsList.NavigateUrl = PortalUtils.NavigatePageURL(
|
||||
PortalUtils.GetCurrentPageId(), "SpaceID", PanelSecurity.PackageId.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +83,7 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
|
||||
private string GetOrganizationEditUrl(string itemId)
|
||||
{
|
||||
return ExchangeHelper.BuildUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home",
|
||||
return PortalUtils.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home",
|
||||
"ItemID=" + itemId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,5 +29,14 @@ namespace WebsitePanel.Portal.SkinControls {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlSpaceOrgs;
|
||||
|
||||
/// <summary>
|
||||
/// lnkOrgnsList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink lnkOrgnsList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,6 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
// organization
|
||||
bool orgVisible = (PanelRequest.ItemID > 0);
|
||||
|
||||
//spanOrgsSelector.Visible = spanOrgn.Visible = orgVisible;
|
||||
spanOrgn.Visible = orgVisible;
|
||||
|
||||
if (orgVisible)
|
||||
|
@ -122,7 +121,7 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
// load organization details
|
||||
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
|
||||
|
||||
lnkOrgn.NavigateUrl = ExchangeHelper.BuildUrl(
|
||||
lnkOrgn.NavigateUrl = PortalUtils.EditUrl(
|
||||
"ItemID", PanelRequest.ItemID.ToString(), ORGANIZATION_CONTROL_KEY,
|
||||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||
lnkOrgn.Text = org.Name;
|
||||
|
@ -136,7 +135,7 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
|
||||
if (!String.IsNullOrEmpty(control.Src))
|
||||
{
|
||||
lbOrgCurPage.Text = ExchangeHelper.GetLocalizedString(DM_FOLDER_VIRTUAL_PATH + control.Src, PAGE_NANE_KEY);
|
||||
lbOrgCurPage.Text = PortalUtils.GetLocalizedString(DM_FOLDER_VIRTUAL_PATH + control.Src, PAGE_NANE_KEY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue