예제 #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

			// Check for customization parameters
			ApplicationName = Request.Params["AppName"] ?? ImageServerConstants.DefaultApplicationName;
			SplashScreenUrl = Request.Params["SplashScreenUrl"] ?? DefaultSplashScreenPath;
			CssClassName = Request.Params["CssClassName"];
			CustomCssUrl = Request.Params["CssUrl"];

			if (!string.IsNullOrEmpty(CssClassName))
			{
				this.PageBody.Attributes["class"] += " " + CssClassName;
			}

			if (!string.IsNullOrEmpty(CustomCssUrl))
			{
				// include the custom css (this will append to the end of the list and will overwrite the default css)
				var stylesheet = new HtmlLink { Href = CustomCssUrl };
				stylesheet.Attributes.Add("rel", "stylesheet");
				stylesheet.Attributes.Add("type", "text/css");
				Page.Header.Controls.Add(stylesheet);
			}

        	SetSplashScreen();
			
            ForeachExtension<ILoginPageExtension>(ext => ext.OnLoginPageInit(this));
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String ukeyString = Request.QueryString["ukey"];
            int inukey = ukeyString == null ? -1 : int.Parse(ukeyString);
            ukeyHiddenField.Value = inukey.ToString();
            TwitterLink.Visible = inukey != -1;
            FaceBookLink.Visible = inukey != -1;
            if (inukey == -1)
                inukey = FacesLite.GetRandomUkey(inukey);
            FaceUkeyLabel.Text = "  " + inukey.ToString();
            Image1.ImageUrl = String.Format("https://s3.amazonaws.com/FaceSpace/Faces/{0}.jpg", inukey);
            Image2.ImageUrl = String.Format("https://s3.amazonaws.com/FaceSpace/Faces/{0}.anti.jpg", inukey);
            Image3.ImageUrl = String.Format("https://s3.amazonaws.com/FaceSpace/Faces/{0}.reconstituted.jpg", inukey);
            Image3.Attributes.Add("title", "Synthetic, Reconstructed Face");

            SynthFaceLink.NavigateUrl = String.Format("http://facefield.org/SynthFace.aspx?ukey={0}", inukey);
            SpectrumLink.NavigateUrl = String.Format("http://facefield.org/Carousel.aspx?ukey={0}", inukey);
            TwitterLink.NavigateUrl = String.Format("http://twitter.com/share?text={0}&url={1}",
                HttpUtility.UrlEncode("My anti-face looks just like me. Not.\n#antiface @face_field"),
                Request.Url
                );
            FaceBookLink.NavigateUrl = String.Format("https://www.facebook.com/sharer/sharer.php?u={0}", Request.Url);

            // tell facebook which thumbnail to use.
            HtmlLink canonical = new HtmlLink();
            canonical.Href = String.Format("https://s3.amazonaws.com/FaceSpace/Faces/{0}.thumb.anti.jpg", inukey);
            canonical.Attributes["rel"] = "image_src";
            Page.Header.Controls.Add(canonical);
        }
        /// <summary>
        /// Agrega el hmtl link al header del catalogo, del css correspondiente a cargar
        /// </summary>
        protected void CargarCSS()
        {
            string cColor = null;
            HtmlLink link = new HtmlLink();

            sRutaArchivoConfig = Server.MapPath("~/Archivos/Configuracion.xml");
            if (File.Exists(sRutaArchivoConfig))
            {
                oblConfiguracion = new MedNeg.Configuracion.BlConfiguracion();
                cConfiguracion = (MedDAL.Configuracion.DALConfiguracion)oblConfiguracion.CargaDatos(sRutaArchivoConfig);
                try
                {
                    if (!cConfiguracion.sColorInterfaz.Equals(""))
                        cColor = cConfiguracion.sColorInterfaz;
                    else
                        cColor = "Gris";
                }
                catch
                {
                    cColor = "Gris";
                }
            }
            else
                cColor = "Gris";

            link.Href = "Css/" + cColor + ".css";
            link.Attributes.Add("rel", "stylesheet");
            link.Attributes.Add("type", "text/css");
            Page.Header.Controls.Add(link);
        }
 protected void AddLink(Control cssRoot, int InsertAt, HtmlLink link)
 {
     if (string.IsNullOrEmpty(Condition))
     {
         if (InsertAt == -1)
         {
             cssRoot.Controls.Add(link);
         }
         else
         {
             cssRoot.Controls.AddAt(InsertAt, link);
         }
     }
     else
     {
         var openif = new Literal();
         openif.Text = string.Format("<!--[if {0}]>", Condition);
         var closeif = new Literal();
         closeif.Text = "<![endif]-->";
         if (InsertAt == -1)
         {
             cssRoot.Controls.Add(openif);
             cssRoot.Controls.Add(link);
             cssRoot.Controls.Add(closeif);
         }
         else
         {
             //Since we want to add at a specific location, we do this in reverse order
             //this allows us to use the same insertion point
             cssRoot.Controls.AddAt(InsertAt, closeif);
             cssRoot.Controls.AddAt(InsertAt, link);
             cssRoot.Controls.AddAt(InsertAt, openif);
         }
     }
 }
예제 #5
0
        protected void Page_Init(object sender, EventArgs e)
        {
            using (HtmlLink stylesheet = new HtmlLink())
            {
                string path = "/bundles/master-page.css";

                if (CultureManager.IsRtl())
                {
                    path = path.Replace("css", "rtl.css");
                }

                stylesheet.Href = path;
                stylesheet.Attributes["rel"] = "stylesheet";
                stylesheet.Attributes["type"] = "text/css";
                stylesheet.Attributes["media"] = "all";
                this.Page.Header.Controls.Add(stylesheet);
            }

            if (Offices.GetOffices(AppUsers.GetCurrentUserDB()).Any())
            {
                this.Response.Redirect("~/SignIn.aspx");
            }

            this.RegisterJavascript();
        }
예제 #6
0
        protected override void OnPreRender(EventArgs e) {

            if (Path.HasExtension(ImageUrl) || ImageUrl.EndsWith(Path.AltDirectorySeparatorChar.ToString()) || ImageUrl.EndsWith(Path.DirectorySeparatorChar.ToString())) {
                ImageUrl = Path.GetDirectoryName(ImageUrl);
            }

            string cssFileName = ImageOptimizations.LinkCompatibleCssFile(new HttpContextWrapper(Context).Request.Browser) ?? ImageOptimizations.LowCompatibilityCssFile;

            // Set up fileName and path variables
            string localPath = Context.Server.MapPath(ImageUrl);

            // Check that CSS file is accessible
            if (!File.Exists(Path.Combine(localPath, cssFileName))) {
                return;
            }

            // Have to change directory separator character because the ImageSprite method uses Path.GetDirectory, which uses backslashes
            StringWrapper key = new StringWrapper(ImageUrl.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));

            if (!Page.Items.Contains(key)) {
                Page.Items.Add(key, null);

                HtmlLink css = new HtmlLink();
                css.Href = Path.Combine(ImageUrl, cssFileName);
                css.Attributes["rel"] = "stylesheet";
                css.Attributes["type"] = "text/css";
                css.Attributes["media"] = "all";
                Page.Header.Controls.Add(css);
            }
        }
예제 #7
0
        protected void Page_Init(object sender, EventArgs e)
        {
            String[] css = new String[] { "http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css"
                                        , "../css/Common.css"
                                        , "../css/OneColumn.css"
                                        , "../css/ibmcognosdemo.css"
                                        , "../css/Controls.css" };

            String[] js = new String[] { "http://api.demandbase.com/autocomplete/widget.js"
                                       , "http://code.jquery.com/jquery-1.8.3.js"
                                       , "http://code.jquery.com/ui/1.10.0/jquery-ui.js"
                                       , "../js/DemandBase.js"
                                       , "../js/FormGenerator.js" };

            for (int i = 0; i < css.Length; i++)
            {
                HtmlLink link = new HtmlLink();
                link.Attributes.Add("href", Page.ResolveClientUrl(css[i]));
                link.Attributes.Add("type", "text/css");
                link.Attributes.Add("rel", "stylesheet");
                Page.Header.Controls.Add(link);
            }

            for (int i = 0; i < js.Length; i++)
            {
                HtmlGenericControl script = new HtmlGenericControl("script");
                script.Attributes.Add("type", "text/javascript");
                script.Attributes.Add("src", js[i]);
                Page.Header.Controls.Add(script);
            }
        }
