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