this will allow importing of outside variables not set in $_REQUEST */ function smarty_block_form( $pParams, $pContent, &$gBitSmarty) { global $gBitSystem, $gSniffer; if( $pContent ) { if( !isset( $pParams['method'] ) ) { $pParams['method'] = 'post'; } $atts = ''; if( isset( $pParams['secure'] ) && $pParams['secure'] ) { // This is NEEDED to enforce HTTPS secure logins! $url = 'https://' . $_SERVER['HTTP_HOST']; } else { $url = ''; } // We need an onsubmit handler in safari to show all tabs again so uploads in hidden tabs work $onsubmit = ''; if( $gSniffer->_browser_info['browser'] == 'sf' ) { $onsubmit .= "disposeAllTabs();"; } // services can add something to onsubmit if( $gBitSmarty->get_template_vars( 'serviceOnsubmit' ) ) { $onsubmit .= $gBitSmarty->get_template_vars( 'serviceOnsubmit' ).";"; } foreach( $pParams as $key => $val ) { switch( $key ) { case 'ifile': case 'ipackage': if( $key == 'ipackage' ) { if( $val == 'root' ) { $url .= BIT_ROOT_URL.$pParams['ifile']; } else { $url .= constant( strtoupper( $val ).'_PKG_URL' ).$pParams['ifile']; } } break; case 'legend': if( !empty( $val ) ) { $legend = ''; } break; // this is needed for backwards compatibility since we sometimes pass in a url case 'action': if( substr( $val, 0, 4 ) == 'http' ) { if( isset( $pParams['secure'] ) && $pParams['secure'] && ( substr( $val, 0, 5 ) != 'https' )) { $val = preg_replace( '/^http/', 'https', $val ); } $url = $val; } else { $url .= $val; } break; case 'ianchor': case 'secure': break; case 'onsubmit': if( !empty( $val ) ) { $onsubmit .= $val.";"; } break; default: if( !empty( $val ) ) { $atts .= $key.'="'.$val.'" '; } break; } } if( empty( $url )) { $url = $_SERVER['PHP_SELF']; } else if( $url == 'https://' . $_SERVER['HTTP_HOST'] ) { $url .= $_SERVER['PHP_SELF']; } $onsub = ( !empty( $onsubmit ) ? ' onsubmit="'.$onsubmit.'"' : '' ); $ret = '
'; return $ret; } } ?>