XPressME Integration Kit

Trac

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

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

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

File size: 619 bytes
Line 
1<?php
2// Block Version: 1.0
3function sidebar_block($options)
4{
5        $templates = array();
6        $templates[] = "sidebar.php";
7        $sidebar_path = locate_template($templates, false);
8        if (empty($sidebar_path)){ // ktai_style plugin is empty
9                $sidebar_path = dirname(dirname(__FILE__)) . "/sidebar.php";
10        }
11        ob_start();
12                require($sidebar_path);
13                $output = ob_get_contents();
14        ob_end_clean();
15        $pattern = '<div\s+id\s*=\s*["\']xpress_sidebar["\']\s*>';
16        $output = preg_replace("/".$pattern."/s" , '<div class="xpress_sidebar_block">' , $output);
17
18        $block['sidebar'] = $output;                                                           
19        return $block ;
20
21}
22
23?>
Note: See TracBrowser for help on using the repository browser.