예제 #8
0
 public void AddStyleSheet(string id, string href, bool isFirst)
 {
     Control objCSS = this.FindControl("CSS");
     if (objCSS != null)
     {
         Control objCtrl = Page.Header.FindControl(id);
         if (objCtrl == null)
         {
             HtmlLink objLink = new HtmlLink();
             objLink.ID = id;
             objLink.Attributes["rel"] = "stylesheet";
             objLink.Attributes["type"] = "text/css";
             objLink.Href = href;
             if (isFirst)
             {
                 int iLink;
                 for (iLink = 0; iLink <= objCSS.Controls.Count - 1; iLink++)
                 {
                     if (objCSS.Controls[iLink] is HtmlLink)
                     {
                         break;
                     }
                 }
                 objCSS.Controls.AddAt(iLink, objLink);
             }
             else
             {
                 objCSS.Controls.Add(objLink);
             }
         }
     }
 }
예제 #9
0
파일: XPage.cs 프로젝트: jorik041/X.Web
        protected virtual void SetCanonicalUrl(string canonicalUrl)
        {
            if (String.IsNullOrEmpty(canonicalUrl))
            {
                throw new Exception("Empty canonical url");
            }

            canonicalUrl = canonicalUrl.ToLower();

            if (!String.IsNullOrEmpty(canonicalUrl))
            {
                var requestUrl = Request.Url.ToString();

                if (requestUrl != canonicalUrl && requestUrl != canonicalUrl + "default.aspx" /*&& !requestUrl.Contains("localhost")*/)
                {
                    Response.Redirect(canonicalUrl);
                }
            }

            if (!_canonicalUrlAdded)
            {
                var link = new HtmlLink();
                link.Attributes["rel"] = "canonical";
                link.Href = canonicalUrl;

                Header.Controls.Add(link);
                _canonicalUrlAdded = true;
            }
            else
            {
                throw new Exception("Canonical url already added");
            }
        }
예제 #10
0
파일: Util.cs 프로젝트: Leonscape/ESWCtrls
        public static void addStyleSheet(string css, string key, Page currentPage, WebControl control)
        {
            ControlCollection ctrls = currentPage.Controls;
            if (currentPage.Master != null)
                ctrls = currentPage.Master.Controls;

            foreach (Control ctrl in ctrls)
            {
                if (ctrl.GetType().Name == "HtmlHead")
                {
                    ctrls = ctrl.Controls;
                    break;
                }
            }

            if (key != null)
            {
                foreach (Control ctrl in ctrls)
                {
                    if (ctrl.ID == key)
                        return;
                }
            }

            string url = currentPage.ClientScript.GetWebResourceUrl(control.GetType(), "ESWCtrls.ResEmbed.Styles." + css);
            HtmlLink link = new HtmlLink();
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("rel", "stylesheet");
            link.Attributes.Add("media", "screen");
            link.Href = url;
            link.ID = key;

            ctrls.Add(new LiteralControl("\n"));
            ctrls.Add(link);
        }
        private void PasswordLengthControl_Load(object sender, EventArgs e)
        {
            if (this.Page != null)
            {
                if (this.Page.Header != null)
                {
                    if (!this.Page.ClientScript.IsClientScriptBlockRegistered("passCss"))
                    {
                        var link = new HtmlLink
                        {
                            Href = this.Page.ClientScript.GetWebResourceUrl(
                                this.GetType(),
                                "Msts.Content.Chapter09.PasswordStrength.css")
                        };

                        link.Attributes.Add("rel", "stylesheet");
                        link.Attributes.Add("type", "text/css");

                        this.Page.Header.Controls.Add(link);
                        this.Page.ClientScript.RegisterClientScriptBlock(
                            typeof(Page), 
                            "passCss",
                            string.Empty);
                    }
                }
            }
        }
 private static HtmlLink MakeStyleTag(string path)
 {
     HtmlLink ctrl = new HtmlLink {Href = path};
     ctrl.Attributes.Add("rel", "stylesheet");
     ctrl.Attributes.Add("type", "text/css");
     return ctrl;
 }
예제 #13
0
        /// <summary>
        /// Registers the embedded client resource.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="resourceContainer">The type containing the embedded resource</param>
        /// <param name="resourceName">Name of the resource.</param>
        /// <param name="type">The type.</param>
        public static void RegisterEmbeddedClientResource(this Page page, Type resourceContainer, string resourceName, ClientDependencyType type)
        {
            var target = page.Header;

            // if there's no <head runat="server" /> don't throw an exception.
            if (target != null)
            {
                switch (type)
                {
                    case ClientDependencyType.Css:
                        // get the urls for the embedded resources
                        var resourceUrl = page.ClientScript.GetWebResourceUrl(resourceContainer, resourceName);
                        var link = new HtmlLink();
                        link.Attributes.Add("href", resourceUrl);
                        link.Attributes.Add("type", "text/css");
                        link.Attributes.Add("rel", "stylesheet");
                        target.Controls.Add(link);
                        break;

                    case ClientDependencyType.Javascript:
                        page.ClientScript.RegisterClientScriptResource(resourceContainer, resourceName);
                        break;

                    default:
                        break;
                }
            }
        }
예제 #14
0
        protected override void OnPreRender(EventArgs e)
        {
            if (this.Page != null)
            {
                if (this.UIType == EasilyReportUIType.AspNet)
                {
                    string script = AspNetScriptsProvider.GetScripts();
                    AspNetScriptsProvider.RegisterStartupScript(this, script);
                }
            }

            base.OnPreRender(e);

            if (this.UIType == EasilyReportUIType.AspNet)
            {
                string rscUrl = WebEasilyReportCSS.CssUrl;
                bool isCssExist = false;
                foreach (Control ctrl in this.Page.Header.Controls)
                {
                    if (ctrl is HtmlLink && ((HtmlLink)ctrl).Href == rscUrl)
                        isCssExist = true;
                }
                if (!isCssExist)
                {
                    HtmlLink cssLink = new HtmlLink();
                    cssLink.Href = rscUrl;
                    cssLink.Attributes.Add("rel", "stylesheet");
                    cssLink.Attributes.Add("type", "text/css");
                    this.Page.Header.Controls.Add(cssLink);
                }
            }
        }
 internal void SetStyleSheet()
 {
     if ((this.LinkedStyleSheets != null) && (this.LinkedStyleSheets.Length > 0))
     {
         if (this.Page.Header == null)
         {
             throw new InvalidOperationException(System.Web.SR.GetString("Page_theme_requires_page_header"));
         }
         int num = 0;
         foreach (string str in this.LinkedStyleSheets)
         {
             HtmlLink child = new HtmlLink {
                 Href = str
             };
             child.Attributes["type"] = "text/css";
             child.Attributes["rel"] = "stylesheet";
             if (this._styleSheetTheme)
             {
                 this.Page.Header.Controls.AddAt(num++, child);
             }
             else
             {
                 this.Page.Header.Controls.Add(child);
             }
         }
     }
 }
예제 #16
0
파일: Default.aspx.cs 프로젝트: elfmon/hgis
    /// <summary>
    /// Injects OpenLayers CSS & JS;
    /// Injects proj4js JS
    /// </summary>
    private void IncludeOpenLayers()
    {
        //web.config ol_settings
        var ol_settings = Cartomatic.Utils.Serialisation.DeserializeJsonString(ConfigurationManager.AppSettings["ol_settings"]);

        //extract version from url
        string version = Request.QueryString["ol"];

        //if not provided auto default to whatever is set in the web.config
        if (string.IsNullOrEmpty(version))
        {
            version = ol_settings.version;
        }

        //OpenLayers css
        System.Web.UI.HtmlControls.HtmlLink olCss = new System.Web.UI.HtmlControls.HtmlLink();
        olCss.Attributes["rel"]  = "stylesheet";
        olCss.Attributes["type"] = "text/css";
        olCss.Href = jslibs + "OpenLayers/" + version + "/css/ol.css";
        Page.Header.Controls.Add(olCss);


        //Proj4Js
        System.Web.UI.HtmlControls.HtmlGenericControl p4Js = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        p4Js.Attributes["type"] = "text/javascript";
        p4Js.Attributes["src"]  = jslibs + "proj4js/1.5.0/dist/proj4.js";
        Page.Header.Controls.Add(p4Js);


        //OpenLayers
        System.Web.UI.HtmlControls.HtmlGenericControl olJs = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        olJs.Attributes["type"] = "text/javascript";
        olJs.Attributes["src"]  = jslibs + "OpenLayers/" + version + "/build/ol.js";
        Page.Header.Controls.Add(olJs);
    }
        /// <summary>
        /// Adds the CSS file.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="cssFile">The CSS file.</param>
        public static void AddCssFile(this Page page, string cssFile)
        {
            Assert.ArgumentNotNull(page, "page");
              Assert.ArgumentNotNullOrEmpty(cssFile, "cssFile");

              HtmlLink link = new HtmlLink();
              link.Href = cssFile;

              link.Attributes.Add("rel", "stylesheet");
              link.Attributes.Add("type", "text/css");

              if (page.Header != null)
              {
            try
            {
              if (!IsExistCssInHeader(page, cssFile))
              {
            page.Header.Controls.Add(link);
              }
            }
            catch
            {
              AddToClientScriptManager(page, link);
            }
              }
              else
              {
            AddToClientScriptManager(page, link);
              }
        }
