/** * Build all available possibilities for a public name * * @access private * @return string */ private function display_public_name() { //need to do that because __get() method return a fatal error in empty() condition $fname = $this->_profile->_firstname; $lname = $this->_profile->_lastname; $options = '<option>' . $this->_profile->_username . '</option>'; if ($this->_profile->_nickname != $this->_profile->_username) { $options .= Html::up_option($this->_profile->_publicname, $this->_profile->_nickname); } if (!empty($fname)) { $options .= Html::up_option($this->_profile->_publicname, $this->_profile->_firstname); } if (!empty($lname)) { $options .= Html::up_option($this->_publicname, $this->_profile->_lastname); } if (!empty($fname) && !empty($lname)) { $options .= Html::up_option($this->_profile->_publicname, $fname . ' ' . $lname); $options .= Html::up_option($this->_profile->_publicname, $lname . ' ' . $fname); } return '<select id="public_name" name="public_name">' . $options . '</select>'; }