Menu

Where is the menu code?

Help
2010-06-11
2013-05-30
  • ispacecrusader

    ispacecrusader - 2010-06-11

    Hi,
    I'm new to PhpGedView (I'm using it within a Joomla environment) and have been putting effort into adjusting a theme to my liking. I'm quite far already, but one thing I cannot manage: I want to add a menu button, which will lead to a single page. I've read the 'customize menu' article on the PGV Wiki , but the information there is not correct in my case. The menu information is not in the header.php (or, to be exact: the toplinks.php, I'm adjusting the justblack custom theme). The only thing in the header is this:

    $menus = $menubar->getTotaalOverzichtMenus();
            foreach($menus as $m=>$menu) {
                if($menu->link != "") {
                    print "\t<td width=\"7%\" valign=\"top\">\n";
                    $menu->printMenu();
                    print "\t</td>\n";
    

    This does not allow me to configure the actual menu-button. Which image must it use? Which page must it point to? I've added the above code, but this results in an error:
    Fatal error: Call to undefined method MenuBar::getTotaalOverzichtMenus() in /share/MD0_DATA/Qweb/Joomla/phpgedview423/themes/blackispace/toplinks.php on line 122
    I've been searching a long time for where I can actually configure a menu item, but cannot find it. Can anyone point me in the right direction, or alternatively, explain to me how I can add a menu button?
    Thank you for your help!
    iSpaceCrusader

     
  • Gerry Kroll

    Gerry Kroll - 2010-06-11

    The "justblack" theme is not one of the standard PGV themes.  We can't help you with that.

    However, you should have a look at how the other standard themes handle menus, and adapt your "justblack" theme accordingly.

    You'll find most of the code dealing with menus in file "includes/classes/class_menubar.php".

    You might want to look at the "simplygreen" or perhaps the "minimal" theme.  Don't look at the "cloudy" theme - this one is a real mess and is in need of a re-write.

     
  • ispacecrusader

    ispacecrusader - 2010-06-11

    Hi canajun2eh,
    thank you, that helps. I've added first a full menu item, but this resulted in a lot of errors. Then I added a submenu item in one of the existing menus, hoping that would be simpler. It returns with: ERROR 8: Undefined index: overview_list. This is what the code looks like:

            if (file_exists(PGV_ROOT.'famlist.php')) $menuList["family"] = $pgv_lang["family_list"];
            if (file_exists(PGV_ROOT.'aldfaer.php')) $menuList["overview"] = $pgv_lang["overview_list"];
            if (file_exists(PGV_ROOT.'branches.php')) $menuList["branches"] = $pgv_lang["branch_list"];
    

    where the middle line is the one I added (copied an existing one, altered the names). My guess is that the theme does not really matter much in this case, it's about how a menu or submenu item is indexed, do you agree?. If so, do you have more knowledge on which files I need to alter, other than the class_menubar.php? Apparently, there must be an even deeper level.
    Thank you!

     
  • Gerry Kroll

    Gerry Kroll - 2010-06-11

    No, the problem is that the language variable

    $pgv_lang["overview_list"]
    

    is not defined.  You need to create a new file for each of the languages you wish to support, and define that variable in each of them.  The new files need to be in the "languages" directory, and they need to be called "extra.xx.php" where the "xx" part is the language code.

    For example, the "languages/extra.en.php" file would have this content:

    <?php
    $pgv_lang["overview_list"] = "whatever seems right here";
    ?>
    
     
  • ispacecrusader

    ispacecrusader - 2010-06-24

    Hi canajun2eh,
    Thank you for your help! I've managed to solve the issue, have everything working as intended now!

     

Log in to post a comment.