source: extensions/Comments_on_Albums/admin/config.php @ 9641

Last change on this file since 9641 was 9641, checked in by mistic100, 13 years ago

[plugins] Comments on Albums

  • stable version
File size: 1.5 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4// +-----------------------------------------------------------------------+
5//                              Save configuration
6// +-----------------------------------------------------------------------+
7if (isset($_POST['config_submit'])) {
8        $user_config = array(
9                'icon_color' => $_POST['icon_color'],
10                'icon_color_over' => $_POST['icon_color_over'],
11        );
12       
13        pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'comments_on_albums';");
14        redirect(COA_ADMIN . '-config&amp;msg=saved');
15}       
16
17// +-----------------------------------------------------------------------+
18//                              Template
19// +-----------------------------------------------------------------------+
20if (isset($_GET['msg']) AND $_GET['msg'] == 'saved') {
21        array_push($page['infos'], l10n('Information data registered in database'));
22}
23
24// available icons
25$dh = opendir(COA_PATH . 'template/s26');
26while (($file = readdir($dh)) !== false ) {
27        if ($file !== '.' && $file !== '..') {
28                $color = preg_replace('#^outline\_([a-f0-9]{6})\.png$#', '$1', $file);
29                $template->append('COLORS', $color);
30        }
31}
32closedir($dh);
33       
34
35$template->assign(array(
36        'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
37        'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
38));
39
40
41$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
42$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
43?>
Note: See TracBrowser for help on using the repository browser.