/// <summary> /// Generates the link to view. /// </summary> /// <param name="path">The path.</param> /// <param name="fullPath">The full path.</param> /// <returns></returns> private string GenerateLinkToView(string path, string fullPath) { // generate url + args string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}", SPSTools.GetCurrentPageBaseUrl(Page), SPHttpUtility.UrlKeyValueEncode(fullPath), SPHttpUtility.UrlKeyValueEncode(GetView().ID)); // onclick string onclick = string.Format("javascript:EnterFolder('{0}');javascript: return false;", hrefArgs); string href; // different html if we are in list context if (IsListContext) { href = string.Format("<a href=\"{0}\">{1}</a>", hrefArgs, path); } else { href = string.Format("<a href=\"{0}\" onclick=\"{1}\">{2}</a>", hrefArgs, onclick, path); } return(href); }
/// <summary> /// Generates the link to view. /// </summary> /// <param name="path">The path.</param> /// <param name="fullPath">The full path.</param> /// <returns></returns> private string GenerateLinkToView(string path, string fullPath) { // generate url + args string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}", SPSTools.GetCurrentPageBaseUrl(Page), //SPHttpUtility.UrlKeyValueEncode(path), //FIX: 2.8 Ivalid characters SPHttpUtility.EcmaScriptStringLiteralEncode( SPHttpUtility.UrlPathEncode(fullPath, false, true)), SPHttpUtility.UrlKeyValueEncode(GetView().ID)); // onclick string onclick = string.Format("javascript:EnterFolder('{0}');javascript: return false;", hrefArgs); string href; // different html if we are in list context //if (IsListContext) //{ // href = string.Format("<a href=\"{0}\">{1}</a>", hrefArgs, path); //} //else { href = string.Format("<a href=\"\" onclick=\"{1}\">{2}</a>", hrefArgs, onclick, path); } return(href); }
/// <summary> /// Generates the link to view. /// </summary> /// <param name="path">The path.</param> /// <returns> /// The current page url with the selected folder and view (javascript :EnterFolder) /// </returns> protected virtual string GenerateLinkToView(string path) { string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}", SPSTools.GetCurrentPageBaseUrl(Page), SPHttpUtility.UrlKeyValueEncode(path), SPHttpUtility.UrlKeyValueEncode(GetView().ID)); string url = string.Format("javascript:EnterFolder('{0}');", hrefArgs); return(url); }
private char[] GetHtml() { WssVersion wssVersion = SPSTools.GetSharePointVersion(); if (wssVersion == WssVersion.WssAgust2008 || wssVersion == WssVersion.Wss3Sp2) { return(GetHtmlSP2()); } return(GetHtmlBSP2()); }
/// <summary> /// Gets the link to upload. /// </summary> /// <returns>javascript navigate to upload page</returns> private string GetLinkToUpload() { string prefixedUrl = string.Format("{0}/_layouts/Upload.aspx?List={1}&RootFolder={2}&Source={3}", SPContext.Current.Web.ServerRelativeUrl, SPHttpUtility.UrlKeyValueEncode( new Guid(_listGuid).ToString("B").ToUpper()), _breadCrumb.GetCurrentFolder(), SPSTools.GetCurrentUrl()); return(string.Format("javascript:STSNavigate('{0}')", SPHttpUtility.EcmaScriptStringLiteralEncode( SPUtility.GetServerRelativeUrlFromPrefixedUrl(prefixedUrl)))); }
private void SetRootFolder() { WssVersion wssVersion = SPSTools.GetSharePointVersion(); if (wssVersion == WssVersion.WssAgust2008 || wssVersion == WssVersion.Wss3Sp2) { SetRootFolderSP2(); } else { SetRootFolderBSP2(); } }
/// <summary> /// Generates the link to view. /// </summary> /// <param name="path">The path.</param> /// <returns> /// The current page url with the selected folder and view (javascript :EnterFolder) /// </returns> protected virtual string GenerateLinkToView(string path) { string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}", SPSTools.GetCurrentPageBaseUrl(Page), //SPHttpUtility.UrlKeyValueEncode(path), //FIX: 2.8 Ivalid characters SPHttpUtility.EcmaScriptStringLiteralEncode( SPHttpUtility.UrlPathEncode(path, false, true)), SPHttpUtility.UrlKeyValueEncode(GetView().ID)); string url = string.Format("javascript:EnterFolder('{0}');", hrefArgs); return(url); }
/// <summary> /// Gens the java script dialog. /// </summary> /// <param name="url">The URL.</param> /// <param name="callBack">The call back.</param> /// <returns></returns> private string GenJavaScriptDialog(string url, string callBack) { string features = "resizable: yes; status: no; scroll: no; help: no; center: yes; " + "dialogWidth : 500px; dialogHeight : 550px;"; if (!SPSTools.IsIE55Plus(Context)) { features = "resizable=yes,status=no,scrollbars=no,menubar=no," + "directories=no,location=no,width=500px,height=550px"; } return(string.Format("commonShowModalDialog('{0}','{1}',{2},null);", url, features, callBack)); }