Changeset 5340


Ignore:
Timestamp:
03/25/10 11:08:33 (10 years ago)
Author:
plg
Message:

improvement: dynamically activate all installed themes (with checks on
parent availability and so on).

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_install.inc.php

    r5239 r5340  
    124124  return $engines; 
    125125} 
     126 
     127/** 
     128 * Automatically activate all themes in the "themes" directory. 
     129 * 
     130 * @return void 
     131 */ 
     132function activate_all_themes() 
     133{ 
     134  include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 
     135  $themes = new themes(); 
     136  foreach ($themes->fs_themes as $theme_id => $fs_theme) 
     137  { 
     138    $themes->perform_action('activate', $theme_id); 
     139  } 
     140} 
    126141?> 
  • trunk/admin/include/themes.class.php

    r5259 r5340  
    7979        { 
    8080          // the theme is already active 
     81          break; 
     82        } 
     83 
     84        if ('default' == $theme_id) 
     85        { 
     86          // you can't activate the "default" theme 
    8187          break; 
    8288        } 
  • trunk/install.php

    r5266 r5340  
    377377    load_conf_from_db(); 
    378378 
     379    // PWG_CHARSET is required for building the fs_themes array in the 
     380    // themes class 
     381    define('PWG_CHARSET', $pwg_charset); 
     382    activate_all_themes(); 
     383 
    379384    $insert = array( 
    380385      'id' => 1, 
  • trunk/install/config.sql

    r5328 r5340  
    5252    'Information displayed on picture page' 
    5353  ); 
    54  
    55 INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia'); 
    56 INSERT INTO piwigo_themes (id, name) VALUES ('clear', 'clear'); 
    57 INSERT INTO piwigo_themes (id, name) VALUES ('dark', 'dark'); 
Note: See TracChangeset for help on using the changeset viewer.