source: extensions/Statistics/admin/stat_admin.php @ 7445

Last change on this file since 7445 was 7445, checked in by plg, 13 years ago

bug fixed: ability to use a Google Analytics/Piwik javascript code including a
comma.

simpler code, easier to maintain I hope.

change file format from MacOs to Unix line endings.

File size: 1.8 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4load_language('plugin.lang', STAT_PATH);
5
6$conf_statistics = unserialize($conf['statistics']);
7
8$template->assign(
9  array(
10    'statisticsCONTENT' => $conf_statistics['content'],
11    'STATITICS_HEADER'  => $conf_statistics['header'] ? 'checked="checked"' : '' ,
12    'STATISTICS_TAIL'   => $conf_statistics['tail']   ? 'checked="checked"' : '' ,
13    'STATISTICS_ADMIN'  => $conf_statistics['exclude_admin']  ? 'checked="checked"' : '' ,
14    'STATISTICS_GUEST'  => $conf_statistics['exclude_guest']  ? 'checked="checked"' : '' ,
15    )
16  );
17
18if (isset($_POST['submit']))
19{
20  $statistics_content = stripslashes($_POST['statistics_content']);
21 
22  $conf_statistics = array(
23    'content' => $statistics_content,
24    'header' => isset($_POST['stat_header']),
25    'tail' => isset($_POST['stat_tail']),
26    'exclude_admin' => isset($_POST['stat_admin']),
27    'exclude_guest' => isset($_POST['stat_guest']),
28    );
29
30  $query = '
31UPDATE '.CONFIG_TABLE.'
32  SET value = \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\'
33  WHERE param = \'statistics\'
34;';
35  pwg_query($query);
36
37  array_push($page['infos'], l10n('statistics_save_config'));
38  $template->assign(
39    array(
40      'statisticsCONTENT' => $statistics_content,
41      'STATITICS_HEADER'  => isset($_POST['stat_header']) ? 'checked="checked"' : '' ,
42      'STATISTICS_TAIL'   => isset($_POST['stat_tail'])   ? 'checked="checked"' : '' ,
43      'STATISTICS_ADMIN'  => isset($_POST['stat_admin'])  ? 'checked="checked"' : '' ,
44      'STATISTICS_GUEST'  => isset($_POST['stat_guest'])  ? 'checked="checked"' : '' ,
45      )
46    );
47}
48
49$template->set_filenames(array('plugin_admin_content' => realpath(STAT_PATH . 'admin/stat_admin.tpl')));
50$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
51?>
Note: See TracBrowser for help on using the repository browser.