1 | <?php
|
---|
2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
4 |
|
---|
5 | eval( '
|
---|
6 | function b_'.$mydirname.'_category_show($options){
|
---|
7 | return _b_category_show($options) ;
|
---|
8 | }
|
---|
9 | function b_'.$mydirname.'_category_edit($options){
|
---|
10 | return _b_category_edit($options) ;
|
---|
11 | }
|
---|
12 | ' ) ;
|
---|
13 |
|
---|
14 | if( ! defined( 'XPRESS_CATEGORY_BLOCK_INCLUDED' ) ) {
|
---|
15 | define( 'XPRESS_CATEGORY_BLOCK_INCLUDED' , 1 ) ;
|
---|
16 |
|
---|
17 | function _b_category_edit($options)
|
---|
18 | {
|
---|
19 |
|
---|
20 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
21 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_category_block.html' : trim( $options[1] );
|
---|
22 | $show_option_all = empty( $options[2] ) ? '' : $options[2] ;
|
---|
23 | $orderby = empty( $options[3] ) ? 'name' : $options[3] ;
|
---|
24 | $order = empty( $options[4] ) ? 'ASC' : $options[4] ;
|
---|
25 | $show_last_updated = empty( $options[5] ) ? false : true ;
|
---|
26 | $show_count = empty( $options[6] ) ? false : true ;
|
---|
27 | $hide_empty = empty( $options[7] ) ? false : true ;
|
---|
28 | $use_desc_for_title = empty( $options[8] ) ? false : true ;
|
---|
29 | $exclude = empty( $options[9] ) ? '' : $options[9] ;
|
---|
30 | $includes = empty( $options[10] ) ? '' : $options[10] ;
|
---|
31 | $hierarchical = empty( $options[11] ) ? false : true ;
|
---|
32 | $depth = !is_numeric( $options[12] ) ? 0 : $options[12] ;
|
---|
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 . "' />";
|
---|
37 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
38 | $form .= "<br />";
|
---|
39 | $form .= _MB_XP2_CAT_ALL_STR . " <input type='text' name='options[2]' value='" . $show_option_all . "' /><br />";
|
---|
40 | $form .= _MB_XP2_CAT_ORDERBY .": ";
|
---|
41 | $form .= "<select name='options[3]'>";
|
---|
42 | if ($orderby =='name')
|
---|
43 | $form .= "<option value='name' selected='selected'>". _MB_XP2_CAT_NAME;
|
---|
44 | else
|
---|
45 | $form .= "<option value='name'>". _MB_XP2_CAT_NAME;
|
---|
46 | if ($orderby =='count')
|
---|
47 | $form .= "<option value='count' selected='selected'>". _MB_XP2_CAT_COUNT;
|
---|
48 | else
|
---|
49 | $form .= "<option value='count'>". _MB_XP2_CAT_COUNT;
|
---|
50 | if ($orderby =='ID')
|
---|
51 | $form .= "<option value='ID' selected='selected'>". _MB_XP2_CAT_ID;
|
---|
52 | else
|
---|
53 | $form .= "<option value='ID'>". _MB_XP2_CAT_ID;
|
---|
54 | $form .= "</select><br/>";
|
---|
55 |
|
---|
56 | $form .= _MB_XP2_SORT_ORDER .": ";
|
---|
57 | $form .= "<select name='options[4]'>";
|
---|
58 | if ($order =='ASC')
|
---|
59 | $form .= "<option value='ASC' selected='selected'>" . _MB_XP2_SORT_ASC;
|
---|
60 | else
|
---|
61 | $form .= "<option value='ASC'>" . _MB_XP2_SORT_ASC;
|
---|
62 | if ($order =='DESC')
|
---|
63 | $form .= "<option value='DESC' selected='selected'>" . _MB_XP2_SORT_DESC;
|
---|
64 | else
|
---|
65 | $form .= "<option value='DESC'>" . _MB_XP2_SORT_DESC;
|
---|
66 | $form .= "</select><br/>";
|
---|
67 |
|
---|
68 | $form .= yes_no_radio_option('options[5]', _MB_XP2_SHOW_LAST_UPDATE , $show_last_updated) . "<br />" ;
|
---|
69 | $form .= yes_no_radio_option('options[6]', _MB_XP2_SHOW_NUM_OF_POST , $show_count) . "<br />" ;
|
---|
70 | $form .= yes_no_radio_option('options[7]', _MB_XP2_CAT_HIDE_EMPTY , $hide_empty) . "<br />" ;
|
---|
71 | $form .= yes_no_radio_option('options[8]', _MB_XP2_DESC_FOR_TITLE , $use_desc_for_title) . "<br />" ;
|
---|
72 | $form .= _MB_XP2_CAT_EXCLUDE . " <input type='text' name='options[9]' value='" . $exclude . "' size ='60' /><br />";
|
---|
73 | $form .= _MB_XP2_CAT_INCLUDE . " <input type='text' name='options[10]' value='" . $includes . "' size ='60' /><br />";
|
---|
74 | $form .= yes_no_radio_option('options[11]', _MB_XP2_CAT_HIERARCHICAL , $hierarchical) . "<br />" ;
|
---|
75 | $form .= _MB_XP2_CAT_DEPTH . " <input type='text' name='options[12]' value='" . $depth . "' size ='8' /><br />";
|
---|
76 | return $form;
|
---|
77 | }
|
---|
78 |
|
---|
79 | function _b_category_show($options)
|
---|
80 | {
|
---|
81 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
82 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
83 | $block_function_name = basename( __FILE__ );
|
---|
84 |
|
---|
85 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
86 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
87 | }
|
---|
88 |
|
---|
89 | }
|
---|
90 |
|
---|
91 | ?> |
---|