X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=classes%2Fprofile.php;h=d9b55b076aa640cd92a37cae24f3dd6d157f5e39;hb=c54829c19716897a4ad1eb2f13b2f66e896fdcae;hp=df2771e75e8e99929f3344ff4b2728affea9ad4c;hpb=2d89ec936167033886ae76b153605d7ccf19bc20;p=platal.git diff --git a/classes/profile.php b/classes/profile.php index df2771e..d9b55b0 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -1,6 +1,6 @@ photo; } else if ($fallback) { - return PlImage::fromFile(dirname(__FILE__).'/../htdocs/images/none.png', - 'image/png'); + if ($this->mainEducation() == 'X') { + return PlImage::fromFile(dirname(__FILE__) . '/../htdocs/images/none_x.png', 'image/png'); + } + return PlImage::fromFile(dirname(__FILE__) . '/../htdocs/images/none_md.png', 'image/png'); } return null; } @@ -841,6 +843,24 @@ class Profile return ($isOk && ($maxlen > 2 || $maxlen == strlen($_lastname))); } + /* Export to JSON + */ + public function export() + { + return array( + 'hrpid' => $this->hrid(), + 'display_name' => $this->shortName(), + 'full_name' => $this->fullName(), + 'directory_name' => $this->directory_name, + 'promo' => $this->promo(), + 'year_promo' => $this->yearpromo(), + 'is_active' => $this->isActive(), + 'first_name' => $this->firstName(), + 'last_name' => $this->lastName(), + 'is_female' => $this->isFemale(), + ); + } + private static function fetchProfileData(array $pids, $respect_order = true, $fields = 0x0000, $visibility = null) { if (count($pids) == 0) {