XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/blocks/recent_posts_content_block.php @ 289

Last change on this file since 289 was 232, checked in by toemon, 15 years ago

external追加に伴うフォルダー構成変更

File size: 3.1 KB
Line 
1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_content_show($options){
7        return _b_content_show($options) ;
8}
9function b_'.$mydirname.'_content_edit($options){
10        return _b_content_edit($options) ;
11}
12' ) ;
13
14if( ! 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                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] );
21                $disp_count =  ($options[2])?intval($options[2]):10;
22                $excerpt = empty( $options[3] ) ? false : true ;
23                $excerpt_size =  ($options[4])?intval($options[4]):100;
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
28
29                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
30
31                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
32               
33                $form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
34            $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
35                $form .= "<br />";
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";
41               
42                $form .= "<br />\n";
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";
45            $isAll = (count($selected)==0||empty($selected[0]))?true:false;
46            $form .= "&nbsp;&nbsp;<select name=\"options[]\" multiple=\"multiple\">\n";
47            $form .= "\t<option value=\"0\" ";
48            if ($isAll) $form .= " selected=\"selected\"";
49            $form .= ">"._MB_XP2_ALL ."</option>\n";
50                ob_start();
51                dropdown_cats_options('ID','asc',$selected);
52                $list_str = ob_get_contents();
53                ob_end_clean();
54            $form .= $list_str. "</select><br />\n";
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?>
Note: See TracBrowser for help on using the repository browser.