[44] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_comments_show($options){
|
---|
| 7 | return _b_comments_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_comments_edit($options){
|
---|
| 10 | return _b_comments_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | if( ! defined( 'XPRESS_COMMENTS_BLOCK_INCLUDED' ) ) {
|
---|
| 16 | define( 'XPRESS_COMMENTS_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 17 | function _b_comments_edit($options)
|
---|
| 18 | {
|
---|
| 19 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_comments_block.html' : trim( $options[1] );
|
---|
| 21 | $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
|
---|
| 22 | $disp_length = empty( $options[3] ) ? '30' : $options[3] ;
|
---|
| 23 | $selected = array_slice($options,4); // get allowed cats
|
---|
[44] | 24 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 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 />";
|
---|
[121] | 29 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
| 30 | $form .= "<br />";
|
---|
[120] | 31 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />";
|
---|
| 32 | $form .= _MB_XPRESS_LENGTH .": <input type='text' name='options[3]' value='" . $disp_length . "' />";
|
---|
[44] | 33 | $form .= "<br /><br />" . _MB_XPRESS_COM_TYPE ;
|
---|
| 34 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
| 35 | $form .= "<br /> <select name=\"options[]\" multiple=\"multiple\">";
|
---|
| 36 | $form .= "<option value=\"0\" ";
|
---|
| 37 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
| 38 | $form .= ">"._MB_XPRESS_ALL ."</option>";
|
---|
| 39 |
|
---|
| 40 | $form .= "<option value=\"1\" ";
|
---|
| 41 | if (in_array(1, $selected))
|
---|
| 42 | $form .= " selected=\"selected\"";
|
---|
| 43 | $form .= ">"._MB_XPRESS_COMMENT ."</option>";
|
---|
| 44 |
|
---|
| 45 | $form .= "<option value=\"2\" ";
|
---|
| 46 | if (in_array(2, $selected))
|
---|
| 47 | $form .= " selected=\"selected\"";
|
---|
| 48 | $form .= ">"._MB_XPRESS_TRUCKBACK ."</option>";
|
---|
| 49 |
|
---|
| 50 | $form .= "<option value=\"3\" ";
|
---|
| 51 | if (in_array(3, $selected))
|
---|
| 52 | $form .= " selected=\"selected\"";
|
---|
| 53 | $form .= ">"._MB_XPRESS_PINGBACK ."</option>";
|
---|
| 54 | $form .= "</select><br />";
|
---|
| 55 | // $form .="<br /><input type='text' size='60' name='options[5]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 | return $form;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | function _b_comments_show($options)
|
---|
| 62 | {
|
---|
| 63 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 64 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 65 | $block_function_name = basename( __FILE__ );
|
---|
| 66 |
|
---|
| 67 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 68 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 69 | }
|
---|
| 70 | }
|
---|
| 71 | ?> |
---|