1 | <?php |
---|
2 | |
---|
3 | // Need upgrade? |
---|
4 | |
---|
5 | global $conf; |
---|
6 | |
---|
7 | include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php'); |
---|
8 | |
---|
9 | load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/'); |
---|
10 | |
---|
11 | $config_send= array(); |
---|
12 | |
---|
13 | if(isset($_POST['submit_stripped_black_bloc'])) |
---|
14 | { |
---|
15 | $config_send['color_main']=(isset($_POST['f_color_main']) and !empty($_POST['f_color_main'])) ? $_POST['f_color_main'] : 'E6554F'; |
---|
16 | $config_send['column_width']=(isset($_POST['f_column_width'])) ? $_POST['f_column_width'] : 170; |
---|
17 | if ( isset($_POST['f_column_width']) and isset($_POST['f_thumbnail_width'])) |
---|
18 | { |
---|
19 | if ( $_POST['f_column_width']>$_POST['f_thumbnail_width'] ) |
---|
20 | { |
---|
21 | $config_send['thumbnail_width']=$_POST['f_thumbnail_width']; |
---|
22 | } |
---|
23 | else |
---|
24 | { |
---|
25 | $config_send['thumbnail_width']=$_POST['f_column_width']-20; |
---|
26 | } |
---|
27 | } |
---|
28 | else |
---|
29 | { |
---|
30 | $config_send['thumbnail_width']=150; |
---|
31 | } |
---|
32 | $config_send['every_x']=(isset($_POST['f_every_x'])) ? $_POST['f_every_x'] : 20; |
---|
33 | $config_send['starting_to']=(isset($_POST['f_starting_to'])) ? $_POST['f_starting_to'] : 1; |
---|
34 | $config_send['catthumb']=(isset($_POST['f_catthumb'])) ? $_POST['f_catthumb'] : 'none'; |
---|
35 | $config_send['orientation_option']=(isset($_POST['f_orientation_option'])) ? $_POST['f_orientation_option'] : 'none'; |
---|
36 | conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config_send))); |
---|
37 | |
---|
38 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
39 | |
---|
40 | load_conf_from_db(); |
---|
41 | } |
---|
42 | if(!isset($conf['stripped'])) |
---|
43 | { |
---|
44 | array_push($page['errors'], l10n('The parent-theme Stripped need to be enabled in order to use its parameters')); |
---|
45 | } |
---|
46 | |
---|
47 | $template->set_filenames(array( |
---|
48 | 'theme_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
49 | |
---|
50 | $template->assign('options', unserialize($conf['stripped_black_bloc'])); |
---|
51 | |
---|
52 | $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); |
---|
53 | |
---|
54 | ?> |
---|