Menu

Display submenu item based on gedcom file id

Help
2011-04-16
2013-05-30
  • George Scott

    George Scott - 2011-04-16

    I have a test such as the following;
    // Fourth sub-menu (visible only to users with site Admin rights)
    if (PGV_USER_IS_ADMIN) {
    $submenu = new Menu("About This Data", "custom link #2");
    $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff");
    $menu->addSubmenu($submenu);
    }
    I would like to test instead if I'm currently using the gedfile Scott.ged.  What is the proper if statement?

     
  • Gerry Kroll

    Gerry Kroll - 2011-04-17

    The following constants might help:
    PGV_GED_ID : the currently active internal GEDCOM ID
    PGV_GEDCOM : file name of that curretnly active GEDCOM

    The following function might also help:
    get_gedcom_from_id($ged_id)

    Input is any valid GEDCOM number.  Output is the GEDCOM file name to match.

     
  • George Scott

    George Scott - 2011-04-18

    Thanks!  The following works great:
    if (PGV_GEDCOM=="HestonTest.ged"){
    $submenu = new Menu("Link to Scott GEDCOM", "http://www.hestonscottgen.com/phpgedview/individual.php?pid=I581&ged=ScottMC.ged");
    $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff");
    $menu->addSubmenu($submenu);
    }

     

Log in to post a comment.