[10938] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | global $template,$conf; |
---|
| 5 | $me = get_plugin_data($plugin_id); |
---|
| 6 | include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); |
---|
| 7 | |
---|
| 8 | // delete conf for deleted themes (but not for deactivated themes) |
---|
| 9 | foreach ($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 | |
---|
| 17 | |
---|
| 18 | $template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/admin/admin.tpl') ); |
---|
| 19 | $template->assign("RH_VERSION",RH_VERSION); |
---|
| 20 | $template->assign("RH_confpanel",realpath( dirname(__FILE__).'/admin/rh_theme_conf.tpl')); |
---|
| 21 | $template->append('head_elements','<link rel="stylesheet" type="text/css" href="'.RH_PATH.'admin/admin.css" />'); |
---|
| 22 | $rhthemes = new themes(); |
---|
| 23 | $rh_vierge=0; |
---|
| 24 | |
---|
| 25 | foreach (get_pwg_themes() as $pwg_templateID => $pwg_template) { |
---|
| 26 | if (isset($_POST['submit'])) { |
---|
| 27 | $me->rh_config[$pwg_templateID]['selected_cat'] = $_POST[$pwg_templateID.'selected_cat']; |
---|
| 28 | $me->rh_config[$pwg_templateID]['active_on_picture'] = (isset( $_POST[$pwg_templateID.'active_on_picture'] )) ? $_POST[$pwg_templateID.'active_on_picture'] : 'off' ; |
---|
| 29 | $me->rh_config[$pwg_templateID]['concat_before'] = (isset( $_POST[$pwg_templateID.'concat_before'] )) ? $_POST[$pwg_templateID.'concat_before'] : 'off' ; |
---|
| 30 | $me->rh_config[$pwg_templateID]['concat_after'] = (isset( $_POST[$pwg_templateID.'concat_after'] )) ? $_POST[$pwg_templateID.'concat_after'] : 'off' ; |
---|
| 31 | $me->rh_config[$pwg_templateID]['head_css'] = $_POST[$pwg_templateID.'head_css']; |
---|
| 32 | $me->rh_config[$pwg_templateID]['img_css'] = $_POST[$pwg_templateID.'img_css']; |
---|
| 33 | $me->rh_config[$pwg_templateID]['mode_background'] = (isset( $_POST[$pwg_templateID.'mode_background'] )) ? $_POST[$pwg_templateID.'mode_background'] : 'off' ; |
---|
| 34 | $me->rh_config[$pwg_templateID]['root_link'] = (isset( $_POST[$pwg_templateID.'root_link'] )) ? $_POST[$pwg_templateID.'root_link'] : 'off' ; |
---|
| 35 | $me->save_config(); |
---|
| 36 | |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | $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'; |
---|
| 40 | $rhthemboxclass=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? 'themeDefault' : ''; |
---|
| 41 | $rh_vierge=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? $rh_vierge+1 : $rh_vierge; |
---|
| 42 | $template->append('rhthemes', array( |
---|
| 43 | 'CURRENT_THEME_NAME'=> $pwg_template, |
---|
| 44 | 'CURRENT_THEME_ID' => $pwg_templateID, |
---|
| 45 | 'ACTIVE_ON_PICTURE' => ($me->rh_config[$pwg_templateID]['active_on_picture']=='on') ? 'checked' : '', |
---|
| 46 | 'MODE_BACKGROUND' => ($me->rh_config[$pwg_templateID]['mode_background']=='on') ? 'checked' : '', |
---|
| 47 | 'CONCAT_BEFORE' => ($me->rh_config[$pwg_templateID]['concat_before']=='on') ? 'checked' : '', |
---|
| 48 | 'CONCAT_AFTER' => ($me->rh_config[$pwg_templateID]['concat_after']=='on') ? 'checked' : '', |
---|
| 49 | 'ROOT_LINK' => ($me->rh_config[$pwg_templateID]['root_link']=='on') ? 'checked' : '', |
---|
| 50 | 'HEAD_CSS' => $me->rh_config[$pwg_templateID]['head_css'], |
---|
| 51 | 'IMG_CSS' => $me->rh_config[$pwg_templateID]['img_css'], |
---|
| 52 | 'CATSELECTED' => $me->rh_config[$pwg_templateID]['selected_cat'], |
---|
| 53 | 'SCREENSHOT_URL' => $rhscreenshot, |
---|
| 54 | 'THEMEBOXCLASS' => $rhthemboxclass |
---|
| 55 | )); |
---|
| 56 | } |
---|
| 57 | $template->assign('rh_vierge',$rh_vierge); |
---|
| 58 | display_select_cat_wrapper( |
---|
| 59 | 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE, |
---|
| 60 | array(), |
---|
| 61 | 'categories' |
---|
| 62 | ); |
---|
| 63 | |
---|
| 64 | load_language('plugin.lang', RH_PATH); |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 69 | ?> |
---|