[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] ;
|
---|
| 20 | $disp_count = ($options[1])?intval($options[1]):10;
|
---|
| 21 | $except = empty( $options[2] ) ? false : true ;
|
---|
| 22 | $except_size = ($options[3])?intval($options[3]):100;
|
---|
| 23 | $tag_select = $options[4] ;
|
---|
| 24 | $selected = array_slice($options,5); // get allowed cats
|
---|
| 25 | $this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_block_content.html' : trim( $options[5] );
|
---|
| 26 |
|
---|
| 27 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 28 |
|
---|
| 29 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 30 |
|
---|
| 31 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
|
---|
| 32 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[1]' value='" . $disp_count . "' />";
|
---|
| 33 | $form .= "<br />" . yes_no_radio_option('options[2]', _MB_XPRESS_P_EXCEPT , $except);
|
---|
| 34 | $form .= "<br />" . _MB_XPRESS_P_EXCEPT_SIZE .": <input type='text' name='options[3]' value='" . $except_size . "' />";
|
---|
| 35 | $form .= "<br /><br />" . _MB_XPRESS_CATS_SELECT ;
|
---|
| 36 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
| 37 | $form .= "<br /> <select name=\"options[]\" multiple=\"multiple\">";
|
---|
| 38 | $form .= "<option value=\"0\" ";
|
---|
| 39 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
| 40 | $form .= ">"._MB_XPRESS_ALL ."</option>";
|
---|
| 41 | ob_start();
|
---|
| 42 | dropdown_cats_options('ID','asc',$selected);
|
---|
| 43 | $list_str = ob_get_contents();
|
---|
| 44 | ob_end_clean();
|
---|
| 45 | $form .= $list_str. "</select><br />";
|
---|
| 46 | $form .= "<br />" . _MB_XPRESS_TAGS_SELECT .": <input type='text' name='options[4]' value='" . $tag_select . "' />";
|
---|
| 47 |
|
---|
| 48 | // $form .="<br /><input type='text' size='60' name='options[11]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 49 |
|
---|
| 50 | return $form;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | function _b_content_show($options)
|
---|
| 55 | {
|
---|
| 56 | global $wpdb;
|
---|
| 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 | ?> |
---|