Overview
SHA1:ef1b8f1267f403bdf5ee5dd8eeb4457bfc08b337
Date: 2015-02-19 06:53:33
User: bohwaz
Comment:Permettre self_url sans query string, permettre de changer une date en timestamp
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-02-19
06:53
[90f06b9e42] formattage rapprochement définitif (user: bohwaz, tags: trunk)
06:53
[ef1b8f1267] Permettre self_url sans query string, permettre de changer une date en timestamp (user: bohwaz, tags: trunk)
06:52
[0c1f27c28d] Mise en commun des éléments (user: bohwaz, tags: trunk)
Changes

Modified src/include/lib/Garradin/Template.php from [31d36787f2] to [3428aae4cb].

28
29
30
31
32
33
34

35
36
37
38
39
40
41

        $this->compile_check = true;

        $this->reserved_template_varname = 'tpl';

        $this->assign('www_url', WWW_URL);
        $this->assign('self_url', Utils::getSelfUrl());


        $this->assign('is_logged', false);
    }
}

$tpl = Template::getInstance();








>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

        $this->compile_check = true;

        $this->reserved_template_varname = 'tpl';

        $this->assign('www_url', WWW_URL);
        $this->assign('self_url', Utils::getSelfUrl());
        $this->assign('self_url_no_qs', Utils::getSelfUrl(true));

        $this->assign('is_logged', false);
    }
}

$tpl = Template::getInstance();

Modified src/include/lib/Garradin/Utils.php from [9eefb1f3b8] to [f6e82cd370].

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    }

    static public function makeTimestampFromForm($d)
    {
        return mktime($d['h'], $d['min'], 0, $d['m'], $d['d'], $d['y']);
    }

    static public function modifyDate($str, $change)
    {
        $date = \DateTime::createFromFormat('Y-m-d', $str);
        $date->modify($change);
        return $date->format('Y-m-d');
    }

    static public function checkDate($str)
    {
        if (!preg_match('!^(\d{4})-(\d{2})-(\d{2})$!', $str, $match))
            return false;








|



|







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    }

    static public function makeTimestampFromForm($d)
    {
        return mktime($d['h'], $d['min'], 0, $d['m'], $d['d'], $d['y']);
    }

    static public function modifyDate($str, $change, $as_timestamp = false)
    {
        $date = \DateTime::createFromFormat('Y-m-d', $str);
        $date->modify($change);
        return ($as_timestamp ? $date->getTimestamp() : $date->format('Y-m-d'));
    }

    static public function checkDate($str)
    {
        if (!preg_match('!^(\d{4})-(\d{2})-(\d{2})$!', $str, $match))
            return false;