[54] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_content_show($options){
|
---|
| 7 | return _b_content_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_content_edit($options){
|
---|
| 10 | return _b_content_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_CONTENT_BLOCK_INCLUDED' ) ) {
|
---|
| 15 | define( 'XPRESS_CONTENT_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 16 |
|
---|
| 17 | function _b_content_edit($options)
|
---|
| 18 | {
|
---|
| 19 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] );
|
---|
| 21 | $disp_count = ($options[2])?intval($options[2]):10;
|
---|
[145] | 22 | $excerpt = empty( $options[3] ) ? false : true ;
|
---|
| 23 | $excerpt_size = ($options[4])?intval($options[4]):100;
|
---|
[142] | 24 | $date_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
| 25 | $time_format = empty( $options[6] ) ? '' : $options[6] ;
|
---|
| 26 | $tag_select = $options[7] ;
|
---|
| 27 | $selected = array_slice($options,8); // get allowed cats
|
---|
[54] | 28 |
|
---|
| 29 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 30 |
|
---|
| 31 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 32 |
|
---|
[100] | 33 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
[121] | 34 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
| 35 | $form .= "<br />";
|
---|
[183] | 36 | $form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
| 37 | $form .= yes_no_radio_option('options[3]', _MB_XP2_P_EXCERPT , $excerpt) . "<br />\n";
|
---|
| 38 | $form .= _MB_XP2_P_EXCERPT_SIZE .": <input type='text' name='options[4]' value='" . $excerpt_size . "' /><br />\n";
|
---|
| 39 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n";
|
---|
| 40 | $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
|
---|
[100] | 41 |
|
---|
| 42 | $form .= "<br />\n";
|
---|
[183] | 43 | $form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
|
---|
| 44 | $form .= _MB_XP2_CATS_SELECT ."<br />\n";
|
---|
[54] | 45 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
[100] | 46 | $form .= " <select name=\"options[]\" multiple=\"multiple\">\n";
|
---|
| 47 | $form .= "\t<option value=\"0\" ";
|
---|
[54] | 48 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
[183] | 49 | $form .= ">"._MB_XP2_ALL ."</option>\n";
|
---|
[54] | 50 | ob_start();
|
---|
| 51 | dropdown_cats_options('ID','asc',$selected);
|
---|
| 52 | $list_str = ob_get_contents();
|
---|
| 53 | ob_end_clean();
|
---|
[100] | 54 | $form .= $list_str. "</select><br />\n";
|
---|
[54] | 55 |
|
---|
| 56 | // $form .="<br /><input type='text' size='60' name='options[11]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 57 |
|
---|
| 58 | return $form;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | function _b_content_show($options)
|
---|
| 63 | {
|
---|
| 64 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 65 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 66 | $block_function_name = basename( __FILE__ );
|
---|
| 67 |
|
---|
| 68 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 69 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 70 | }
|
---|
| 71 | }
|
---|
| 72 | ?> |
---|