1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Brickrouge;
13
14 class DateRange extends Element
15 {
16 const T_START_TAGS = '#daterange-start-tags';
17 const T_FINISH_TAGS = '#daterange-finish-tags';
18
19 public function __construct($tags=array(), $dummy=null)
20 {
21 $start_tags = isset($tags[self::T_START_TAGS]) ? $tags[self::T_START_TAGS] : array();
22 $finish_tags = isset($tags[self::T_FINISH_TAGS]) ? $tags[self::T_FINISH_TAGS] : array();
23
24 parent::__construct
25 (
26 'div', $tags + array
27 (
28 self::CHILDREN => array
29 (
30 new Date
31 (
32 $start_tags + array
33 (
34 self::LABEL => 'Début',
35 self::LABEL_POSITION => 'before',
36
37 'name' => 'start'
38 )
39 ),
40
41 ' ',
42
43 new Date
44 (
45 $finish_tags + array
46 (
47 self::LABEL => 'Fin',
48 self::LABEL_POSITION => 'before',
49
50 'name' => 'finish'
51 )
52 )
53 ),
54
55 'class' => 'wd-daterange'
56 )
57 );
58 }
59 }