Dotclear

Changeset 2541:10f7fb5a782a


Ignore:
Timestamp:
11/13/13 14:22:39 (12 years ago)
Author:
Dsls
Branch:
default
Message:

Introducing tplset. default templates now become "legacy" tplset. Closes #1216

Location:
inc
Files:
2 edited
19 moved

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.themes.php

    r2492 r2541  
    2222*/ 
    2323class dcThemes extends dcModules 
    24 {     
     24{ 
    2525     protected static $type = 'theme'; 
    2626 
     
    2828     This method registers a theme in modules list. You should use this to 
    2929     register a new theme. 
    30       
     30 
    3131     <var>$parent</var> is a optional value to indicate them inheritance. 
    32      If <var>$parent</var> is null / not set, we simply fall back to  
     32     If <var>$parent</var> is null / not set, we simply fall back to 
    3333     the standard behavior, by using 'default'. 
    34       
     34 
    3535     <var>$priority</var> is an integer. Modules are sorted by priority and name. 
    3636     Lowest priority comes first. This property is currently ignored when dealing 
    3737     with themes. 
    38       
     38 
    3939     @param    name           <b>string</b>       Module name 
    4040     @param    desc           <b>string</b>       Module description 
    4141     @param    author         <b>string</b>       Module author name 
    4242     @param    version        <b>string</b>       Module version 
    43      @param    properties     <b>array</b>        extra properties  
     43     @param    properties     <b>array</b>        extra properties 
    4444     (currently available keys : parent, priority, standalone_config, type) 
    4545     */ 
     
    5959          # Themes specifics properties 
    6060          $properties = array_merge( 
    61                array('parent' => null), 
     61               array('parent' => null, 'tplset' => 'legacy'), 
    6262               $properties, 
    6363               array('permissions' => 'admin') // force themes perms 
     
    6565 
    6666          parent::registerModule($name, $desc, $author, $version, $properties); 
    67      }     
    68       
     67     } 
     68 
    6969     /** 
    7070     Loads namespace <var>$ns</var> specific file for module with ID 
    7171     <var>$id</var> 
    7272     Note : actually, only 'public' namespace is supported with themes. 
    73       
     73 
    7474     @param    id        <b>string</b>       Module ID 
    7575     @param    ns        <b>string</b>       Namespace name 
  • inc/public/prepend.php

    r1949 r2541  
    101101     } 
    102102} 
    103       
     103 
    104104# If theme doesn't exist, stop everything 
    105105if (!$core->themes->moduleExists($__theme)) { 
     
    134134     $__theme_tpl_path[] = $core->blog->themes_path.'/'.$__parent_theme.'/tpl'; 
    135135} 
    136  
    137 $core->tpl->setPath( 
    138      $__theme_tpl_path, 
    139      dirname(__FILE__).'/default-templates', 
    140      $core->tpl->getPath()); 
    141  
     136$tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 
     137if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 
     138     $core->tpl->setPath( 
     139          $__theme_tpl_path, 
     140          dirname(__FILE__).'/default-templates/'.$tplset, 
     141          $core->tpl->getPath()); 
     142} else { 
     143     $core->tpl->setPath( 
     144          $__theme_tpl_path, 
     145          $core->tpl->getPath()); 
     146} 
    142147$core->url->mode = $core->blog->settings->system->url_scan; 
    143148 
     
    145150     # --BEHAVIOR-- publicBeforeDocument 
    146151     $core->callBehavior('publicBeforeDocument',$core); 
    147       
     152 
    148153     $core->url->getDocument(); 
    149       
     154 
    150155     # --BEHAVIOR-- publicAfterDocument 
    151156     $core->callBehavior('publicAfterDocument',$core); 
     
    155160          ,660); 
    156161} 
    157 ?> 
     162 
Note: See TracChangeset for help on using the changeset viewer.

Sites map