XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php @ 448

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

ブロックのバージョン管理実装 Fixes #246

File size: 3.5 KB
Line 
1<?php
2// Block Version: 1.0
3function meta_block($options)
4{
5        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
6        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_meta.html' : trim( $options[1] );
7        $wp_link = empty( $options[2] ) ? false : true ;
8        $xoops_link = empty( $options[3] ) ? false : true ;
9        $post_rss = empty( $options[4] ) ? false : true ;
10        $comment_rss = empty( $options[5] ) ? false : true ;
11        $post_new = empty( $options[6] ) ? false : true ;
12        $admin_edit = empty( $options[7] ) ? false : true ;
13        $readme = empty( $options[8] ) ? false : true ;
14        $ch_style = empty( $options[9] ) ? false : true ;
15       
16        $output ="<ul>\n";
17       
18        if ($wp_link){
19                $output .= '<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform." target="_blank">WordPress</a></li>';
20        }
21        if ($xoops_link){
22                $output .= '<li><a href="http://xoopscube.sourceforge.net/" title="Powered by XOOPS Cube, state-of-the-art Content Management Portal." target="_blank">XOOPS cube</a></li>';
23        }
24        if ($post_rss){
25                $output .= '<li><a href="'.get_bloginfo('rss2_url').'" title="'. __('Posts RSS', 'xpress') .'">'. __('Posts RSS', 'xpress') .'</a></li>';
26        }
27        if ($comment_rss){     
28                $output .= '<li><a href="'.get_bloginfo('comments_rss2_url').'" title="'. __('Comments RSS', 'xpress') .'">'. __('Comments RSS', 'xpress') .'</a></li>';
29        }
30
31        if (is_user_logged_in()) {
32                global $current_user;
33
34                $Now_user_level = $current_user->user_level;
35               
36                if ($post_new){
37                        if($Now_user_level > 0){
38                                if (xpress_is_wp_version('<','2.1') ){
39                                        $output .=
40                                        '<li>'.
41                                        '<a href="'.get_settings('siteurl').'/wp-admin/post.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
42                                        '</li>';
43                                } else {
44                                        $output .=
45                                        '<li>'.
46                                        '<a href="'.get_settings('siteurl').'/wp-admin/post-new.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
47                                        '</li>';
48                                }
49                        }
50                }
51                if ($admin_edit){
52                        if($Now_user_level > 7){
53                                $output .=     
54                                '<li>'.
55                                '<a href="'.get_settings('siteurl').'/wp-admin/" title="'. __('Site Admin', 'xpress') .'">'. __('Site Admin', 'xpress') .'</a>'.
56                                '</li>';
57                        }
58                }
59                $output .=
60                                '<li>'.
61                                '<a href="'.get_settings('siteurl').'/wp-admin/profile.php" title="' . __('User Profile', 'xpress') .'">'. __('User Profile', 'xpress') .'</a>'.
62                                '</li>';                               
63               
64
65                if (defined('S2VERSION')){
66                        if($Now_user_level > 7){
67                                        $output .=
68                                        '<li>'.
69                                        '<a href="'.get_settings('siteurl').'/wp-admin/users.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
70                                        '</li>';
71                        } else {
72                                        $output .=
73                                        '<li>'.
74                                        '<a href="'.get_settings('siteurl').'/wp-admin/profile.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
75                                        '</li>';
76                        }
77                }
78                       
79        }
80       
81        if ($readme){
82                $output .='<li>'.'<a href="'.get_settings('siteurl').'/readme.html" title="' .  __('ReadMe', 'xpress') . '">' . __('ReadMe', 'xpress') . '</a>'.'</li>';
83        }
84        $output .= disp_mode_set();
85        if (function_exists('wp_theme_switcher') ) {
86                ob_start();
87                        echo '<li>' . __('Themes') . ':';
88                        wp_theme_switcher('dropdown');
89                        echo '</li>';
90                        $output .= ob_get_contents();
91                ob_end_clean();
92        }
93        $output .= '</ul>';
94        $block['meta_info'] = $output;
95        return $block ;
96}
97?>
Note: See TracBrowser for help on using the repository browser.