Update header and footer files

Important Notice for updating to 3.2 final!

We have finally upgraded header and footer to match the rest of the framework.

    • Header and footer are now classes

    • They can be dropped anywhere in the includes directory or be used from the core package

    • They use the same language style as the rest

    • Eliminates footer language file

    • Eliminates emptyfooter.php and emptyheader.php

    • Provides access to all application_view methods.

** This update breaks compatibility with previous versions

You will be getting some Notices, warnings and a Fatal error, but don't worry updating your files will take a second!

Updating old header and footer pages

This only applies if you already upgrade to the latest version of Tequila (on Mercurial only or Final 3.2 when released)

    1. Goto to includes/ directory

    2. Delete emptyfooter.php, emptyheader.php

    3. Open Header and footer files, (You can safely delete the files if they have no code or just the language include)

    4. Remove the include language file

    5. Copy the code sample and paste your current code after line 16 (or add class and function wrappers)

    6. Remove any "defined' variable that you are using; use $lang instead Defined constants in Tequila are only:

    7. htmlCharset,

    8. xmlCharset

    9. imgpath

<?php 2 class header extends application_view 3 { 4 public function showheader() 5 { 6 global $sec; 7 $this->setlang('header'); 8 $this->template->assign("charset",htmlCharset); 9 $this->template->assign("xmlCharset", xmlCharset); 10 $this->template->assign('username', $sec->user->I_NAME); 11 $this->template->assignGlobal("imgpath", imgpath ); 12 $this->template->gotoBlock( "_ROOT"); 13 14 // Add a reference to variable $tpl 15 $tpl = $this->template; 16 // Paste your code after this line 17 } 18 19 } 20 ?>

Upgrading footer page

To upgrade your footer page simply copy your current footer code into the showfooter function

** If your footer page doesn't have any code or just the language include, you can delete the file

1 <?php 2 class footer extends application_view 3 { 4 /** 5 * Single header function 6 * 7 */ 8 public function showfooter() 9 { 10 $this->setlang('footer'); 11 } 12 13 } 14 ?>

Update your header and footer language files

    1. Footer language file is not used any more, please join the content of both files in header

    2. Replace any defined constant to an assignment to the $lang var as in the following sample

1 <?php 2 global $lang; 3 // Replace: define("logout","Logout"); >> $lang['header']['logout'] ='logout'; 4 $lang['header']['METADESC'] = 'Tequila powered site '; 5 $lang['header']['METAWORDS'] = 'Tequila powered site, write your metawords here'; 6 $lang['header']['SiteTitle'] = 'Tequila powered site'; 7 $lang['header']['logged_welcome'] ='Welcome '; 8 $lang['header']['logout'] ='logout'; 9 $lang['footer']['powered'] = 'Powered by Tequila'; 10 ?>

That's it! Sorry for this small compatibility break!