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