예제 #18
0
        public static void RegisterCssInclude(this ClientScriptManager clientScriptManager, string cssUrl, ResourceInsertPosition position)
        {
            if (cssUrl.StartsWith("~"))
                cssUrl = VirtualPathUtility.ToAbsolute(cssUrl);

            Page page = (Page)HttpContext.Current.Handler;
            if (page.Items[cssUrl] == null)
            {
                HtmlLink link = new HtmlLink();
                link.Href = cssUrl;
                link.Attributes["type"] = "text/css";
                link.Attributes["rel"] = "stylesheet";
                link.Attributes["title"] = "Default Style";

                switch (position)
                {
                    case ResourceInsertPosition.HeaderTop:
                        {
                            int index = (int)(page.Items["__CssResourceIndex"] ?? 0);
                            page.Header.Controls.AddAt(index, link);
                            page.Items["__CssResourceIndex"] = ++index;
                        }
                        break;
                    case ResourceInsertPosition.HeaderBottom:
                        page.Header.Controls.Add(link);
                        break;
                    case ResourceInsertPosition.BodyBottom:
                        page.Form.Controls.Add(link);
                        break;
                }

                page.Items[cssUrl] = new object();
            }
        }
 /// <summary>
 /// Adds to client script manager.
 /// </summary>
 /// <param name="page">The page.</param>
 /// <param name="link">The link.</param>
 private static void AddToClientScriptManager(Page page, HtmlLink link)
 {
     HtmlTextWriter writer = new HtmlTextWriter(new StringWriter(new StringBuilder()));
       link.RenderControl(writer);
       page.ClientScript.RegisterClientScriptBlock(typeof(Page),
     writer.InnerWriter.ToString(), writer.InnerWriter.ToString());
 }
예제 #20
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            ErrorControl errorControl = new ErrorControl();

            if (this.IsAsyncPostBackRequest)
            {
                Controls.Add(errorControl);
            }
            else
            {
                HtmlGenericControl html = new HtmlGenericControl("html");

                HtmlHead head = new HtmlHead();

                HtmlLink link = new HtmlLink();
                link.Href = HttpRuntime.AppDomainAppVirtualPath + "/UIBase/Styles/GlobalReset.css";
                link.Attributes.Add("rel", "stylesheet");
                link.Attributes.Add("type", "text/css");

                head.Controls.Add(link);
                html.Controls.Add(head);

                Controls.Add(html);

                HtmlGenericControl body = new HtmlGenericControl("body");
                body.Attributes.Add("style", "padding: 10px");
                body.Controls.Add(errorControl);
                html.Controls.Add(body);
            }
        }
예제 #21
0
    public static void cssInclude(string cssPath, bool useImport, System.Web.UI.MasterPage masterPage)
    {
        if (useImport)
        {
            using (System.Web.UI.HtmlControls.HtmlGenericControl control = new System.Web.UI.HtmlControls.HtmlGenericControl())
            {
                control.TagName = "style";
                control.Attributes.Add("type", "text/css");
                control.InnerHtml = "@import \"" + cssPath + "\";";

                masterPage.Page.Header.Controls.Add(control);
            }
        }
        else
        {
            using (System.Web.UI.HtmlControls.HtmlLink control = new System.Web.UI.HtmlControls.HtmlLink())
            {
                control.Attributes.Add("rel", "Stylesheet");
                control.Attributes.Add("type", "text/css");
                control.Attributes.Add("href", cssPath);

                masterPage.Page.Header.Controls.Add(control);
            }
        }
    }
예제 #22
0
        public static void PrintWebControl(Control ctrl, string Script)
        {
            StringWriter stringWrite = new StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
            if (ctrl is WebControl)
            {
                Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
            }
            Page pg = new Page();
            pg.EnableEventValidation = false;
            pg.StyleSheetTheme = "../CSS/order.css";
            if (Script != string.Empty)
            {
                pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
            }

            HtmlLink link = new HtmlLink();
            link.Href = "../CSS/order.css";
            HtmlForm frm = new HtmlForm();
            pg.Controls.Add(frm);
            frm.Attributes.Add("runat", "server");
            frm.Controls.Add(ctrl);
            pg.DesignerInitialize();
            pg.RenderControl(htmlWrite);
            string strHTML = stringWrite.ToString();
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write("<head runat='server'> <title>Printer - Bản in tại Support.evnit.evn.com.vn</title> <link type='text/css' rel='stylesheet' href='../CSS/order.css'><link type='text/css' rel='stylesheet' href='../CSS/style.css'></head>");
            HttpContext.Current.Response.Write(strHTML);
            HttpContext.Current.Response.Write("<script>window.print();</script>");
            HttpContext.Current.Response.End();
        }
예제 #23
0
 public void AddStyleSheet(Page page, string cssPath)
 {
     HtmlLink link = new HtmlLink();
     link.Href = cssPath;
     link.Attributes["rel"] = "stylesheet";
     link.Attributes["type"] = "text/css";
 }
예제 #24
0
        protected void DoSEO()
        {
            HtmlLink canonicalTag = new HtmlLink();
            canonicalTag.Attributes.Add("rel", "canonical");

            // Set page title
            ((DotNetNuke.Framework.CDefault)this.Page).Title = ModuleConfiguration.ModuleTitle;

            if (Request.QueryString["target"] == "ingredient")
            {// Eventual target will be a list of ingredients--show the ingredient div

                // Set page meta description
                ((DotNetNuke.Framework.CDefault)this.Page).Description = "Browse liquors and mixers by alcohol proof.";

                // Set page link canonical tag
                canonicalTag.Href = ConfigurationManager.AppSettings["SiteUrl"] + "ingredients/browse/proof";
            }
            else
            {// Eventual target will be a list of drinks--show the drink div

                // Set page meta description
                ((DotNetNuke.Framework.CDefault)this.Page).Description = "Browse drink recipes by the drink's alcohol proof.";

                // Set page link canonical tag
                canonicalTag.Href = ConfigurationManager.AppSettings["SiteUrl"] + "drinks/browse/proof";
            }

            ((DotNetNuke.Framework.CDefault)this.Page).Header.Controls.Add(canonicalTag);
        }
        protected void Page_Load(object sender, EventArgs e)
        {


            // Define an HtmlLink control.
            HtmlLink TableLinkCss = new HtmlLink();
            TableLinkCss.Href = Page.ResolveUrl("~/Manager/css/table/" + Common.TableSink + "/Css.css");
            TableLinkCss.Attributes.Add("rel", "stylesheet");
            TableLinkCss.Attributes.Add("type", "text/css");

            // Add the HtmlLink to the Head section of the page.
            Page.Header.Controls.Add(TableLinkCss);



            HtmlGenericControl CheckLinkJs = new HtmlGenericControl("script");

            CheckLinkJs.Attributes.Add("type", "text/javascript");
            CheckLinkJs.Attributes.Add("src", Page.ResolveUrl("~/Manager/js/checkform.js"));
            CheckLinkJs.Attributes.Add("charset", "utf-8");
            Page.Header.Controls.Add(CheckLinkJs);



            HtmlGenericControl dateLinkJs = new HtmlGenericControl("script");
            dateLinkJs.Attributes.Add("src", Page.ResolveUrl("~/Manager/js/date/date.js"));
            dateLinkJs.Attributes.Add("type", "text/javascript");
            dateLinkJs.Attributes.Add("charset", "utf-8");
            Page.Header.Controls.Add(dateLinkJs);

            Page.Header.Controls[2].Visible = false;


        }
