Example #1
0
        private void DisplayTableMetadataLinks()
        {
            if (!PXWeb.Settings.Current.Selection.MetadataAsLinks)
            {
                IPxUrl url = RouteInstance.PxUrlProvider.Create(null);
                if (PXWeb.Settings.Current.Database[url.Database].Metadata.UseMetadata)
                {
                    if (!string.IsNullOrWhiteSpace(PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel.Meta.MetaId))
                    {
                        PCAxis.Metadata.IMetaIdProvider man = PXWeb.Settings.Current.Database[url.Database].Metadata.MetaLinkMethod;

                        List <PCAxis.Metadata.MetaLink> links = man.GetTableLinks(PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel.Meta.MetaId, LocalizationManager.CurrentCulture.Name).ToList();

                        foreach (PCAxis.Metadata.MetaLink link in links)
                        {
                            HyperLink lnk = new HyperLink();
                            lnk.Text        = link.LinkText;
                            lnk.NavigateUrl = link.Link;
                            lnk.Target      = link.Target;
                            lnk.CssClass    = "meta_tablelink";
                            divTableLinks.Controls.Add(lnk);
                        }
                    }
                }
            }
        }
Example #2
0
 private void DisplayTableMetadataLinks()
 {
     if (!PXWeb.Settings.Current.Selection.MetadataAsLinks)
     {
         IPxUrl url = RouteInstance.PxUrlProvider.Create(null);
         if (PXWeb.Settings.Current.Database[url.Database].Metadata.UseMetadata)
         {
             if (!string.IsNullOrWhiteSpace(PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel.Meta.MetaId))
             {
                 List <PCAxis.Metadata.MetaLink> links = _linkManager.GetTableLinks(PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel.Meta.MetaId, LocalizationManager.CurrentCulture.Name).ToList();
                 if (links.Count > 0)
                 {
                     /*If we get other use cases for TableLink, we need to take a look at how we do this,
                      * but for now we can put everything here */
                     Literal div = new Literal();
                     div.Text = "<div class=\"pxweb_about_the_statistics pxweb-link with-icon\">";
                     divTableLinks.Controls.Add(div);
                     foreach (PCAxis.Metadata.MetaLink link in links)
                     {
                         HyperLink lnk = new HyperLink();
                         lnk.Text        = String.Format("<span class=\"link-text\">{0}</span>", Server.HtmlEncode(link.LinkText));
                         lnk.NavigateUrl = link.Link;
                         lnk.Target      = link.Target;
                         lnk.CssClass    = "external-link-icon";
                         lnk.Attributes.Add("rel", "noopener");
                         divTableLinks.Controls.Add(lnk);
                     }
                     Literal divend = new Literal();
                     divend.Text = "</div>";
                     divTableLinks.Controls.Add(divend);
                 }
             }
         }
     }
 }