Plugin Directory

Changeset 559312


Ignore:
Timestamp:
06/17/2012 06:55:44 AM (14 years ago)
Author:
technosis
Message:

finish theme scanning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • templ33t/branches/01_02_handling_posts/templ33t_object.php

    r559299 r559312  
    490490    }
    491491
    492     function parseTheme($theme = null) {
     492    function parseTheme($theme = null, $orig = array()) {
    493493       
    494494        $themes = get_themes();
    495495        $theme = get_theme_data(get_theme_root() . '/' . $theme . '/style.css');
    496496       
    497         print_r($themes[$theme['Name']]);
    498        
    499         $home = locate_template('home.php');
    500         $page = locate_template('page.php');
     497        $templates = array();
     498       
     499        $templates[] = locate_template('home.php');
     500        $templates[] = locate_template('page.php');
     501        $templates[] = locate_template('posts.php');
     502        $templates[] = locate_template('single.php');
     503       
    501504        $custom = get_page_templates();
    502         $posts = locate_template('posts.php');
    503         $single = locate_template('single.php');
    504        
    505         echo 'HOME: '.$home.'<br/>'
    506             . 'PAGE: '.$page.'<br/>'
    507             . 'CUSTOM: '.print_r($custom, true).'<br/>'
    508             . 'POSTS: '.$posts.'<br/>'
    509             . 'SINGLE: '.$single.'<br/>';
    510        
     505       
     506        foreach($custom as $temp) {
     507            $templates[] = $temp;
     508        }
     509       
     510        $config = array();
     511       
     512        foreach($templates as $temp) {
     513           
     514            $temp = basename($temp);
     515           
     516            if(!empty($temp) && !array_key_exists($temp)) {
     517               
     518                if(array_key_exists($temp, $orig)) {
     519                   
     520                    $config[$temp] = $this->parseTemplate(get_theme_root() . '/' . $theme . '/' . $temp, $theme, $orig[$temp]);
     521                   
     522                } else {
     523                   
     524                    $config[$temp] = $this->parseTemplate(get_theme_root() . '/' . $theme . '/' . $temp, $theme);
     525                   
     526                }
     527               
     528            }
     529           
     530        }
     531       
     532        print_r($config);
    511533        die();
    512534       
     535        return $config;
    513536       
    514537       
     
    18011824
    18021825                        // get templates
    1803                         $templates = $this->parseTheme($theme);
     1826                        $templates = $this->parseTheme($theme, $compare);
    18041827
    18051828                        if ($compare != $templates) {
Note: See TracChangeset for help on using the changeset viewer.