diff options
| author | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:51 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:51 +0000 |
| commit | 32506efbcaba41d85c0f41197b92eea224058323 (patch) | |
| tree | 1775b0f1ccd10ff4c2e924814d104985fca80644 /smarty_bit | |
| parent | 7ccbe895a45e54147b1fa67c4c47d84be9c6da2e (diff) | |
| download | kernel-32506efbcaba41d85c0f41197b92eea224058323.tar.gz kernel-32506efbcaba41d85c0f41197b92eea224058323.tar.bz2 kernel-32506efbcaba41d85c0f41197b92eea224058323.zip | |
merge recent changes to HEAD
Diffstat (limited to 'smarty_bit')
| -rw-r--r-- | smarty_bit/block.form.php | 5 | ||||
| -rw-r--r-- | smarty_bit/function.formfeedback.php | 3 | ||||
| -rw-r--r-- | smarty_bit/function.jspopup.php | 51 |
3 files changed, 39 insertions, 20 deletions
diff --git a/smarty_bit/block.form.php b/smarty_bit/block.form.php index 4e9bf58..3dee3a1 100644 --- a/smarty_bit/block.form.php +++ b/smarty_bit/block.form.php @@ -13,6 +13,7 @@ * Input: * - ipackage (optional) - package where we should direct the form after submission * - ifile (optional) - file that is targetted + * - ianchor (optional) - move to anchor after submitting * if neither are set, $PHP_SELF is used as url * - legend if set, it will generate a fieldset using the input as legend * @uses smarty_function_escape_special_chars() @@ -45,6 +46,8 @@ function smarty_block_form($params, $content, &$gBitSmarty) { case 'action': $url = $val; break; + case 'ianchor': + break; default: $atts .= $key.'="'.$val.'" '; break; @@ -53,7 +56,7 @@ function smarty_block_form($params, $content, &$gBitSmarty) { if( !isset( $url ) ) { $url = $_SERVER['PHP_SELF']; } - $ret = '<form action="'.$url.'" '.$atts.'>'; + $ret = '<form action="'.$url.( !empty( $params['ianchor'] ) ? '#'.$params['ianchor'] : '' ).'" '.$atts.'>'; $ret .= isset( $legend ) ? '<fieldset>'.$legend : '<div>'; // adding the div makes it easier to be xhtml compliant $ret .= $content; $ret .= '<div class="clear"></div>'; // needed to avoid rendering issues diff --git a/smarty_bit/function.formfeedback.php b/smarty_bit/function.formfeedback.php index 8f1c5ed..a097a54 100644 --- a/smarty_bit/function.formfeedback.php +++ b/smarty_bit/function.formfeedback.php @@ -21,6 +21,7 @@ function smarty_function_formfeedback( $params,&$gBitSmarty ) { $hash = &$params; } $feedback = ''; + $i = 0; foreach( $hash as $key => $val ) { if( $val ) { require_once $gBitSmarty->_get_plugin_filepath('function','biticon'); @@ -36,7 +37,7 @@ function smarty_function_formfeedback( $params,&$gBitSmarty ) { } $feedback .= '<ul>'; foreach( $val as $valText ) { - $feedback .= '<li class="'.$key.'">'.smarty_function_biticon( $biticon,$gBitSmarty ).' '.$valText.'</li>'; + $feedback .= '<li id="fat'.$i++.'" class="fade-000000 '.$key.'">'.smarty_function_biticon( $biticon,$gBitSmarty ).' '.$valText.'</li>'; } $feedback .= '</ul>'; } else { diff --git a/smarty_bit/function.jspopup.php b/smarty_bit/function.jspopup.php index 250368b..a04053a 100644 --- a/smarty_bit/function.jspopup.php +++ b/smarty_bit/function.jspopup.php @@ -8,24 +8,39 @@ /** * smarty_function_jspopup */ -function smarty_function_jspopup($params, &$gBitSmarty) -{ - extract($params); - // Param = zone - if(empty($href)) { - $gBitSmarty->trigger_error("assign: missing href parameter"); - return; - } - $attrs = array(); - $attrs[] = "alwaysRaised=yes"; - $attrs[] = (!isset($scrollbars)) ? "scrollbars=no" : "scrollbars=".$scrollbars.""; - $attrs[] = (!isset($menubar)) ? "menubar=no" : "menubar=".$menubar.""; - $attrs[] = (!isset($resizable)) ? "resizable=yes" : "resizable=".$resizable.""; - if (isset($height)) $attrs[] = "height=".$height; - if (isset($width)) $attrs[] = "width=".$width; - print "href='#' onClick='javascript:window.open(\"$href\",\"\",\"" . join(",", $attrs) . "\");' "; -} +function smarty_function_jspopup($params, &$gBitSmarty) { + $ret = ''; + if( empty( $params['href'] ) ) { + $gBitSmarty->trigger_error( 'assign: missing "href" parameter' ); + } + + if( empty( $params['title'] ) ) { + $gBitSmarty->trigger_error( 'assign: missing "title" parameter' ); + } + + $optionHash = array( 'type', 'width', 'height', 'gutsonly' ); + foreach( $params as $param => $val ) { + if( !in_array( $param, $optionHash ) ) { + if( $param != 'title' ) { + $guts .= ' '.$param.'="'.$val.'"'; + } else { + $guts .= ' '.$param.'="'.tra( 'This will open a new window: ' ).tra( $params['title'] ).'"'; + } + } + } -/* vim: set expandtab: */ + if( !empty( $params['type'] ) && $params['type'] == 'fullscreen' ) { + $js = 'popUpWin(this.href,\'fullScreen\');'; + } else { + $js = 'popUpWin(this.href,\'standard\','.( !empty( $params['width'] ) ? $params['width'] : 600 ).','.( !empty( $params['height'] ) ? $params['height'] : 400 ).');'; + } + $guts .= ' onkeypress="'.$js.'" onclick="'.$js.'return false;"'; + + if( !empty( $params['gutsonly'] ) ) { + return $guts; + } else { + return( '<a '.$guts.'>'.tra( $params['title'] ).'</a>' ); + } +} ?> |
