aboutsummaryrefslogtreecommitdiffstats
path: root/Report/Box/00_Project.php
blob: 7e310c24b45c7948459d0b0dff541898ae853a5c (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
<?php
/**
 * Project reporting box.
 *
 * PHP version 5
 *
 * @category Dashboard
 * @package  Buildsystem
 * @author   Romain d'Alverny <rda@mageia.org>
 * @license  MIT License, see LICENSE.txt
 * @link     http://svnweb.mageia.org/svn/soft/dashboard/
*/

/**
*/
class Report_Box_Project extends Report_Box
{
    /**
    */
    var $title = "Project info";
    
    /**
    */
    function _get_var_definitions() {
        return array(
            'age'  => ':render',
            'next' => ':render'
//            'contribs' => '%d registered contributors',
//            'packagers' => '%d packagers',
        );
    }

    function _render_value_age()
    {
        $today = time();
        $myBirthDate = strtotime("2010-09-18 19:00:00");
        return array(
            't' => sprintf("I'm %d days old.", round(abs($today-$myBirthDate)/60/60/24)),
            'c' => 'ok',
            's' => 0
        );
    }
    
    function _render_value_next()
    {
        $today = time();
        $release = strtotime("2011-06-01 19:00:00");
        return array(
            't' => sprintf("Next release in %d days.", round(abs($today-$release)/60/60/24)),
            'c' => 'ok',
            's' => 0
        );
        
    }

}