source: extensions/Random_Header/admin/rh_admin.php @ 7401

Last change on this file since 7401 was 7401, checked in by repie38, 13 years ago

Case sensitive url for admin css in some environement.
added anti-hack method in maintain.inc.php

File size: 3.4 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4global $template,$conf;
5$me = get_plugin_data($plugin_id);
6include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
7
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
17
18$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'));
21$template->append('head_elements','<link rel="stylesheet" type="text/css" href="'.RH_PATH.'admin/rh_admin.css" />');
22$rhthemes = new themes();
23$rh_vierge=0;
24
25foreach (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->save_config();
35               
36        }
37       
38        $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';
39    $rhthemboxclass=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? 'themeDefault' : '';     
40        $rh_vierge=($me->rh_config[$pwg_templateID]['selected_cat']!=0) ? $rh_vierge+1 : $rh_vierge;
41        $template->append('rhthemes', array(
42                                'CURRENT_THEME_NAME'=> $pwg_template,
43                                'CURRENT_THEME_ID'      => $pwg_templateID,
44                                'ACTIVE_ON_PICTURE' => ($me->rh_config[$pwg_templateID]['active_on_picture']=='on') ? 'checked' : '',
45                                'MODE_BACKGROUND'       => ($me->rh_config[$pwg_templateID]['mode_background']=='on') ? 'checked' : '',
46                                'CONCAT_BEFORE'         => ($me->rh_config[$pwg_templateID]['concat_before']=='on') ? 'checked' : '',
47                                'CONCAT_AFTER'          => ($me->rh_config[$pwg_templateID]['concat_after']=='on') ? 'checked' : '',
48                                'HEAD_CSS'                      =>  $me->rh_config[$pwg_templateID]['head_css'],
49                                'IMG_CSS'                       =>  $me->rh_config[$pwg_templateID]['img_css'],
50                                'CATSELECTED'           =>  $me->rh_config[$pwg_templateID]['selected_cat'],
51                                'SCREENSHOT_URL'        =>      $rhscreenshot,
52                                'THEMEBOXCLASS'         =>      $rhthemboxclass
53                                ));
54}
55$template->assign('rh_vierge',$rh_vierge);
56display_select_cat_wrapper(
57          'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE,
58          array(),
59          'categories'
60          );
61         
62load_language('plugin.lang', RH_PATH);
63
64 
65 
66$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
67?>
Note: See TracBrowser for help on using the repository browser.