webui/cmcollections.ps1

Get-SkParams | Out-Null

if ($Script:CollectionType -eq '2') {
    $Ctype  = "Device"
    $qfname = "cmdevicecollections.sql"
}
else {
    $Ctype  = "User"
    $qfname = "cmusercollections.sql"
}

$PageTitle   = "CM $CType Collections"
if (![string]::IsNullOrEmpty($Script:SearchValue)) {
    $PageTitle += ": $($Script:SearchValue)"
}
$content  = ""
$menulist = ""
$tabset   = ""
$pagelink = Split-Path -Leaf $MyInvocation.MyCommand.Definition
try {
    $params = @{
        QueryFile = $qfname 
        PageLink  = "cmcollections.ps1" 
        Columns   = ('CollectionID','CollectionName','Comment','Members','Type','Variables','LimitedTo')
        Sorting   = "CollectionName"
        NoCaption = $True
    }
    $content = Get-SkQueryTableMultiple @params
    $tabset  = Write-SkMenuTabSetAlphaNumeric -BaseLink "cmcollections.ps1?t=$CollectionType&f=collectionname&x=begins&v=" -DefaultID $TabSelected
    $content += Write-SkDetailView -PageRef "cmcollections.ps1" -Mode $Detailed
}
catch {
    $content = "<table id=table2><tr><td>Error: $($Error[0].Exception.Message)</td></tr></table>"
}
finally {
    Write-SkWebContent
}