2 /***************************************************************************
3 * Copyright (C) 2003-2010 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
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. *
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. *
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 *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 require_once 'directory.enums.inc.php';
24 // {{{ class UserFilterBuilder
25 class UserFilterBuilder
29 private $valid = true
;
31 private $orders = array();
34 * @param $fields An array of UFB_Field objects
35 * @param $envprefix Prefix to use for parts of the query
37 public function __construct($fields, $envprefix = '')
39 $this->fields
= $fields;
40 $this->envprefix
= $envprefix;
43 /** Builds the UFC; returns as soon as a field says it is invalid
45 private function buildUFC()
47 if ($this->ufc
!= null
) {
50 $this->ufc
= new PFC_And();
52 foreach ($this->fields
as $field) {
53 $this->valid
= $field->apply(&$this);
60 public function addCond(PlFilterCondition
&$cond)
62 $this->ufc
->addChild($cond);
65 public function addOrder(PlFilterOrder
&$order)
67 $this->order
[] = $order;
70 public function isValid()
76 /** Returns the built UFC
77 * @return The UFC, or PFC_False() if an error happened
79 public function &getUFC()
85 return new PFC_False();
89 /** Returns adequate orders
91 public function getOrders()
97 /** Wrappers around Env::i/s/..., to add envprefix
99 public function s($key, $def = '') {
100 return trim(Env
::s($this->envprefix
. $key, $def));
103 public function i($key, $def = 0) {
104 return intval(trim(Env
::i($this->envprefix
. $key, $def)));
107 public function v($key, $def = null
) {
108 return Env
::v($this->envprefix
. $key, $def);
111 public function has($key) {
112 return (Env
::has($this->envprefix
. $key) && strlen($this->s($key, '')) > 0);
115 public function isOn($key) {
116 return (Env
::has($this->envprefix
. $key) && $this->s($key) == 'on');
121 // {{{ class UFB_QuickSearch
122 class UFB_QuickSearch
extends UserFilterBuilder
124 public function __construct($envprefix = '')
127 new UFBF_Quick('quick', 'Recherche rapide'),
129 parent
::__construct($fields, $envprefix);
134 // {{{ class UFB_AdvancedSearch
135 class UFB_AdvancedSearch
extends UserFilterBuilder
137 public function __construct($envprefix = '')
140 new UFBF_Name('name', 'Nom'),
141 new UFBF_Promo('promo1', 'Promotion', 'egal1'),
142 new UFBF_Promo('promo2', 'Promotion', 'egal2'),
143 new UFBF_Sex('woman', 'Sexe'),
144 new UFBF_Registered('subscriber', 'Inscrit'),
145 new UFBF_Dead('alive', 'En vie'),
147 new UFBF_Town('city', 'Ville / Code Postal'),
148 new UFBF_Country('countryTxt', 'country', 'Pays'),
149 new UFBF_AdminArea('region', 'Région'),
151 new UFBF_JobCompany('entreprise', 'Entreprise'),
152 new UFBF_JobSector('sector', 'Poste'),
153 new UFBF_JobDescription('jobdescription', 'Fonction'),
154 new UFBF_JobCv('cv', 'CV'),
156 new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'),
157 new UFBF_Binet('binetTxt', 'binet', 'Binet'),
158 new UFBF_Group('groupexTxt', 'groupex', 'Groupe X'),
159 new UFBF_Section('sectionTxt', 'section', 'Section'),
161 new UFBF_Formation('schoolTxt', 'school', "École d'application"),
162 new UFBF_Diploma('diplomaTxt', 'diploma', 'Diplôme'),
163 new UFBF_StudiesDomain('fieldTxt', 'field', "Domaine d'études"),
165 new UFBF_Comment('free', 'Commentaire'),
166 new UFBF_Phone('phone_number', 'Téléphone'),
167 new UFBF_Networking('networking_address', 'networking_type', 'Networking et sites webs'),
169 parent
::__construct($fields, $envprefix);
174 // {{{ class UFB_Field
175 abstract class UFB_Field
180 protected $empty = false
;
181 protected $val = null
;
184 * @param $envfield Name of the field in the environment
185 * @param $formtext User-friendly name of that field
187 public function __construct($envfield, $formtext = '')
189 $this->envfield
= $envfield;
190 if ($formtext != '') {
191 $this->formtext
= $formtext;
193 $formtext = ucfirst($envfield);
197 /** Prints the given error message to the user, and returns false
198 * in order to be used as return $this->raise('ERROR');
200 * All %s in the $msg will be replaced with the formtext.
202 protected function raise($msg)
204 Platal
::page()->trigError(str_replace('%s', $this->formtext
, $msg));
208 public function apply(UserFilterBuilder
&$ufb) {
209 if (!$this->check($ufb)) {
214 $ufc = $this->buildUFC($ufb);
222 /** Create the UFC associated to the field; won't be called
223 * if the field is "empty"
224 * @param &$ufb UFB to which fields must be added
227 abstract protected function buildUFC(UserFilterBuilder
&$ufb);
229 /** This function is intended to run consistency checks on the value
230 * @return boolean Whether the input is valid
232 abstract protected function check(UserFilterBuilder
&$ufb);
236 // {{{ class UFBF_Text
237 abstract class UFBF_Text
extends UFB_Field
242 public function __construct($envfield, $formtext = '', $minlength = 2, $maxlength = 255)
244 parent
::__construct($envfield, $formtext);
245 $this->minlength
= $minlength;
246 $this->maxlength
= $maxlength;
249 protected function check(UserFilterBuilder
&$ufb)
251 if (!$ufb->has($this->envfield
)) {
256 $this->val
= $ufb->s($this->envfield
);
257 if (strlen($this->val
) < $this->minlength
) {
258 return $this->raise("Le champ %s est trop court (minimum {$this->minlength}).");
259 } else if (strlen($this->val
) > $this->maxlength
) {
260 return $this->raise("Le champ %s est trop long (maximum {$this->maxlength}).");
261 } else if (preg_match(":[\]\[<>{}~/§_`|%$^=+]|\*\*:u", $this->val
)) {
262 return $this->raise('Le champ %s contient un caractère interdit rendant la recherche impossible.');
270 // {{{ class UFBF_Range
271 /** Subclass to use for fields which only allow integers within a range
273 abstract class UFBF_Range
extends UFB_Field
279 public function __construct($envfield, $formtext = '', $min = 0, $max = 65535)
281 parent
::__construct($envfield, $formtext);
286 protected function check(UserFilterBuilder
&$ufb)
288 if (!$ufb->has($this->envfield
)) {
293 $this->val
= $ufb->i($this->envfield
);
294 if ($this->val
< $this->min
) {
295 return $this->raise("Le champs %s est inférieur au minimum ({$this->min}).");
296 } else if ($this->val
> $this->max
) {
297 return $this->raise("Le champ %s est supérieur au maximum ({$this->max}).");
304 // {{{ class UFBF_Index
305 /** Subclass to use for indexed fields
307 abstract class UFBF_Index
extends UFB_Field
309 protected function check(UserFilterBuilder
&$ufb)
311 if (!$ufb->has($this->envfield
)) {
319 // {{{ class UFBF_Enum
320 /** Subclass to use for fields whose value must belong to a specific set of values
322 abstract class UFBF_Enum
extends UFB_Field
324 protected $allowedvalues;
326 public function __construct($envfield, $formtext = '', $allowedvalues = array(), $strict = false
)
328 parent
::__construct($envfield, $formtext);
329 $this->allowedvalues
= $allowedvalues;
330 $this->strict
= $strict;
333 protected function check(UserFilterBuilder
&$ufb)
335 if (!$ufb->has($this->envfield
)) {
340 $this->val
= $ufb->v($this->envfield
);
341 if (! in_array($this->val
, $this->allowedvalues
)) {
343 return $this->raise("La valeur {$this->val} n'est pas valide pour le champ %s.");
353 // {{{ class UFBF_Bool
354 abstract class UFBF_Bool
extends UFB_Field
356 protected function check(UserFilterBuilder
&$ufb)
358 if (!$ufb->has($this->envfield
)) {
363 $this->val
= ($ufb->i($this->envfield
) != 0);
369 // {{{ class UFBF_Mixed
370 /** A class for building UFBFs when the user can input either a text or an ID
372 abstract class UFBF_Mixed
extends UFB_Field
374 /** Name of the DirEnum on which class is based
378 protected $envfieldindex;
380 public function __construct($envfieldtext, $envfieldindex, $formtext = '')
382 parent
::__construct($envfieldtext, $formtext);
383 $this->envfieldindex
= $envfieldindex;
386 protected function check(UserFilterBuilder
&$ufb)
388 if (!$ufb->has($this->envfieldindex
) && !$ufb->has($this->envfield
)) {
393 if ($ufb->has($this->envfieldindex
)) {
394 $index = $ufb->v($this->envfieldindex
);
395 if (is_int($index)) {
396 $index = intval($index);
398 $index = strtoupper($index);
400 $this->val
= array($index);
402 $indexes = DirEnum
::getIDs($this->direnum
, $ufb->s($this->envfield
),
403 $ufb->i('exact') ? DirEnumeration
::MODE_EXACT
: DirEnumeration
::MODE_CONTAINS
);
404 if (count($indexes) == 0) {
407 $this->val
= $indexes;
414 // {{{ class UFBF_Quick
415 class UFBF_Quick
extends UFB_Field
417 protected function check(UserFilterBuilder
&$ufb)
419 if (!$ufb->has($this->envfield
)) {
424 $this->val
= str_replace('*', '%', replace_accent($ufb->s($this->envfield
)));
429 protected function buildUFC(UserFilterBuilder
&$ufb)
432 $r = $s = $this->val
;
436 if (S
::admin() && strpos($s, '@') !== false
) {
437 return new UFC_Email($s);
438 } else if (S
::admin() && preg_match('/[0-9]+\.([0-9]+|%)\.([0-9]+|%)\.([0-9]+|%)/', $s)) {
439 // TODO: create UFC_Ip
440 // $this->conds->addChild(new UFC_Ip($s));
444 $conds = new PFC_And();
448 $s = preg_replace('!\d+!', ' ', $s);
449 $strings = preg_split("![^a-zA-Z%]+!",$s, -1, PREG_SPLIT_NO_EMPTY
);
450 if (count($strings) > 5) {
451 Platal
::page()->trigWarning("Tu as indiqué trop d'éléments dans ta recherche, seuls les 5 premiers seront pris en compte");
452 $strings = array_slice($strings, 0, 5);
455 if (count($strings)) {
459 $flags = array('public');
461 if ($ufb->i('soundex')) {
464 foreach ($strings as $string) {
465 $st[] = soundex_fr($string);
471 if ($ufb->i('exact')) {
476 $conds->addChild(new UFC_NameTokens($st, $flags, $soundex, $exact));
478 $ufb->addOrder(new UFO_Score());
483 $s = preg_replace('! *- *!', '-', $r);
484 $s = preg_replace('!([<>]) *!', ' \1', $s);
485 $s = preg_replace('![^0-9\-><]!', ' ', $s);
486 $s = preg_replace('![<>\-] !', '', $s);
487 $ranges = preg_split('! +!', $s, -1, PREG_SPLIT_NO_EMPTY
);
488 foreach ($ranges as $r) {
489 if (preg_match('!^\d{4}$!', $r)) {
490 $conds->addChild(new UFC_Promo('=', UserFilter
::DISPLAY
, 'X' . $r));
491 } elseif (preg_match('!^(\d{4})-(\d{4})$!', $r, $matches)) {
492 $p1=min(intval($matches[1]), intval($matches[2]));
493 $p2=max(intval($matches[1]), intval($matches[2]));
494 $conds->addChild(new PFC_And(
495 new UFC_Promo('>=', UserFilter
::DISPLAY
, 'X' . $p1),
496 new UFC_Promo('<=', UserFilter
::DISPLAY
, 'X' . $p2)
498 } elseif (preg_match('!^<(\d{4})!', $r, $matches)) {
499 $conds->addChild(new UFC_Promo('<=', UserFilter
::DISPLAY
, 'X' . $matches[1]));
500 } elseif (preg_match('!^>(\d{4})!', $r, $matches)) {
501 $conds->addChild(new UFC_Promo('>=', UserFilter
::DISPLAY
, 'X' . $matches[1]));
507 $t = preg_replace('!(\d{4}-\d{4}|>\d{4}|<\d{4})!', '', $s);
508 $t = preg_replace('![<>\- ]!', '', $t);
509 if (strlen($t) > 4) {
510 $conds->addChild(new UFC_Phone($t));
518 // {{{ class UFBF_Name
519 class UFBF_Name
extends UFBF_Text
521 protected function check(UserFilterBuilder
&$ufb)
523 if (!parent
::check($ufb)) {
527 $this->val
= preg_split('/[[:space:]]/', $this->val
);
528 if (count($this->val
) == 0) {
534 protected function buildUFC(UserFilterBuilder
&$ufb)
536 return new UFC_NameTokens($this->val
, array(), $ufb->i('with_soundex'), $ufb->i('exact'));
541 // {{{ class UFBF_Promo
542 class UFBF_Promo
extends UFB_Field
544 private static $validcomps = array('<', '<=', '=', '>=', '>');
546 private $envfieldcomp;
548 public function __construct($envfield, $fromtext = '', $envfieldcomp)
550 parent
::__construct($envfield, $fromtext);
551 $this->envfieldcomp
= $envfieldcomp;
554 protected function check(UserFilterBuilder
&$ufb)
556 if (!$ufb->has($this->envfield
) ||
!$ufb->has($this->envfieldcomp
)) {
561 $this->val
= $ubf->i($this->envfield
);
562 $this->comp
= $ubf->v($this->envfieldcomp
);
564 if (!in_array($this->comp
, self
::$validcomps)) {
565 return $this->raise("Le critère {$this->comp} n'est pas valide pour le champ %s");
568 if (preg_match('/^[0-9]{2}$/', $this->val
)) {
571 if ($this->val
< 1900 ||
$this->val
> 9999) {
572 return $this->raise("Le champ %s doit être une année à 4 chiffres.");
577 protected function buildUFC(UserFilterBuilder
&$ufb) {
578 return new UFC_Promo($this->comp
, UserFilter
::DISPLAY
, 'X' . $this->val
);
583 // {{{ class UFBF_Sex
584 class UFBF_Sex
extends UFBF_Enum
586 public function __construct($envfield, $formtext = '')
588 parent
::__construct($envfield, $formtext, array(1, 2));
591 private static function getVal($id)
595 return User
::GENDER_MALE
;
598 return User
::GENDER_FEMALE
;
603 protected function buildUFC(UserFilterBuilder
&$ufb)
605 return new UFC_Sex(self
::getVal($this->val
));
610 // {{{ class UFBF_Registered
611 class UFBF_Registered
extends UFBF_Enum
613 public function __construct($envfield, $formtext = '')
615 parent
::__construct($envfield, $formtext, array(1, 2));
618 protected function buildUFC(UserFilterBuilder
&$ufb)
620 if ($this->val
== 1) {
621 return new UFC_Registered();
622 } else if ($this->val
== 2) {
623 return new PFC_Not(UFC_Registered());
629 // {{{ class UFBF_Dead
630 class UFBF_Dead
extends UFBF_Enum
632 public function __construct($envfield, $formtext = '')
634 parent
::__construct($envfield, $formtext, array(1, 2));
637 protected function buildUFC(UserFilterBuilder
&$ufb)
639 if ($this->val
== 1) {
640 return new PFC_Not(UFC_Dead());
641 } else if ($this->val
== 2) {
642 return new UFC_Dead();
648 // {{{ class UFBF_Town
649 /** Retrieves a town, either from a postal code or a town name
651 class UFBF_Town
extends UFBF_Text
658 private $onlycurrentfield;
660 public function __construct($envfield, $formtext = '', $type = self
::TYPE_ANY
, $onlycurrentfield = 'only_current')
663 $this->onlycurrentfield
= $onlycurrentfield;
664 parent
::__construct($envfield, $formtext, 2, 30);
667 protected function buildUFC(UserFilterBuilder
&$ufb)
669 if ($ufb->isOn($this->onlycurrentfield
)) {
670 $flags = UFC_Address
::FLAG_CURRENT
;
672 $flags = UFC_Address
::FLAG_ANY
;
675 if (preg_match('/[0-9]/', $this->val
)) {
676 if ($this->type
& self
::TYPE_ZIP
) {
677 return new UFC_AddressField($this->val
, UFC_AddressField
::FIELD_ZIPCODE
, UFC_Address
::TYPE_ANY
, $flags);
679 return new PFC_False();
682 $byname = new UFC_AddressText(null
, UFC_Address
::CONTAINS
, UFC_Address
::TYPE_ANY
, $flags, null
, $this->val
);
683 $byzip = new UFC_AddressField($this->val
, UFC_AddressField
::FIELD_ZIPCODE
, UFC_Address
::TYPE_ANY
, $flags);
684 if ($this->type
& self
::TYPE_ANY
) {
685 return new PFC_Or($byname, $byzip);
686 } else if ($this->type
& self
::TYPE_TEXT
) {
696 // {{{ class UFBF_Country
697 class UFBF_Country
extends UFBF_Mixed
699 protected $direnum = DirEnum
::COUNTRIES
;
700 protected $onlycurrentfield;
702 public function __construct($envfieldtext, $envfieldindex, $formtext = '', $onlycurrentfield = 'only_current')
704 parent
::__construct($envfieldtext, $envfieldindex, $formtext);
705 $this->onlycurrentfield
= $onlycurrentfield;
708 protected function buildUFC(UserFilterBuilder
&$ufb)
710 if ($ufb->isOn($this->onlycurrentfield
)) {
711 $flags = UFC_Address
::FLAG_CURRENT
;
713 $flags = UFC_Address
::FLAG_ANY
;
716 return new UFC_AddressField($this->val
, UFC_AddressField
::FIELD_COUNTRY
, UFC_Address
::TYPE_ANY
, $flags);
721 // {{{ class UFBF_AdminArea
722 class UFBF_AdminArea
extends UFBF_Mixed
724 protected $direnum = DirEnum
::ADMINAREAS
;
725 protected $onlycurrentfield;
727 public function __construct($envfieldtext, $envfieldindex, $formtext = '', $onlycurrentfield = 'only_current')
729 parent
::__construct($envfieldtext, $envfieldindex, $formtext);
730 $this->onlycurrentfield
= $onlycurrentfield;
734 protected function buildUFC(UserFilterBuilder
&$ufb)
736 if ($ufb->isOn($this->onlycurrentfield
)) {
737 $flags = UFC_Address
::FLAG_CURRENT
;
739 $flags = UFC_Address
::FLAG_ANY
;
742 return new UFC_AddressField($this->val
, UFC_AddressField
::FIELD_ADMAREA
, UFC_Address
::TYPE_ANY
, $flags);
747 // {{{ class UFBF_JobCompany
748 class UFBF_JobCompany
extends UFBF_Text
750 private $onlymentorfield;
752 public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent')
754 parent
::__construct($envfield, $formtext);
755 $this->onlymentorfield
= $onlymentorfield;
758 public function check(UserFilterBuilder
&$ufb) {
759 if (parent
::check($ufb)) {
760 # No company check for mentors
761 if ($ufb->isOn($this->onlymentorfield
)) {
770 protected function buildUFC(UserFilterBuilder
&$ufb)
772 return new UFC_Job_Company(UFC_Job_Company
::JOBNAME
, $this->val
);
777 // {{{ class UFBF_JobSector
778 class UFBF_JobSector
extends UFBF_Mixed
780 protected $direnum = DirEnum
::SECTORS
;
781 private $onlymentorfield;
783 public function __construct($envfieldtext, $envfieldindex, $formtext = '', $onlymentorfield = 'only_referent')
785 parent
::__construct($envfieldtext, $envfieldindex, $formtext);
786 $this->onlymentorfield
= $onlymentorfield;
789 protected function buildUFC(UserFilterBuilder
&$ufb)
791 if ($ufb->isOn($this->onlymentorfield
)) {
792 return new UFC_Mentor_Sectorization($this->val
, UserFilter
::JOB_SUBSECTOR
);
794 return new UFC_Job_Sectorization($this->val
, UserFilter
::JOB_SUBSUBSECTOR
);
800 // {{{ class UFBF_JobDescription
801 class UFBF_JobDescription
extends UFBF_Text
803 private $onlymentorfield;
805 public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent')
807 parent
::__construct($envfield, $formtext);
808 $this->onlymentorfield
= $onlymentorfield;
811 protected function buildUFC(UserFilterBuilder
&$ufb)
813 if ($ufb->isOn($this->onlymentorfield
)) {
814 return new UFC_Mentor_Expertise($this->val
);
816 return new UFC_Job_Description($this->val
, UserFilter
::JOB_USERDEFINED
);
822 // {{{ class UFBF_JobCv
823 class UFBF_JobCv
extends UFBF_Text
825 private $onlymentorfield;
827 public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent')
829 parent
::__construct($envfield, $formtext);
830 $this->onlymentorfield
= $onlymentorfield;
833 protected function buildUFC(UserFilterBuilder
&$ufb)
835 if ($ufb->isOn($this->onlymentorfield
)) {
836 return new UFC_Mentor_Expertise($this->val
);
838 return new UFC_Job_Description($this->val
, UserFilter
::JOB_CV
);
844 // {{{ class UFBF_Nationality
845 class UFBF_Nationality
extends UFBF_Mixed
847 protected $direnum = DirEnum
::NATIONALITIES
;
849 protected function buildUFC(UserFilterBuilder
&$ufb)
851 return new UFC_Nationality($this->val
);
856 // {{{ class UFBF_Binet
857 class UFBF_Binet
extends UFBF_Mixed
859 protected $direnum = DirEnum
::BINETS
;
861 protected function buildUFC(UserFilterBuilder
&$ufb)
863 return new UFC_Binet($this->val
);
868 // {{{ class UFBF_Group
869 class UFBF_Group
extends UFBF_Mixed
871 protected $direnum = DirEnum
::GROUPESX
;
873 protected function buildUFC(UserFilterBuilder
&$ufb)
875 if (count($this->val
) == 1) {
876 return new UFC_Group($this->val
[0]);
880 foreach ($this->val
as $grp) {
881 $or->addChild(new UFC_Group($grp));
888 // {{{ class UFBF_Section
889 class UFBF_Section
extends UFBF_Index
891 protected $direnum = DirEnum
::SECTIONS
;
893 protected function buildUFC(UserFilterBuilder
&$ufb)
895 return new UFC_Section($this->val
);
900 // {{{ class UFBF_Formation
901 class UFBF_Formation
extends UFBF_Mixed
903 protected $direnum = DirEnum
::SCHOOLS
;
905 protected function buildUFC(UserFilterBuilder
&$ufb)
907 return new UFC_Formation($this->val
);
912 // {{{ class UFBF_Diploma
913 class UFBF_Diploma
extends UFBF_Mixed
915 protected $direnum = DirEnum
::DEGREES
;
917 protected function buildUFC(UserFilterBuilder
&$ufb)
919 return new UFC_Diploma($this->val
);
924 // {{{ class UFBF_StudiesDomain
925 class UFBF_StudiesDomain
extends UFBF_Mixed
927 protected $direnum = DirEnum
::STUDIESDOMAINS
;
929 protected function buildUFC(UserFilterBuilder
&$ufb)
931 return new UFC_StudyField($this->val
);
936 // {{{ class UFBF_Comment
937 class UFBF_Comment
extends UFBF_Text
939 protected function buildUFC(UserFilterBuilder
&$ufb)
941 return new UFC_Comment($this->val
);
946 // {{{ class UFBF_Phone
947 class UFBF_Phone
extends UFBF_Text
949 protected function buildUFC(UserFilterBuilder
&$ufb)
951 return new UFC_Phone($this->val
);
956 // {{{ class UFBF_Networking
957 class UFBF_Networking
extends UFBF_Text
959 private $networktypefield;
962 public function __construct($envfield, $networktypefield, $formtext = '')
964 parent
::__construct($envfield, $formtext);
965 $this->networktypefield
= $networktypefield;
968 public function check(UserFilterBuilder
&$ufb)
970 if (parent
::check($ufb)) {
971 $this->nwtype
= $ufb->i($this->networktypefield
);
978 public function buildUFC(UserFilterBuilder
&$ufb)
980 return new UFC_Networking($this->nwtype
, $this->val
);