[%- FILTER null %]

[%# set statusroot to either status.html or status_header.html, depending on which you use %]
[% statusroot = 'status.html' %]

[%# set noHomeLink = 1 if you want to remove the home link from the breadcrumb links at the top of any lists %]
[% noHomeLink = 0 %]

[%# the separator to be used in crumb lists %]
[% crumbSeparator = '/' %]

[%# set setting_chooser_noHome to 1 if you want the home links removed from the server/player settings pulldown menu %]
[% setting_chooser_noHome = 0 %]

[%# set controGraphics if you wish to have your list controls use graphics, set to 0 if you want text only %]
[% controlGraphics  = 0 %]

[%# set browserTarget to the name of the frame used for browser lists, if your skin uses frames %]
[% browserTarget  = "browser" %]

[%# set this to set whether or not the skin is capable of using javascript. %]
[% useAJAX = 1 %]

[%# set this to set whether or not the skin is capable of using the extjs javascript library. %]
[% useExtJS = 0 %]

[%# set this for the background color to use on resized images %]
[% bgcolor = "" %]

[%# set this for the preferred style of server side resize (see Artwork Docs). Default is 'p' for 'pad' %]
[% resizeParam = "p" %]

[%# set this parameter to the size of your cmd buttons used in browse mode, playlist etc %]
[% cmdLinkIconSize = 13 %]

[%- BLOCK cmdlink -%]
<a [% content %] [% UNLESS noTarget %]target="status"[% END %]>[% cmdtitle | string %]</a>
[%- END -%]

[% # this block can be called for filling in space for an unused control item, or mixer link %]
[% BLOCK dummylink -%]
[%- END %]

[%# this is to wrap around an href which does a play command, with a default image for skins that support it %]
[% BLOCK playlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "PLAY"
		cmdimage = "b_play.gif" -%]
[%- END %]

[%# this is to wrap around an href which does an add command, with a default image for skins that support it %]
[% BLOCK addlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "ADD_TO_PLAYLIST"
		cmdimage = "b_add.gif" -%]
[%- END %]

[%# this is to wrap around an href which does an add-to-favorites command, with a default image for skins that support it %]
[% BLOCK favaddlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "PLUGIN_FAVORITES_ADD"
		cmdimage = "b_favorite.gif" -%]
[%- END %]

[%# this is to wrap around an href which does an insert command %]
[%- BLOCK insertlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "PLAY_NEXT"
		cmdimage = "b_queue.gif" -%]
[%- END -%]

[%- BLOCK morelink -%]
	[%- PROCESS cmdlink
		cmdtitle = "MORE"
		cmdimage = "b_mmmix.gif" -%]
[%- END -%]

[%# this is to wrap around an href which drops down one more level when browsing multi-level lists (eg Shoutcast) %]
[% BLOCK descendlink -%]
<a [% content %]>[% stringNEXT %]</a>
[%- END %]

[%# this is to wrap around an href which does a remove command, with default image reference %]
[%- BLOCK removelink -%]
	[%- PROCESS cmdlink
		cmdtitle = "REMOVE_FROM_PLAYLIST"
		cmdimage = "b_delete.gif" -%]
[%- END -%]

[%# this is to wrap around an href which does a delete-from-favorites command, with default image reference %]
[%- BLOCK favdellink -%]
	[%- PROCESS cmdlink
		cmdtitle = "PLUGIN_FAVORITES_REMOVE"
		cmdimage = "b_favorite_remove.gif" -%]
[%- END -%]

[%# this is to wrap around an href which does a url edit command, with default image reference %]
[%- BLOCK editlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "EDIT"
		cmdimage = "b_edit.gif" -%]
[%- END -%]

[%# this is to wrap around browse list items %]
[% BLOCK listitem %]
	<td width="100%" [% IF odd %]class="odd" bgcolor="#d0d0d0"[% ELSE %]class="even" bgcolor="#FFFFFF"[% END %]>
		[% IF content == '' %]
			[% title %]		
		[% ELSE %]
			<a [% content %] >[% title %]</a>
		[% END %]
	</td>
[% END %]

[%# this is a link to the home page %]
[% BLOCK homelink;
	"<a href=\"";webroot;"home.html?player=$playerURI\"" ; IF target; "target=\""; $target; "\""; END; ">"; img or stringHOME; "</a>";
END %]

[%# this is to wrap around a link which moves something up a list %]
[% BLOCK moveuplink -%]
	[%- PROCESS cmdlink
		cmdtitle = "MOVEUP"
		cmdimage = "b_up.gif" -%]
[%- END %]

[%# this is to wrap around a link which moves something down a list %]
[% BLOCK movedownlink -%]
	[%- PROCESS cmdlink
		cmdtitle = "MOVEDOWN"
		cmdimage = "b_down.gif" -%]
[%- END %]

[%# this is the warning shown while server is still scanning -%]
[% BLOCK scanwarning %]
<b>[% "NOTE" | string %]</b> [% "SCAN_WARNING" | string -%]
	[%- IF audiodir -%]
		[%- "SCAN_CLICK" | string; %]<a href="browsetree.html?level=0&amp;player=[% playerURI %]">[% "HERE" | string %]</a>.
	[%- END %]
[% END %]

[%# this is the bread crumb trail to the current page %]
[% BLOCK crumblist -%]
[%- IF not noHomeLink %][% PROCESS homelink %][% END -%]
[%- FOREACH item = pwd_list.list -%]
  [%- IF not noHomeLink or not loop.first %] [% crumbSeparator %] [% END -%]
  [%- PROCESS crumblistitem -%]
[%- END -%]
[%- END %]

[%# this is an individual bread crumb %]
[% BLOCK crumblistitem -%]
[%- IF item.exists('title') -%]
<a [% PROCESS "${item.hreftype}ItemHRef" %]>[% item.title | replace('^\s*/','') | html %]</a>
[%- ELSE -%]
[% item | replace('^\s*/','') %]
[%- END -%]
[%- END %]

[% BLOCK contentcontainer %]
<div id="[% listid || 'browsedbList' %]">
	[%- content | indent(4) %]
</div>
[%- END %]

[% BLOCK gallerycontainer %]
<div id="[% listid || 'browsedbList' %]"><ul class="thumbwrap">
	[%- content | indent(4) %]
</ul></div>
[%- END %]

[% BLOCK dummycontainer %]
<div>
	[%- content | indent(4) %]
</div>
[%- END %]

[% BLOCK contentitem -%]
<div class="[% odd ? "odd" : "even" %]">
	[%- IF anchor %]
		<a name="[% anchor | uri %]"></a>
	[%- END -%]
	
	<div class="[% lineclass || 'browsedbListItem' %]">
		[%- IF leftcontrols -%]
			<span class="browsedbLeftControls">
			[%- PROCESS $leftcontrols -%]
			</span>
		[%- END %]
		[%- content | indent(4) %]
		[%- IF rightcontrols -%]
			<span class="browsedbRightControls">
			[%- PROCESS $rightcontrols -%]
			</span>
		[%- ELSIF controls -%]
			<div class="browsedbControls">
			[%- PROCESS $controls -%]
			</div>
		[%- END %]
	</div>
</div>
[%- END %]

[% BLOCK galleryitem %]
<li>
	<div style="width:[% item.size %]px;">
		<div class="artworkImage" style="width: [% item.size %];">
			<div style="width:[% item.size %]px;height:[% item.size %]px;overflow:hidden;">
				[% PROCESS thumbnailItemImg height="$item.size" %]
			</div>
		</div>

		[% SET class = 'even' odd = 0 %]

		<div class="artworkText" style="width:[% item.size %]px;"><span style="width:[% item.size %]px;">
		[%- content | indent(4) %]
		</span></div>
	</div>
</li>
[%- END %]

[%# these are the links to be shown with items on the playlist %]
[% BLOCK playlistcontrols -%]
	[% WRAPPER playlink %][% PROCESS cmdHRef cmdType = 'jump' num = item.num %][% END %]
	[% WRAPPER removelink %][% PROCESS cmdHRef cmdType='delete' %][% END %]
[%- END %]

[%# These are the controls to be shown when browsing the music library %]
[% BLOCK browsecontrols %]
	[%- SET class = odd ? 'odd" bgcolor="#d0d0d0':'even" bgcolor="#FFFFFF' target='status' -%]
	[%- header='1' width=cmdLinkIconSize height=cmdLinkIconSize -%]
	[% IF showplayall -%]
		[% WRAPPER playlink noTarget = 1 %]href="[% playallhref %]"[% END %]
		[% WRAPPER addlink  noTarget = 1 %]href="[% addallhref %]"[% END %]
	[% ELSIF showdescend && href -%]
		[%- WRAPPER descendlink %][%- href -%][% END -%]
		[% IF showplay -%]
			[% WRAPPER playlink %][% PROCESS cmdHRef cmdType='play' %][% END %]
			[% WRAPPER addlink  %][% PROCESS cmdHRef cmdType='add'  %][% END %]
		[%- END %]
	[% ELSE %]
		[% WRAPPER playlink %][% PROCESS cmdHRef cmdType='play' %][% END %]
		[% WRAPPER addlink  %][% PROCESS cmdHRef cmdType='add'  %][% END %]
		[% PROCESS favoritescontrol %]
	[%- END %]
	
[%- END %]

[%# These are the controls to be shown when browsing the music library %]
[% BLOCK radiocontrols %]
	[% SET class = odd ? 'odd" bgcolor="#d0d0d0':'even" bgcolor="#FFFFFF' target='status' %]
	[% header='1' width=cmdLinkIconSize height=cmdLinkIconSize %]
	[% WRAPPER playlink %][% PROCESS cmdHRef cmdType='play' %][% END %]
	[% WRAPPER addlink  %][% PROCESS cmdHRef cmdType='add'  %][% END %]
[% END %]

[% BLOCK favoritescontrol %]
	[%- IF (useAJAX || useExtJS) && (item.isFavorite.defined || isFavorite.defined); 
			IF item.isFavorite || isFavorite; 
				linktype = 'favdellink'; 
			ELSE; 
				linktype = 'favaddlink'; 
			END; 

			WRAPPER $linktype noTarget=1;
				IF !ajaxRequest %]href="javascript:void(0);" onClick="[% IF useExtJS; 'SqueezeJS.Utils.'; END %]toggleFavorite(this, '[% (itemobj.url || item.url) | uri  | replace("'", "%27") %]', '[% (item.text || item.title || itemobj.title || item.name) | uri  | replace("'", "%27") %]', '[% (itemobj.icon || item.icon) | uri  | replace("'", "%27") %]')"[% END;
			END;
		END -%]
[% END %]

[%# this formats the track item %]
[% BLOCK trackinfo %]
	[% IF item.currentsong %][% item.noHref=1 %]<b>[% END %]
	
	[% IF item.infohref %]
			<a [% item.infohref %] target="browser" class="browseItemLink">[% ( item.text || item.title ) | html %]</a>
	[% ELSIF item.num || item.num == 0 %]
			[% UNLESS item.noHref %]<a [% PROCESS songinfoItemHRef %] target="browser">[% END %]
			[% item.title | html %][% UNLESS item.noHref %]</a>[% END %]
	[%# browse list items %]
	[%# no level info means its a music folder item, and check for itemobj to make sure it isn't just a text item %]
	[% ELSIF item.item || !item.defined('level') && item.itemobj %]
		<a [% PROCESS songinfoItemHRef %] target="browser" class="browseItemLink">[% item.text | html %]</a>
	[% ELSIF item.songtitle %]
		<a [% PROCESS songinfoItemHRef %] target="browser" class="browseItemLink">[% item.songtitle | html %]</a>
	[% ELSE %]
		[% item.text | html %]
	[% END %]
	
	[% IF item.includeArtist && (artist = item.artistsWithAttributes ? item.artistsWithAttributes.0 : item.itemobj.artist) && artist.name != item.noArtist; PROCESS artistsAsHTML.html itemobj = item.itemobj; END %]
	
	[% IF item.includeAlbum && (albumTitle = item.albumTitle || (item.itemobj.album && item.itemobj.album.title)) && albumTitle != item.noAlbum && albumTitle != "" %][% stringFROM %]
	<a [% PROCESS albumItemHRef %] target="browser" class="browseItemLink">[% albumTitle | html %]</a>[% END %]
	[% IF item.currentsong %]</b>[% END %]
[% END %]

[% BLOCK albuminfo %]
	[% IF item.albumId || item.itemobj.album.id %]
		<a [% PROCESS albumItemHRef %] target="browser" class="browseItemLink">[% item.text | html %]</a>
	[% ELSE %]
		[% item.text | html %]
	[% END %]

	[% IF item.showYear %]
		<a [% PROCESS yearItemHRef %] class="browseItemLink">([% item.year %])</a>
	[% END %]
	
	[% IF item.includeArtist && (artist = item.artistsWithAttributes ? item.artistsWithAttributes.0 : item.itemobj.artist) && artist.name != item.noArtist; PROCESS artistsAsHTML.html itemobj = item.itemobj; END %]
[% END %]

[% BLOCK workinfo %]
	[% IF item.workId || item.itemobj.work.id %]
		<a [% PROCESS workItemHRef %] target="browser" class="browseItemLink">[% item.text | html %]</a>
	[% ELSE %]
		[% item.text | html %]
	[% END %]
[% END %]

[% BLOCK iteminfo;
	IF item.levelName == 'album';
		PROCESS albuminfo;
	ELSIF item.levelName == 'work';
		PROCESS workinfo;
	ELSE;
		PROCESS trackinfo;
END; END %]

[% BLOCK songInfoPlayLinks %]
	<div id="songInfoPlayLinks">
		[% PROCESS browsecontrols %]
	</div>
[% END %]

[% BLOCK songInfoItem %]
	<div id="[% title %]">
		<span class="songInfoTitle">
			[% IF title; title | string; stringCOLON; END %]
		</span>
		<span class="songInfoText">[% item %]</span>
	</div>
[% END %]


[%# This is to build the pagebar or alphapagebar, it should be PROCESSed %]
[% BLOCK pagebar %]
[%- IF NOT pageinfo.alphamap; PROCESS pagebarcalc pagesperbar = 15; END %]
<div class="pagebar">
[% IF pagesstart %]  <a href="[% pageinfo.path %]?start=0[% pageinfo.otherparams | html %][% IF sess %]&amp;sess=[% sess; END %]">[% stringFIRST %]</a> [% END %]
[% IF pageprev || pageprev == '0' %] <a href="[% pageinfo.path %]?start=[% pageprev %][% pageinfo.otherparams | html %][% IF sess %]&amp;sess=[% sess; END %]">[% stringPREVIOUS %]</a> [% END %]
[%- IF pageinfo.alphamap %]
[%- FOREACH alphakey = pageinfo.alphaindex -%]
 [%- curpage = (pageinfo.alphamap.item(alphakey) == pageinfo.startitem) -%]
 <a href="[% pageinfo.path | html %]?start=[% pageinfo.alphamap.item(alphakey) %][% pageinfo.otherparams | html %][% IF sess %]&amp;sess=[% sess; END %]#[% alphakey | uri %]">[% IF curpage %]<b>[% END %][% alphakey | html %][% IF curpage %]</b>[% END %]</a> 
[%- END %]
[%- ELSE %]
[%- FOREACH ind=[pagebarstart..pagebarend] -%]
 [%- IF ind == pageinfo.currentpage %] <b>[% ind + 1 %]</b> 
 [%- ELSE %] <a href="[% pageinfo.path  | html %]?start=[% ind * pageinfo.itemsperpage %][% pageinfo.otherparams  | html %][% IF sess %]&amp;sess=[% sess; END %]">[% ind + 1 %]</a> 
 [%- END %]
[% END %]
[%- END %]
[% IF pagenext %] <a href="[% pageinfo.path %]?start=[% pagenext %][% pageinfo.otherparams | html %][% IF sess %]&amp;sess=[% sess; END %]">[% stringNEXT %]</a> [% END %]
[% IF pagesend %] <a href="[% pageinfo.path %]?start=[% pagesend %][% pageinfo.otherparams | html %][% IF sess %]&amp;sess=[% sess; END %]">[% stringLAST %]</a> [% END %]
</div>
[% END %]

[% BLOCK pagebarheader %]
<span class="pagebarheadertext">
[% "ITEMS" | string %] [% pageinfo.startitem %] [% "TO" | string %] [% pageinfo.enditem %] [% "OF" | string %] [% pageinfo.totalitems %]
</span>
[% END %]

[% BLOCK helpTopicList %]
<ul style="direction: ltr;">
	[% content -%]
</ul>
[% END -%]

[% BLOCK helpTopic %]
	<li><a href="[% href %]"[% IF target %] target="[% target %]"[% END %]>[% title %]</a></li>
[% END -%]

[% BLOCK settingSection %]
	<div class="settingSection" [% IF sectionID %]id="[% sectionID %]"[% END %]  [% IF customStyle %]style="[% customStyle %]"[% END %]>
		[% content %]
	</div>
[% END -%]

[% BLOCK settingGroup %]
	<div class="settingGroup">
		[% IF title && simple %]<p><b>[% title | getstring %]</b></p>
		[% ELSIF title %]<div class="prefHead">[% title | getstring %]</div>[% END %]
		[% IF desc && !simple %]<div class="prefDesc hiddenDesc">[% desc | getstring %]</div>[% END %]
		<div class="prefs">[% content %]&nbsp;</div>
	</div>
[% END -%]

[% BLOCK setting %]
	[% WRAPPER settingSection %]
		[% WRAPPER settingGroup %]
			[% content %]
		[% END -%]
	[% END -%]	
[% END -%]

[% BLOCK jsString %]
	strings['[% IF jsId; jsId; ELSE; id | lower; END %]'] = "[% id | string | replace('"', '\"') %]";
[% END %]
[% END -%]
