X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fmentor.inc.php;h=17d9cdd67c0983c795fa6ad3cce8860f09df047c;hb=25b261b1e0c8745d1f134f1a082e428ab50bd811;hp=d026ed0c28446c2efcd84cf2efe4f73e8d8d1a9e;hpb=ce0b2c6f3fc4e7c524df32f56f1bc8e8d573bb1a;p=platal.git diff --git a/modules/profile/mentor.inc.php b/modules/profile/mentor.inc.php index d026ed0..17d9cdd 100644 --- a/modules/profile/mentor.inc.php +++ b/modules/profile/mentor.inc.php @@ -19,7 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -class ProfileSectors implements ProfileSetting +class ProfileSettingSectors implements ProfileSetting { public function value(ProfilePage &$page, $field, $value, &$success) { @@ -69,9 +69,19 @@ class ProfileSectors implements ProfileSetting } } } + + public function getText($value) { + $sectors = array(); + foreach ($value as $sector) { + foreach ($sector as $subsector) { + $sectors[] = $subsector; + } + } + return implode(', ', $sectors); + } } -class ProfileCountry implements ProfileSetting +class ProfileSettingCountry implements ProfileSetting { public function value(ProfilePage &$page, $field, $value, &$success) { @@ -107,10 +117,14 @@ class ProfileCountry implements ProfileSetting $page->pid(), $id); } } + + public function getText($value) { + return implode(', ', $value); + } } -class ProfileMentor extends ProfilePage +class ProfileSettingMentor extends ProfilePage { protected $pg_template = 'profile/mentor.tpl'; @@ -118,8 +132,8 @@ class ProfileMentor extends ProfilePage { parent::__construct($wiz); $this->settings['expertise'] = null; - $this->settings['sectors'] = new ProfileSectors(); - $this->settings['countries'] = new ProfileCountry(); + $this->settings['sectors'] = new ProfileSettingSectors(); + $this->settings['countries'] = new ProfileSettingCountry(); } protected function _fetchData() @@ -157,6 +171,7 @@ class ProfileMentor extends ProfilePage $page->assign('countryList', XDB::iterator("SELECT iso_3166_1_a2, countryFR FROM geoloc_countries ORDER BY countryFR")); + $page->assign('hrpid', $this->profile->hrpid); } }