[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] ;
|
---|
[120] | 19 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_list_block.html' : trim( $options[1] );
|
---|
| 20 | $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
|
---|
| 21 | $disp_red = empty( $options[3] ) ? '1' : $options[3] ;
|
---|
| 22 | $disp_green = empty( $options[4] ) ? '7' : $options[4] ;
|
---|
| 23 | $tag_select = $options[5] ;
|
---|
| 24 | $selected = array_slice($options,6); // get allowed cats
|
---|
[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";
|
---|
[121] | 30 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
| 31 | $form .= "<br />";
|
---|
[120] | 32 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
| 33 | $form .= _MB_XPRESS_REDNEW_DAYS .": <input type='text' name='options[3]' value='" . $disp_red . "' /><br />\n";
|
---|
| 34 | $form .= _MB_XPRESS_GREENNEW_DAYS .": <input type='text' name='options[4]' value='" . $disp_green . "' /><br />\n";
|
---|
[100] | 35 |
|
---|
| 36 | $form .= "<br />\n";
|
---|
[120] | 37 | $form .= _MB_XPRESS_TAGS_SELECT .": <input type='text' name='options[5]' value='" . $tag_select . "' /><br />\n";
|
---|
[100] | 38 | $form .= _MB_XPRESS_CATS_SELECT ."<br />\n";
|
---|
| 39 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
| 40 | $form .= " <select name=\"options[]\" multiple=\"multiple\">\n";
|
---|
| 41 | $form .= "\t<option value=\"0\" ";
|
---|
| 42 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
| 43 | $form .= ">"._MB_XPRESS_ALL ."</option>\n";
|
---|
| 44 | ob_start();
|
---|
| 45 | dropdown_cats_options('ID','asc',$selected);
|
---|
| 46 | $list_str = ob_get_contents();
|
---|
| 47 | ob_end_clean();
|
---|
| 48 | $form .= $list_str. "</select><br />\n";
|
---|
| 49 |
|
---|
| 50 | // $form .="<br /><input type='text' size='60' name='options[5]' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 51 |
|
---|
| 52 | return $form;
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | function _b_posts_show($options)
|
---|
| 56 | {
|
---|
| 57 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 58 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 59 | $block_function_name = basename( __FILE__ );
|
---|
| 60 |
|
---|
| 61 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 62 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 63 | }
|
---|
| 64 | }
|
---|
| 65 | ?> |
---|