예제 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request.Params["id"];

                if (id == null || id == "")
                {
                    return;
                }

                try
                {
                    int newsID = Convert.ToInt32(id);
                    ShowNews(newsID);
                }
                catch (Exception)
                {}

                HtmlLink rssNews = new HtmlLink();
                rssNews.Attributes.Add("rel", "alternate");
                rssNews.Attributes.Add("type", "application/rss+xml");
                rssNews.Attributes.Add("title", Config.Misc.SiteTitle + " - " + Lang.Trans("News"));
                rssNews.Attributes.Add("href", "Rss.ashx?action=news");
                Header.Controls.Add(rssNews);
            }
        }
        protected void InitAssets()
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"] = "stylesheet";
            NetworkBrowsercss.Attributes["type"] = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Page.Header.Controls.Add(NetworkBrowsercss);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");
            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/lib/prototype.js");
            Page.Header.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");
            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/src/scriptaculous.js");
            Page.Header.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");
            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/javascript/networkBrowserClass.js");
            Page.Header.Controls.Add(jsscript3);

            divSwfScript.InnerHtml = "<script language=\"JavaScript\" type=\"text/javascript\"> " +
               "AC_FL_RunContent(" +
               "'codebase', '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'," +
               "'width', '600'," +
               "'height', '485'," +
               "'src', '" + Root.Domain + "/profile/Modules/NetworkCluster/network_browser_force.swf'," +
               "'movie', '" + Root.Domain + "/profile/Modules/NetworkCluster/network_browser_force'," +
               "'quality', 'high'," +
               "'pluginspage', '//www.adobe.com/go/getflashplayer'," +
               "'align', 'middle'," +
               "'play', 'true'," +
               "'loop', 'true'," +
               "'scale', 'showall'," +
               "'wmode', 'transparent'," +
               "'devicefont', 'false'," +
               "'id', 'network_browserFLASH'," +
               "'bgcolor', '#ffffff'," +
               "'name', 'network_browserFLASH'," +
               "'menu', 'true'," +
               "'allowFullScreen', 'false'," +
               "'allowScriptAccess', 'always'," +
               "'salign', ''" +
               "); //end AC code" +
               "</script>";

            HtmlGenericControl script = new HtmlGenericControl("script");
            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "function loadClusterView() {" +
                " network_browser._cfg.profile_network_path = '/" + Request.QueryString["Predicate"].ToString() + "/cluster'; " +
                " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkCluster/NetworkClusterSvc.aspx?p='); " +
                " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " +
                "};" +
                "//function GoPerson(x) {document.location='"+ Root.Domain +"/profiles/profile/person/'+x;}";
            Page.Header.Controls.Add(script);
        }
예제 #28
0
파일: Default.aspx.cs 프로젝트: elfmon/hgis
 /// <summary>
 /// Injects favicon
 /// </summary>
 private void IncludeFavicon()
 {
     System.Web.UI.HtmlControls.HtmlLink favicon = new System.Web.UI.HtmlControls.HtmlLink();
     favicon.Attributes["rel"]  = "icon";
     favicon.Attributes["type"] = "image/png";
     favicon.Href = "resx/favicon/favicon.png";
     Page.Header.Controls.Add(favicon);
 }
        private static HtmlLink CreateHtmlLink(string url)
        {
            var link = new HtmlLink { Href = url };
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("rel", "stylesheet");

            return link;
        }
예제 #30
0
 public HtmlLink CreateHtmlLink(string path)
 {
     var cssLink = new HtmlLink { Href = path };
     cssLink.Attributes.Add("rel", "stylesheet");
     cssLink.Attributes.Add("type", "text/css");
     cssLink.Attributes.Add("media", "screen");
     return cssLink;
 }
예제 #31
0
 protected void Page_Init(object sender, EventArgs e)
 {
     var myHtmlLink = new HtmlLink { Href = "Styles/Site.css" };
     myHtmlLink.Attributes.Add("rel", "stylesheet");
     myHtmlLink.Attributes.Add("type", "text/css");
     Page.Header.Controls.Add(myHtmlLink);
     //myHtmlLink.Href = "~/scripts/fmt_vmenu/css/fmtstyle.css";
 }
예제 #32
0
 /// <summary>a helper function for create a css-link control</summary>
 private static Control CreateStyleLink(string href)
 {
     HtmlLink link = new HtmlLink();
     link.Attributes.Add("rel", "Stylesheet");
     link.Attributes.Add("type", "text/css");
     link.Attributes.Add("href", href);
     return link;
 }
예제 #33
0
 public static void AddStyleSheet(Page page, string cssPath)
 {
     HtmlLink link = new HtmlLink();
     link.Href = cssPath;
     link.Attributes["rel"] = "stylesheet";
     link.Attributes["type"] = "text/css";
     page.Header.Controls.Add(link);
 }
예제 #34
0
 protected void Page_Load(object sender, EventArgs e)
 {
     System.Web.UI.HtmlControls.HtmlLink css = new System.Web.UI.HtmlControls.HtmlLink();
     css.Href = "/css/main_1.css";
     css.Attributes["rel"]  = "stylesheet";
     css.Attributes["type"] = "text/css";
     // css.Attributes["media"] = "all"; //add any attributes as needed
     Master.Page.Header.Controls.Add(css);
 }
예제 #35
0
        protected void InitAssets(string listid)
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"]   = "stylesheet";
            NetworkBrowsercss.Attributes["type"]  = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Head1.Controls.Add(NetworkBrowsercss);

            HtmlGenericControl jsscript0 = new HtmlGenericControl("script");

            jsscript0.Attributes.Add("type", "text/javascript");
            jsscript0.Attributes.Add("src", Root.Domain + "/profile/Modules/NetworkCluster/JavaScript/watchdog.js");
            Head1.Controls.Add(jsscript0);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");

            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/profile/Modules/NetworkCluster/scriptaculous/lib/prototype.js");
            Head1.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");

            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/profile/Modules/NetworkCluster/scriptaculous/src/scriptaculous.js");
            Head1.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");

            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/lists/Modules/NetworkClusterList/JavaScript/networkBrowserClass.js");
            Head1.Controls.Add(jsscript3);

            HtmlGenericControl jsscript4 = new HtmlGenericControl("script");

            jsscript4.Attributes.Add("type", "text/javascript");
            jsscript4.Attributes.Add("src", Root.Domain + "/lists/Modules/NetworkClusterList/JavaScript/networkClusterLayoutEngine.js");
            Head1.Controls.Add(jsscript4);

            HtmlGenericControl jsscript5 = new HtmlGenericControl("script");

            jsscript5.Attributes.Add("type", "text/javascript");
            jsscript5.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js");
            Head1.Controls.Add(jsscript5);

            HtmlGenericControl script = new HtmlGenericControl("script");

            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "function loadClusterView() {" +
                               " network_browser.Init('" + Root.Domain + "/lists/modules/NetworkClusterList/NetworkClusterListSvc.aspx?p='); " +
                               " network_browser.loadNetwork('" + listid + "'); " +
                               "};";
            Head1.Controls.Add(script);
        }
예제 #36
0
    public static void faviconInclude(string faviconPath, System.Web.UI.MasterPage masterPage)
    {
        using (System.Web.UI.HtmlControls.HtmlLink favicon = new System.Web.UI.HtmlControls.HtmlLink())
        {
            favicon.Attributes.Add("rel", "shortcut icon");
            favicon.Attributes.Add("type", "image/x-icon");
            favicon.Attributes.Add("href", faviconPath);

            masterPage.Page.Header.Controls.Add(favicon);
        }
    }
예제 #37
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            System.Web.UI.HtmlControls.HtmlLink cssLink = new System.Web.UI.HtmlControls.HtmlLink();
            string cssUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "ProudMonkey.Common.Controls.css.MessageBox.css");

            cssLink.Href = cssUrl;
            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            this.Page.Header.Controls.Add(cssLink);

            SetControlProperties();
        }
    /// <summary>
    /// Loads the colorpicker script.</summary>
    /// <param name="page">The web page.</param>
    public static void LoadLibrary_ColorPicker(System.Web.UI.Page page)
    {
        System.Web.UI.HtmlControls.HtmlGenericControl colorpickerScript = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        colorpickerScript.Attributes["type"] = "text/javascript";
        colorpickerScript.Attributes["src"]  = page.ResolveUrl("~/design/libraries/jquery/colorpicker/js/colorpicker.js");
        page.Header.FindControl("phHeader").Controls.Add(colorpickerScript);

        System.Web.UI.HtmlControls.HtmlLink colorpickerCSS = new System.Web.UI.HtmlControls.HtmlLink();
        colorpickerCSS.Href = page.ResolveUrl("~/design/libraries/jquery/colorpicker/css/colorpicker.css");
        colorpickerCSS.Attributes.Add("rel", "stylesheet");
        colorpickerCSS.Attributes.Add("type", "text/css");
        page.Header.FindControl("phHeader").Controls.Add(colorpickerCSS);
    }
