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_PAGE_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] ) ? 0 : $options[1] ;
|
---|
22 | $sort_order_asc = empty( $options[3] ) ? 0 : 1 ;
|
---|
23 | $show_date = empty( $options[4] ) ? 0 : 1 ;
|
---|
24 | $date_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
25 |
|
---|
26 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
27 |
|
---|
28 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
|
---|
29 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
30 | $form .= "<br />";
|
---|
31 | $form .= _MB_XPRESS_SORT_COLUMN ."\n";
|
---|
32 | $form .= "<select name='options[2]' size='1'>\n";
|
---|
33 | $selected[0] = ''; $selected[1]= ''; $selected[2]= '';
|
---|
34 | $selected[$sort_column] = ' selected ';
|
---|
35 | $form .= "<option value='0' " . $selected[0] . " >" . _MB_XPRESS_TITLE . "</option>\n";
|
---|
36 | $form .= "<option value='1' " . $selected[1] . " >" . _MB_XPRESS_PUBLISH_DATE . "</option>\n";
|
---|
37 | $form .= "<option value='2' " . $selected[2] . " >" . _MB_XPRESS_MENU_ORDER . "</option>\n";
|
---|
38 | $form .= "</select><br />\n";
|
---|
39 | $form .= yes_no_radio_option('options[3]', _MB_XPRESS_SORT_ORDER , $sort_order_asc , _MB_XPRESS_SORT_ASC ,_MB_XPRESS_SORT_DESC) . "<br />\n";
|
---|
40 | $form .= yes_no_radio_option('options[4]', _MB_XPRESS_SHOW_DATE , $show_date) . "<br />\n";
|
---|
41 | $form .= _MB_XPRESS_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n";
|
---|
42 | // $form .="<br /><input type='text' size='60' name='options[2]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
43 |
|
---|
44 | return $form;
|
---|
45 | }
|
---|
46 |
|
---|
47 | function _b_page_show($options)
|
---|
48 | {
|
---|
49 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
50 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
51 | $block_function_name = basename( __FILE__ );
|
---|
52 |
|
---|
53 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
54 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
55 | }
|
---|
56 |
|
---|
57 | }
|
---|
58 |
|
---|
59 | ?> |
---|