imageSize = $attributes['image_size']; unset($attributes['image_size']); } if (isset($attributes['sub_title'])) { $this->subTitle = $attributes['sub_title']; unset($attributes['sub_title']); } parent::__construct($name, $label, $attributes); $this->setType('hidden'); } /** * {@inheritdoc} */ public function setValue($value) { $this->user = !is_a($value, 'Chamilo\UserBundle\Entity\User') ? UserManager::getManager()->find($value) : $value; parent::setValue($this->user->getId()); } /** * {@inheritdoc} */ public function toHtml() { if (!$this->user) { return ''; } $userInfo = api_get_user_info($this->user->getId()); $userPicture = isset($userInfo["avatar_{$this->imageSize}"]) ? $userInfo["avatar_{$this->imageSize}"] : $userInfo["avatar"]; if (!$this->subTitle) { $this->subTitle = $this->user->getUsername(); } $html = parent::toHtml(); $html .= '