Project

General

Profile

StatisticsBlock » History » Version 4

Batyr Mackenov, December 03, 2012 23:01

1 1 Vasily Bezruchkin
h1. Statistics Block
2
3
The "Statistics" block is used to display site statistics parameters by packages or even plugins.
4
5
You have to follow instructions below to install your data into "Statistics" common block.
6
7 3 Anonymous
# Place "populateCommonStatisticsBlock" named hook
8 1 Vasily Bezruchkin
# The script will provide '$data' variable into hook code
9
# The hook code should append needed number of array items into $data variable
10
# Array key will be shown as a heading of provided data
11
# Array items should be designed in the following manner: every item will be a separate row, 'item' element will be shown at left hand side, and 'value' element will appear at right hand side.
12
13
Example hook code:
14
<pre><code class="php">
15
if(isset($data))
16
{
17
	$blockInfo = array(
18
		array(
19
			'key' => 'Total',
20
			'value' => '29'
21
		),
22
		array(
23
			'key' => 'Active',
24
			'value' => '16'
25
		)
26
	);
27
28
	$data['Articles'] = $blockInfo;
29
}
30 4 Batyr Mackenov
</code></pre>
31 1 Vasily Bezruchkin
32
The script will assemble all of items and will render it as a block.