[118] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_page_show($options){
|
---|
| 7 | return _b_page_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_page_edit($options){
|
---|
| 10 | return _b_page_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_PAGE_BLOCK_INCLUDED' ) ) {
|
---|
[195] | 15 | define( 'XPRESS_PAGE_BLOCK_INCLUDED' , 1 ) ;
|
---|
[118] | 16 |
|
---|
| 17 | function _b_page_edit($options)
|
---|
| 18 | {
|
---|
| 19 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] );
|
---|
[127] | 21 | $sort_column = empty( $options[2] ) ? 'post_title' : $options[2] ;
|
---|
| 22 | $sort_order = empty( $options[3] ) ? 'asc' : $options[3] ;
|
---|
| 23 | $exclude = empty( $options[4] ) ? '' : $options[4] ;
|
---|
[205] | 24 | $exclude_tree = empty( $options[5] ) ? '' : $options[5] ;
|
---|
[127] | 25 | $includes = empty( $options[6] ) ? '' : $options[6] ;
|
---|
| 26 | $depth = !is_numeric( $options[7] ) ? 0 : $options[7] ;
|
---|
| 27 | $child_of = !is_numeric( $options[8] ) ? 0 : $options[8] ;
|
---|
| 28 | $show_date = empty( $options[9] ) ? 'none' : $options[9] ;
|
---|
| 29 | $date_format = empty( $options[10] ) ? '' : $options[10] ;
|
---|
| 30 | $hierarchical = empty( $options[11] ) ? false : true ;
|
---|
| 31 | $meta_key = empty( $options[12] ) ? '' : $options[12] ;
|
---|
| 32 | $meta_value = empty( $options[13] ) ? '' : $options[13] ;
|
---|
[118] | 33 |
|
---|
| 34 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 35 |
|
---|
| 36 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
|
---|
[463] | 37 | $form .= _MB_XP2_THISTEMPLATE . "<input type='text' size='50' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
[121] | 38 | $form .= "<br />";
|
---|
[183] | 39 | $form .= _MB_XP2_PAGE_ORDERBY .": ";
|
---|
[127] | 40 | $form .= "<select name='options[2]'>";
|
---|
| 41 |
|
---|
| 42 | if ($sort_column =='post_title')
|
---|
[183] | 43 | $form .= "<option value='post_title' selected='selected'>". _MB_XP2_PAGE_TITLE;
|
---|
[127] | 44 | else
|
---|
[183] | 45 | $form .= "<option value='post_title'>". _MB_XP2_PAGE_TITLE;
|
---|
[127] | 46 |
|
---|
| 47 | if ($sort_column =='menu_order')
|
---|
[183] | 48 | $form .= "<option value='menu_order' selected='selected'>". _MB_XP2_PAGE_MENU_ORDER;
|
---|
[127] | 49 | else
|
---|
[183] | 50 | $form .= "<option value='menu_order'>". _MB_XP2_PAGE_MENU_ORDER;
|
---|
[127] | 51 |
|
---|
| 52 | if ($sort_column =='post_date')
|
---|
[183] | 53 | $form .= "<option value='post_date' selected='selected'>". _MB_XP2_PAGE_POST_DATE;
|
---|
[127] | 54 | else
|
---|
[183] | 55 | $form .= "<option value='post_date'>". _MB_XP2_PAGE_POST_DATE;
|
---|
[127] | 56 |
|
---|
| 57 | if ($sort_column =='post_modified')
|
---|
[183] | 58 | $form .= "<option value='post_modified' selected='selected'>". _MB_XP2_PAGE_POST_MODIFY;
|
---|
[127] | 59 | else
|
---|
[183] | 60 | $form .= "<option value='post_modified'>". _MB_XP2_PAGE_POST_MODIFY;
|
---|
[127] | 61 |
|
---|
| 62 | if ($sort_column =='ID')
|
---|
[183] | 63 | $form .= "<option value='ID' selected='selected'>". _MB_XP2_PAGE_ID;
|
---|
[127] | 64 | else
|
---|
[183] | 65 | $form .= "<option value='ID'>". _MB_XP2_PAGE_ID;
|
---|
[127] | 66 |
|
---|
| 67 | if ($sort_column =='post_author')
|
---|
[183] | 68 | $form .= "<option value='post_author' selected='selected'>". _MB_XP2_PAGE_AUTHOR;
|
---|
[127] | 69 | else
|
---|
[183] | 70 | $form .= "<option value='post_author'>". _MB_XP2_PAGE_AUTHOR;
|
---|
[127] | 71 |
|
---|
| 72 | if ($sort_column =='post_name')
|
---|
[183] | 73 | $form .= "<option value='post_name' selected='selected'>". _MB_XP2_PAGE_SLUG;
|
---|
[127] | 74 | else
|
---|
[183] | 75 | $form .= "<option value='post_name'>". _MB_XP2_PAGE_SLUG;
|
---|
[127] | 76 |
|
---|
| 77 | $form .= "</select><br/>";
|
---|
| 78 |
|
---|
| 79 |
|
---|
[183] | 80 | $form .= _MB_XP2_SORT_ORDER .": ";
|
---|
[127] | 81 | $form .= "<select name='options[3]'>";
|
---|
| 82 | if ($sort_order =='asc')
|
---|
[183] | 83 | $form .= "<option value='asc' selected='selected'>" . _MB_XP2_SORT_ASC;
|
---|
[127] | 84 | else
|
---|
[183] | 85 | $form .= "<option value='asc'>" . _MB_XP2_SORT_ASC;
|
---|
[127] | 86 | if ($sort_order =='desc')
|
---|
[183] | 87 | $form .= "<option value='desc' selected='selected'>" . _MB_XP2_SORT_DESC;
|
---|
[127] | 88 | else
|
---|
[183] | 89 | $form .= "<option value='desc'>" . _MB_XP2_SORT_DESC;
|
---|
[127] | 90 | $form .= "</select><br/>\n";
|
---|
| 91 |
|
---|
[183] | 92 | $form .= _MB_XP2_PAGE_EXCLUDE . " <input type='text' name='options[4]' value='" . $exclude . "' size ='60' /><br />\n";
|
---|
[205] | 93 | $form .= _MB_XP2_PAGE_EXCLUDE_TREE . " <input type='text' name='options[5]' value='" . $exclude_tree . "' size ='60' /><br />\n";
|
---|
[183] | 94 | $form .= _MB_XP2_PAGE_INCLUDE . " <input type='text' name='options[6]' value='" . $includes . "' size ='60' /><br />\n";
|
---|
| 95 | $form .= _MB_XP2_PAGE_DEPTH . " <input type='text' name='options[7]' value='" . $depth . "' size ='8' /><br />";
|
---|
| 96 | $form .= _MB_XP2_PAGE_CHILD_OF . " <input type='text' name='options[8]' value='" . $child_of . "' size ='8' /><br />";
|
---|
[127] | 97 |
|
---|
[183] | 98 | $form .= _MB_XP2_SHOW_DATE_SELECT .": ";
|
---|
[127] | 99 | $form .= "<select name='options[9]'>";
|
---|
| 100 | if ($show_date =='none')
|
---|
[183] | 101 | $form .= "<option value='none' selected='selected'>" . _MB_XP2_SHOW_DATE_NONE;
|
---|
[127] | 102 | else
|
---|
[183] | 103 | $form .= "<option value='none'>" . _MB_XP2_SHOW_DATE_NONE;
|
---|
[127] | 104 |
|
---|
| 105 | if ($show_date =='post_date')
|
---|
[183] | 106 | $form .= "<option value='post_date' selected='selected'>" . _MB_XP2_SHOW_POST_DATE;
|
---|
[127] | 107 | else
|
---|
[183] | 108 | $form .= "<option value='post_date'>" . _MB_XP2_SHOW_POST_DATE;
|
---|
[127] | 109 |
|
---|
| 110 | if ($show_date =='modified')
|
---|
[183] | 111 | $form .= "<option value='modified' selected='selected'>" . _MB_XP2_SHOW_MODIFY_DATE;
|
---|
[127] | 112 | else
|
---|
[183] | 113 | $form .= "<option value='modified'>" . _MB_XP2_SHOW_MODIFY_DATE;
|
---|
[127] | 114 |
|
---|
| 115 | $form .= "</select><br/>\n";
|
---|
| 116 |
|
---|
[183] | 117 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[10]' value='" . $date_format . "' /><br />\n";
|
---|
| 118 | $form .= yes_no_radio_option('options[11]', _MB_XP2_PAGE_HIERARCHICAL , $hierarchical) . "<br />" ;
|
---|
| 119 | $form .= _MB_XP2_PAGE_META_KEY . " <input type='text' name='options[12]' value='" . $meta_key . "' size ='40' /><br />\n";
|
---|
[386] | 120 | $form .= _MB_XP2_PAGE_META_VALUE . " <input type='text' name='options[13]' value='" . $meta_value . "' size ='40' /><br />\n";
|
---|
[127] | 121 |
|
---|
[118] | 122 | return $form;
|
---|
| 123 | }
|
---|
| 124 |
|
---|
| 125 | function _b_page_show($options)
|
---|
| 126 | {
|
---|
| 127 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 128 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 129 | $block_function_name = basename( __FILE__ );
|
---|
| 130 |
|
---|
| 131 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 132 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 133 | }
|
---|
| 134 |
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | ?> |
---|