########################################################### # Hier ist die gesamte HTML-Formatierung implementiert ########################################################### $PSDefaultParameterValues['*:Encoding'] = 'utf8' Function Write-MyStart() { [OutputType([String])] Param( [String]$Description, [String]$StyleDir, [String]$Stylesheet, [String]$Title, [String]$BaseDir, [String]$Header ) Process { return ` ' ' + $Title + '

' + $header + '

' } } Function Write-MyPic() { [OutputType([String])] Param ( [PSObject]$PSObject, [String]$Proportion ) Process { $Html = Write-MyStart -Description $PSObject.22 -StyleDir '../' -Stylesheet 'Pics.css' -Title $PSObject.22 -BaseDir '../' -Header '' $Html = $Html + "`n" + '
' + $PSObject.22 + ', Museumsdorf Volksdorf

' + $PSObject.21 + '

' + $PSObject.24 + '

Stichworte:   '+ $PSObject.18 + '
Originaldatei:   ' + $PSObject.0 + '
Dateigröße:   ' + $PSObject.1 + ' / ' + $PSObject.31 + ' px
Siehe auch:   ' + (Write-MyS_A -S_A $PSObject.20) + '
' $Html = $Html + (Write-MyEnd -Dir '../') return $Html } } Function Write-MyS_A() { [OutputType([String])] Param ( [String]$S_A ) Process { $Html = "" $S_A.split(";") | ForEach-Object -process { $Filename = $_.Trim() if ($Filename.Length -gt 0) { $Filename = ($Filename -Split '.', 0, "SimpleMatch")[0] if ($Filename.Length -ne 0) { $Html = $Html + '' + $Filename + '' + '
' } } } return $Html } } Function Write-MyLink() { [OutputType([String])] Param ( [String]$Filename ) Process { return '' + ($Filename -Split '.', 0, "SimpleMatch")[0] + '' + '
' } } Function Write-MyGallery() { [OutputType([String])] Param( [String]$Leaf, [String]$Content ) Process { # Title $Content = ($Content -split '', 2, 'simplematch')[1] $Title, $Content = ($Content -split '', 2, 'simplematch') # LowResFile $Content = ($Content -split '/LowRes/', 2, 'simplematch')[1] $LLRes = ($Content -split '"', 2, 'simplematch')[0] $Caption = ($Content -split '

', 2, 'simplematch')[1] $Caption = ($Caption -split '

', 2, 'simplematch')[0] $LeafBase = ($Leaf -split '.', 0, 'simplematch')[-2] # write HTML $Html = '
' + $Title + '

' + $LeafBase + '

' + $Caption + '

' return $Html } } Function Write-MyKeywords() { [OutputType([String])] Param ( [Hashtable]$StwList ) Process { $Html = Write-MyStart -Description 'Museumsdorf Volksdorf' -StyleDir '' -Stylesheet 'Keywords.css' -Title 'Museumsdorf Test' -LogoDir '' -Header 'Stichwortverzeichnis' $Html = $Html + "`n" ForEach ($Item in ($StwList.GetEnumerator() | Sort-Object Name)) { $Html = $Html + '
' + "`n" } $Html = $Html + (Write-MyEnd -Dir '') return $Html } } Function Write-MyEnd() { [OutputType([String])] Param( [String]$Dir ) Process { $Html = '
' return $Html } } Function Write-MyGalleryEnd() { [OutputType([String])] Param( [int]$Page, [boolean]$End ) Process { if ($Page -eq 0) { $Left = ' ' } else { $Left = '← zurück' } if ($End) { $Right = ' ' } else { $Right = 'weiter →' } $Html = ' ' return $Html } }