[18843] | 1 | <?php |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | load_language('theme.lang', PHPWG_THEMES_PATH.'PwgCarbon/'); |
---|
| 5 | |
---|
| 6 | global $conf; |
---|
| 7 | if (isset($_POST['ramdom'])) |
---|
| 8 | { |
---|
| 9 | $params = array( |
---|
| 10 | 'color_bg' => rand(1,9), |
---|
| 11 | 'color_theme' => rand(1,9), |
---|
| 12 | 'th' => rand(1,3), |
---|
| 13 | 'bg' => rand(1,6), |
---|
| 14 | 'hd' => rand(1,6), |
---|
| 15 | 'thumbreflex' => rand(0,1), |
---|
| 16 | 'imgtheme' => rand(0,1), |
---|
| 17 | 'colormenu' => rand(0,1), |
---|
| 18 | 'lytebox' => rand(0,1), |
---|
| 19 | 'menuident' => rand(1,3), |
---|
| 20 | ); |
---|
| 21 | |
---|
| 22 | conf_update_param('PwgCarbon', pwg_db_real_escape_string(serialize($params))); |
---|
| 23 | |
---|
| 24 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
| 25 | |
---|
| 26 | load_conf_from_db(); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | if (isset($_POST['default'])) |
---|
| 30 | { |
---|
| 31 | $params = array( |
---|
| 32 | 'color_bg' => '4', |
---|
| 33 | 'color_theme' => '4', |
---|
| 34 | 'th' => '1', |
---|
| 35 | 'bg' => '1', |
---|
| 36 | 'hd' => '4', |
---|
| 37 | 'thumbreflex' => '1', |
---|
| 38 | 'imgtheme' => '1', |
---|
| 39 | 'colormenu' => '0', |
---|
| 40 | 'lytebox' => '0', |
---|
| 41 | 'menuident' => '1', |
---|
| 42 | ); |
---|
| 43 | |
---|
| 44 | conf_update_param('PwgCarbon', pwg_db_real_escape_string(serialize($params))); |
---|
| 45 | |
---|
| 46 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
| 47 | |
---|
| 48 | load_conf_from_db(); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | if (isset($_POST['thumbreflex'])) |
---|
| 53 | $thumbreflex=1; |
---|
| 54 | else |
---|
| 55 | $thumbreflex=0; |
---|
| 56 | if (isset($_POST['imgtheme'])) |
---|
| 57 | $imgtheme=1; |
---|
| 58 | else |
---|
| 59 | $imgtheme=0; |
---|
| 60 | if (isset($_POST['colormenu'])) |
---|
| 61 | $colormenu=1; |
---|
| 62 | else |
---|
| 63 | $colormenu=0; |
---|
| 64 | if (isset($_POST['lytebox'])) |
---|
| 65 | $lytebox=1; |
---|
| 66 | else |
---|
| 67 | $lytebox=0; |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | if (isset($_POST['submit'])) |
---|
| 71 | { |
---|
| 72 | $params = array( |
---|
| 73 | 'color_bg' => $_POST['color_bg'], |
---|
| 74 | 'color_theme' => $_POST['color_theme'], |
---|
| 75 | 'th' => $_POST['th'], |
---|
| 76 | 'bg' => $_POST['bg'], |
---|
| 77 | 'hd' => $_POST['hd'], |
---|
| 78 | 'menuident' => $_POST['menuident'], |
---|
| 79 | 'thumbreflex' => $thumbreflex, |
---|
| 80 | 'imgtheme' => $imgtheme, |
---|
| 81 | 'colormenu' => $colormenu, |
---|
| 82 | 'lytebox' => $lytebox, |
---|
| 83 | ); |
---|
| 84 | |
---|
| 85 | conf_update_param('PwgCarbon', pwg_db_real_escape_string(serialize($params))); |
---|
| 86 | |
---|
| 87 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
| 88 | |
---|
| 89 | load_conf_from_db(); |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | $params = array_merge(unserialize($conf['PwgCarbon'])); |
---|
| 93 | $template->assign(array( |
---|
| 94 | 'selected_color_bg' => $params['color_bg'], |
---|
| 95 | 'selected_bg' => $params['bg'], |
---|
| 96 | 'selected_th' => $params['th'], |
---|
| 97 | 'selected_color_theme' => $params['color_theme'], |
---|
| 98 | 'selected_hd' => $params['hd'], |
---|
| 99 | 'selected_thumbreflex' => $params['thumbreflex'], |
---|
| 100 | 'selected_imgtheme' => $params['imgtheme'], |
---|
| 101 | 'selected_colormenu' => $params['colormenu'], |
---|
| 102 | 'selected_lytebox' => $params['lytebox'], |
---|
| 103 | 'selected_menuident' => $params['menuident'], |
---|
| 104 | )); |
---|
| 105 | |
---|
| 106 | $template->set_filenames( |
---|
| 107 | array( |
---|
| 108 | 'theme_admin_content' => dirname(__FILE__) . '/admin.tpl') |
---|
| 109 | ); |
---|
| 110 | |
---|
| 111 | $template->assign('options', unserialize($conf['PwgCarbon'])); |
---|
| 112 | |
---|
| 113 | $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); |
---|
| 114 | ?> |
---|