예제 #39
0
 protected override void OnLoad(EventArgs e)
 {
     if (Blogsa.ActiveUser != null && Blogsa.ActiveUser.Role.Contains("admin") && Page.Header.FindControl("blogsa") == null)
     {
         System.Web.UI.HtmlControls.HtmlLink hlBlogsa = new System.Web.UI.HtmlControls.HtmlLink();
         hlBlogsa.ID   = "blogsa";
         hlBlogsa.Href = ResolveUrl("~/Admin/Css/blogsa.css");
         hlBlogsa.Attributes.Add("rel", "stylesheet");
         hlBlogsa.Attributes.Add("type", "text/css");
         Page.Header.Controls.Add(hlBlogsa);
     }
     base.OnLoad(e);
 }
예제 #40
0
파일: Default.aspx.cs 프로젝트: elfmon/hgis
    //Generic script injection logic
    //------------------------------


    /// <summary>
    /// Includes splash screen
    /// </summary>
    private void IncludeSplashScreen()
    {
        //First inject splashscreen css and js
        System.Web.UI.HtmlControls.HtmlLink ssCss = new System.Web.UI.HtmlControls.HtmlLink();
        ssCss.Attributes["rel"]  = "stylesheet";
        ssCss.Attributes["type"] = "text/css";
        ssCss.Href = "resx/splash/hgis.css";
        Page.Header.Controls.Add(ssCss);

        System.Web.UI.HtmlControls.HtmlGenericControl ssJs = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        ssJs.Attributes["type"] = "text/javascript";
        ssJs.Attributes["src"]  = "resx/splash/hgis.js";
        Page.Header.Controls.Add(ssJs);
    }
예제 #41
0
파일: Default.aspx.cs 프로젝트: elfmon/hgis
    /// <summary>
    /// Includes custom css
    /// </summary>
    private void IncludeCustomCss()
    {
        //
        System.Web.UI.HtmlControls.HtmlLink hgisCss = new System.Web.UI.HtmlControls.HtmlLink();
        hgisCss.Attributes["rel"]  = "stylesheet";
        hgisCss.Attributes["type"] = "text/css";
        hgisCss.Href = "resx/css/hgis.css";
        Page.Header.Controls.Add(hgisCss);

        //font awsome
        System.Web.UI.HtmlControls.HtmlLink faCss = new System.Web.UI.HtmlControls.HtmlLink();
        faCss.Attributes["rel"]  = "stylesheet";
        faCss.Attributes["type"] = "text/css";
        faCss.Href = "resx/font-awesome-4.1.0/css/font-awesome.min.css";
        Page.Header.Controls.Add(faCss);
    }
    /// <summary>
    /// Loads the fancybox script.</summary>
    /// <param name="page">The web page.</param>
    public static void LoadLibrary_FancyBox(System.Web.UI.Page page)
    {
        System.Web.UI.HtmlControls.HtmlGenericControl mousewheelScript = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        mousewheelScript.Attributes["type"] = "text/javascript";
        mousewheelScript.Attributes["src"]  = page.ResolveUrl("~/design/libraries/jquery/fancybox/jquery.mousewheel-3.0.2.pack.js");
        page.Header.FindControl("phHeader").Controls.Add(mousewheelScript);

        System.Web.UI.HtmlControls.HtmlGenericControl fancyboxScript = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        fancyboxScript.Attributes["type"] = "text/javascript";
        fancyboxScript.Attributes["src"]  = page.ResolveUrl("~/design/libraries/jquery/fancybox/jquery.fancybox-1.3.1.pack.js");
        page.Header.FindControl("phHeader").Controls.Add(fancyboxScript);

        System.Web.UI.HtmlControls.HtmlLink fancyboxSCSS = new System.Web.UI.HtmlControls.HtmlLink();
        fancyboxSCSS.Href = page.ResolveUrl("~/design/libraries/jquery/fancybox/jquery.fancybox-1.3.1.css");
        fancyboxSCSS.Attributes.Add("rel", "stylesheet");
        fancyboxSCSS.Attributes.Add("type", "text/css");
        fancyboxSCSS.Attributes.Add("media", "screen");
        page.Header.FindControl("phHeader").Controls.Add(fancyboxSCSS);
    }
예제 #43
0
 protected override void OnInit(System.EventArgs e)
 {
     base.OnInit(e);
     PageTitle.AddTitle(SettingsManager.GetMasterSettings(true).SiteName);
     foreach (System.Web.UI.Control control in this.Page.Header.Controls)
     {
         if (control is System.Web.UI.HtmlControls.HtmlLink)
         {
             System.Web.UI.HtmlControls.HtmlLink link = control as System.Web.UI.HtmlControls.HtmlLink;
             if (link.Href.StartsWith("/"))
             {
                 link.Href = Globals.ApplicationPath + link.Href;
             }
             else
             {
                 link.Href = Globals.ApplicationPath + "/" + link.Href;
             }
         }
     }
 }
예제 #44
0
 protected override void OnInit(System.EventArgs e)
 {
     base.OnInit(e);
     PageTitle.AddTitle(Hidistro.Membership.Context.HiContext.Current.SiteSettings.SiteName, this.Context);
     foreach (System.Web.UI.Control control in this.Page.Header.Controls)
     {
         if (control is System.Web.UI.HtmlControls.HtmlLink)
         {
             System.Web.UI.HtmlControls.HtmlLink htmlLink = control as System.Web.UI.HtmlControls.HtmlLink;
             if (htmlLink.Href.StartsWith("/"))
             {
                 htmlLink.Href = Globals.ApplicationPath + htmlLink.Href;
             }
             else
             {
                 htmlLink.Href = Globals.ApplicationPath + "/" + htmlLink.Href;
             }
         }
     }
 }
예제 #45
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.ScriptManager1.IsInAsyncPostBack)
        {
            // After every Ajax postback re-initialize the JQuery UI elements
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "initializeUI", "initializeUI(); initializeExampleUI();", true);
        }

        if (!this.ScriptManager1.IsInAsyncPostBack)
        {
            // Load the custom CSS used by the PopupPictureTrimmer
            System.Web.UI.HtmlControls.HtmlLink lightBoxCustomCSS = new System.Web.UI.HtmlControls.HtmlLink();
            lightBoxCustomCSS.Href = this.ResolveUrl("CodeCarvings.Piczard.LightBox.Custom.css");
            lightBoxCustomCSS.Attributes.Add("rel", "stylesheet");
            lightBoxCustomCSS.Attributes.Add("type", "text/css");
            this.Header.FindControl("phHeader").Controls.Add(lightBoxCustomCSS);

            // Load the colorpicker script
            ExamplesHelper.LoadLibrary_ColorPicker(this);
        }

        if (!this.IsPostBack)
        {
            // Load the image
            CropConstraint cropConstraint = new FixedCropConstraint(100, 100);
            cropConstraint.DefaultImageSelectionStrategy = CropConstraintImageSelectionStrategy.DoNotResize;

            this.InlinePictureTrimmer1.LoadImageFromFileSystem("~/repository/source/flowers2.png", cropConstraint);
            this.PopupPictureTrimmer1.LoadImageFromFileSystem("~/repository/source/flowers2.png", cropConstraint);
        }

        // Configure the PictureTrimmer instances
        this.SetPictureTrimmerConfiguration(this.InlinePictureTrimmer1);
        this.SetPictureTrimmerConfiguration(this.PopupPictureTrimmer1);
        this.PopupPictureTrimmer1.LightBoxCssClass = this.ddlPopupLightBoxCssClass.SelectedValue;

        this.cbShowResizePanel.Enabled = this.cbAllowResize.Checked;

        // Reset some settings after every postback...
        this.MyUpdateProgress1.AssociatedUpdatePanelID = this.UpdatePanel1.UniqueID;
    }
