X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fdirenum.php;h=e0b485df2e65c5f06094d8c9e4297a4e914ed879;hb=d989355f50a69412c756e6729c83cba913683e40;hp=2cd0f410bdeb649689e2b1e20b552ab52f30e3b1;hpb=70bcaa84dbf13b5398cd8a55689ed4ac187e5e86;p=platal.git diff --git a/classes/direnum.php b/classes/direnum.php index 2cd0f41..e0b485d 100644 --- a/classes/direnum.php +++ b/classes/direnum.php @@ -30,6 +30,7 @@ class DirEnum * being DE_$basename). */ const NAMETYPES = 'nametypes'; + const NAMES = 'names'; const BINETS = 'binets'; const GROUPESX = 'groupesx'; @@ -93,8 +94,10 @@ class DirEnum self::init($type); } $obj = self::$enumerations[$type]; + $args = func_get_args(); + array_shift($args); if ($obj->capabilities & DirEnumeration::HAS_OPTIONS) { - return call_user_func(array($obj, 'getOptionsIter')); + return call_user_func_array(array($obj, 'getOptionsIter'), $args); } else { return PlIteratorUtils::fromArray(array()); } @@ -343,7 +346,7 @@ abstract class DE_WithSuboption extends DirEnumeration } else if (array_key_exists($subid, $this->suboptions)) { return $this->suboptions[$subid]; } else { - return false; + return array(); } } @@ -427,6 +430,18 @@ class DE_NameTypes extends DirEnumeration } // }}} +// {{{ class DE_Names +// returns 'system' names ('lastname', 'lastname_marital', ...) +class DE_Names extends DirEnumeration +{ + public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION; + + protected $from = 'profile_name_enum'; + protected $idfield = 'type'; + protected $valfield = 'name'; +} +// }}} + /** GROUPS */ // {{{ class DE_Binets @@ -602,12 +617,12 @@ class DE_JobDescription extends DirEnumeration // {{{ class DE_Networking class DE_Networking extends DirEnumeration { - protected $idfield = 'profile_networking_enum.network_type'; + protected $idfield = 'profile_networking_enum.nwid'; protected $valfield = 'profile_networking_enum.name'; protected $from = 'profile_networking_enum'; - protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.network_type = profile_networking_enum.network_type)'; + protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.nwid = profile_networking_enum.nwid)'; protected $ac_unique = 'profile_networking.pid'; } // }}}