{$myAccountLinks = $userquery->my_account_links()}
{include file="$style_dir/blocks/manage/userMenuLeft.html"}
{if $mode =='manage_playlist'}

## {lang code='manage_playlists'}

{if (has_access('allow_create_playlist',false,$verify_logged_user))}

### {lang code='add_new_playlist'}

{lang code='playlist_name'}
{else}
{lang code="creating_playlist_is_disabled"}
{/if}

| {lang code='vdo_title'} | {lang code='date_added'} | {lang code='total_items'}
{section name=plist loop=$playlists} {assign var=playlist_items value=$cbvid->get_playlist_items($playlists[plist].playlist_id, 'playlist_items.date_added DESC')}
| {$playlists[plist].playlist_name|truncate:100} - {lang code='view'} {assign var=firstitem value=$playlist_items[0]} {if $firstitem} {lang code='play'} {else} {lang code='play'} {/if} {lang code='delete'} | {$playlists[plist].date_added|date_format} | {$cbvid->action->count_playlist_items($playlists[plist].playlist_id)|number_format}
{/section}

{/if} {if $mode =='edit_playlist'}

## {lang code='manage_playlists'}

### {lang code='edit_playlist'}

{assign var='playlist_fields' value=$cbvid->action->load_playlist_fields($playlist)} {foreach from=$playlist_fields item=group} {foreach from=$group.fields item=field}
{$field.title} {$field.class='form-control'} {$formObj->createField($field)}
{/foreach} {/foreach}
{if $items}
{/if}

| {lang code='vdo_title'} | {lang code='date_added'} | {lang code='views'} | {lang code='comments'}
{section name=plist loop=$items} {include file="$style_dir/blocks/manage/account_video.html" video=$items[plist] bg=$bg control="playlist" pid=$playlist.playlist_id} {sectionelse}
{lang code='no_video_in_playlist'}
{/section}

{/if}