assetBegin() public static method

public static assetBegin ( string $AssetContainer = 'Panel' )
$AssetContainer string
Exemplo n.º 1
0
?>
    <!-- Robots should not see the dashboard, but tell them not to index it just in case. -->
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body id="<?php 
echo htmlspecialchars($BodyIdentifier);
?>
" class="<?php 
echo $this->CssClass;
?>
">
<?php 
$this->renderAsset('Symbols');
// TODO: Pull this asset out elsewhere
Gdn_Theme::assetBegin('DashboardUserDropDown');
$user = Gdn::session()->User;
$rm = new RoleModel();
$roles = $rm->getByUserID(val('UserID', $user))->resultArray();
$roleTitlesArray = [];
foreach ($roles as $role) {
    $roleTitlesArray[] = val('Name', $role);
}
$roleTitles = implode(', ', $roleTitlesArray);
/** var UserController $user */
?>
<div class="card card-user">
    <?php 
$userBlock = new MediaItemModule(val('Name', $user), userUrl($user), $roleTitles, '', ['class' => 'card-block']);
$userBlock->setView('media-sm')->setImage(userPhotoUrl($user))->addButton(t('My Profile') . ' ' . dashboardSymbol('external-link', 'icon-11 icon-text'), userUrl($user), ['class' => 'btn btn-sm-rounded btn-secondary padded-top']);
echo $userBlock;
Exemplo n.º 2
0
 /**
  * Formats a help element and adds it to the help asset.
  *
  * @param $title
  * @param $description
  */
 function helpAsset($title, $description)
 {
     Gdn_Theme::assetBegin('Help');
     echo '<aside role="note" class="help">';
     echo wrap($title, 'h2', ['class' => 'help-title']);
     echo wrap($description, 'div', ['class' => 'help-description']);
     echo '</aside>';
     Gdn_Theme::assetEnd();
 }