Commit | Line | Data |
---|---|---|
d9b3d712 RB |
1 | <?php |
2 | /*************************************************************************** | |
12262f13 | 3 | * Copyright (C) 2003-2011 Polytechnique.org * |
d9b3d712 RB |
4 | * http://opensource.polytechnique.org/ * |
5 | * * | |
6 | * This program is free software; you can redistribute it and/or modify * | |
7 | * it under the terms of the GNU General Public License as published by * | |
8 | * the Free Software Foundation; either version 2 of the License, or * | |
9 | * (at your option) any later version. * | |
10 | * * | |
11 | * This program is distributed in the hope that it will be useful, * | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
14 | * GNU General Public License for more details. * | |
15 | * * | |
16 | * You should have received a copy of the GNU General Public License * | |
17 | * along with this program; if not, write to the Free Software * | |
18 | * Foundation, Inc., * | |
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * | |
20 | ***************************************************************************/ | |
21 | ||
21b67462 | 22 | // {{{ class UserFilterBuilder |
d9b3d712 RB |
23 | class UserFilterBuilder |
24 | { | |
25 | private $envprefix; | |
26 | private $fields; | |
27 | private $valid = true; | |
28 | private $ufc = null; | |
59c6cb70 | 29 | private $orders = array(); |
d9b3d712 RB |
30 | |
31 | /** Constructor | |
32 | * @param $fields An array of UFB_Field objects | |
33 | * @param $envprefix Prefix to use for parts of the query | |
34 | */ | |
35 | public function __construct($fields, $envprefix = '') | |
36 | { | |
37 | $this->fields = $fields; | |
38 | $this->envprefix = $envprefix; | |
39 | } | |
40 | ||
41 | /** Builds the UFC; returns as soon as a field says it is invalid | |
42 | */ | |
43 | private function buildUFC() | |
44 | { | |
45 | if ($this->ufc != null) { | |
46 | return; | |
47 | } | |
48 | $this->ufc = new PFC_And(); | |
49 | ||
50 | foreach ($this->fields as $field) { | |
51 | $this->valid = $field->apply(&$this); | |
52 | if (!$this->valid) { | |
53 | return; | |
54 | } | |
55 | } | |
56 | } | |
57 | ||
58 | public function addCond(PlFilterCondition &$cond) | |
59 | { | |
60 | $this->ufc->addChild($cond); | |
61 | } | |
62 | ||
59c6cb70 RB |
63 | public function addOrder(PlFilterOrder &$order) |
64 | { | |
65 | $this->order[] = $order; | |
66 | } | |
67 | ||
d9b3d712 RB |
68 | public function isValid() |
69 | { | |
70 | $this->buildUFC(); | |
71 | return $this->valid; | |
72 | } | |
73 | ||
6faa0186 RB |
74 | public function isEmpty() |
75 | { | |
76 | $this->buildUFC(); | |
77 | foreach ($this->fields as $field) { | |
78 | if (! $field->isEmpty()) { | |
79 | return false; | |
80 | } | |
81 | } | |
82 | return true; | |
83 | } | |
84 | ||
d9b3d712 RB |
85 | /** Returns the built UFC |
86 | * @return The UFC, or PFC_False() if an error happened | |
87 | */ | |
3314838e | 88 | public function getUFC() |
d9b3d712 RB |
89 | { |
90 | $this->buildUFC(); | |
91 | if ($this->valid) { | |
92 | return $this->ufc; | |
93 | } else { | |
94 | return new PFC_False(); | |
95 | } | |
96 | } | |
97 | ||
59c6cb70 RB |
98 | /** Returns adequate orders |
99 | */ | |
100 | public function getOrders() | |
101 | { | |
102 | $this->buildUFC(); | |
103 | return $this->orders; | |
104 | } | |
105 | ||
d9b3d712 RB |
106 | /** Wrappers around Env::i/s/..., to add envprefix |
107 | */ | |
0f17825b FB |
108 | public function s($key, $def = '') |
109 | { | |
110 | return Env::s($this->envprefix . $key, $def); | |
111 | } | |
112 | ||
113 | public function t($key, $def = '') | |
114 | { | |
115 | return Env::t($this->envprefix . $key, $def); | |
d9b3d712 RB |
116 | } |
117 | ||
0f17825b FB |
118 | public function i($key, $def = 0) |
119 | { | |
05fa89a5 | 120 | return Env::i($this->envprefix . $key, $def); |
d9b3d712 RB |
121 | } |
122 | ||
0f17825b FB |
123 | public function v($key, $def = null) |
124 | { | |
d9b3d712 RB |
125 | return Env::v($this->envprefix . $key, $def); |
126 | } | |
127 | ||
0f17825b FB |
128 | public function b($key, $def = false) |
129 | { | |
130 | return Env::b($this->envprefix . $key, $def); | |
131 | } | |
132 | ||
133 | public function has($key) | |
134 | { | |
135 | return Env::has($this->envprefix . $key); | |
136 | } | |
137 | ||
138 | public function blank($key, $strict = false) | |
139 | { | |
140 | return Env::blank($key, $strict); | |
d9b3d712 | 141 | } |
d9696b0a | 142 | |
78be0329 FB |
143 | public function hasAlnum($key) |
144 | { | |
145 | $str = $this->s($key); | |
146 | return preg_match('/[a-z0-9]/i', $str); | |
147 | } | |
148 | ||
149 | public function hasAlpha($key) | |
150 | { | |
151 | $str = $this->s($key); | |
152 | return preg_match('/[a-z]/i', $str); | |
153 | } | |
154 | ||
0f17825b FB |
155 | public function isOn($key) |
156 | { | |
157 | return $this->has($key) && $this->t($key) == 'on'; | |
d9696b0a | 158 | } |
d9b3d712 | 159 | } |
21b67462 | 160 | // }}} |
d9b3d712 | 161 | |
59c6cb70 RB |
162 | // {{{ class UFB_QuickSearch |
163 | class UFB_QuickSearch extends UserFilterBuilder | |
164 | { | |
165 | public function __construct($envprefix = '') | |
166 | { | |
167 | $fields = array( | |
168 | new UFBF_Quick('quick', 'Recherche rapide'), | |
78a47eb4 | 169 | new UFBF_NotRegistered('nonins', 'Non inscrits'), |
59c6cb70 RB |
170 | ); |
171 | parent::__construct($fields, $envprefix); | |
172 | } | |
173 | } | |
174 | // }}} | |
175 | ||
21b67462 RB |
176 | // {{{ class UFB_AdvancedSearch |
177 | class UFB_AdvancedSearch extends UserFilterBuilder | |
178 | { | |
0f567f55 RB |
179 | /** Create a UFB_AdvancedSearch. |
180 | * @param $include_admin Whether to include 'admin-only' fields | |
181 | * @param $include_ax Whether to include 'ax-only' fields | |
182 | * @param $envprefix Optional prefix for form field names. | |
183 | */ | |
184 | public function __construct($include_admin = false, $include_ax = false, $envprefix = '') | |
21b67462 RB |
185 | { |
186 | $fields = array( | |
187 | new UFBF_Name('name', 'Nom'), | |
188 | new UFBF_Promo('promo1', 'Promotion', 'egal1'), | |
189 | new UFBF_Promo('promo2', 'Promotion', 'egal2'), | |
190 | new UFBF_Sex('woman', 'Sexe'), | |
191 | new UFBF_Registered('subscriber', 'Inscrit'), | |
192 | new UFBF_Dead('alive', 'En vie'), | |
193 | ||
194 | new UFBF_Town('city', 'Ville / Code Postal'), | |
195 | new UFBF_Country('countryTxt', 'country', 'Pays'), | |
86ab1c8f SJ |
196 | new UFBF_AdminArea('administrativearea', 'Région'), |
197 | new UFBF_SubAdminArea('subadministrativearea', 'Département'), | |
21b67462 RB |
198 | |
199 | new UFBF_JobCompany('entreprise', 'Entreprise'), | |
21b67462 RB |
200 | new UFBF_JobDescription('jobdescription', 'Fonction'), |
201 | new UFBF_JobCv('cv', 'CV'), | |
3ac45f10 | 202 | new UFBF_JobTerms('jobterm', 'Mots-clefs'), |
21b67462 RB |
203 | |
204 | new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'), | |
205 | new UFBF_Binet('binetTxt', 'binet', 'Binet'), | |
206 | new UFBF_Group('groupexTxt', 'groupex', 'Groupe X'), | |
207 | new UFBF_Section('sectionTxt', 'section', 'Section'), | |
208 | ||
fb3b6547 RB |
209 | new UFBF_EducationSchool('schoolTxt', 'school', "École d'application"), |
210 | new UFBF_EducationDegree('diplomaTxt', 'diploma', 'Diplôme'), | |
211 | new UFBF_EducationField('fieldTxt', 'field', "Domaine d'études"), | |
21b67462 RB |
212 | |
213 | new UFBF_Comment('free', 'Commentaire'), | |
3ed7556a RB |
214 | new UFBF_Phone('phone_number', 'Téléphone'), |
215 | new UFBF_Networking('networking_address', 'networking_type', 'Networking et sites webs'), | |
96f01fba RB |
216 | |
217 | new UFBF_Mentor('only_referent', 'Référent'), | |
21b67462 | 218 | ); |
0f567f55 RB |
219 | |
220 | if ($include_admin || $include_ax) { | |
221 | $fields[] = new UFBF_SchoolIds('schoolid_ax', 'Matricule AX', UFC_SchoolId::AX); | |
222 | } | |
223 | ||
21b67462 RB |
224 | parent::__construct($fields, $envprefix); |
225 | } | |
226 | } | |
227 | // }}} | |
228 | ||
6faa0186 RB |
229 | // {{{ class UFB_MentorSearch |
230 | class UFB_MentorSearch extends UserFilterBuilder | |
231 | { | |
232 | public function __construct($envprefix = '') | |
233 | { | |
234 | $fields = array( | |
459e6f81 PC |
235 | new UFBF_MentorCountry('country'), |
236 | new UFBF_MentorTerm('jobterm', 'jobtermText'), | |
6faa0186 RB |
237 | new UFBF_MentorExpertise('expertise'), |
238 | ); | |
239 | parent::__construct($fields, $envprefix); | |
240 | } | |
241 | } | |
242 | // }}} | |
243 | ||
21b67462 | 244 | // {{{ class UFB_Field |
d9b3d712 RB |
245 | abstract class UFB_Field |
246 | { | |
247 | protected $envfield; | |
248 | protected $formtext; | |
249 | ||
250 | protected $empty = false; | |
251 | protected $val = null; | |
252 | ||
253 | /** Constructor | |
254 | * @param $envfield Name of the field in the environment | |
255 | * @param $formtext User-friendly name of that field | |
256 | */ | |
257 | public function __construct($envfield, $formtext = '') | |
258 | { | |
259 | $this->envfield = $envfield; | |
260 | if ($formtext != '') { | |
261 | $this->formtext = $formtext; | |
262 | } else { | |
263 | $formtext = ucfirst($envfield); | |
264 | } | |
265 | } | |
266 | ||
267 | /** Prints the given error message to the user, and returns false | |
268 | * in order to be used as return $this->raise('ERROR'); | |
269 | * | |
270 | * All %s in the $msg will be replaced with the formtext. | |
271 | */ | |
272 | protected function raise($msg) | |
273 | { | |
274 | Platal::page()->trigError(str_replace('%s', $this->formtext, $msg)); | |
275 | return false; | |
276 | } | |
277 | ||
278 | public function apply(UserFilterBuilder &$ufb) { | |
279 | if (!$this->check($ufb)) { | |
280 | return false; | |
281 | } | |
282 | ||
1d364832 | 283 | if (!$this->isEmpty()) { |
d9b3d712 RB |
284 | $ufc = $this->buildUFC($ufb); |
285 | if ($ufc != null) { | |
286 | $ufb->addCond($ufc); | |
287 | } | |
288 | } | |
289 | return true; | |
290 | } | |
291 | ||
6faa0186 RB |
292 | public function isEmpty() |
293 | { | |
294 | return $this->empty; | |
295 | } | |
296 | ||
d9b3d712 RB |
297 | /** Create the UFC associated to the field; won't be called |
298 | * if the field is "empty" | |
299 | * @param &$ufb UFB to which fields must be added | |
300 | * @return UFC | |
301 | */ | |
302 | abstract protected function buildUFC(UserFilterBuilder &$ufb); | |
303 | ||
304 | /** This function is intended to run consistency checks on the value | |
305 | * @return boolean Whether the input is valid | |
306 | */ | |
307 | abstract protected function check(UserFilterBuilder &$ufb); | |
308 | } | |
21b67462 | 309 | // }}} |
d9b3d712 | 310 | |
21b67462 | 311 | // {{{ class UFBF_Text |
d9b3d712 RB |
312 | abstract class UFBF_Text extends UFB_Field |
313 | { | |
d9b3d712 RB |
314 | private $minlength; |
315 | private $maxlength; | |
316 | ||
f3f800d8 | 317 | public function __construct($envfield, $formtext = '', $minlength = 2, $maxlength = 255) |
d9b3d712 RB |
318 | { |
319 | parent::__construct($envfield, $formtext); | |
d9b3d712 RB |
320 | $this->minlength = $minlength; |
321 | $this->maxlength = $maxlength; | |
322 | } | |
323 | ||
324 | protected function check(UserFilterBuilder &$ufb) | |
325 | { | |
0f17825b | 326 | if ($ufb->blank($this->envfield)) { |
d9b3d712 RB |
327 | $this->empty = true; |
328 | return true; | |
329 | } | |
330 | ||
0f17825b | 331 | $this->val = $ufb->t($this->envfield); |
d9b3d712 RB |
332 | if (strlen($this->val) < $this->minlength) { |
333 | return $this->raise("Le champ %s est trop court (minimum {$this->minlength})."); | |
334 | } else if (strlen($this->val) > $this->maxlength) { | |
335 | return $this->raise("Le champ %s est trop long (maximum {$this->maxlength})."); | |
5a0b9531 | 336 | } else if (preg_match(":[\]\[<>{}~§_`|%$^=]|\*\*:u", $this->val)) { |
f3f800d8 | 337 | return $this->raise('Le champ %s contient un caractère interdit rendant la recherche impossible.'); |
d9b3d712 | 338 | } |
f3f800d8 | 339 | |
d9b3d712 RB |
340 | return true; |
341 | } | |
342 | } | |
21b67462 | 343 | // }}} |
d9b3d712 | 344 | |
21b67462 | 345 | // {{{ class UFBF_Range |
d9b3d712 RB |
346 | /** Subclass to use for fields which only allow integers within a range |
347 | */ | |
348 | abstract class UFBF_Range extends UFB_Field | |
349 | { | |
350 | ||
351 | private $min; | |
352 | private $max; | |
353 | ||
354 | public function __construct($envfield, $formtext = '', $min = 0, $max = 65535) | |
355 | { | |
356 | parent::__construct($envfield, $formtext); | |
357 | $this->min = $min; | |
358 | $this->max = $max; | |
359 | } | |
360 | ||
361 | protected function check(UserFilterBuilder &$ufb) | |
362 | { | |
0f17825b | 363 | if ($ufb->blank($this->envfield)) { |
d9b3d712 RB |
364 | $this->empty = true; |
365 | return true; | |
366 | } | |
367 | ||
368 | $this->val = $ufb->i($this->envfield); | |
369 | if ($this->val < $this->min) { | |
370 | return $this->raise("Le champs %s est inférieur au minimum ({$this->min})."); | |
371 | } else if ($this->val > $this->max) { | |
372 | return $this->raise("Le champ %s est supérieur au maximum ({$this->max})."); | |
373 | } | |
374 | return true; | |
375 | } | |
376 | } | |
21b67462 | 377 | // }}} |
d9b3d712 | 378 | |
21b67462 | 379 | // {{{ class UFBF_Index |
d9b3d712 RB |
380 | /** Subclass to use for indexed fields |
381 | */ | |
382 | abstract class UFBF_Index extends UFB_Field | |
383 | { | |
384 | protected function check(UserFilterBuilder &$ufb) | |
385 | { | |
0f17825b | 386 | if ($ufb->blank($this->envfield)) { |
d9b3d712 RB |
387 | $this->empty = true; |
388 | } | |
6faa0186 | 389 | $this->val = $ufb->i($this->envfield); |
d9b3d712 RB |
390 | return true; |
391 | } | |
392 | } | |
21b67462 | 393 | // }}} |
d9b3d712 | 394 | |
21b67462 | 395 | // {{{ class UFBF_Enum |
d9b3d712 RB |
396 | /** Subclass to use for fields whose value must belong to a specific set of values |
397 | */ | |
398 | abstract class UFBF_Enum extends UFB_Field | |
399 | { | |
21b67462 RB |
400 | protected $allowedvalues; |
401 | ||
402 | public function __construct($envfield, $formtext = '', $allowedvalues = array(), $strict = false) | |
d9b3d712 RB |
403 | { |
404 | parent::__construct($envfield, $formtext); | |
405 | $this->allowedvalues = $allowedvalues; | |
21b67462 | 406 | $this->strict = $strict; |
d9b3d712 RB |
407 | } |
408 | ||
409 | protected function check(UserFilterBuilder &$ufb) | |
410 | { | |
0f17825b | 411 | if ($ufb->blank($this->envfield)) { |
d9b3d712 RB |
412 | $this->empty = true; |
413 | return true; | |
414 | } | |
415 | ||
416 | $this->val = $ufb->v($this->envfield); | |
417 | if (! in_array($this->val, $this->allowedvalues)) { | |
21b67462 RB |
418 | if ($this->strict) { |
419 | return $this->raise("La valeur {$this->val} n'est pas valide pour le champ %s."); | |
420 | } else { | |
421 | $this->empty = true; | |
422 | } | |
d9b3d712 RB |
423 | } |
424 | return true; | |
425 | } | |
426 | } | |
21b67462 | 427 | // }}} |
d9b3d712 | 428 | |
21b67462 RB |
429 | // {{{ class UFBF_Bool |
430 | abstract class UFBF_Bool extends UFB_Field | |
d9b3d712 | 431 | { |
21b67462 RB |
432 | protected function check(UserFilterBuilder &$ufb) |
433 | { | |
0f17825b | 434 | if ($ufb->blank($this->envfield)) { |
21b67462 RB |
435 | $this->empty = true; |
436 | return true; | |
437 | } | |
438 | ||
0f17825b | 439 | $this->val = $ufb->b($this->envfield); |
21b67462 RB |
440 | return true; |
441 | } | |
442 | } | |
443 | // }}} | |
d9b3d712 | 444 | |
21b67462 RB |
445 | // {{{ class UFBF_Mixed |
446 | /** A class for building UFBFs when the user can input either a text or an ID | |
447 | */ | |
448 | abstract class UFBF_Mixed extends UFB_Field | |
449 | { | |
450 | /** Name of the DirEnum on which class is based | |
451 | */ | |
452 | protected $direnum; | |
453 | ||
454 | protected $envfieldindex; | |
455 | ||
456 | public function __construct($envfieldtext, $envfieldindex, $formtext = '') | |
d9b3d712 | 457 | { |
21b67462 RB |
458 | parent::__construct($envfieldtext, $formtext); |
459 | $this->envfieldindex = $envfieldindex; | |
d9b3d712 RB |
460 | } |
461 | ||
21b67462 | 462 | protected function check(UserFilterBuilder &$ufb) |
d9b3d712 | 463 | { |
78be0329 | 464 | if ($ufb->blank($this->envfieldindex) && !$ufb->hasAlnum($this->envfield)) { |
21b67462 RB |
465 | $this->empty = true; |
466 | return true; | |
467 | } | |
468 | ||
0f17825b | 469 | if (!$ufb->blank($this->envfieldindex)) { |
21b67462 RB |
470 | $index = $ufb->v($this->envfieldindex); |
471 | if (is_int($index)) { | |
472 | $index = intval($index); | |
473 | } else { | |
474 | $index = strtoupper($index); | |
475 | } | |
476 | $this->val = array($index); | |
d9b3d712 | 477 | } else { |
aab2ffdd | 478 | $indexes = DirEnum::getIDs($this->direnum, $ufb->t($this->envfield), |
0f17825b | 479 | $ufb->b('exact') ? XDB::WILDCARD_EXACT : XDB::WILDCARD_CONTAINS); |
21b67462 RB |
480 | if (count($indexes) == 0) { |
481 | return false; | |
482 | } | |
483 | $this->val = $indexes; | |
d9b3d712 | 484 | } |
21b67462 | 485 | return true; |
d9b3d712 RB |
486 | } |
487 | } | |
21b67462 | 488 | // }}} |
d9b3d712 | 489 | |
f3f800d8 | 490 | // {{{ class UFBF_Quick |
59c6cb70 RB |
491 | class UFBF_Quick extends UFB_Field |
492 | { | |
493 | protected function check(UserFilterBuilder &$ufb) | |
494 | { | |
0f17825b | 495 | if ($ufb->blank($this->envfield)) { |
59c6cb70 RB |
496 | $this->empty = true; |
497 | return true; | |
498 | } | |
499 | ||
0f17825b | 500 | $this->val = str_replace('*', '%', replace_accent($ufb->t($this->envfield))); |
4b2e2074 RB |
501 | |
502 | return true; | |
59c6cb70 RB |
503 | } |
504 | ||
505 | protected function buildUFC(UserFilterBuilder &$ufb) | |
506 | { | |
59c6cb70 | 507 | |
4b2e2074 | 508 | $r = $s = $this->val; |
59c6cb70 RB |
509 | |
510 | /** Admin: Email, IP | |
511 | */ | |
512 | if (S::admin() && strpos($s, '@') !== false) { | |
4b2e2074 | 513 | return new UFC_Email($s); |
59c6cb70 | 514 | } else if (S::admin() && preg_match('/[0-9]+\.([0-9]+|%)\.([0-9]+|%)\.([0-9]+|%)/', $s)) { |
0c457792 | 515 | return new UFC_Ip($s); |
59c6cb70 RB |
516 | } |
517 | ||
4b2e2074 RB |
518 | $conds = new PFC_And(); |
519 | ||
59c6cb70 RB |
520 | /** Name |
521 | */ | |
522 | $s = preg_replace('!\d+!', ' ', $s); | |
523 | $strings = preg_split("![^a-zA-Z%]+!",$s, -1, PREG_SPLIT_NO_EMPTY); | |
524 | if (count($strings) > 5) { | |
525 | Platal::page()->trigWarning("Tu as indiqué trop d'éléments dans ta recherche, seuls les 5 premiers seront pris en compte"); | |
526 | $strings = array_slice($strings, 0, 5); | |
527 | } | |
528 | ||
529 | if (count($strings)) { | |
530 | if (S::logged()) { | |
531 | $flags = array(); | |
532 | } else { | |
533 | $flags = array('public'); | |
534 | } | |
0f17825b | 535 | $exact =$ufb->b('exact'); |
9d590571 | 536 | $conds->addChild(new UFC_NameTokens($strings, $flags, $ufb->b('with_soundex'), $exact)); |
59c6cb70 | 537 | |
4b2e2074 | 538 | $ufb->addOrder(new UFO_Score()); |
59c6cb70 RB |
539 | } |
540 | ||
541 | /** Promo ranges | |
542 | */ | |
543 | $s = preg_replace('! *- *!', '-', $r); | |
544 | $s = preg_replace('!([<>]) *!', ' \1', $s); | |
545 | $s = preg_replace('![^0-9\-><]!', ' ', $s); | |
546 | $s = preg_replace('![<>\-] !', '', $s); | |
547 | $ranges = preg_split('! +!', $s, -1, PREG_SPLIT_NO_EMPTY); | |
548 | foreach ($ranges as $r) { | |
549 | if (preg_match('!^\d{4}$!', $r)) { | |
550 | $conds->addChild(new UFC_Promo('=', UserFilter::DISPLAY, 'X' . $r)); | |
551 | } elseif (preg_match('!^(\d{4})-(\d{4})$!', $r, $matches)) { | |
552 | $p1=min(intval($matches[1]), intval($matches[2])); | |
553 | $p2=max(intval($matches[1]), intval($matches[2])); | |
554 | $conds->addChild(new PFC_And( | |
555 | new UFC_Promo('>=', UserFilter::DISPLAY, 'X' . $p1), | |
556 | new UFC_Promo('<=', UserFilter::DISPLAY, 'X' . $p2) | |
557 | )); | |
558 | } elseif (preg_match('!^<(\d{4})!', $r, $matches)) { | |
559 | $conds->addChild(new UFC_Promo('<=', UserFilter::DISPLAY, 'X' . $matches[1])); | |
560 | } elseif (preg_match('!^>(\d{4})!', $r, $matches)) { | |
4b2e2074 | 561 | $conds->addChild(new UFC_Promo('>=', UserFilter::DISPLAY, 'X' . $matches[1])); |
59c6cb70 RB |
562 | } |
563 | } | |
564 | ||
565 | /** Phone number | |
566 | */ | |
567 | $t = preg_replace('!(\d{4}-\d{4}|>\d{4}|<\d{4})!', '', $s); | |
568 | $t = preg_replace('![<>\- ]!', '', $t); | |
569 | if (strlen($t) > 4) { | |
570 | $conds->addChild(new UFC_Phone($t)); | |
571 | } | |
572 | ||
573 | return $conds; | |
574 | } | |
575 | } | |
576 | // }}} | |
577 | ||
0f567f55 RB |
578 | // {{{ class UFBF_SchoolIds |
579 | class UFBF_SchoolIds extends UFB_Field | |
580 | { | |
581 | // One of UFC_SchoolId types | |
582 | protected $type; | |
583 | ||
584 | public function __construct($envfield, $formtext, $type = UFC_SchoolId::AX) | |
585 | { | |
586 | parent::__construct($envfield, $formtext); | |
587 | $this->type = $type; | |
588 | } | |
589 | ||
590 | protected function check(UserFilterBuilder &$ufb) | |
591 | { | |
592 | if ($ufb->blank($this->envfield)) { | |
593 | $this->empty = true; | |
594 | return true; | |
595 | } | |
596 | ||
597 | $value = $ufb->t($this->envfield); | |
598 | $values = explode("\n", $value); | |
599 | $ids = array(); | |
600 | foreach ($values as $val) { | |
601 | if (preg_match('/^[0-9A-Z]{0,8}$/', $val)) { | |
602 | $ids[] = $val; | |
603 | } | |
604 | } | |
605 | if (count($ids) == 0) { | |
606 | return $this->raise("Le champ %s ne contient aucune valeur valide."); | |
607 | } | |
608 | ||
609 | $this->val = $ids; | |
610 | return true; | |
611 | } | |
612 | ||
613 | protected function buildUFC(UserFilterBuilder &$ufb) | |
614 | { | |
615 | return new UFC_SchoolId($this->type, $this->val); | |
616 | } | |
617 | } | |
618 | // }}} | |
619 | ||
21b67462 RB |
620 | // {{{ class UFBF_Name |
621 | class UFBF_Name extends UFBF_Text | |
622 | { | |
623 | protected function check(UserFilterBuilder &$ufb) | |
624 | { | |
625 | if (!parent::check($ufb)) { | |
626 | return false; | |
627 | } | |
628 | ||
629 | $this->val = preg_split('/[[:space:]]/', $this->val); | |
630 | if (count($this->val) == 0) { | |
631 | $this->empty = true; | |
632 | } | |
633 | return true; | |
634 | } | |
635 | ||
636 | protected function buildUFC(UserFilterBuilder &$ufb) | |
637 | { | |
0f17825b | 638 | return new UFC_NameTokens($this->val, array(), $ufb->b('with_soundex'), $ufb->b('exact')); |
21b67462 RB |
639 | } |
640 | } | |
641 | // }}} | |
642 | ||
643 | // {{{ class UFBF_Promo | |
d9b3d712 RB |
644 | class UFBF_Promo extends UFB_Field |
645 | { | |
646 | private static $validcomps = array('<', '<=', '=', '>=', '>'); | |
647 | private $comp; | |
648 | private $envfieldcomp; | |
649 | ||
650 | public function __construct($envfield, $fromtext = '', $envfieldcomp) | |
651 | { | |
652 | parent::__construct($envfield, $fromtext); | |
653 | $this->envfieldcomp = $envfieldcomp; | |
654 | } | |
655 | ||
656 | protected function check(UserFilterBuilder &$ufb) | |
657 | { | |
0f17825b | 658 | if ($ufb->blank($this->envfield) || $ufb->blank($this->envfieldcomp)) { |
d9b3d712 RB |
659 | $this->empty = true; |
660 | return true; | |
661 | } | |
662 | ||
9e6b7376 RB |
663 | $this->val = $ufb->i($this->envfield); |
664 | $this->comp = $ufb->v($this->envfieldcomp); | |
d9b3d712 RB |
665 | |
666 | if (!in_array($this->comp, self::$validcomps)) { | |
667 | return $this->raise("Le critère {$this->comp} n'est pas valide pour le champ %s"); | |
668 | } | |
669 | ||
670 | if (preg_match('/^[0-9]{2}$/', $this->val)) { | |
671 | $this->val += 1900; | |
672 | } | |
673 | if ($this->val < 1900 || $this->val > 9999) { | |
674 | return $this->raise("Le champ %s doit être une année à 4 chiffres."); | |
675 | } | |
676 | return true; | |
677 | } | |
678 | ||
679 | protected function buildUFC(UserFilterBuilder &$ufb) { | |
999db5aa | 680 | return new UFC_Promo($this->comp, UserFilter::GRADE_ING, $this->val); |
d9b3d712 RB |
681 | } |
682 | } | |
21b67462 RB |
683 | // }}} |
684 | ||
685 | // {{{ class UFBF_Sex | |
686 | class UFBF_Sex extends UFBF_Enum | |
687 | { | |
688 | public function __construct($envfield, $formtext = '') | |
689 | { | |
690 | parent::__construct($envfield, $formtext, array(1, 2)); | |
691 | } | |
692 | ||
693 | private static function getVal($id) | |
694 | { | |
695 | switch($id) { | |
696 | case 1: | |
697 | return User::GENDER_MALE; | |
698 | break; | |
699 | case 2: | |
700 | return User::GENDER_FEMALE; | |
701 | break; | |
702 | } | |
703 | } | |
704 | ||
705 | protected function buildUFC(UserFilterBuilder &$ufb) | |
706 | { | |
707 | return new UFC_Sex(self::getVal($this->val)); | |
708 | } | |
709 | } | |
710 | // }}} | |
711 | ||
78a47eb4 RB |
712 | // {{{ class UFBF_NotRegistered |
713 | // Simple field for selecting only alive, not registered users (for quick search) | |
714 | class UFBF_NotRegistered extends UFBF_Bool | |
715 | { | |
716 | protected function buildUFC(UserFilterBuilder &$ufb) | |
717 | { | |
718 | if ($this->val) { | |
719 | return new PFC_And( | |
720 | new PFC_Not(new UFC_Dead()), | |
721 | new PFC_Not(new UFC_Registered()) | |
722 | ); | |
723 | } | |
724 | } | |
725 | } | |
726 | // }}} | |
727 | ||
21b67462 RB |
728 | // {{{ class UFBF_Registered |
729 | class UFBF_Registered extends UFBF_Enum | |
730 | { | |
731 | public function __construct($envfield, $formtext = '') | |
732 | { | |
733 | parent::__construct($envfield, $formtext, array(1, 2)); | |
734 | } | |
735 | ||
736 | protected function buildUFC(UserFilterBuilder &$ufb) | |
737 | { | |
738 | if ($this->val == 1) { | |
739 | return new UFC_Registered(); | |
740 | } else if ($this->val == 2) { | |
e637cb69 | 741 | return new PFC_Not(new UFC_Registered()); |
21b67462 RB |
742 | } |
743 | } | |
744 | } | |
745 | // }}} | |
d9b3d712 | 746 | |
21b67462 RB |
747 | // {{{ class UFBF_Dead |
748 | class UFBF_Dead extends UFBF_Enum | |
749 | { | |
750 | public function __construct($envfield, $formtext = '') | |
751 | { | |
752 | parent::__construct($envfield, $formtext, array(1, 2)); | |
753 | } | |
754 | ||
755 | protected function buildUFC(UserFilterBuilder &$ufb) | |
756 | { | |
757 | if ($this->val == 1) { | |
2d9951d8 | 758 | return new PFC_Not(new UFC_Dead()); |
21b67462 RB |
759 | } else if ($this->val == 2) { |
760 | return new UFC_Dead(); | |
761 | } | |
762 | } | |
763 | } | |
764 | // }}} | |
765 | ||
766 | // {{{ class UFBF_Town | |
767 | /** Retrieves a town, either from a postal code or a town name | |
768 | */ | |
769 | class UFBF_Town extends UFBF_Text | |
770 | { | |
771 | const TYPE_TEXT = 1; | |
772 | const TYPE_ZIP = 2; | |
773 | const TYPE_ANY = 3; | |
774 | ||
775 | private $type; | |
d9696b0a RB |
776 | private $onlycurrentfield; |
777 | ||
778 | public function __construct($envfield, $formtext = '', $type = self::TYPE_ANY, $onlycurrentfield = 'only_current') | |
21b67462 RB |
779 | { |
780 | $this->type = $type; | |
d9696b0a | 781 | $this->onlycurrentfield = $onlycurrentfield; |
f3f800d8 | 782 | parent::__construct($envfield, $formtext, 2, 30); |
21b67462 RB |
783 | } |
784 | ||
785 | protected function buildUFC(UserFilterBuilder &$ufb) | |
786 | { | |
d9696b0a RB |
787 | if ($ufb->isOn($this->onlycurrentfield)) { |
788 | $flags = UFC_Address::FLAG_CURRENT; | |
789 | } else { | |
790 | $flags = UFC_Address::FLAG_ANY; | |
791 | } | |
792 | ||
21b67462 RB |
793 | if (preg_match('/[0-9]/', $this->val)) { |
794 | if ($this->type & self::TYPE_ZIP) { | |
d9696b0a | 795 | return new UFC_AddressField($this->val, UFC_AddressField::FIELD_ZIPCODE, UFC_Address::TYPE_ANY, $flags); |
21b67462 RB |
796 | } else { |
797 | return new PFC_False(); | |
798 | } | |
799 | } else { | |
1f8dfc60 | 800 | $byname = new UFC_AddressText(null, XDB::WILDCARD_CONTAINS, UFC_Address::TYPE_ANY, $flags, null, $this->val); |
d9696b0a | 801 | $byzip = new UFC_AddressField($this->val, UFC_AddressField::FIELD_ZIPCODE, UFC_Address::TYPE_ANY, $flags); |
21b67462 RB |
802 | if ($this->type & self::TYPE_ANY) { |
803 | return new PFC_Or($byname, $byzip); | |
804 | } else if ($this->type & self::TYPE_TEXT) { | |
805 | return $byname; | |
806 | } else { | |
807 | return $byzip; | |
808 | } | |
809 | } | |
810 | } | |
811 | } | |
812 | // }}} | |
813 | ||
814 | // {{{ class UFBF_Country | |
815 | class UFBF_Country extends UFBF_Mixed | |
816 | { | |
817 | protected $direnum = DirEnum::COUNTRIES; | |
d9696b0a RB |
818 | protected $onlycurrentfield; |
819 | ||
820 | public function __construct($envfieldtext, $envfieldindex, $formtext = '', $onlycurrentfield = 'only_current') | |
821 | { | |
822 | parent::__construct($envfieldtext, $envfieldindex, $formtext); | |
823 | $this->onlycurrentfield = $onlycurrentfield; | |
824 | } | |
21b67462 RB |
825 | |
826 | protected function buildUFC(UserFilterBuilder &$ufb) | |
827 | { | |
d9696b0a RB |
828 | if ($ufb->isOn($this->onlycurrentfield)) { |
829 | $flags = UFC_Address::FLAG_CURRENT; | |
830 | } else { | |
831 | $flags = UFC_Address::FLAG_ANY; | |
832 | } | |
833 | ||
834 | return new UFC_AddressField($this->val, UFC_AddressField::FIELD_COUNTRY, UFC_Address::TYPE_ANY, $flags); | |
21b67462 RB |
835 | } |
836 | } | |
837 | // }}} | |
838 | ||
839 | // {{{ class UFBF_AdminArea | |
32283a1a | 840 | class UFBF_AdminArea extends UFBF_Index |
21b67462 RB |
841 | { |
842 | protected $direnum = DirEnum::ADMINAREAS; | |
d9696b0a RB |
843 | protected $onlycurrentfield; |
844 | ||
32283a1a | 845 | public function __construct($envfield, $formtext = '', $onlycurrentfield = 'only_current') |
d9696b0a | 846 | { |
32283a1a | 847 | parent::__construct($envfield, $formtext); |
d9696b0a RB |
848 | $this->onlycurrentfield = $onlycurrentfield; |
849 | } | |
850 | ||
21b67462 RB |
851 | |
852 | protected function buildUFC(UserFilterBuilder &$ufb) | |
853 | { | |
d9696b0a RB |
854 | if ($ufb->isOn($this->onlycurrentfield)) { |
855 | $flags = UFC_Address::FLAG_CURRENT; | |
856 | } else { | |
857 | $flags = UFC_Address::FLAG_ANY; | |
858 | } | |
859 | ||
860 | return new UFC_AddressField($this->val, UFC_AddressField::FIELD_ADMAREA, UFC_Address::TYPE_ANY, $flags); | |
86ab1c8f SJ |
861 | } |
862 | } | |
863 | // }}} | |
864 | ||
865 | // {{{ class UFBF_SubAdminArea | |
866 | class UFBF_SubAdminArea extends UFBF_Index | |
867 | { | |
868 | protected $direnum = DirEnum::SUBADMINAREAS; | |
869 | protected $onlycurrentfield; | |
870 | ||
871 | public function __construct($envfield, $formtext = '', $onlycurrentfield = 'only_current') | |
872 | { | |
873 | parent::__construct($envfield, $formtext); | |
874 | $this->onlycurrentfield = $onlycurrentfield; | |
875 | } | |
876 | ||
877 | ||
878 | protected function buildUFC(UserFilterBuilder &$ufb) | |
879 | { | |
880 | if ($ufb->isOn($this->onlycurrentfield)) { | |
881 | $flags = UFC_Address::FLAG_CURRENT; | |
882 | } else { | |
883 | $flags = UFC_Address::FLAG_ANY; | |
884 | } | |
885 | ||
886 | return new UFC_AddressField($this->val, UFC_AddressField::FIELD_SUBADMAREA, UFC_Address::TYPE_ANY, $flags); | |
21b67462 RB |
887 | } |
888 | } | |
889 | // }}} | |
890 | ||
891 | // {{{ class UFBF_JobCompany | |
892 | class UFBF_JobCompany extends UFBF_Text | |
893 | { | |
d9696b0a RB |
894 | private $onlymentorfield; |
895 | ||
896 | public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent') | |
897 | { | |
898 | parent::__construct($envfield, $formtext); | |
899 | $this->onlymentorfield = $onlymentorfield; | |
900 | } | |
901 | ||
902 | public function check(UserFilterBuilder &$ufb) { | |
903 | if (parent::check($ufb)) { | |
904 | # No company check for mentors | |
905 | if ($ufb->isOn($this->onlymentorfield)) { | |
906 | $this->empty = true; | |
907 | } | |
908 | return true; | |
909 | } else { | |
910 | return false; | |
911 | } | |
912 | } | |
913 | ||
21b67462 RB |
914 | protected function buildUFC(UserFilterBuilder &$ufb) |
915 | { | |
916 | return new UFC_Job_Company(UFC_Job_Company::JOBNAME, $this->val); | |
917 | } | |
918 | } | |
919 | // }}} | |
920 | ||
3ac45f10 PC |
921 | // {{{ class UFBF_JobTerms |
922 | class UFBF_JobTerms extends UFBF_Index | |
923 | { | |
924 | protected function buildUFC(UserFilterBuilder &$ufb) | |
925 | { | |
926 | return new UFC_Job_Terms($this->val); | |
927 | } | |
928 | } | |
929 | // }}} | |
930 | ||
21b67462 RB |
931 | // {{{ class UFBF_JobDescription |
932 | class UFBF_JobDescription extends UFBF_Text | |
933 | { | |
d9696b0a RB |
934 | private $onlymentorfield; |
935 | ||
936 | public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent') | |
937 | { | |
938 | parent::__construct($envfield, $formtext); | |
939 | $this->onlymentorfield = $onlymentorfield; | |
940 | } | |
941 | ||
21b67462 RB |
942 | protected function buildUFC(UserFilterBuilder &$ufb) |
943 | { | |
d9696b0a RB |
944 | if ($ufb->isOn($this->onlymentorfield)) { |
945 | return new UFC_Mentor_Expertise($this->val); | |
946 | } else { | |
947 | return new UFC_Job_Description($this->val, UserFilter::JOB_USERDEFINED); | |
948 | } | |
21b67462 RB |
949 | } |
950 | } | |
951 | // }}} | |
952 | ||
953 | // {{{ class UFBF_JobCv | |
954 | class UFBF_JobCv extends UFBF_Text | |
955 | { | |
d9696b0a RB |
956 | private $onlymentorfield; |
957 | ||
958 | public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent') | |
959 | { | |
960 | parent::__construct($envfield, $formtext); | |
961 | $this->onlymentorfield = $onlymentorfield; | |
962 | } | |
963 | ||
21b67462 RB |
964 | protected function buildUFC(UserFilterBuilder &$ufb) |
965 | { | |
d9696b0a RB |
966 | if ($ufb->isOn($this->onlymentorfield)) { |
967 | return new UFC_Mentor_Expertise($this->val); | |
968 | } else { | |
969 | return new UFC_Job_Description($this->val, UserFilter::JOB_CV); | |
970 | } | |
21b67462 RB |
971 | } |
972 | } | |
973 | // }}} | |
974 | ||
975 | // {{{ class UFBF_Nationality | |
976 | class UFBF_Nationality extends UFBF_Mixed | |
977 | { | |
978 | protected $direnum = DirEnum::NATIONALITIES; | |
979 | ||
980 | protected function buildUFC(UserFilterBuilder &$ufb) | |
981 | { | |
982 | return new UFC_Nationality($this->val); | |
983 | } | |
984 | } | |
985 | // }}} | |
986 | ||
987 | // {{{ class UFBF_Binet | |
988 | class UFBF_Binet extends UFBF_Mixed | |
989 | { | |
990 | protected $direnum = DirEnum::BINETS; | |
991 | ||
992 | protected function buildUFC(UserFilterBuilder &$ufb) | |
993 | { | |
994 | return new UFC_Binet($this->val); | |
995 | } | |
996 | } | |
997 | // }}} | |
998 | ||
999 | // {{{ class UFBF_Group | |
1000 | class UFBF_Group extends UFBF_Mixed | |
1001 | { | |
1002 | protected $direnum = DirEnum::GROUPESX; | |
1003 | ||
1004 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1005 | { | |
1006 | if (count($this->val) == 1) { | |
1007 | return new UFC_Group($this->val[0]); | |
1008 | } | |
1009 | ||
1010 | $or = new PFC_Or(); | |
1011 | foreach ($this->val as $grp) { | |
1012 | $or->addChild(new UFC_Group($grp)); | |
1013 | } | |
1014 | return $or; | |
1015 | } | |
1016 | } | |
1017 | // }}} | |
1018 | ||
1019 | // {{{ class UFBF_Section | |
442f967f | 1020 | class UFBF_Section extends UFBF_Mixed |
21b67462 RB |
1021 | { |
1022 | protected $direnum = DirEnum::SECTIONS; | |
1023 | ||
1024 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1025 | { | |
1026 | return new UFC_Section($this->val); | |
1027 | } | |
1028 | } | |
1029 | // }}} | |
1030 | ||
fb3b6547 RB |
1031 | // {{{ class UFBF_EducationSchool |
1032 | class UFBF_EducationSchool extends UFBF_Mixed | |
21b67462 | 1033 | { |
fb3b6547 | 1034 | protected $direnum = DirEnum::EDUSCHOOLS; |
21b67462 RB |
1035 | |
1036 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1037 | { | |
fb3b6547 | 1038 | return new UFC_EducationSchool($this->val); |
21b67462 RB |
1039 | } |
1040 | } | |
1041 | // }}} | |
1042 | ||
fb3b6547 RB |
1043 | // {{{ class UFBF_EducationDegree |
1044 | class UFBF_EducationDegree extends UFBF_Mixed | |
21b67462 | 1045 | { |
fb3b6547 | 1046 | protected $direnum = DirEnum::EDUDEGREES; |
21b67462 RB |
1047 | |
1048 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1049 | { | |
fb3b6547 | 1050 | return new UFC_EducationDegree($this->val); |
21b67462 RB |
1051 | } |
1052 | } | |
1053 | // }}} | |
1054 | ||
fb3b6547 RB |
1055 | // {{{ class UFBF_EducationField |
1056 | class UFBF_EducationField extends UFBF_Mixed | |
21b67462 | 1057 | { |
fb3b6547 | 1058 | protected $direnum = DirEnum::EDUFIELDS; |
21b67462 RB |
1059 | |
1060 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1061 | { | |
fb3b6547 | 1062 | return new UFC_EducationField($this->val); |
21b67462 RB |
1063 | } |
1064 | } | |
1065 | // }}} | |
1066 | ||
1067 | // {{{ class UFBF_Comment | |
1068 | class UFBF_Comment extends UFBF_Text | |
1069 | { | |
1070 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1071 | { | |
1072 | return new UFC_Comment($this->val); | |
1073 | } | |
1074 | } | |
1075 | // }}} | |
3ed7556a RB |
1076 | |
1077 | // {{{ class UFBF_Phone | |
1078 | class UFBF_Phone extends UFBF_Text | |
1079 | { | |
1080 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1081 | { | |
1082 | return new UFC_Phone($this->val); | |
1083 | } | |
1084 | } | |
1085 | // }}} | |
1086 | ||
1087 | // {{{ class UFBF_Networking | |
1088 | class UFBF_Networking extends UFBF_Text | |
1089 | { | |
1090 | private $networktypefield; | |
1091 | private $nwtype; | |
1092 | ||
1093 | public function __construct($envfield, $networktypefield, $formtext = '') | |
1094 | { | |
1095 | parent::__construct($envfield, $formtext); | |
1096 | $this->networktypefield = $networktypefield; | |
1097 | } | |
1098 | ||
1099 | public function check(UserFilterBuilder &$ufb) | |
1100 | { | |
1101 | if (parent::check($ufb)) { | |
1102 | $this->nwtype = $ufb->i($this->networktypefield); | |
1103 | return true; | |
1104 | } else { | |
1105 | return false; | |
1106 | } | |
1107 | } | |
1108 | ||
1d364832 RB |
1109 | public function isEmpty() |
1110 | { | |
1111 | return parent::isEmpty() || $this->nwtype == 0; | |
1112 | } | |
1113 | ||
3ed7556a RB |
1114 | public function buildUFC(UserFilterBuilder &$ufb) |
1115 | { | |
1116 | return new UFC_Networking($this->nwtype, $this->val); | |
1117 | } | |
1118 | } | |
1119 | // }}} | |
6faa0186 | 1120 | |
96f01fba RB |
1121 | // {{{ class UFBF_Mentor |
1122 | class UFBF_Mentor extends UFBF_Bool | |
1123 | { | |
1124 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1125 | { | |
1126 | return new UFC_Mentor(); | |
1127 | } | |
1128 | } | |
1129 | // }}} | |
1130 | ||
6faa0186 | 1131 | // {{{ class UFBF_MentorCountry |
459e6f81 | 1132 | class UFBF_MentorCountry extends UFBF_Text |
6faa0186 RB |
1133 | { |
1134 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1135 | { | |
1136 | return new UFC_Mentor_Country($this->val); | |
1137 | } | |
1138 | } | |
1139 | // }}} | |
1140 | ||
459e6f81 PC |
1141 | // {{{ class UFBF_Mentorterm |
1142 | class UFBF_MentorTerm extends UFBF_Index | |
1143 | { | |
1144 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1145 | { | |
1146 | return new UFC_Mentor_Terms($this->val); | |
1147 | } | |
1148 | } | |
1149 | // }}} | |
1150 | ||
6faa0186 RB |
1151 | // {{{ class UFBF_MentorExpertise |
1152 | class UFBF_MentorExpertise extends UFBF_Text | |
1153 | { | |
1154 | protected function buildUFC(UserFilterBuilder &$ufb) | |
1155 | { | |
1156 | return new UFC_Mentor_Expertise($this->val); | |
1157 | } | |
1158 | } | |
1159 | // }}} | |
05fa89a5 FB |
1160 | |
1161 | // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: | |
d9b3d712 | 1162 | ?> |