예제 #46
0
파일: Default.aspx.cs 프로젝트: elfmon/hgis
    /// <summary>
    /// Injects ExtJS
    /// </summary>
    private void IncludeExtJs()
    {
        //web.config sencha_settings
        var sencha_settings = Cartomatic.Utils.Serialisation.DeserializeJsonString(ConfigurationManager.AppSettings["sencha_settings"]);

        string version = Request.QueryString["ext"];

        if (string.IsNullOrEmpty(version))
        {
            version = sencha_settings.extjs_version;
        }

        //Emit some info on picked extjs version so xtra ext goodies can be linked dynamically
        System.Web.UI.HtmlControls.HtmlGenericControl extJsVersionScript = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        extJsVersionScript.Attributes["type"] = "text/javascript";
        extJsVersionScript.InnerHtml          =
            "var __extjs__ = '" + version + "';";
        Page.Header.Controls.Add(extJsVersionScript);


        string style        = Request.QueryString["style"] ?? "";
        string extThemeName = "";

        switch (style.ToLower())
        {
        default:
        case "crisp-touch":
            extThemeName = "ext-theme-crisp-touch";
            break;

        case "crisp":
            extThemeName = "ext-theme-crisp";
            break;

        case "blue":
            extThemeName = "ext-theme-classic";
            break;

        case "gray":
            extThemeName = "ext-theme-gray";
            break;

        case "neptune":
            extThemeName = "ext-theme-neptune";
            break;

        case "neptune-touch":
            extThemeName = "ext-theme-neptune-touch";
            break;
        }

        string extSkinCssPath = jslibs + "extjs/" + version + "/build/packages/" + extThemeName + "/build/resources/" + extThemeName + "-all.css";
        string extSkinJsPath  = jslibs + "extjs/" + version + "/build/packages/" + extThemeName + "/build/" + extThemeName + ".js";;

        //Add extjs css
        System.Web.UI.HtmlControls.HtmlLink skinCss = new System.Web.UI.HtmlControls.HtmlLink();
        skinCss.Attributes["rel"]  = "stylesheet";
        skinCss.Attributes["type"] = "text/css";
        skinCss.Href = extSkinCssPath;
        Page.Header.Controls.Add(skinCss);


        bool debugjs;

        Boolean.TryParse(Request.QueryString["devjs"], out debugjs);

        //Extjs script
        System.Web.UI.HtmlControls.HtmlGenericControl extJs = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        extJs.Attributes["type"] = "text/javascript";
        if (debugjs)
        {
            extJs.Attributes["src"] = jslibs + "extjs/" + version + "/build/ext-all-debug.js";
        }
        else
        {
            extJs.Attributes["src"] = jslibs + "extjs/" + version + "/build/ext-all.js";
        }
        Page.Header.Controls.Add(extJs);


        //add extjs skin js
        System.Web.UI.HtmlControls.HtmlGenericControl skinJs = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
        skinJs.Attributes["type"] = "text/javascript";
        skinJs.Attributes["src"]  = extSkinJsPath;
        Page.Header.Controls.Add(skinJs);
    }
예제 #47
0
        protected void InitAssets()
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"]   = "stylesheet";
            NetworkBrowsercss.Attributes["type"]  = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Page.Header.Controls.Add(NetworkBrowsercss);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");

            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js");
            Page.Header.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");

            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js");
            Page.Header.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");

            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/javascript/networkBrowserClass.js");
            Page.Header.Controls.Add(jsscript3);

            divSwfScript.InnerHtml = "<script language=\"JavaScript\" type=\"text/javascript\"> " +
                                     "AC_FL_RunContent(" +
                                     "'codebase', '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'," +
                                     "'width', '600'," +
                                     "'height', '600'," +
                                     "'src', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser.swf'," +
                                     "'movie', '" + Root.Domain + "/profile/Modules/NetworkRadial/network_browser'," +
                                     "'quality', 'high'," +
                                     "'pluginspage', '//www.adobe.com/go/getflashplayer'," +
                                     "'align', 'middle'," +
                                     "'play', 'true'," +
                                     "'loop', 'true'," +
                                     "'scale', 'showall'," +
                                     "'wmode', 'transparent'," +
                                     "'devicefont', 'false'," +
                                     "'id', 'network_browserFLASH'," +
                                     "'bgcolor', '#ffffff'," +
                                     "'name', 'network_browserFLASH'," +
                                     "'menu', 'true'," +
                                     "'allowFullScreen', 'false'," +
                                     "'allowScriptAccess', 'always'," +
                                     "'salign', ''" +
                                     "); //end AC code" +
                                     "</script>";


            HtmlGenericControl script = new HtmlGenericControl("script");

            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "window.onload = function() {" +
                               " network_browser._cfg.profile_network_path = '/" + Request.QueryString["Predicate"].ToString() + "/radial'; " +
                               " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p='); " +
                               " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " +
                               "}";
            Page.Header.Controls.Add(script);

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();

            RDFTriple   request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"]));
            XmlDocument x       = data.GetProfileNetworkForBrowser(request);

            System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList();
            args.AddParam("root", "", Root.Domain);

            System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform();

            lblProfileName.Text = x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["fn"].Value + " " +
                                  x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["ln"].Value;

            litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml);
        }
