Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Method.TestOooLayout.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Ooo Layout test
8  *
9  * @author Anakeen
10  *
11  * @package Dcp\Pu
12  */
13 /**
14  */
15 /**
16  */
17 /**
18  * @begin-method-ignore
19  * this part will be deleted when construct document class until end-method-ignore
20  */
21 class __TST_OOOLAYOUT extends Doc
22 {
23  /**
24  * @var OooLayout
25  */
26  public $lay;
27  /**
28  * @end-method-ignore
29  */
30  /**
31  * @templateController
32  * @param $target
33  */
34  function PU_dcp_data_RepeatMulti($target)
35  {
36 
37  $this->lay->set("TODAY", $this->getTimeDate());
38 
39  $repeatColor[] = array(
40  "COLOR" => "jaune",
41  "VEGETABLE" => array(
42  "pomme",
43  "banane"
44  ) ,
45  "VARIETY" => array(
46  array(
47  "granny",
48  "fuji",
49  "golden"
50  ) ,
51  array(
52  "plantain"
53  )
54  )
55  );
56  $repeatColor[] = array(
57  "COLOR" => "rouge",
58  "VEGETABLE" => array(
59  "cerise",
60  "fraise"
61  ) ,
62  "VARIETY" => array(
63  array(
64  "bigarreau",
65  "griotte"
66  ) ,
67  array(
68  "mara des bois",
69  "agate",
70  "anabelle"
71  )
72  )
73  );
74  $repeatColor[] = array(
75  "COLOR" => "vert",
76  "VEGETABLE" => array(
77  "concombre",
78  "cornichon",
79  "poivron"
80  ) ,
81  "VARIETY" => array(
82  array(
83  "gynial",
84  "Cucumis sativus"
85  ) ,
86  array(
87  "vert de paris"
88  ) ,
89  array(
90  "doux sonar",
91  "jericho"
92  )
93  )
94  );
95 
96  $this->lay->setRepeatable($repeatColor);
97  }
98  /**
99  *
100  * @templateController
101  */
102  function PU_dcp_data_repeatOne($target)
103  {
104 
105  $this->lay->set("TODAY", $this->getTimeDate());
106 
107  $repeatColor[] = array(
108  "COLOR" => "jaune",
109  "VEGETABLE" => array(
110  "banane"
111  ) ,
112  "COUNTRY" => array(
113  "Guadeloupe"
114  ) ,
115  "VARIETY" => array(
116  "plantain"
117  ) ,
118  "WEIGHT" => array(
119  "100g"
120  )
121  );
122 
123  $repeatColor[] = array(
124  "COLOR" => "rouge",
125  "VEGETABLE" => array(
126  "bigarreau"
127  ) ,
128  "COUNTRY" => array(
129  "Dordogne"
130  ) ,
131  "VARIETY" => array(
132  "mara des bois"
133  ) ,
134  "WEIGHT" => array(
135  "20g"
136  )
137  );
138  $repeatColor[] = array(
139  "COLOR" => "vert",
140 
141  "COUNTRY" => array(
142  "Normandie"
143  ) ,
144  "VEGETABLE" => array(
145  "concombre"
146  ) ,
147  "VARIETY" => array(
148  "gynial"
149  ) ,
150  "WEIGHT" => array(
151  "30g"
152  )
153  );
154 
155  $this->lay->setRepeatable($repeatColor);
156  }
157  /**
158  *
159  * @templateController
160  * @param $target
161  * @return mixed
162  */
163  function PU_dcp_data_IfOooLayout($target)
164  {
165  if (!$this->lay->file) return;
166  if (strtolower(get_class($this->lay)) != 'ooolayout') return;
167  if ($target !== 'ooo') return;
168  $this->lay->eset("TODAY", $this->getTimeDate());
169 
170  $t = array();
171  for ($i = 1; $i < 6; $i++) {
172 
173  $t[] = array(
174  "V_N1" => "Valeur $i",
175  "V_T1" => "Titre $i",
176  "ODD" => (($i % 2) == 0)
177  );
178  }
179 
180  $this->lay->set("HEADER", false);
181  $this->lay->set("FOOTER", true);
182  $this->lay->setRepeatable($t);
183  //$this->viewDefaultCard($target);
184  //$this->lay->set("V_OOO_IMAGE_ENTETE", $this->lay->get("V_OOO_IMAGE"));
185 
186  }
187  /**
188  * @templateController
189  * @param $target
190  */
191  function PU_dcp_data_RowOooLayout($target)
192  {
193 
194  $this->lay->set("TODAY", $this->getTimeDate());
195  $this->lay->setColumn("NOTE1", array(
196  "Do",
197  "RĂ©",
198  "Mi"
199  ));
200  $this->lay->setColumn("NOTE2", array(
201  "Fa",
202  "Sol"
203  ));
204 
205  $this->viewDefaultCard($target);
206  }
207  /**
208  * @templateController
209  * @param $target
210  */
211  function PU_dcp_data_RepeatOooLayout($target)
212  {
213 
214  $this->lay->set("TODAY", $this->getTimeDate());
215 
216  $t = array();
217  for ($i = 1; $i < 5; $i++) {
218  $sub = array();
219  $subBis = array();
220  $sub3 = array();
221  $sub3Bis = array();
222  $sub4 = array();
223  $sub4Bis = array();
224  for ($j = 1; $j < (2 + $i); $j++) {
225  $sub[] = ("Sous Valeur $i/$j");
226  $subBis[] = ("Bis $i/$j");
227  for ($k = 1; $k < ($i + $j + 1); $k++) {
228  $sub3[$j - 1][] = ("Niveau 3 : $i/$j/$k");
229  $sub3Bis[$j - 1][] = ("Ter $i/$j/$k");
230  for ($l = 1; $l < (($i + $j + 1)); $l++) {
231  $sub4[$j - 1][$k - 1][] = ("Niveau 4 : $i/$j/$k/$l");
232  $sub4Bis[$j - 1][$k - 1][] = ("Quater $i/$j/$k/$l");
233  }
234  }
235  }
236  $t[] = array(
237  "V_N1" => "Valeur $i",
238  "V_T1" => "Titre $i",
239  "S_N2bis" => $subBis,
240  "S_N2" => $sub,
241  "S_N3" => $sub3,
242  "S_N3bis" => $sub3Bis,
243  "S_N4" => $sub4,
244  "S_N4bis" => $sub4Bis
245  );
246  }
247 
248  $this->lay->setRepeatable($t);
249 
250  $this->viewDefaultCard($target);
251  }
252  /**
253  * @begin-method-ignore
254  * this part will be deleted when construct document class until end-method-ignore
255  */
256 }
257 /**
258  * @end-method-ignore
259  */
260 ?>
PU_dcp_data_RepeatMulti($target)
PU_dcp_data_RepeatOooLayout($target)
static getTimeDate($hourdelta=0, $second=false)
Definition: Class.Doc.php:8826
← centre documentaire © anakeen