Show
Ignore:
Timestamp:
03/29/10 15:30:02 (3 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)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/themes.class.php

    r5382 r5446  
    7171    } 
    7272 
     73    $file_to_include = PHPWG_THEMES_PATH.'/'.$theme_id.'/admin/maintain.inc.php'; 
     74 
    7375    $errors = array(); 
    7476 
     
    101103          break; 
    102104        } 
    103          
    104         $query = " 
     105 
     106        if (file_exists($file_to_include)) 
     107        { 
     108          include($file_to_include); 
     109          if (function_exists('theme_activate')) 
     110          { 
     111            theme_activate($theme_id, $this->fs_themes[$theme_id]['version'], $errors); 
     112          } 
     113        } 
     114 
     115        if (empty($errors)) 
     116        { 
     117          $query = " 
    105118INSERT INTO ".THEMES_TABLE." 
    106119  SET id = '".$theme_id."' 
     
    108121    , name = '".$this->fs_themes[$theme_id]['name']."' 
    109122;"; 
    110         pwg_query($query); 
     123          pwg_query($query); 
     124        } 
    111125        break; 
    112126 
     
    151165          $this->set_default_theme($new_theme); 
    152166        } 
    153          
     167 
     168        if (file_exists($file_to_include)) 
     169        { 
     170          include($file_to_include); 
     171          if (function_exists('theme_deactivate')) 
     172          { 
     173            theme_deactivate($theme_id); 
     174          } 
     175        } 
     176 
    154177        $query = " 
    155178DELETE 
     
    375398              ; 
    376399          } 
    377            
     400 
     401          $admin_file = $path.'/admin/admin.inc.php'; 
     402          if (file_exists($admin_file)) 
     403          { 
     404            $theme['admin_uri'] = get_root_url().'admin.php?page=theme&theme='.$file; 
     405          } 
     406 
    378407          // IMPORTANT SECURITY ! 
    379408          $theme = array_map('htmlspecialchars', $theme);