Backend\Modules\Profiles\Engine\Model::getUser PHP Method

getUser() public static method

Get the HTML for a user to use in a datagrid
public static getUser ( integer $id ) : string
$id integer The Id of the user.
return string
    public static function getUser($id)
    {
        $id = (int) $id;
        // create user instance
        $user = self::get($id);
        // no user found, stop here
        if (empty($user)) {
            return '';
        }
        // get settings
        $nickname = $user['display_name'];
        $allowed = BackendAuthentication::isAllowedAction('Edit', 'Profiles');
        // get avatar
        $avatar = self::getAvatar($id, $user['email']);
        // build html
        $html = '<div class="dataGridAvatar">' . "\n";
        $html .= '  <div class="avatar av24">' . "\n";
        if ($allowed) {
            $html .= '      <a href="' . BackendModel::createURLForAction('Edit', 'Profiles') . '&amp;id=' . $id . '">' . "\n";
        }
        $html .= '          <img src="' . $avatar . '" width="24" height="24" alt="' . $nickname . '" />' . "\n";
        if ($allowed) {
            $html .= '      </a>' . "\n";
        }
        $html .= '  </div>';
        $html .= '  <p><a href="' . BackendModel::createURLForAction('Edit', 'Profiles') . '&amp;id=' . $id . '">' . $nickname . '</a></p>' . "\n";
        $html .= '</div>';
        return $html;
    }