cvs: php4 /ext/standard info.c info.h

From: Date: Sat, 19 Apr 2003 17:40:19 +0000
Subject: cvs: php4 /ext/standard info.c info.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20390@lists.php.net to get a copy of this message
sas Sat Apr 19 13:40:19 2003 EDT Modified files: /php4/ext/standard info.c info.h Log: Extend print_table_row so that one can specify the CSS class directly. Add "vr" class which aligns the content to the right border. Index: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.234 php4/ext/standard/info.c:1.235 --- php4/ext/standard/info.c:1.234 Wed Apr 9 13:46:42 2003 +++ php4/ext/standard/info.c Sat Apr 19 13:40:19 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c,v 1.234 2003/04/09 17:46:42 rasmus Exp $ */ +/* $Id: info.c,v 1.235 2003/04/19 17:40:19 sas Exp $ */ #include "php.h" #include "php_ini.h" @@ -751,12 +751,12 @@ } /* }}} */ -/* {{{ php_info_print_table_row +/* {{{ php_info_print_table_row_internal */ -PHPAPI void php_info_print_table_row(int num_cols, ...) +static void php_info_print_table_row_internal(int num_cols, + const char *value_class, va_list row_elements) { int i; - va_list row_elements; char *row_element; char *elem_esc = NULL; /* @@ -765,14 +765,13 @@ TSRMLS_FETCH(); - va_start(row_elements, num_cols); if (!sapi_module.phpinfo_as_text) { php_printf("<tr>"); } for (i=0; i<num_cols; i++) { if (!sapi_module.phpinfo_as_text) { php_printf("<td class=\"%s\">", - (i==0 ? "e" : "v" ) + (i==0 ? "e" : value_class ) ); } row_element = va_arg(row_elements, char *); @@ -803,7 +802,30 @@ if (!sapi_module.phpinfo_as_text) { php_printf("</tr>\n"); } +} +/* }}} */ + +/* {{{ php_info_print_table_row + */ +PHPAPI void php_info_print_table_row(int num_cols, ...) +{ + va_list row_elements; + + va_start(row_elements, num_cols); + php_info_print_table_row_internal(num_cols, "v", row_elements); + va_end(row_elements); +} +/* }}} */ + +/* {{{ php_info_print_table_row_ex + */ +PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, + ...) +{ + va_list row_elements; + va_start(row_elements, value_class); + php_info_print_table_row_internal(num_cols, value_class, row_elements); va_end(row_elements); } /* }}} */ Index: php4/ext/standard/info.h diff -u php4/ext/standard/info.h:1.32 php4/ext/standard/info.h:1.33 --- php4/ext/standard/info.h:1.32 Wed Apr 2 11:51:39 2003 +++ php4/ext/standard/info.h Sat Apr 19 13:40:19 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.h,v 1.32 2003/04/02 16:51:39 cmv Exp $ */ +/* $Id: info.h,v 1.33 2003/04/19 17:40:19 sas Exp $ */ #ifndef INFO_H #define INFO_H @@ -73,6 +73,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header); PHPAPI void php_info_print_table_header(int num_cols, ...); PHPAPI void php_info_print_table_row(int num_cols, ...); +PHPAPI void php_info_print_table_row_ex(int num_cols, const char *, ...); PHPAPI void php_info_print_table_start(void); PHPAPI void php_info_print_table_end(void); PHPAPI void php_info_print_box_start(int bg);

« previous php.cvs (#20390) next »