Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Get the Panes for a tabGet the Panes for a tab
Previous
 
Next
New Post
12/1/2008 2:26 AM
 

 I've looked around the forums and the DNN source, couldn't find a way to get the Panes for the non-active tab - If there is a way that I missed in my search, I'd like to know so I can use that instead. :)

Until then, I thought I'd share the function I wrote to do this.

protected ArrayList GetTabPanes(int TabID)
{ 
    TabController tabController = new TabController(); 
    TabInfo tabInfo = tabController.GetTab(TabID, 0, true); 

    string strSkinPath = "";

    strSkinPath = tabInfo.SkinPath; 
    if (strSkinPath == null || strSkinPath == "")
    { 
        strSkinPath = PortalSettings.DefaultPortalSkin; 
    } 

    switch (strSkinPath.ToLowerInvariant().Substring(0, 3))
    { 
        case "[g]": 
            strSkinPath = Regex.Replace(strSkinPath, "\\[g]", Globals.HostMapPath, RegexOptions.IgnoreCase);
            break; 
        case "[l]": 
            strSkinPath = Regex.Replace(strSkinPath, "\\[l]", PortalSettings.HomeDirectoryMapPath, RegexOptions.IgnoreCase);
            break; 
    } 

    StreamReader sr = File.OpenText(strSkinPath); 
    string strSkinFile = sr.ReadToEnd(); 
    Regex regEx = new Regex("(?<=<(td|div|span|p) )[^>]*((?<= runat=\"server\").*(?=>))", RegexOptions.IgnoreCase); 
    MatchCollection mc = regEx.Matches(strSkinFile); 
    ArrayList arrayList = new ArrayList(); 
    Regex regExID = new Regex("(?<= ID=\").*?(?=\")", RegexOptions.IgnoreCase); 
    string strPane = ""; 
    foreach (Match match in mc)
    { 
        strPane = regExID.Match(match.Value).Value; 

        if (strPane.ToLowerInvariant() == "controlpanel" || strPane.ToLowerInvariant() == "") continue;
         
        arrayList.Add(strPane); 
    } 

    return arrayList; 
}

I'm not sure if this is 100% for all skins; It's VERY lightly tested, I just finished it up tonight and have only tested against DNN5 RC2 default skin. Yes, only tested in DNN5 RC2.

If anyone has any advice about this function, such as reducing to a single regex statement, code changes, feedback, ect, please post it, I'd love to hear it.

 

Note - Colorized code produced from http://puzzleware.net/CodeHtmler/default.aspx

 
New Post
9/8/2010 11:45 AM
 
I am doing something similar but in DNN 5.3.1 I found a Panes ArrayList off of my TabInfo class.

Private Sub GetPanes(ByVal iTabID As Integer)
            Dim ctlTab As New TabController
            Dim infoTab As Tabs.TabInfo = ctlTab.GetTab(iTabID, Me.PortalId, False)
            Dim arrPanes As ArrayList = infoTab.Panes()
End Sub

-something clever or funny.
 
New Post
9/9/2010 10:25 AM
 
Well Baatezu,  your answer is better than mine.  After running the debugger I can see that the TabInfo.Panes = Nothing.  I think I might switch to your method.

-something clever or funny.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Get the Panes for a tabGet the Panes for a tab


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out