Ignore:
Timestamp:
Oct 23, 2010, 10:53:37 PM (13 years ago)
Author:
repie38
Message:

moved conf file to db (_config table)
small fix on admin panel
new maintain procedures including upgrade from 2.1 or earlier (get conf from file and delete it)
deleted themes conf is no more stocked

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Random_Header/admin/rh_admin.php

    r7330 r7358  
    66include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
    77
     8// delete conf for deleted themes (but not for deactivated themes)
     9foreach ($me->rh_config as $theme_in_rh_conf => $test) {
     10        if (!file_exists($conf['themes_dir'].'/'.$theme_in_rh_conf.'/'.'themeconf.inc.php')) {
     11                unset($me->rh_config[$theme_in_rh_conf]);
     12        }
     13}
     14$me->save_config();
     15
     16
    817
    918$template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/rh_admin.tpl') );
     19$template->assign("RH_VERSION",RH_VERSION);
     20$template->assign("RH_confpanel",realpath( dirname(__FILE__).'/rh_theme_conf.tpl'));
    1021$rhthemes = new themes();
    11 
     22$rh_vierge=0;
    1223
    1324foreach (get_pwg_themes() as  $pwg_templateID => $pwg_template) {
     
    2132                $me->rh_config[$pwg_templateID]['mode_background']              = (isset( $_POST[$pwg_templateID.'mode_background'] )) ? $_POST[$pwg_templateID.'mode_background'] : 'off' ;
    2233                $me->save_config();
     34               
    2335        }
    2436       
    2537        $rhscreenshot=(file_exists(PHPWG_THEMES_PATH.$pwg_templateID . '/screenshot.png')) ? PHPWG_THEMES_PATH.$pwg_templateID . '/screenshot.png' : PHPWG_ROOT_PATH.'admin/themes/'.$conf['admin_theme'].'/images/missing_screenshot.png';
    26     $rhthemboxclass=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? 'themeDefault' : 'toto';     
    27        
     38    $rhthemboxclass=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? 'themeDefault' : '';     
     39        $rh_vierge=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? $rh_vierge+1 : $rh_vierge;
    2840        $template->append('rhthemes', array(
    2941                                'CURRENT_THEME_NAME'=> $pwg_template,
     
    4052                                ));
    4153}
    42 
     54$template->assign('rh_vierge',$rh_vierge);
    4355display_select_cat_wrapper(
    4456          'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE,
Note: See TracChangeset for help on using the changeset viewer.