Ignore:
Timestamp:
Mar 7, 2010, 3:24:02 PM (14 years ago)
Author:
vdigital
Message:

New feature: Template modeling to reduce coding efforts when you want to create a new template.

File:
1 edited

Legend:

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

    r5014 r5071  
    9797  /**
    9898   * Sets the template root directory for this Template object.
     99   * Revised from Piwigo 2.1 to add modeling support
    99100   */
    100101  function set_template_dir($dir)
    101102  {
    102     $this->smarty->template_dir = $dir;
    103 
     103        if (!defined('IN_ADMIN'))
     104        { // Modeling is active only on gallery side and never in admin
     105          // Set the normal directory
     106      $this->smarty->template_dir = array($dir);
     107          // Modeling by theme parameter
     108          $modeling = './template/' . $this->get_themeconf('modeling');
     109      if ( $modeling != './template/' and is_dir($modeling))
     110          {
     111                $this->smarty->template_dir[] = $modeling;
     112      }
     113          // Default template directory
     114          $this->smarty->template_dir[] = './template-common/yoga';
     115        }
     116    else
     117        {
     118      $this->smarty->template_dir = $dir;
     119        }
    104120    $real_dir = realpath($dir);
    105121    $compile_id = crc32( $real_dir===false ? $dir : $real_dir);
Note: See TracChangeset for help on using the changeset viewer.