Rev | Line | |
---|
[118] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | function page_block($options)
|
---|
| 4 | {
|
---|
| 5 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 6 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] );
|
---|
| 7 | $sort_column = empty( $options[2] ) ? 0 : $options[1] ;
|
---|
| 8 | $sort_order_asc = empty( $options[3] ) ? 0 : 1 ;
|
---|
| 9 | $show_date = empty( $options[4] ) ? 0 : 1 ;
|
---|
| 10 | $date_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
| 11 |
|
---|
| 12 | switch ($sort_column) {
|
---|
| 13 | case 0:
|
---|
| 14 | $sort_column_name = 'post_title';
|
---|
| 15 | break ;
|
---|
| 16 | case 1:
|
---|
| 17 | $sort_column_name = 'post_date';
|
---|
| 18 | break ;
|
---|
| 19 | case 2:
|
---|
| 20 | $sort_column_name = 'menu_order';
|
---|
| 21 | break ;
|
---|
| 22 | default:
|
---|
| 23 | $sort_column_name = 'post_title';
|
---|
| 24 | break ;
|
---|
| 25 | }
|
---|
| 26 | if (empty($date_format)) $date_format = get_option('date_format');
|
---|
| 27 | if ($show_date) $show_date_name = 'post_date' ; else $show_date_name = '';
|
---|
| 28 | $parm = array(
|
---|
| 29 | 'depth' => 0,
|
---|
| 30 | 'title_li' => '',
|
---|
| 31 | 'show_date' => $show_date_name,
|
---|
| 32 | 'date_format' => $date_format,
|
---|
| 33 | 'child_of' => 0,
|
---|
| 34 | 'exclude' => '',
|
---|
| 35 | 'echo' => 0,
|
---|
| 36 | 'authors' => '',
|
---|
| 37 | 'sort_column' => $sort_column_name
|
---|
| 38 | );
|
---|
| 39 |
|
---|
| 40 | $content = wp_list_pages($parm);
|
---|
| 41 | $item_no = 0;
|
---|
| 42 | $row_data = array(
|
---|
| 43 | 'page' => $content
|
---|
| 44 | );
|
---|
| 45 | $block['contents']['item'.$item_no] = $row_data;
|
---|
| 46 | $item_no++;
|
---|
| 47 |
|
---|
| 48 | $block['data_count'] = $item_no; //xml unserialise error
|
---|
| 49 |
|
---|
| 50 | return $block ;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.