This mod requires that you make edits to several files, but you'll find that the edits are very similar to one another and quite straightforward.
1) genlib.php
In the function tng_menu, add the following lines after the first set of doMenuItems calls. This will allow additions to an individual's tabs.
if( !$disallowgedcreate || $allow_ged ) {
$menu .= doMenuItem( 5, "$gedform_url" . "personID=$entityID&tree=$tree", "$cms[tngpath]tng_ged.gif", $text[extractgedcom], $currpage, "gedcom" );
$nexttab = "6";
}
else
$nexttab = "5";
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("addons/$addon/genlib.php"))
include("addons/$addon/genlib.php");
}
$editstr = "editperson.php?person";
And in the tng_icons menu, add these lines to allow additions to the 'Find', 'Media' and 'Info' menus. This will allow additions to these menus by addons.
$menu .= "<li><a href=\"$searchform_url\"><img src=\"$cms[tngpath]tng_search2.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />text[search]</a></li>\n";
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("addons/$addon/find_menu.php"))
include("addons/$addon/find_menu.php");
}
$menu .= "<ul>\n";
$menu .= "<li><a href=\"$browsemedia_noargs_url\"><img src=\"$cms[tngpath]tng_media.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />text[allmedia]</a></li>\n";
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("addons/$addon/media_menu.php"))
include("addons/$addon/media_menu.php");
}
$menu .= "<ul>\n";
$menu .= "<li><a href=\"$suggest_url\"><img src=\"$cms[tngpath]tng_contact.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />text[contactus]</a></li>\n";
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("addons/$addon/info_menu.php"))
include("addons/$addon/info_menu.php");
}
$menu .= "<ul>\n";
2) admin/leftbanner.php
We will add similar code into this file to allow an addon to put itself onto the left banner of the Admin page.
<tr><td><span class="normal"><a href="backuprestore.php" target="main" class="lightlink"><?php echo $admtext[backuprestore]; ?></a></span></td></tr>
<?php
}
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("addons/$addon/admin/leftbanner.php"))
include("addons/$addon/admin/leftbanner.php");
}
?>
3) admin/main.php
This addition will allow addons to list themselves on the main Admin page. The code is added twice here to "balance" out the list, alternating between the left and right columns.
<tr>
<td class="fieldnameback" nowrap onMouseover="this.className='mouseoverback';" onMouseout="this.className='fieldnameback';">
<a href="timelineevents.php" class="lightlink2"><img src="tlevents_icon.gif" alt="<?php echo $admtext[tlevents]; ?>" width="40" height="40" border="1" align="left" hspace="5" style="border-color: black;">
<span class="whitesubhead"><strong><?php echo $admtext[tlevents]; ?></strong></span><br/>
<span class="smaller"><?php echo $timelinemsg; ?></span></a>
</td>
</tr>
<?php
$i = 1;
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if ($i % 2 == 1) {
if (is_file("../addons/$addon/admin/main.php"))
include("../addons/$addon/admin/main.php");
}
$i++;
}
?>
</table>
<tr>
<td class="fieldnameback" nowrap onMouseover="this.className='mouseoverback';" onMouseout="this.className='fieldnameback';">
<a href="backuprestore.php" class="lightlink2"><img src="backuprestore_icon.gif" alt="<?php echo $admtext[backuprestore]; ?>" width="40" height="40" border="1" align="left" hspace="5" style="border-color: black;">
<span class="whitesubhead"><strong><?php echo $admtext[backuprestore]; ?></strong></span><br/>
<span class="smaller"><?php echo $admtext[backupitems]; ?></span></a>
</td>
</tr>
<?php
$i = 1;
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if ($i % 2 == 0) {
if (is_file("../addons/$addon/admin/main.php"))
include("../addons/$addon/admin/main.php");
}
$i++;
}
}
?>
</table>
4) English/cust_text.php
This will allow addons to include their own language dependent text files. I only show the English directory, but you would want to make this addition to all language directories you may have. Simply add these lines at the end of the file.
foreach (explode(',', $GLOBALS['addons']) as $addon) {
if (is_file("../addons/$addon/$mylanguage/text.php"))
include("../addons/$addon/$mylanguage/text.php");
}
?>
5) tngtabs1.css
Finally you will need to add an additional tab setting in the
tngtabs1.css (since you will now have an additional tab on an individual's page). These settings appear twice in the file, and are dependent on the width of your tabs (so your file may not look exactly like the example).
The first set of lines appears at the top of the file:
#a5 { left: -115px;}
#a6 { left: -140px;}
#a7 { left: -165px;}
and the second set of edits appear a bit further down:
#tngnav a#a5 { left: -115px;}
#tngnav a#a6 { left: -140px;}
#tngnav a#a7 { left: -165px;}
You will simply need to calculate the next value based on the existing numbers. Remember that this is only adding one tab... if you continue to add other addons you would need to add #a8, #a9, etc.