PortingTikiWikiPackages

This is documentation of the process used while porting Trackers V2 from TikiWiki 1.9 to bitweaver.

Created by: Stephan Borg, Last modification: 18 May 2008 (20:42 UTC) by laetzer

Making the Menu

TP menus are different from TW. We have to cut the menu items out of TW's templates/modules/mod-application_menu.tpl and create a trackers2/templates/menu_trackers2.tpl. I found the menu template from trackers package was suitable with some modification.

<?php
<class="menuoption" href="{$gTikiLoc.TRACKERS2_PKG_URL}index.php">{tr}List trackers{/tr}</a>
{if 
$tiki_p_admin_trackers eq 'y'}
    <
class="menuoption" href="{$gTikiLoc.TRACKERS2_PKG_URL}admin/index.php">{tr}Admin trackers{/tr}</a>
{/if}
?>


Making the Admin Menu

First we have to rename the main Trackers2 admin page.
mv trackers2/admin/tiki-admin_trackers.php trackers2/admin/admin_tracker2_inc.php

Now we have to create the Admin menu. Again the trackers/templates/menu_trackers2_admin.tpl is based on a similar file found in the trackers package.

<?php
{if $tiki_p_admin_trackers eq 'y'}
    <
class="menuoption" href="{$gTikiLoc.TRACKERS2_PKG_URL}admin/index.php">{tr}Trackers Settings{/tr}</a>
{/if}
?>


Now, create the trackers2/admin/index.php file as shown below.

<?php
    
// This is not a package.
    
header ("location: ../index.php");
?>


Removing remaining tiki- references

Next, I run a very destructive script **BEWARE** - that removes all tiki- prefixes within all files.

<?php
find -type f -exec perl --wpe 's/tiki-//g' {} \;
?>


Initial Testing


At this point, we can begin testing. Browse to http://your.tp.install/kernel/admin/index.php and click on Trackers 2 Settings.