[100] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_posts_show($options){
|
---|
| 7 | return _b_posts_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_posts_edit($options){
|
---|
| 10 | return _b_posts_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_POSTS_BLOCK_INCLUDED' ) ) {
|
---|
| 15 | define( 'XPRESS_POSTS_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 16 | function _b_posts_edit($options)
|
---|
| 17 | {
|
---|
| 18 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 19 | $disp_count = empty( $options[1] ) ? '10' : $options[1] ;
|
---|
| 20 | $disp_red = empty( $options[2] ) ? '1' : $options[2] ;
|
---|
| 21 | $disp_green = empty( $options[3] ) ? '7' : $options[3] ;
|
---|
| 22 | $tag_select = $options[4] ;
|
---|
| 23 | $selected = array_slice($options,5); // get allowed cats
|
---|
[109] | 24 | $this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_recent_posts_list_block.html' : trim( $options[6] );
|
---|
[100] | 25 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 26 |
|
---|
| 27 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 28 |
|
---|
| 29 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
| 30 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[1]' value='" . $disp_count . "' /><br />\n";
|
---|
| 31 | $form .= _MB_XPRESS_REDNEW_DAYS .": <input type='text' name='options[2]' value='" . $disp_red . "' /><br />\n";
|
---|
| 32 | $form .= _MB_XPRESS_GREENNEW_DAYS .": <input type='text' name='options[3]' value='" . $disp_green . "' /><br />\n";
|
---|
| 33 |
|
---|
| 34 | $form .= "<br />\n";
|
---|
| 35 | $form .= _MB_XPRESS_TAGS_SELECT .": <input type='text' name='options[4]' value='" . $tag_select . "' /><br />\n";
|
---|
| 36 | $form .= _MB_XPRESS_CATS_SELECT ."<br />\n";
|
---|
| 37 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
| 38 | $form .= " <select name=\"options[]\" multiple=\"multiple\">\n";
|
---|
| 39 | $form .= "\t<option value=\"0\" ";
|
---|
| 40 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
| 41 | $form .= ">"._MB_XPRESS_ALL ."</option>\n";
|
---|
| 42 | ob_start();
|
---|
| 43 | dropdown_cats_options('ID','asc',$selected);
|
---|
| 44 | $list_str = ob_get_contents();
|
---|
| 45 | ob_end_clean();
|
---|
| 46 | $form .= $list_str. "</select><br />\n";
|
---|
| 47 |
|
---|
| 48 | // $form .="<br /><input type='text' size='60' name='options[5]' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 49 |
|
---|
| 50 | return $form;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | function _b_posts_show($options)
|
---|
| 54 | {
|
---|
| 55 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 56 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 57 | $block_function_name = basename( __FILE__ );
|
---|
| 58 |
|
---|
| 59 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 60 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
| 63 | ?> |
---|