예제 #48
0
    protected void SetupGUI()
    {
        UserView userView = UserView.GetInstance();

        lblSiteIsClinic.Value   = userView.IsClinicView || userView.IsGPView ? "1" : "0";
        lblSiteIsAgedCare.Value = userView.IsAgedCareView                    ? "1" : "0";


        if (Session["SystemVariables"] != null)
        {
            lblBannerMessage.Text = ((SystemVariables)Session["SystemVariables"])["BannerMessage"].Value;
        }
        lblBannerMessage.Visible = Session["SystemVariables"] != null && Convert.ToBoolean(((SystemVariables)Session["SystemVariables"])["ShowBannerMessage"].Value);

        lblSupportContactMessage.Text = "<b>" + System.Configuration.ConfigurationManager.AppSettings["SupportContactMessage"] + "</b>";

        // set the style sheet
        System.Web.UI.HtmlControls.HtmlLink newStyleSheet = new System.Web.UI.HtmlControls.HtmlLink();
        newStyleSheet.Attributes.Add("type", "text/css");
        newStyleSheet.Attributes.Add("rel", "stylesheet");
        newStyleSheet.Href = Session["SystemVariables"] == null ? System.Configuration.ConfigurationManager.AppSettings["CssPage"] : ((SystemVariables)Session["SystemVariables"])["CssPage"].Value;
        Page.Header.Controls.Add(newStyleSheet);

        SiteName.Text = Session["SystemVariables"] == null ? "Mediclinic" : ((SystemVariables)Session["SystemVariables"])["Site"].Value;


        spn_login_display_not_loged_in.Visible = !userView.IsLoggedIn;
        spn_login_display_loged_in.Visible     = userView.IsLoggedIn;

        if (userView.IsLoggedIn)
        {
            lblUsername.Text = Session["StaffFullnameWithoutMiddlename"].ToString();

            if (userView.IsAdminView)
            {
                lblSiteOrOrg.Text = Session["SiteName"] == null ? "[No Site Selected]" : (string)Session["SiteName"];
            }
            else
            {
                lblSiteOrOrg.Text = Session["OrgName"] == null ? "[No Clinic Selected]" : (string)Session["OrgName"];
            }

            lnkSelectSiteOrOrg.Text        = userView.IsAdminView ? "Change Site"               : "Change Clinic";
            lnkSelectSiteOrOrg.NavigateUrl = userView.IsAdminView ? "~/Account/SelectSite.aspx" : "~/Account/SelectOrg.aspx";


            if (Session["SiteID"] == null || (!userView.IsAdminView && Session["OrgID"] == null))
            {
                lnkChangePwd.Visible              = false;
                lnkChangePwd_OpenBracket.Visible  = false;
                lnkChangePwd_CloseBracket.Visible = false;
            }


            if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["ShowLastBuildTime"]))
            {
                lblLastBuildTime.Text = Utilities.IsDev() ?
                                        " Last Build: " + Utilities.GetBuildDate().ToString("dd MMM HH:mm:ss") + " " :
                                        " Last Build: " + Utilities.GetBuildDate().ToString("dd MMM HH:mm") + " ";
            }
        }



        for (int i = NavigationMenu.Items.Count - 1; i >= 0; i--)
        {
            if (userView.IsAgedCareView && NavigationMenu.Items[i].Text == "Patients")
            {
                NavigationMenu.Items[i].Text = "Residents";
                for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                {
                    NavigationMenu.Items[i].ChildItems[j].Text = NavigationMenu.Items[i].ChildItems[j].Text.Replace("Patient", "Resident");
                }
            }

            if (NavigationMenu.Items[i].Text == "Bookings")
            {
                if (userView.IsAdminView) // admin has no specific Session["OrgID"] set so show page for them to select multiple orgs to show
                {
                    NavigationMenu.Items[i].NavigateUrl = "~/SelectOrganisations.aspx";
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Bookings Report")
                        {
                            ;
                        }
                        else if (NavigationMenu.Items[i].ChildItems[j].Text == "Schedule Report")
                        {
                            ;
                        }
                        else if (NavigationMenu.Items[i].ChildItems[j].Text == "Bookings")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/SelectOrganisations.aspx";
                        }
                        else if (NavigationMenu.Items[i].ChildItems[j].Text == "Booking Edit Reason List" || NavigationMenu.Items[i].ChildItems[j].Text == "Booking Unavailability Reason List")
                        {
                            ;
                        }
                        else
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        }
                    }
                }
                else
                {
                    NavigationMenu.Items[i].NavigateUrl = "~/BookingsForClinic.aspx?orgs=" + Session["OrgID"] + "&ndays=1";
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Bookings")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/BookingsForClinic.aspx?orgs=" + Session["OrgID"] + "&ndays=1";
                        }

                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Bookings List")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/BookingsList.aspx?staff=" + Session["StaffID"] + "&start_date=" + DateTime.Today.ToString("yyyy_MM_dd") + "&end_date=" + DateTime.Today.ToString("yyyy_MM_dd");
                        }

                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Booking Edit Reason List" || NavigationMenu.Items[i].ChildItems[j].Text == "Booking Unavailability Reason List")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        }
                    }
                }
            }

            if (NavigationMenu.Items[i].Text == "Organisations")
            {
                if (!userView.IsAdminView)
                {
                    NavigationMenu.Items.RemoveAt(i);
                    continue;
                }

                for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                {
                    if (userView.IsAgedCareView &&
                        (NavigationMenu.Items[i].ChildItems[j].Text == "Clinics List" ||
                         NavigationMenu.Items[i].ChildItems[j].Text == "Add Clinic"))
                    {
                        NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        continue;
                    }

                    if (!userView.IsAgedCareView &&
                        (NavigationMenu.Items[i].ChildItems[j].Text == "Facilities List" ||
                         NavigationMenu.Items[i].ChildItems[j].Text == "Add Facility"))
                    {
                        NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        continue;
                    }

                    if (NavigationMenu.Items[i].ChildItems[j].Text == "External Organisations - All" ||
                        NavigationMenu.Items[i].ChildItems[j].Text == "External Organisations - Medical Practices")
                    {
                        NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        continue;
                    }
                }

                if (!userView.IsAdminView)
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Stats")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                            continue;
                        }
                    }
                }

                if (userView.IsAgedCareView)
                {
                    NavigationMenu.Items[i].Text = "Facilities";
                }
                else
                {
                    NavigationMenu.Items[i].Text = "Clinics";
                }
            }
            else if (NavigationMenu.Items[i].Text == "Sales")
            {
                for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                {
                    if (NavigationMenu.Items[i].ChildItems[j].Text == "Cash Sale")
                    {
                        if (userView.IsAdminView)
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/AddStandardInvoice.aspx";
                        }
                        else
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/AddStandardInvoice.aspx?org=" + (Session["OrgID"] == null ? "" : Session["OrgID"].ToString());
                        }
                    }
                }
            }
            else if (NavigationMenu.Items[i].Text == "Create New Website")
            {
                if (!userView.IsStakeholder)
                {
                    NavigationMenu.Items.RemoveAt(i);
                    continue;
                }
            }
            else if (NavigationMenu.Items[i].Text == "Site & Settings")
            {
                for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                {
                    if (!userView.IsStakeholder && !userView.IsMasterAdmin && NavigationMenu.Items[i].ChildItems[j].Text == "Website Settings")
                    {
                        NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        continue;
                    }
                }
            }
            else if (NavigationMenu.Items[i].Text == "Letters")
            {
                if (userView.IsAgedCareView)
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Recall Letters")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        }
                    }
                }
            }



            if (!userView.IsAdminView)
            {
                if (NavigationMenu.Items[i].Text == "Staff" ||
                    NavigationMenu.Items[i].Text == "Organisations" ||
                    NavigationMenu.Items[i].Text == "Products & Services" ||
                    NavigationMenu.Items[i].Text == "Financials" ||
                    NavigationMenu.Items[i].Text == "SMS & Email" ||
                    NavigationMenu.Items[i].Text == "Site & Settings")
                {
                    NavigationMenu.Items.RemoveAt(i);
                    continue;
                }
                else if (NavigationMenu.Items[i].Text == "Organisations")
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Stats")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        }
                    }
                }
                else if (NavigationMenu.Items[i].Text == "Letters")
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Print Letter")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl += (Session != null && Session["OrgID"] != null ? "?org=" + Session["OrgID"].ToString() : "");
                        }
                        else if (NavigationMenu.Items[i].ChildItems[j].Text == "Letters Sent History")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl += (Session != null && Session["OrgID"] != null ? "?org=" + Session["OrgID"].ToString() : "");
                        }
                        else
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                        }
                    }
                }
            }
            else  // is admin view
            {
                if ((!userView.IsStakeholder && !userView.IsMasterAdmin) && NavigationMenu.Items[i].Text == "Staff")
                {
                    NavigationMenu.Items.RemoveAt(i);
                }

                if (NavigationMenu.Items[i].Text == "Sales")
                {
                    NavigationMenu.Items.RemoveAt(i);
                }

                if (NavigationMenu.Items[i].Text == "Products & Services")
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Set Specific Prices Per Clinic" && userView.IsAgedCareView)
                        {
                            NavigationMenu.Items[i].ChildItems[j].Text = "Set Specific Prices Per Facility/Wing/Unit";
                        }

                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Products & Services List")
                        {
                            NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/OfferingInfo.aspx";  // ?inv_type=" + (isClinics ? "1,2,3" : "4");
                        }
                        if (NavigationMenu.Items[i].ChildItems[j].Text == "Cash Sale")
                        {
                            if (userView.IsAdminView)
                            {
                                NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/AddStandardInvoice.aspx";
                            }
                            else
                            {
                                NavigationMenu.Items[i].ChildItems[j].NavigateUrl = "~/AddStandardInvoice.aspx?org=" + (Session["OrgID"] == null ? "" : Session["OrgID"].ToString());
                            }
                        }
                    }
                }

                if (NavigationMenu.Items[i].Text == "Financials")
                {
                    for (int j = NavigationMenu.Items[i].ChildItems.Count - 1; j >= 0; j--)
                    {
                        if (!userView.IsStakeholder && NavigationMenu.Items[i].ChildItems[j].Text == "Claim Numbers Allocation")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                            continue;
                        }
                        if (!userView.IsStakeholder && NavigationMenu.Items[i].ChildItems[j].Text == "HINX Files")
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                            continue;
                        }
                        if (!userView.IsAdminView && (NavigationMenu.Items[i].ChildItems[j].Text == "Invoices Report" || NavigationMenu.Items[i].ChildItems[j].Text == "Receipts Report"))
                        {
                            NavigationMenu.Items[i].ChildItems.RemoveAt(j);
                            continue;
                        }
                    }
                }
            }
        }


        if (HttpContext.Current.Request.Url.LocalPath.Contains("/Account/Login.aspx") ||
            HttpContext.Current.Request.Url.LocalPath.Contains("/Account/SelectOrg.aspx") ||
            HttpContext.Current.Request.Url.LocalPath.Contains("/Account/SelectSite.aspx") ||
            HttpContext.Current.Request.Url.LocalPath.Contains("/Account/LostPassword.aspx"))
        {
            RemoveMenu();
        }
    }
