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

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

feature:0001114
add an option to make the random image a link to gallery root url
will need an update in translation for DE, HU, ES and IT

File size: 3.7 KB
RevLine 
[3684]1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
[7330]4global $template,$conf;
[3684]5$me = get_plugin_data($plugin_id);
[7134]6include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
[3684]7
[7358]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();
[7134]15
[7358]16
17
[3684]18$template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/rh_admin.tpl') );
[7358]19$template->assign("RH_VERSION",RH_VERSION);
20$template->assign("RH_confpanel",realpath( dirname(__FILE__).'/rh_theme_conf.tpl'));
[7401]21$template->append('head_elements','<link rel="stylesheet" type="text/css" href="'.RH_PATH.'admin/rh_admin.css" />');
[7134]22$rhthemes = new themes();
[7358]23$rh_vierge=0;
[3684]24
[7134]25foreach (get_pwg_themes() as  $pwg_templateID => $pwg_template) {
[3684]26        if (isset($_POST['submit'])) {
[7134]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' ;
[7412]34                $me->rh_config[$pwg_templateID]['root_link']                    = (isset( $_POST[$pwg_templateID.'root_link'] )) ? $_POST[$pwg_templateID.'root_link'] : 'off' ;
[3684]35                $me->save_config();
[7358]36               
[3684]37        }
38       
[7330]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';
[7358]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;
[7134]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' : '',
[7412]49                                'ROOT_LINK'             => ($me->rh_config[$pwg_templateID]['root_link']=='on') ? 'checked' : '',
[7134]50                                'HEAD_CSS'                      =>  $me->rh_config[$pwg_templateID]['head_css'],
51                                'IMG_CSS'                       =>  $me->rh_config[$pwg_templateID]['img_css'],
[7330]52                                'CATSELECTED'           =>  $me->rh_config[$pwg_templateID]['selected_cat'],
53                                'SCREENSHOT_URL'        =>      $rhscreenshot,
54                                'THEMEBOXCLASS'         =>      $rhthemboxclass
[3684]55                                ));
[3687]56}
[7358]57$template->assign('rh_vierge',$rh_vierge);
[3684]58display_select_cat_wrapper(
59          'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE,
60          array(),
61          'categories'
62          );
[7134]63         
[3684]64load_language('plugin.lang', RH_PATH);
65
[7134]66 
67 
[3684]68$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
69?>
Note: See TracBrowser for help on using the repository browser.