XPressME Integration Kit

Trac

source: branches/Ver2.4/xpressme_integration_kit/blocks/meta_block.php @ 829

Last change on this file since 829 was 495, checked in by toemon, 14 years ago

ブロックオプションでjavascriptの有効性チェック Fixes #274

File size: 2.5 KB
Line 
1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_meta_show($options){
7        return _b_meta_show($options) ;
8}
9function b_'.$mydirname.'_meta_edit($options){
10        return _b_meta_edit($options) ;
11}
12' ) ;           
13       
14if( ! defined( 'XPRESS_META_BLOCK_INCLUDED' ) ) {
15        define( 'XPRESS_META_BLOCK_INCLUDED' , 1 ) ;
16
17        function _b_meta_edit($options)
18        {
19                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
20                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_meta_block.html' : trim( $options[1] );
21                $wp_link = empty( $options[2] ) ? false : true ;
22                $xoops_link = empty( $options[3] ) ? false : true ;
23                $post_rss = empty( $options[4] ) ? false : true ;
24                $comment_rss = empty( $options[5] ) ? false : true ;
25                $post_new = empty( $options[6] ) ? false : true ;
26                $admin_edit = empty( $options[7] ) ? false : true ;
27                $readme = empty( $options[8] ) ? false : true ;
28                $ch_style = empty( $options[9] ) ? false : true ;
29               
30                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');       
31
32                $form  = javascript_check();
33                $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
34                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
35                $form .= "<br />";
36                $form .= yes_no_radio_option('options[2]', _MB_XP2_META_WP_LINK , $wp_link) . "<br />\n";
37                $form .= yes_no_radio_option('options[3]', _MB_XP2_META_XOOPS_LINK , $xoops_link) . "<br />\n";
38                $form .= yes_no_radio_option('options[4]', _MB_XP2_META_POST_RSS , $post_rss) . "<br />\n";
39                $form .= yes_no_radio_option('options[5]', _MB_XP2_META_COMMENT_RSS , $comment_rss) . "<br />\n";
40                $form .= yes_no_radio_option('options[6]', _MB_XP2_META_POST_NEW , $post_new) . "<br />\n";
41                $form .= yes_no_radio_option('options[7]', _MB_XP2_META_ADMIN , $admin_edit) . "<br />\n";
42                $form .= yes_no_radio_option('options[8]', _MB_XP2_META_README , $readme) . "<br />\n";
43                $form .= yes_no_radio_option('options[9]', _MB_XP2_META_CH_STYLE , $ch_style) . "\n";
44           
45                return $form;
46        }
47       
48        function _b_meta_show($options)
49        {
50                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
51                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
52                $block_function_name = basename( __FILE__ );
53               
54                require_once $mydirpath.'/include/xpress_block_render.php';
55                return xpress_block_render($mydirname,$block_function_name,$options);
56        }
57}
58
59?>
Note: See TracBrowser for help on using the repository browser.