예제 #49
0
        protected void InitAssets()
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"]   = "stylesheet";
            NetworkBrowsercss.Attributes["type"]  = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Page.Header.Controls.Add(NetworkBrowsercss);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");

            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterFlash/scriptaculous/lib/prototype.js");
            Page.Header.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");

            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterFlash/scriptaculous/src/scriptaculous.js");
            Page.Header.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");

            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterFlash/JavaScript/networkBrowserClass.js");
            Page.Header.Controls.Add(jsscript3);

            divSwfScript.InnerHtml = "<script language=\"JavaScript\" type=\"text/javascript\"> " +
                                     "AC_FL_RunContent(" +
                                     "'codebase', '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'," +
                                     "'width', '600'," +
                                     "'height', '485'," +
                                     "'src', '" + Root.Domain + "/profile/Modules/NetworkClusterFlash/network_browser_force.swf'," +
                                     "'movie', '" + Root.Domain + "/profile/Modules/NetworkClusterFlash/network_browser_force'," +
                                     "'quality', 'high'," +
                                     "'pluginspage', '//www.adobe.com/go/getflashplayer'," +
                                     "'align', 'middle'," +
                                     "'play', 'true'," +
                                     "'loop', 'true'," +
                                     "'scale', 'showall'," +
                                     "'wmode', 'transparent'," +
                                     "'devicefont', 'false'," +
                                     "'id', 'network_browserFLASH'," +
                                     "'bgcolor', '#ffffff'," +
                                     "'name', 'network_browserFLASH'," +
                                     "'menu', 'true'," +
                                     "'allowFullScreen', 'false'," +
                                     "'allowScriptAccess', 'always'," +
                                     "'salign', ''" +
                                     "); //end AC code" +
                                     "</script>";

            HtmlGenericControl script = new HtmlGenericControl("script");

            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "function loadClusterView() {" +
                               " network_browser._cfg.profile_network_path = '/" + Request.QueryString["Predicate"].ToString() + "/cluster'; " +
                               " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkClusterFlash/NetworkClusterSvc.aspx?p='); " +
                               " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " +
                               "};" +
                               "//function GoPerson(x) {document.location='" + Root.Domain + "/profiles/profile/person/'+x;}";
            Page.Header.Controls.Add(script);
        }
예제 #50
0
        protected void InitAssets()
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"]   = "stylesheet";
            NetworkBrowsercss.Attributes["type"]  = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Page.Header.Controls.Add(NetworkBrowsercss);

            HtmlGenericControl jsscript0 = new HtmlGenericControl("script");

            jsscript0.Attributes.Add("type", "text/javascript");
            jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js");
            Page.Header.Controls.Add(jsscript0);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");

            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/lib/prototype.js");
            Page.Header.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");

            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkCluster/scriptaculous/src/scriptaculous.js");
            Page.Header.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");

            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterGroup/JavaScript/networkBrowserClass.js");
            Page.Header.Controls.Add(jsscript3);

            HtmlGenericControl jsscript4 = new HtmlGenericControl("script");

            jsscript4.Attributes.Add("type", "text/javascript");
            jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkClusterGroup/JavaScript/networkClusterLayoutEngine.js");
            Page.Header.Controls.Add(jsscript4);

            HtmlGenericControl jsscript5 = new HtmlGenericControl("script");

            jsscript5.Attributes.Add("type", "text/javascript");
            jsscript5.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js");
            Page.Header.Controls.Add(jsscript5);


            HtmlGenericControl script = new HtmlGenericControl("script");

            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "function loadClusterView() {" +
                               " network_browser.Init('" + Root.Domain + "/profile/modules/NetworkClusterGroup/NetworkClusterGroupSvc.aspx?p='); " +
                               " network_browser.loadNetwork('" + Request.QueryString["Subject"].ToString() + "'); " +
                               "};";
            Page.Header.Controls.Add(script);


            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();
            RDFTriple   request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"]));
            XmlDocument x       = data.GetGroupNetworkForBrowserXML(request);

            System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList();
            args.AddParam("root", "", Root.Domain);
            DateTime d = DateTime.Now;

            System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform();
            litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTableGroup.xslt"), args, x.InnerXml);
        }
예제 #51
0
        protected void InitAssets()
        {
            System.Web.UI.HtmlControls.HtmlLink NetworkBrowsercss = new System.Web.UI.HtmlControls.HtmlLink();
            NetworkBrowsercss.Href = Root.Domain + "/Profile/CSS/NetworkBrowser.css";
            NetworkBrowsercss.Attributes["rel"]   = "stylesheet";
            NetworkBrowsercss.Attributes["type"]  = "text/css";
            NetworkBrowsercss.Attributes["media"] = "all";
            Page.Header.Controls.Add(NetworkBrowsercss);

            System.Web.UI.HtmlControls.HtmlLink vizcss = new System.Web.UI.HtmlControls.HtmlLink();
            vizcss.Href = Root.Domain + "/Profile/CSS/viz.css";
            vizcss.Attributes["rel"]   = "stylesheet";
            vizcss.Attributes["type"]  = "text/css";
            vizcss.Attributes["media"] = "all";
            Page.Header.Controls.Add(vizcss);

            HtmlGenericControl jsscript0 = new HtmlGenericControl("script");

            jsscript0.Attributes.Add("type", "text/javascript");
            jsscript0.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/watchdog.js");
            Page.Header.Controls.Add(jsscript0);

            HtmlGenericControl jsscript1 = new HtmlGenericControl("script");

            jsscript1.Attributes.Add("type", "text/javascript");
            jsscript1.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/lib/prototype.js");
            Page.Header.Controls.Add(jsscript1);

            HtmlGenericControl jsscript2 = new HtmlGenericControl("script");

            jsscript2.Attributes.Add("type", "text/javascript");
            jsscript2.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/scriptaculous/src/scriptaculous.js");
            Page.Header.Controls.Add(jsscript2);

            HtmlGenericControl jsscript3 = new HtmlGenericControl("script");

            jsscript3.Attributes.Add("type", "text/javascript");
            jsscript3.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/layout_balanced.js");
            Page.Header.Controls.Add(jsscript3);

            HtmlGenericControl jsscript4 = new HtmlGenericControl("script");

            jsscript4.Attributes.Add("type", "text/javascript");
            jsscript4.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/sliders.js");
            Page.Header.Controls.Add(jsscript4);

            HtmlGenericControl jsscript5 = new HtmlGenericControl("script");

            jsscript5.Attributes.Add("type", "text/javascript");
            jsscript5.Attributes.Add("src", Root.Domain + "/Profile/Modules/NetworkRadial/JavaScript/viz.js");
            Page.Header.Controls.Add(jsscript5);

            HtmlGenericControl jsscript6 = new HtmlGenericControl("script");

            jsscript6.Attributes.Add("type", "text/javascript");
            jsscript6.Attributes.Add("src", "//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js");
            Page.Header.Controls.Add(jsscript6);

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();
            int personID = data.GetPersonId(Int64.Parse(Request.QueryString["Subject"].ToString()));
            HtmlGenericControl script = new HtmlGenericControl("script");

            script.Attributes.Add("type", "text/javascript");
            script.InnerHtml = "jQuery(document).ready(function() {try{" +
                               " radial_viz = new RadialGraph_Visualization(jQuery('#radial_view')[0], {radius: 100});" +
                               //" radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + Request.QueryString["Subject"].ToString() + "'); " +
                               " radial_viz.loadNetwork('" + Root.Domain + "/profile/modules/NetworkRadial/NetworkRadialSvc.aspx?p=" + Request.QueryString["Subject"].ToString() + "', '" + personID + "'); " +
                               "} catch(e){}});";
            Page.Header.Controls.Add(script);

            //Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();

            RDFTriple   request = new RDFTriple(Convert.ToInt64(Request.QueryString["subject"]));
            XmlDocument x       = data.GetProfileNetworkForBrowserXML(request);

            System.Xml.Xsl.XsltArgumentList args = new System.Xml.Xsl.XsltArgumentList();
            args.AddParam("root", "", Root.Domain);

            System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform();

            lblProfileName.Text = x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["fn"].Value + " " +
                                  x.SelectSingleNode("LocalNetwork/NetworkPeople/NetworkPerson[@d='0']").Attributes["ln"].Value;

            litNetworkText.Text = Profiles.Framework.Utilities.XslHelper.TransformInMemory(Server.MapPath("~/profile/XSLT/NetworkTable.xslt"), args, x.InnerXml);

            iFrameFlashGraph.Attributes.Add("data-src", Root.Domain + "/profile/Modules/NetworkRadialFlash/Default.aspx?Subject=" + Request.QueryString["subject"] + "&Predicate=" + Request.QueryString["Predicate"]);
        }