2 /***************************************************************************
3 * Copyright (C) 2003-2013 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 ***************************************************************************/
23 /** This class stores all data for the different kinds of fields.
24 * It is only a dispatcher for the various DirEnum_XXX classes.
28 /** Name of availables Enumerations
29 * Each of these consts contains the basename of the class (its full name
30 * being DE_$basename).
32 const BINETS
= 'binets';
33 const GROUPESX
= 'groupesx';
34 const SECTIONS
= 'sections';
36 const EDUSCHOOLS
= 'educationschools';
37 const EDUDEGREES
= 'educationdegrees';
38 const EDUFIELDS
= 'educationfields';
40 const CURRENTCORPS
= 'currentcorps';
41 const ORIGINCORPS
= 'origincorps';
42 const CORPSRANKS
= 'corpsranks';
44 const NATIONALITIES
= 'nationalities';
45 const POSTALCODES
= 'postalcodes';
46 const SUBLOCALITIES
= 'sublocalities';
47 const LOCALITIES
= 'localities';
48 const ADMNISTRATIVEAREAS3
= 'admnistrativeareas3';
49 const ADMNISTRATIVEAREAS2
= 'admnistrativeareas2';
50 const ADMNISTRATIVEAREAS1
= 'admnistrativeareas1';
51 const COUNTRIES
= 'countries';
53 const COMPANIES
= 'companies';
54 const JOBDESCRIPTION
= 'jobdescription';
55 const JOBTERMS
= 'jobterms';
57 const NETWORKS
= 'networking';
59 const MEDALS
= 'medals';
61 const ACCOUNTTYPES
= 'accounttypes';
62 const SKINS
= 'skins';
64 static private $enumerations = array();
66 static private function init($type)
68 if (Platal
::globals()->cacheEnabled() && S
::has('__DE_' . $type)) {
69 self
::$enumerations[$type] = S
::v('__DE_' . $type);
71 $cls = "DE_" . ucfirst($type);
73 self
::$enumerations[$type] = $obj;
74 if (Platal
::globals()->cacheEnabled()
75 && $obj->capabilities
& DirEnumeration
::SAVE_IN_SESSION
) {
76 S
::set('__DE_' . $type, $obj);
81 /** Retrieves all options for a given type
82 * @param $type Type of enum for which options are requested
83 * @return Array of the results
85 static public function getOptions($type)
87 if (!array_key_exists($type, self
::$enumerations)) {
90 $obj = self
::$enumerations[$type];
91 if ($obj->capabilities
& DirEnumeration
::HAS_OPTIONS
) {
92 return call_user_func(array($obj, 'getOptions'));
98 /** Retrieves all options for a given type
99 * @param $type Type of enum for which options are requested
100 * @return PlIterator over the results
102 static public function getOptionsIter($type)
104 if (!array_key_exists($type, self
::$enumerations)) {
107 $obj = self
::$enumerations[$type];
108 $args = func_get_args();
110 if ($obj->capabilities
& DirEnumeration
::HAS_OPTIONS
) {
111 return call_user_func_array(array($obj, 'getOptionsIter'), $args);
113 return PlIteratorUtils
::fromArray(array());
117 /** Retrieves all options with number of profiles for autocompletion
118 * @param $type Type of enum for which options are requested
119 * @param $text Text to autocomplete
120 * @return PlIterator over the results
122 static public function getAutoComplete($type, $text, $sub_id = null
)
124 if (!array_key_exists($type, self
::$enumerations)) {
127 $obj = self
::$enumerations[$type];
128 if ($obj->capabilities
& DirEnumeration
::HAS_AUTOCOMP
) {
129 return call_user_func_array(array($obj, 'getAutoComplete'), array($text, $sub_id));
135 /** Retrieves a list of IDs for a given type
136 * @param $type Type of enum for which IDs are requested
137 * @param $text Text to search in enum valuees
138 * @param $mode Mode of search for those IDs (prefix/suffix/infix)
140 static public function getIDs($type, $text, $mode = XDB
::WILDCARD_EXACT
)
142 if (!array_key_exists($type, self
::$enumerations)) {
145 $obj = self
::$enumerations[$type];
146 if ($obj->capabilities
& DirEnumeration
::HAS_OPTIONS
) {
147 return call_user_func(array($obj, 'getIDs'), $text, $mode);
153 /** Retrieves a single ID for a given type.
154 * @param $type Type of the enum for which an ID is requested
155 * @param $text Text to search in enum values
156 * @param $mode Mode of search of that ID (prefix/suffix/infix/exact)
158 static public function getID($type, $text, $mode = XDB
::WILDCARD_EXACT
)
160 $ids = self
::getIDs($type, $text, $mode);
161 return array_shift($ids);
166 // {{{ class DirEnumeration
167 abstract class DirEnumeration
169 const AUTOCOMPLETE_LIMIT
= 11;
171 const HAS_OPTIONS
= 0x001;
172 const HAS_AUTOCOMP
= 0x002;
173 const SAVE_IN_SESSION
= 0x004;
175 public $capabilities = 0x003; // self::HAS_OPTIONS | self::HAS_AUTOCOMP;
177 /** An internal array of ID => optionTxt
179 protected $options = null
;
181 /** Description of the MySQL storage of the fields
183 protected $idfield = 'id';
184 protected $valfield = 'text';
185 protected $valfield2 = null
;
187 protected $join = '';
188 protected $where = '';
190 /** Fields for autocompletion
192 protected $ac_join = ''; // Additional joins
193 protected $ac_where = null
; // Additional where
194 protected $ac_beginwith = true
; // Whether to search for 'x%' or for '%x%'
195 protected $ac_unique; // Which field is to be taken as unique
196 protected $ac_distinct = true
; // Whether we want to keep only distinct valfield value
197 protected $ac_withid = true
; // Do we want to fetch id too ?
199 protected function _fetchOptions()
201 if (is_null($this->options
)) {
202 $this->loadOptions();
206 public function getOptions()
208 $this->_fetchOptions();
209 return $this->options
;
212 public function getOptionsIter()
214 $options = $this->getOptions();
215 $options = self
::expandArray($options);
216 return PlIteratorUtils
::fromArray($options, 1, true
);
219 // {{{ function getIDs
220 /** Retrieves possible IDs for given text
221 * @param $text Text to search for IDs
222 * @param $mode Mode of search (PREFIX, SUFFIX, CONTAINS)
223 * @return An array of matching IDs ; if empty, input should be considered invalid
225 public function getIDs($text, $mode)
227 if ($mode == XDB
::WILDCARD_EXACT
) {
228 $options = $this->getOptions();
229 return array_keys($options, $text);
231 if ($this->where
== null
) {
234 $where = $this->where
. ' AND ';
237 $conds[] = $this->valfield
. XDB
::formatWildcards($mode, $text);
238 if ($this->valfield2
!= null
) {
239 $conds[] = $this->valfield2
. XDB
::formatWildcards($mode, $text);
241 $where .= '(' . implode(' OR ', $conds) . ')';
243 return XDB
::fetchColumn('SELECT ' . $this->idfield
. '
244 FROM ' . $this->from
. '
247 GROUP BY ' . $this->idfield
);
252 /** Builds a list of query parts for searching @$text in @$field :
253 * field LIKE 'text%', field LIKE '% text%', field LIKE '%-text%'
255 protected function mkTests($field, $text)
258 $tests[] = $field . XDB
::formatWildcards(XDB
::WILDCARD_PREFIX
, $text);
259 if (!$this->ac_beginwith
) {
260 $tests[] = $field . XDB
::formatWildcards(XDB
::WILDCARD_CONTAINS
, ' ' . $text);
261 $tests[] = $field . XDB
::formatWildcards(XDB
::WILDCARD_CONTAINS
, '-' . $text);
266 static protected function expandArray(array $tab, $keyname = 'id', $valname = 'field')
269 foreach ($tab as $key => $val) {
278 // {{{ function getAutoComplete
279 public function getAutoComplete($text, $sub_id = null
)
281 $text = str_replace(array('%', '_'), '', $text);
283 if (is_null($this->ac_where
) ||
$this->ac_where
== '') {
286 $where = $this->ac_where
. ' AND ';
289 $tests = $this->mkTests($this->valfield
, $text);
290 if (!is_null($this->valfield2
)) {
291 $tests = array_merge($tests, $this->mkTests($this->valfield2
, $text));
294 $where .= '(' . implode(' OR ', $tests) . ')';
296 return XDB
::fetchAllAssoc('SELECT ' . $this->valfield
. ' AS field'
297 . ($this->ac_distinct ?
(', COUNT(DISTINCT ' . $this->ac_unique
. ') AS nb') : '')
298 . ($this->ac_withid ?
(', ' . $this->idfield
. ' AS id') : '') . '
299 FROM ' . $this->from
. '
300 ' . $this->ac_join
. '
302 GROUP BY ' . $this->valfield
. '
303 ORDER BY ' . ($this->ac_distinct ?
'nb DESC' : $this->valfield
) . '
304 LIMIT ' . self
::AUTOCOMPLETE_LIMIT
);
308 // {{{ function loadOptions
309 /** The function used to load options
311 protected function loadOptions()
313 $this->options
= XDB
::fetchAllAssoc('id', 'SELECT ' . $this->valfield
. ' AS field,
314 ' . $this->idfield
. ' AS id
315 FROM ' . $this->from
. '
318 GROUP BY ' . $this->valfield
. '
319 ORDER BY ' . $this->valfield
);
325 // {{{ class DE_WithSuboption
326 /** A class for DirEnum with possibility to select only suboptions for a given parameter (country, school, ...)
328 abstract class DE_WithSuboption
extends DirEnumeration
332 protected $suboptions = null
;
334 protected function _fetchSubOptions($subid)
336 if (is_null($this->suboptions
)) {
337 $this->loadSubOptions($subid);
341 protected function loadSubOptions($subid)
343 $where = ($this->where
== '') ?
'' : $this->where
. ' AND ';
344 $this->suboptions
= XDB
::fetchAllAssoc('id', 'SELECT ' . $this->valfield
. ' AS field,
345 ' . $this->idfield
. ' AS id
346 FROM ' . $this->from
. '
348 WHERE ' . $where . $this->optfield
. ' = ' . $subid . '
349 GROUP BY ' . $this->valfield
. '
350 ORDER BY ' . $this->valfield
);
353 public function getOptions($subid = null
)
355 if ($subid == null
) {
356 $this->_fetchOptions();
357 return $this->options
;
360 $this->_fetchSubOptions($subid);
361 if (is_array($this->suboptions
)) {
362 return $this->suboptions
;
368 public function getOptionsIter($subid = null
)
370 return PlIteratorUtils
::fromArray(self
::expandArray($this->getOptions($subid)), 1, true
);
373 public function getIDs($text, $mode, $subid = null
)
375 if ($mode == XDB
::WILDCARD_EXACT
) {
376 $options = $this->getOptions($subid);
377 return array_keys($options, $text);
379 if ($this->where
== null
) {
382 $where = $this->where
. ' AND ';
384 if ($subid != null
&& array_key_exists($subid, $this->suboptions
)) {
385 $where .= XDB
::format($this->optfield
. ' = {?} AND ', $subid);
389 $conds[] = $this->valfield
. XDB
::formatWildcards($mode, $text);
390 if ($this->valfield2
!= null
) {
391 $conds[] = $this->valfield2
. XDB
::formatWildcards($mode, $text);
393 $where .= '(' . implode(' OR ', $conds) . ')';
395 return XDB
::fetchColumn('SELECT ' . $this->idfield
. '
396 FROM ' . $this->from
. '
399 GROUP BY ' . $this->idfield
);
403 public function getAutoComplete($text, $subid = null
)
405 $text = str_replace(array('%', '_'), '', $text);
407 if (is_null($this->ac_where
) ||
$this->ac_where
== '') {
410 $where = $this->ac_where
. ' AND ';
413 if ($subid != null
&& array_key_exists($subid, $this->suboptions
)) {
414 $where .= XDB
::format($this->optfield
. ' = {?} AND ', $subid);
417 $tests = $this->mkTests($this->valfield
, $text);
418 if (!is_null($this->valfield2
)) {
419 $tests = array_merge($tests, $this->mkTests($this->valfield2
, $text));
422 $where .= '(' . implode(' OR ', $tests) . ')';
424 return XDB
::fetchAllAssoc('SELECT ' . $this->valfield
. ' AS field'
425 . ($this->ac_distinct ?
(', COUNT(DISTINCT ' . $this->ac_unique
. ') AS nb') : '')
426 . ($this->ac_withid ?
(', ' . $this->idfield
. ' AS id') : '') . '
427 FROM ' . $this->from
. '
428 ' . $this->ac_join
. '
430 GROUP BY ' . $this->valfield
. '
431 ORDER BY ' . ($this->ac_distinct ?
'nb DESC' : $this->valfield
) . '
432 LIMIT ' . self
::AUTOCOMPLETE_LIMIT
);
439 // {{{ class DE_Binets
440 class DE_Binets
extends DirEnumeration
442 protected $from = 'profile_binet_enum';
444 protected $ac_join = 'INNER JOIN profile_binets ON (profile_binet_enum.id = profile_binets.binet_id)';
445 protected $ac_unique = 'profile_binets.pid';
449 // {{{ class DE_Sections
450 class DE_Sections
extends DirEnumeration
452 protected $from = 'profile_section_enum';
454 protected $ac_join = 'INNER JOIN profiles ON (profiles.section = profile_section_enum.id)';
455 protected $ac_unique = 'profiles.pid';
459 // {{{ class DE_GroupesX
460 class DE_GroupesX
extends DirEnumeration
462 protected $idfield = 'groups.id';
463 protected $valfield = 'groups.nom';
464 protected $valfield2 = 'groups.diminutif';
465 protected $from = 'groups';
466 protected $where = 'WHERE (cat = \'GroupesX\' OR cat = \'Institutions\') AND pub = \'public\'';
468 protected $ac_join = "INNER JOIN group_members ON (groups.id = group_members.asso_id
469 AND (groups.cat = 'GroupesX' OR groups.cat = 'Institutions')
470 AND groups.pub = 'public')";
471 protected $ac_unique = 'group_members.uid';
477 // {{{ class DE_EducationSchools
478 class DE_EducationSchools
extends DirEnumeration
480 protected $ac_beginwith = false
;
481 protected $idfield = 'profile_education_enum.id';
482 protected $valfield = 'profile_education_enum.name';
483 protected $valfield2 = 'profile_education_enum.abbreviation';
484 protected $from = 'profile_education_enum';
486 protected $ac_join = 'INNER JOIN profile_education ON (profile_education.eduid = profile_education_enum.id)';
487 protected $ac_unique = 'profile_education.pid';
491 // {{{ class DE_EducationDegrees
492 class DE_EducationDegrees
extends DE_WithSuboption
494 public $capabilities = self
::HAS_OPTIONS
;
496 protected $idfield = 'profile_education_degree.degreeid';
497 protected $optfield = 'profile_education_degree.eduid';
498 protected $valfield = 'profile_education_degree_enum.degree';
499 protected $from = 'profile_education_degree_enum';
500 protected $join = 'INNER JOIN profile_education_degree ON (profile_education_degree.degreeid = profile_education_degree_enum.id)';
505 // {{{ class DE_EducationFields
506 class DE_EducationFields
extends DirEnumeration
508 protected $valfield = 'profile_education_field_enum.field';
509 protected $from = 'profile_education_field_enum';
511 protected $ac_join = 'INNER JOIN profile_education ON (profile_education.fieldid = profile_education_field_enum.id)';
512 protected $ac_unique = 'profile_education.pid';
516 // {{{ class DE_CurrentCorps
517 class DE_CurrentCorps
extends DirEnumeration
519 protected $idfield = 'profile_corps_enum.id';
520 protected $valfield = 'profile_corps_enum.name';
521 protected $valfield2 = 'profile_corps_enum.abbrev';
522 protected $from = 'profile_corps_enum';
523 protected $where = 'WHERE profile_corps_enum.still_exists = 1';
525 protected $ac_unique = 'profile_corps.pid';
526 protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.current_corpsid = profile_corps_enum.id)';
530 // {{{ class DE_OriginCorps
531 class DE_OriginCorps
extends DirEnumeration
533 protected $idfield = 'profile_corps_enum.id';
534 protected $valfield = 'profile_corps_enum.name';
535 protected $valfield2 = 'profile_corps_enum.abbrev';
536 protected $from = 'profile_corps_enum';
538 protected $ac_unique = 'profile_corps.pid';
539 protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.original_corpsid = profile_corps_enum.id)';
543 // {{{ class DE_CorpsRanks
544 class DE_CorpsRanks
extends DirEnumeration
546 protected $idfield = 'profile_corps_rank_enum.id';
547 protected $valfield = 'profile_corps_rank_enum.name';
548 protected $valfield2 = 'profile_corps_rank_enum.abbrev';
549 protected $from = 'profile_corps_rank_enum';
551 protected $ac_unique = 'profile_corps.pid';
552 protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.rankid = profile_corps_rank_enum.id)';
558 // {{{ class DE_Nationalities
559 class DE_Nationalities
extends DirEnumeration
561 protected $idfield = 'geoloc_countries.iso_3166_1_a2';
562 protected $valfield = 'geoloc_countries.nationality';
563 protected $valfield2 = 'geoloc_countries.nationalityEn';
564 protected $from = 'geoloc_countries';
565 protected $join = 'INNER JOIN profiles ON (geoloc_countries.iso_3166_1_a2 IN (profiles.nationality1, profiles.nationality2, profiles.nationality3))';
567 protected $ac_join = 'INNER JOIN profiles ON (geoloc_countries.iso_3166_1_a2 IN (profiles.nationality1, profiles.nationality2, profiles.nationality3))';
568 protected $ac_unique = 'profiles.pid';
572 // {{{ class DE_AddressesComponents
573 class DE_AddressesComponents
extends DirEnumeration
575 protected $idfield = 'profile_addresses_components_enum.id';
576 protected $valfield = 'profile_addresses_components_enum.long_name';
577 protected $from = 'profile_addresses_components_enum';
579 protected $ac_join = 'INNER JOIN profile_addresses_components ON (profile_addresses_components.component_id = profile_addresses_components_enum.id)';
580 protected $ac_unique = 'profile_addresses_components.pid';
583 // {{{ class DE_AddressesComponents extensions
584 class DE_Countries
extends DE_AddressesComponents
586 protected $where = 'WHERE FIND_IN_SET(\'country\', profile_addresses_components_enum.types)';
587 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'country\', profile_addresses_components_enum.types)';
590 class DE_Admnistrativeareas1
extends DE_AddressesComponents
592 protected $where = 'WHERE FIND_IN_SET(\'admnistrative_area_1\', profile_addresses_components_enum.types)';
593 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'admnistrative_area_1\', profile_addresses_components_enum.types)';
596 class DE_Admnistrativeareas2
extends DE_AddressesComponents
598 protected $where = 'WHERE FIND_IN_SET(\'admnistrative_area_2\', profile_addresses_components_enum.types)';
599 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'admnistrative_area_2\', profile_addresses_components_enum.types)';
602 class DE_Admnistrativeareas3
extends DE_AddressesComponents
604 protected $where = 'WHERE FIND_IN_SET(\'admnistrative_area_3\', profile_addresses_components_enum.types)';
605 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'admnistrative_area_3\', profile_addresses_components_enum.types)';
608 class DE_Localities
extends DE_AddressesComponents
610 protected $where = 'WHERE FIND_IN_SET(\'locality\', profile_addresses_components_enum.types)';
611 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'locality\', profile_addresses_components_enum.types)';
613 // {{{ function getAutoComplete
614 public function getAutoComplete($text, $sub_id = null
)
616 if (is_null($sub_id)) {
617 return parent
::getAutoComplete($text);
619 $tests = $this->mkTests('pace1.long_name', $text);
620 $where .= '(' . implode(' OR ', $tests) . ')';
621 $query = "SELECT pace1.id AS id, pace1.long_name AS field, COUNT(DISTINCT(pac1.pid)) AS nb
622 FROM profile_addresses_components_enum AS pace1
623 INNER JOIN profile_addresses_components AS pac1 ON (pac1.component_id = pace1.id)
624 INNER JOIN profile_addresses_components AS pac2 ON (pac1.pid = pac2.pid AND pac1.jobid = pac2.jobid AND pac1.id = pac2.id
625 AND pac1.groupid = pac2.groupid AND pac1.type = pac2.type)
626 INNER JOIN profile_addresses_components_enum AS pace2 ON (pac2.component_id = pace2.id AND FIND_IN_SET('country', pace2.types))
627 WHERE pace2.id = {?} AND FIND_IN_SET('locality', pace1.types) AND pac1.type = 'home' AND " . $where . "
628 GROUP BY pace1.long_name
629 ORDER BY nb DESC, field
630 LIMIT " . self
::AUTOCOMPLETE_LIMIT
;
631 return XDB
::fetchAllAssoc($query, $sub_id);
638 class DE_Sublocalities
extends DE_AddressesComponents
640 protected $where = 'WHERE FIND_IN_SET(\'sublocality\', profile_addresses_components_enum.types)';
641 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'sublocality\', profile_addresses_components_enum.types)';
644 class DE_Postalcodes
extends DE_AddressesComponents
646 protected $where = 'WHERE FIND_IN_SET(\'postal_code\', profile_addresses_components_enum.types)';
647 protected $ac_where = 'profile_addresses_components.type = \'home\' AND FIND_IN_SET(\'postal_code\', profile_addresses_components_enum.types)';
654 // {{{ class DE_Companies
655 class DE_Companies
extends DirEnumeration
657 protected $idfield = 'profile_job_enum.id';
658 protected $valfield = 'profile_job_enum.name';
659 protected $valfield2 = 'profile_job_enum.acronym';
660 protected $from = 'profile_job_enum';
662 protected $ac_join = 'INNER JOIN profile_job ON (profile_job.jobid = profile_job_enum.id)';
663 protected $ac_unique = 'profile_job.pid';
667 // {{{ class DE_JobDescription
668 class DE_JobDescription
extends DirEnumeration
670 protected $valfield = 'profile_job.description';
671 protected $from = 'profile_job';
672 protected $idfield = 'profile_job.pid';
674 protected $ac_unique = 'profile_job.pid';
678 // {{{ class DE_JobTerms
679 class DE_JobTerms
extends DirEnumeration
681 protected $valfield = 'profile_job_term_enum.name';
682 protected $from = 'profile_job_term_enum';
683 protected $idfield = 'profile_job_term_enum.jtid';
685 // {{{ function getAutoComplete
686 public function getAutoComplete($text, $sub_id = null
)
688 $tokens = JobTerms
::tokenize($text.'%');
689 if (count($tokens) == 0) {
692 $token_join = JobTerms
::token_join_query($tokens, 'e');
693 return XDB
::fetchAllAssoc('SELECT e.jtid AS id, e.full_name AS field, COUNT(DISTINCT p.pid) AS nb
694 FROM profile_job_term_enum AS e
695 INNER JOIN profile_job_term_relation AS r ON (r.jtid_1 = e.jtid)
696 INNER JOIN profile_job_term AS p ON (r.jtid_2 = p.jtid)
699 ORDER BY nb DESC, field
700 LIMIT ' . self
::AUTOCOMPLETE_LIMIT
);
708 // {{{ class DE_Networking
709 class DE_Networking
extends DirEnumeration
711 protected $idfield = 'profile_networking_enum.nwid';
712 protected $valfield = 'profile_networking_enum.name';
713 protected $from = 'profile_networking_enum';
716 protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.nwid = profile_networking_enum.nwid)';
717 protected $ac_unique = 'profile_networking.pid';
723 // {{{ class DE_Medals
724 class DE_Medals
extends DirEnumeration
726 protected $from = 'profile_medal_enum';
728 protected $ac_join = 'INNER JOIN profile_medals ON (profile_medals.mid = profile_medal_enum.id)';
729 protected $ac_unique = 'profile_medals.pid';
735 // {{{ class DE_AccountTypes
736 class DE_AccountTypes
extends DirEnumeration
738 public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
740 protected $from = 'account_types';
741 protected $valfield = 'perms';
742 protected $idfield = 'type';
746 // {{{ class DE_Skins
747 class DE_Skins
extends DirEnumeration
749 public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
751 protected $from = 'skins';
752 protected $valfield = 'name';
753 protected $idfield = 'skin_tpl';
757 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: