Alter default menus

From PGVWiki
Jump to navigation Jump to search

Every time I install a new PhpGedView version, I have to go in and change the menus so they make sense to web and PhpGedView newbies. Menu 1 "Welcome Page" --> "Family Trees" Menu 2 "MyGedView Portal" --> "My Pages" Menu 2.1 "MyGedView" --> "My Start Page"

Change these in the LANG extras file and you won't have to change with each CVS change or version upgrade.

For those unfamiliar with php, this is every bit as easy as it sounds.

Simply add a new file in your languages folder named extra.en.php then place the following short script in the file:


if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) {

print "You cannot access a language file directly.";



$pgv_lang["welcome_page"] = "Family Trees";

$pgv_lang["mgv"] = "My Pages";

$pgv_lang["mygedview"] = "My Start Page";


That is all you have to do to make the menu changes given in the example above.

To rename other menu items, just search for the appropriate item in the lang.en.php and copy it to the extra.en.php file, then change the page title to whatever you like.

Although these examples are for English, the same can be done in any language by working with the appropriate "lang" file and making an "extra" file for that language.