{maketoc}
!Convert permissions
Global variables are deprecated and the verifyPermission function can be used to go to an error page on failure, removing duplicate code and standardising on an error page.
{CODE()}if ($tiki_p_admin_cms == 'y') {{CODE}
becomes
{CODE()}if ($gTikiUser->hasPermission('tiki_p_admin_cms')) {{CODE}
and
{CODE()}if ( !$gTikiUser->hasPermission( 'tiki_p_view' )) {
$smarty->assign('msg',tra("Permission denied you cannot view pages"));
$gTikiSystem->display( 'error.tpl' );
die;
}{CODE}
becomes
{CODE()}$gTikiSystem->verifyPermission( 'tiki_p_view' );{CODE}

!Convert preferences
Function standardisation rename.
{CODE()}$gTikiSystem->get_preference("maxArticles", 10){CODE}
becomes
{CODE()}$gTikiSystem->getPreference("maxArticles", 10){CODE}

!Convert enabled packages and features
Global variables are deprecated and the isPackageActive and isFeatureActive functions can be used to go to an error page on failure, removing duplicate code and standardising on an error page.
{CODE()}$feature_articles{CODE}
becomes
{CODE()}$gTikiSystem->isPackageActive( 'articles' ){CODE}
and
{CODE()}if($feature_listPages != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$gTikiSystem->display( 'error.tpl' );
die;
}{CODE}
becomes
{CODE()}$gTikiSystem->isFeatureActive( 'feature_listPages' );{CODE}
and conversion of package active checks at start of pages.
{CODE()}if ( $feature_articles != 'y' ) {
$smarty->assign( 'msg', tra( "This feature is disabled" ) . ": feature_articles" );
$smarty->display( "error.tpl" );
die;
}{CODE}
becomes
{CODE()}$gTikiSystem->isPackageActive( 'articles' );{CODE}

!Register packages
Package name should be lowercase
{CODE()}$gTikiSystem->registerPackage( 'articles', dirname( __FILE__ ).'/' );{CODE}

!Convert dependent packages
When errors occur due to missing packages, the follow check code should be inserted in appropriate places.
{CODE()}if ($gTikiSystem->isPackageActive( 'categories' )) {
include_once( CATEGORIES_PKG_PATH.'categ_lib.php');
}{CODE}

!Convert db_byte_encode
New location for this function.
{CODE()}$this->db_byte_encode( $imgdata ){CODE}
becomes
{CODE()}$this->mDb->db_byte_encode( $imgdata ){CODE}

!Convert error pages
{CODE()}$smarty->display( "error.tpl" ){CODE}
becomes
{CODE()}$gTikiSystem->display( "error.tpl" ){CODE}

Convert browser title -
$gTikiSystem->setBrowserTitle( tra("articles") );
---
(usually last line)
$gTikiSystem->display( 'tikipackage:articles/list_articles.tpl', tra("articles") );

Convert $user - $user => $gTikiUser->mUserId



!Smarty tpl changes
{if $gTikiSystem->isPackageActive( 'categories' )}
<div class="tabpage {$categoriesTabSelect}">
<h4>{tr}Categorize{/tr}</h4>
{legend legend="Categorize"}
{include file="tikipackage:categories/categorize.tpl"}
{/legend}
</div><!-- end .tabpage -->
{/if}

Page History
Date/CommentUserIPVersion
29 Dec 2005 (03:36 UTC)
Stephan Borg218.214.1.11312
Current • Source
Stephan Borg218.214.1.11311
View • Compare • Difference • Source
Stephan Borg218.214.1.11310
View • Compare • Difference • Source
Stephan Borg218.214.1.1139
View • Compare • Difference • Source
Stephan Borg218.214.1.1138
View • Compare • Difference • Source
Stephan Borg218.214.1.1137
View • Compare • Difference • Source
Stephan Borg218.214.1.1132
View • Compare • Difference • Source