[109] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_popular_show($options){
|
---|
| 7 | return _b_popular_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_popular_edit($options){
|
---|
| 10 | return _b_popular_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_POPULAR_BLOCK_INCLUDED' ) ) {
|
---|
| 15 | define( 'XPRESS_POPULAR_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 16 | function _b_popular_edit($options)
|
---|
| 17 | {
|
---|
| 18 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 19 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_popular.html' : trim( $options[1] );
|
---|
| 20 | $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
|
---|
| 21 | $show_month_range = empty( $options[3] ) ? '0' : $options[3] ;
|
---|
| 22 | $tag_select = $options[4] ;
|
---|
| 23 | $selected = array_slice($options, 5); // get allowed cats
|
---|
[109] | 24 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 25 |
|
---|
| 26 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 27 |
|
---|
| 28 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
[121] | 29 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
| 30 | $form .= "<br />";
|
---|
[120] | 31 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
| 32 | $form .= _MB_MONTH_RANGE .": <input type='text' name='options[3]' value='" . $show_month_range . "' /><br />\n";
|
---|
[109] | 33 | $form .= "<br />\n";
|
---|
| 34 |
|
---|
[120] | 35 | $form .= _MB_XPRESS_TAGS_SELECT .": <input type='text' name='options[4]' value='" . $tag_select . "' /><br />\n";
|
---|
[109] | 36 | $form .= _MB_XPRESS_CATS_SELECT ."<br />\n";
|
---|
| 37 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
| 38 | $form .= "<br /> <select name=\"options[]\" multiple=\"multiple\">";
|
---|
| 39 | $form .= "<option value=\"0\" ";
|
---|
| 40 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
| 41 | $form .= ">"._MB_XPRESS_ALL ."</option>";
|
---|
| 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 />";
|
---|
| 47 | // $form .="<br /><input type='text' size='60' name='options[5]' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 48 |
|
---|
| 49 | return $form;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | function _b_popular_show($options)
|
---|
| 53 | {
|
---|
| 54 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 55 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 56 | $block_function_name = basename( __FILE__ );
|
---|
| 57 |
|
---|
| 58 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 59 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 60 | }
|
---|
| 61 | }
|
---|
| 62 | ?> |
---|