Extend print_table_row so that one can specify the CSS class

directly.  Add "vr" class which aligns the content to the right border.
This commit is contained in:
Sascha Schumann 2003-04-19 17:40:19 +00:00
parent 1939d27aca
commit e4183ae980
2 changed files with 28 additions and 5 deletions

View File

@ -751,12 +751,12 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)
} }
/* }}} */ /* }}} */
/* {{{ 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; int i;
va_list row_elements;
char *row_element; char *row_element;
char *elem_esc = NULL; char *elem_esc = NULL;
/* /*
@ -765,14 +765,13 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)
TSRMLS_FETCH(); TSRMLS_FETCH();
va_start(row_elements, num_cols);
if (!sapi_module.phpinfo_as_text) { if (!sapi_module.phpinfo_as_text) {
php_printf("<tr>"); php_printf("<tr>");
} }
for (i=0; i<num_cols; i++) { for (i=0; i<num_cols; i++) {
if (!sapi_module.phpinfo_as_text) { if (!sapi_module.phpinfo_as_text) {
php_printf("<td class=\"%s\">", php_printf("<td class=\"%s\">",
(i==0 ? "e" : "v" ) (i==0 ? "e" : value_class )
); );
} }
row_element = va_arg(row_elements, char *); row_element = va_arg(row_elements, char *);
@ -803,7 +802,30 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)
if (!sapi_module.phpinfo_as_text) { if (!sapi_module.phpinfo_as_text) {
php_printf("</tr>\n"); 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); va_end(row_elements);
} }
/* }}} */ /* }}} */

View File

@ -73,6 +73,7 @@ PHPAPI void php_info_print_style(TSRMLS_D);
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header); 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_header(int num_cols, ...);
PHPAPI void php_info_print_table_row(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_start(void);
PHPAPI void php_info_print_table_end(void); PHPAPI void php_info_print_table_end(void);
PHPAPI void php_info_print_box_start(int bg); PHPAPI void php_info_print_box_start(int bg);