XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/blocks/enhanced_block.php @ 521

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

拡張ブロックでNoticeが発生するバグ修正 (thx ky982339) Fixes #290

File size: 1.7 KB
RevLine 
[138]1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_enhanced_show($options){
7        return _b_enhanced_show($options) ;
8}
9function b_'.$mydirname.'_enhanced_edit($options){
10        return _b_enhanced_edit($options) ;
11}
12' ) ;
13
[195]14if( ! defined( 'XPRESS_ENHANCED_BLOCK_INCLUDED' ) ) {
15        define( 'XPRESS_ENHANCED_BLOCK_INCLUDED' , 1 ) ;
[138]16       
17        function _b_enhanced_edit($options)
18        {
19                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
20                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_enhanced_block.html' : trim( $options[1] );
21                $include_file = empty( $options[2] ) ? '' : $options[2] ;
22               
[484]23                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
[138]24
[495]25                $form  = javascript_check();
26                $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
[484]27                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
[138]28                $form .= "<br />";
[183]29                $form .= _MB_XP2_ENHACED_FILE .":<br />\n";
[484]30                $form .= '&emsp;' . _MB_XP2_FILE_NAME . ": <b>my_</b><input type='text' name='options[2]' value='" . $include_file . "' /><b>_block.php</b><br>\n";
[183]31                $form .= '&emsp;' . _MB_XP2_MAKE_ENHACED_FILE . "<br>\n";
[138]32                return $form;
33        }
34       
35        function _b_enhanced_show($options)
36        {
37                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
38                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
39                $block_function_name = basename( __FILE__ );
40               
41                require_once $mydirpath.'/include/xpress_block_render.php';
42                return xpress_block_render($mydirname,$block_function_name,$options);
43        }
44       
45}
46
47?>
Note: See TracBrowser for help on using the repository browser.