You appear to be a bot. Output may be restricted
Description
Display CSV as a table
Usage
bw_csv_content_array_table( $content_array, $atts );
Parameters
- $content_array
- ( array ) required – array of contents to be displayed
- $atts
- ( array ) optional – shortcode parameters
Returns
voidSource
File name: oik-bob-bing-wide/shortcodes/oik-csv.phpLines:
1 to 38 of 38
function bw_csv_content_array_table( $content_array, $atts=null ) { $class = bw_array_get( $atts, "class", null ); stag( "table", "bw_csv " . $class ); oik_require_lib( 'bobbforms' ); //oik_require_lib( 'bobbcomp'); $th = bw_array_get( $atts, "th", "y" ); $th = bw_validate_torf( $th ); $totals = bw_array_get( $atts, 'totals', null ); $csv_totals = null; if ( $totals ) { oik_require_lib( 'class-oik-csv-totals' ); $csv_totals = new Oik_csv_totals( $totals ); } foreach ( $content_array as $line ) { //bw_trace2( $line, "line" ); $line = trim( $line ); if ( $line ) { $tablerow = str_getcsv( $line, bw_array_get( $atts, 'del', ',' ) ); $tablerow = bw_csv_dashicons( $tablerow, $atts ); $tablerow = bw_csv_expand_shortcodes( $tablerow ); if ( $th ) { bw_tablerow( $tablerow, "tr", "th" ); $th = false; } else { bw_tablerow( $tablerow ); if ( $csv_totals ) { $csv_totals->row( $tablerow ); } } } } if ( $csv_totals ) { $prefixes = bw_array_get( $atts, 'prefixes', null ); $csv_totals->totals_row( $prefixes ); } etag( "table" ); }View on GitHub