storeConfig( $pName, $prefValue, $pPackageName ); } /** * Store or update a value in the database - automatically collects data from $_REQUEST[$pFeature] * @param $pFeature name of the parameter to be set in the database * @param $pPackageName name of the package the feature belongs to * @return none */ function simple_set_value( $pFeature, $pPackageName = NULL ) { global $_REQUEST, $gBitSystem, $gBitSmarty; if( isset( $_REQUEST[$pFeature] ) ) { $gBitSystem->storeConfig( $pFeature, $_REQUEST[$pFeature], $pPackageName ); $gBitSmarty->assign( $pFeature, $_REQUEST[$pFeature] ); } } /** * Store or update an integer in the database - automatically collects data from $_REQUEST[$pFeature] * @param $pFeature name of the parameter to be set in the database * @param $pPackageName name of the package the feature belongs to * @return none */ function simple_set_int( $pFeature, $pPackageName = NULL ) { global $_REQUEST, $gBitSystem, $gBitSmarty; if ( isset( $_REQUEST[$pFeature] ) && is_numeric( $_REQUEST[$pFeature] ) ) { $gBitSystem->storeConfig( $pFeature, $_REQUEST[$pFeature], $pPackageName ); $gBitSmarty->assign( $pFeature, $_REQUEST[$pFeature] ); } } /** * Store or update a value in the database but assign it by reference to smarty - automatically collects data from $_REQUEST[$pFeature] * @param $pFeature name of the parameter to be set in the database * @param $pPackageName name of the package the feature belongs to * @return none */ function byref_set_value( $pFeature, $pPref = "", $pPackageName = NULL ) { global $_REQUEST, $gBitSystem, $gBitSmarty; if( isset( $_REQUEST[$pFeature] ) ) { if( strlen( $pPref ) > 0 ) { $gBitSystem->storeConfig( $pPref, $_REQUEST[$pFeature], $pPackageName ); // also assign the ref appareantly --gongo $gBitSmarty->assign_by_ref( $pPref, $_REQUEST[$pFeature] ); } else { $gBitSystem->storeConfig( $pFeature, $_REQUEST[$pFeature], $pPackageName ); } $gBitSmarty->assign_by_ref( $pFeature, $_REQUEST[$pFeature] ); } } /** * simple function used to work out what tab was pressed and activates the correct tab after reload * use with TabSubmit as the name of the submit button value and set your tabpage class like this *
* @returns that was submitted */ function set_tab() { global $_REQUEST,$gBitSmarty; $ret = FALSE; if( !empty( $_REQUEST ) ) { foreach( array_keys( $_REQUEST ) as $item ) { if( preg_match( "/TabSubmit/",$item ) ) { $tab = preg_replace( "/TabSubmit/","",$item ); $gBitSmarty->assign( $tab.'TabSelect','tdefault' ); $ret = $tab; } } } return $ret; } ?>