| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
interface HC3_Users_IPresenter |
| 3 |
{ |
| 4 |
public function presentTitle( HC3_Users_Model $user ); |
| 5 |
} |
| 6 |
|
| 7 |
class HC3_Users_Presenter implements HC3_Users_IPresenter |
| 8 |
{ |
| 9 |
public $ui; |
| 10 |
|
| 11 |
public function __construct( HC3_Ui $ui ) |
| 12 |
{ |
| 13 |
$this->ui = $ui; |
| 14 |
} |
| 15 |
|
| 16 |
public function presentTitleList( HC3_Users_Model $user ) |
| 17 |
{ |
| 18 |
$username = $user->getUsername(); |
| 19 |
$displayName = $user->getDisplayName(); |
| 20 |
$email = $user->getEmail(); |
| 21 |
|
| 22 |
$return[] = $this->ui->makeSpan( $username )->tag('font-style', 'bold'); |
| 23 |
$return[] = $this->ui->makeSpan( $displayName )->tag('font-size', 2); |
| 24 |
if( $email != $username ){ |
| 25 |
$return[] = $this->ui->makeSpan( $email )->tag('font-size', 2); |
| 26 |
} |
| 27 |
$return = $this->ui->makeList( $return )->gutter(0); |
| 28 |
|
| 29 |
return $return; |
| 30 |
} |
| 31 |
|
| 32 |
public function presentTitle( HC3_Users_Model $user ) |
| 33 |
{ |
| 34 |
$username = $user->getUsername(); |
| 35 |
$displayName = $user->getDisplayName(); |
| 36 |
$email = $user->getEmail(); |
| 37 |
|
| 38 |
$return[] = $this->ui->makeSpan( $username )->tag('font-style', 'bold'); |
| 39 |
$return[] = '(' . $displayName . ')'; |
| 40 |
|
| 41 |
$return = $this->ui->makeListInline( $return )->gutter(1); |
| 42 |
return $return; |
| 43 |
} |
| 44 |
|
| 45 |
} |