aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_send_statistics.php
blob: 4bfacfdb50d8728ba6391f0f99bbc9375dfe24ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
*
* @package acp
* @version $Id: acp_ranks.php 8479 2008-03-29 00:22:48Z naderman $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}
include($phpbb_root_path . 'includes/questionnaire/questionnaire_phpbb.' . $phpEx);


/**
* @package acp
*/
class acp_send_statistics
{
	var $u_action;

	function main($id, $mode)
	{
		global $config, $template;

		$collect_url = "http://www.phpbb.com/stats/getstatdata.php";

		$this->tpl_name = 'acp_send_statistics';
		$this->page_title = 'ACP_SEND_STATISTICS';

		$c = new Questionnaire_Data_Collector();
		$c->addDataProvider(new Questionnaire_PHP_Data_Provider());
		$c->addDataProvider(new Questionnaire_System_Data_Provider());
		$c->addDataProvider(new questionnaire_phpbb_data_provider($config));

		$template->assign_vars(array(
			'U_COLLECT_STATS'	=> $collect_url,
			'RAW_DATA' => $c->getDataForForm(),
		));

		$raw = $c->getDataRaw();

		foreach ($raw as $provider => $data)
		{
			$template->assign_block_vars('providers', array(
				'NAME'	=> htmlentities($provider),
			));

			foreach ($data as $key => $value)
			{
				if (is_array($value))
				{
					$value = utf8_wordwrap(serialize($value), 75, "\n", true);
				}

				$template->assign_block_vars('providers.values', array(
					'KEY'	=> htmlentities($key),
					'VALUE'	=> htmlentities($value),
				));
			}
		}
	}

	/**
	* Output the data as an HTML Definition List.
	*
	* @param   mixed
	* @param   string
	* @param   string
	* @return  void
	*/
	function data_printer($value, $key)
	{
		echo '<dt>', htmlentities($key), '</dt>', $ident, "\t", '<dd>';
		if (is_array($value))
		{
			$value = htmlentities(serialize($value));
			echo '<dl>';
			echo '</dl>';
		} else {
			echo htmlentities($value);
		}
		echo '</dd>';
	}
}

?>