XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/blocks/recent_comments_block.php @ 484

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

ブロックテンプレートの名前入力フォーム変更 Fixes#267

File size: 2.2 KB
Line 
1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_comments_show($options){
7        return _b_comments_show($options) ;
8}
9function b_'.$mydirname.'_comments_edit($options){
10        return _b_comments_edit($options) ;
11}
12' ) ;
13
14
15if( ! defined( 'XPRESS_COMMENTS_BLOCK_INCLUDED' ) ) {
16        define( 'XPRESS_COMMENTS_BLOCK_INCLUDED' , 1 ) ;
17        function _b_comments_edit($options)
18        {
19                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
20                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_comments_block.html' : trim( $options[1] );
21                $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
22                $disp_length = empty( $options[3] ) ? '30' : $options[3] ;
23                $date_format = empty( $options[4] ) ? '' : $options[4] ;
24                $time_format = empty( $options[5] ) ? '' : $options[5] ;
25                $com_select = empty( $options[6] ) ? '0' : $options[6] ;
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 />\n";
32                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
33                $form .= "<br />";
34                $form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
35                $form .= _MB_XP2_LENGTH .": <input type='text' size='3' name='options[3]' value='" . $disp_length . "' /><br />\n";
36                $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
37                $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
38            $form .= "<br />\n";
39            $form .= comment_type_select('options[6]' , $com_select);
40
41
42                return $form;
43        }
44       
45        function _b_comments_show($options)
46        {
47                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
48                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
49                $block_function_name = basename( __FILE__ );
50               
51                require_once $mydirpath.'/include/xpress_block_render.php';
52                return xpress_block_render($mydirname,$block_function_name,$options);
53        }
54}
55?>
Note: See TracBrowser for help on using the repository browser.