Changeset 5446 for trunk/include


Ignore:
Timestamp:
Mar 29, 2010, 3:30:02 PM (14 years ago)
Author:
patdenice
Message:

feature 1502: Allow to have configuration page for each theme.css.
About string for theme has to be saved in language theme directory (about.html)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r5434 r5446  
    9595    $this->set_template_dir($root.'/'.$theme.'/'.$path);
    9696
    97     include($root.'/'.$theme.'/themeconf.inc.php');
     97    $themeconf = $this->load_themeconf($root.'/'.$theme);
    9898
    9999    if (isset($themeconf['parent']) and $themeconf['parent'] != $theme)
     
    574574    return $source;
    575575  }
     576
     577  function load_themeconf($dir)
     578  {
     579    global $themeconfs, $conf, $page;
     580
     581    $dir = realpath($dir);
     582    if (!isset($themeconfs[$dir]))
     583    {
     584      $themeconf = array();
     585      include($dir.'/themeconf.inc.php');
     586      // Put themeconf in cache
     587      $themeconfs[$dir] = $themeconf;
     588    }
     589    return $themeconfs[$dir];
     590  }
    576591}
    577592
Note: See TracChangeset for help on using the changeset viewer.