XPressME Integration Kit

Trac

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

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

MultiBlog用にブログリストブロックを追加 Fixes #297

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.'_blog_list_show($options){
7        return _b_blog_list_show($options) ;
8}
9function b_'.$mydirname.'_blog_list_edit($options){
10        return _b_blog_list_edit($options) ;
11}
12' ) ;           
13       
14if( ! defined( 'XPRESS_BLOG_LIST_BLOCK_INCLUDED' ) ) {
15        define( 'XPRESS_BLOG_LIST_BLOCK_INCLUDED' , 1 ) ;
16
17        function _b_blog_list_edit($options)
18        {
19
20                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
21                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_blog_list_block.html' : trim( $options[1] );
22                $orderby = empty( $options[2] ) ? 'name' : $options[2] ;
23                $order = empty( $options[3] ) ? 'ASC' : $options[3] ;
24               
25                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');       
26
27                $form  = javascript_check();
28                $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
29                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
30                $form .= "<br />";
31                $form .= _MB_XP2_BLOG_ORDERBY .": ";
32                $form .=  "<select name='options[2]'>";
33                if ($orderby =='name')
34                        $form .=  "<option value='name' selected='selected'>". _MB_XP2_BLOG_NAME;
35                else
36                        $form .=  "<option value='name'>". _MB_XP2_BLOG_NAME;
37                if ($orderby =='count')
38                        $form .=  "<option value='count' selected='selected'>". _MB_XP2_BLOG_COUNT;
39                else
40                        $form .=  "<option value='count'>". _MB_XP2_BLOG_COUNT;
41                if ($orderby =='ID')
42                        $form .=  "<option value='ID' selected='selected'>". _MB_XP2_BLOG_ID;
43                else
44                        $form .=  "<option value='ID'>". _MB_XP2_BLOG_ID;
45                $form .=  "</select><br/>";
46               
47                $form .= _MB_XP2_SORT_ORDER .": ";
48                $form .=  "<select name='options[3]'>";
49                if ($order =='ASC')
50                        $form .=  "<option value='ASC' selected='selected'>" . _MB_XP2_SORT_ASC;
51                else
52                        $form .=  "<option value='ASC'>" . _MB_XP2_SORT_ASC;
53                if ($order =='DESC')
54                        $form .=  "<option value='DESC' selected='selected'>" . _MB_XP2_SORT_DESC;
55                else
56                        $form .=  "<option value='DESC'>" . _MB_XP2_SORT_DESC;
57                $form .=  "</select><br/>";
58               
59                return $form;
60        }
61       
62        function _b_Blog_list_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}
73
74?>
Note: See TracBrowser for help on using the repository browser.