<button 
    type="button" 
    class="btn btn-default oc-icon-align-justify empty <?= $viewMode == Cms\Widgets\MediaManager::VIEW_MODE_GRID ? 'on' : '' ?>" 
    data-command="change-view" 
    data-view="<?= Cms\Widgets\MediaManager::VIEW_MODE_GRID ?>">
</button>
<button 
    type="button"
    class="btn btn-default oc-icon-th empty <?= $viewMode == Cms\Widgets\MediaManager::VIEW_MODE_LIST ? 'on' : '' ?>"
    data-command="change-view"
    data-view="<?= Cms\Widgets\MediaManager::VIEW_MODE_LIST ?>">
</button>
<button
    type="button"
    class="btn btn-default oc-icon-th-large empty <?= $viewMode == Cms\Widgets\MediaManager::VIEW_MODE_TILES ? 'on' : '' ?>"
    data-command="change-view"
    data-view="<?= Cms\Widgets\MediaManager::VIEW_MODE_TILES ?>">
</button>