Changeset 5153 for trunk/include


Ignore:
Timestamp:
Mar 17, 2010, 1:48:38 AM (14 years ago)
Author:
plg
Message:

feature 1514: new screen to manage installed themes; activate, deactivate,
delete, set as default.

plugins.class.php was merged back to a state it doesn't manage themes at all.
themes.class.php was created instead, from a duplication of plugins.class.php
and strongly modified then.

feature 1507: the display of available themes is now much more "graphic".

Location:
trunk/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_default.inc.php

    r5138 r5153  
    769769// where should the user be guided when there is no photo in his gallery yet?
    770770$conf['no_photo_yet_url'] = 'admin.php?page=photos_add';
     771
     772// directory with themes inside
     773$conf['themes_dir'] = PHPWG_ROOT_PATH.'themes';
    771774?>
  • trunk/include/constants.php

    r5014 r5153  
    2525define('PHPWG_VERSION', 'Colibri');
    2626define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
    27 define('PHPWG_DEFAULT_TEMPLATE', 'yoga/Sylvia');
     27define('PHPWG_DEFAULT_TEMPLATE', 'Sylvia');
     28
     29define('PHPWG_THEMES_PATH', $conf['themes_dir'].'/');
    2830
    2931// Required versions
     
    98100if (!defined('OLD_PERMALINKS_TABLE'))
    99101  define('OLD_PERMALINKS_TABLE', $prefixeTable.'old_permalinks');
     102if (!defined('THEMES_TABLE'))
     103  define('THEMES_TABLE', $prefixeTable.'themes');
    100104
    101105?>
  • trunk/include/functions.inc.php

    r5138 r5153  
    714714function get_pwg_themes()
    715715{
    716   global $conf;
    717716  $themes = array();
    718717
    719   $template_dir = PHPWG_ROOT_PATH.'themes';
    720 
    721   foreach (get_dirs($template_dir) as $theme)
    722   {
    723     if ( $theme != 'default' )
    724           {
    725       array_push($themes, $theme);
    726           }
     718  $query = '
     719SELECT
     720    id,
     721    name
     722  FROM '.THEMES_TABLE.'
     723  ORDER BY name ASC
     724;';
     725  $result = pwg_query($query);
     726  while ($row = pwg_db_fetch_assoc($result))
     727  {
     728    $themes[ $row['id'] ] = $row['name'];
    727729  }
    728730
    729731  // plugins want remove some themes based on user status maybe?
    730732  $themes = trigger_event('get_pwg_themes', $themes);
     733 
    731734  return $themes;
    732735}
Note: See TracChangeset for help on using the changeset viewer.