XPressME Integration Kit

Trac


Ignore:
Timestamp:
Dec 15, 2008, 2:09:03 PM (15 years ago)
Author:
toemon
Message:

サイドバー表示・非表示設定機能の実装 r10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/xpress_render.php

    r1 r26  
    3535} 
    3636 
     37// get sidebar rendaring  
     38function get_sidebar_rander($name = null) 
     39{ 
     40        $templates = array(); 
     41        if ( isset($name) ) 
     42                $templates[] = "sidebar-{$name}.php"; 
     43 
     44        $templates[] = "sidebar.php"; 
     45 
     46        $link= locate_template($templates, false); 
     47        if ('' == $link) 
     48                $link =  get_theme_root() . '/default/sidebar.php'; 
     49 
     50        ob_start(); 
     51                require($link); 
     52                $sidebar = ob_get_contents(); 
     53        ob_end_clean(); 
     54        return $sidebar; 
     55} 
     56 
    3757// < body > tag is pulled out from the header of html contents.  
    3858function get_body($contents) 
    3959{ 
     60        $xpess_config = new XPressME_Class(); 
    4061        $pattern = "<body[^>]*?>(.*)<\/body>"; 
    4162        preg_match("/".$pattern."/s",  $contents, $body_matches); 
    4263        $body = $body_matches[1]; 
     64 
     65        if (!$xpess_config->is_theme_sidebar_disp){ 
     66                $side_panel = get_sidebar_rander(); 
     67                        $body = str_replace($side_panel,'',$body); 
     68        } 
    4369        return $body; 
    4470} 
Note: See TracChangeset for help on using the changeset viewer.