Ignore:
Timestamp:
Dec 3, 2005, 6:33:38 PM (18 years ago)
Author:
chrisaga
Message:

improve template : split theme from template itself

rest of the job : template (yoga), themes (clear dark), and php to handle them

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include

    • Property svn:ignore
      •  

        old new  
        11mysql.inc.php
         2config_local.inc.php
  • trunk/include/functions.inc.php

    r894 r960  
    534534
    535535/**
    536  * returns available templates
     536 * returns available templates/themes
    537537 */
    538538function get_templates()
    539539{
    540   return get_dirs(PHPWG_ROOT_PATH.'template');
     540  return get_dirs(PHPWG_ROOT_PATH.'theme');
     541}
     542function get_themes()
     543{
     544  $themes = array();
     545
     546  foreach (get_dirs(PHPWG_ROOT_PATH.'template') as $template)
     547  {
     548    foreach (get_dirs(PHPWG_ROOT_PATH.'template/'.$template.'/theme') as $theme)
     549    {
     550      array_push($themes, $template.'/'.$theme);
     551    }
     552  }
     553
     554  return $themes;
    541555}
    542556
     
    566580  else
    567581  {
    568     $src = PHPWG_ROOT_PATH;
    569     $src.= 'template/'.$user['template'].'/mimetypes/';
     582    $src = get_themeconf('mime_icon_dir');
    570583    $src.= strtolower(get_extension($path)).'.png';
    571584  }
     
    727740  return isset($lang[$key]) ? $lang[$key] : $key;
    728741}
     742
     743/**
     744 * returns the corresponding value from $themeconf if existing. Else, the key is
     745 * returned
     746 *
     747 * @param string key
     748 * @return string
     749 */
     750function get_themeconf($key)
     751{
     752  global $themeconf;
     753
     754  return $themeconf[$key];
     755}
    729756?>
Note: See TracChangeset for help on using the changeset viewer.