Public Module Properties

#Region "  GLOBALNI TEXTY  "

	Public Const gstrProbihaNacitaniStranky As String = "Probíhá načítání stránky..."
	Public Const gstrProbihaUkladaniZaznamu As String = "Probíhá ukládání záznamu..."
	Public Const gstrProbihaUkladaniStranky As String = "Probíhá ukládání stránky..."
	Public Const gstrProbihaUkladaniBloku As String = "Probíhá ukládání bloku..."

	Public Const gstrNeniNalezenyZadnyZaznam As String = "Není nalezený žádný záznam."
	Public Const gstrNeniNalezenyZadnaFotografie As String = "Není nalezena žádná fotografie."
	Public Const gstrZaznamJeOdstraneny As String = "Záznam je odstraněný."
	Public Const gstrFotografieJeOdstranena As String = "Fotografie je odstraněná."

#End Region

#Region "  GLOBALNI ADRESY  "

	Public Const gadrZpravy As String = "/Zpravy.html"
	Public Const gadrUzivatelSeznam As String = "/Seznam-Uzivatelu.html"
	Public Const gadrUzivatelNastaveni As String = "/Nastaveni-Uzivatele.html"
	Public Const gadrUzivatelOdstranit As String = "/Odstranit-Uzivatele.html"
	Public Const gadrOdhlasit As String = "/Odhlasit.html"
	Public Const gadrPrihlasit As String = "/Prihlasit.html"
	Public Const gadrVyhledat As String = "/Vyhledat.html"

#End Region

#Region "  GLOBALNI PROMENNE  "

	Public Const gTableColCaption As String = "col-xs-12 col-md-4 col-lg-3 form-caption" 'Bootstrap sloupce pro nadpis radku
	Public Const gTableColField As String = "col-xs-12 col-md-8 col-lg-9 form-field" 'Bootstrap sloupce pro obsah radku
	Public Const gTableColControls As String = "col-xs-12 col-md-8 col-lg-9 form-controls" 'Bootstrap sloupce pro ovladaci tlacitka

#End Region

#Region "  CESTY  "

	''' <summary>
	''' Zakladni cesta do hlavni slozky
	''' </summary>
	Public Property _Path() As String
		Get
			Return HttpContext.Current.Application("_Path")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Application("_Path") = value
		End Set
	End Property

    ''' <summary>
    ''' Zakladni relativni cesta do adresare admin
    ''' </summary>
    Public Property _PathAdmin() As String
		Get
			Return HttpContext.Current.Application("_PathAdmin")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Application("_PathAdmin") = value
		End Set
	End Property

	Public Property _PathAdminRelative() As String
		Get
			Return HttpContext.Current.Application("_PathAdminRelative")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Application("_PathAdminRelative") = value
		End Set
	End Property

	Public Property _PathFotoRelative() As String
		Get
			Return HttpContext.Current.Application("_PathFotoRelative")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Application("_PathFotoRelative") = value
		End Set
	End Property

    ''' <summary>
    ''' Absolutni cesta prezentace
    ''' </summary>
    Public Property _PathFoto() As String
		Get
			Return HttpContext.Current.Application("_PathFoto")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Application("_PathFoto") = value
		End Set
	End Property

#End Region

#Region "  UZIVATEL  "

	''' <summary>
	''' Prihlaseny uzivatel k uctu
	''' </summary>
	Public Property _UserID() As String
		Get
			Try
				If HttpContext.Current.Request.Cookies("_UserID") Is Nothing Then
					Dim c As HttpCookie = New HttpCookie("_UserID")
					HttpContext.Current.Response.Cookies.Add(c)
				End If
				Return HttpContext.Current.Request.Cookies("_UserID").Value
			Catch ex As Exception
				Return ""
			End Try
		End Get
		Set(ByVal value As String)
			If HttpContext.Current.Request.Cookies("_UserID") Is Nothing Then
				Dim c As HttpCookie = New HttpCookie("_UserID")
				HttpContext.Current.Response.Cookies.Add(c)
			End If
			HttpContext.Current.Response.Cookies("_UserID").Expires = Now.AddDays(30)
			HttpContext.Current.Response.Cookies("_UserID").Value = value
		End Set
	End Property

	Public Property _UserName() As String
		Get
			Try
				If HttpContext.Current.Request.Cookies("_UserName") Is Nothing Then
					Dim c As HttpCookie = New HttpCookie("_UserName")
					HttpContext.Current.Response.Cookies.Add(c)
				End If
				Return HttpContext.Current.Request.Cookies("_UserName").Value
			Catch ex As Exception
				Return ""
			End Try
		End Get
		Set(ByVal value As String)
			If HttpContext.Current.Request.Cookies("_UserName") Is Nothing Then
				Dim c As HttpCookie = New HttpCookie("_UserName")
				HttpContext.Current.Response.Cookies.Add(c)
			End If
			HttpContext.Current.Response.Cookies("_UserName").Expires = Now.AddDays(30)
			HttpContext.Current.Response.Cookies("_UserName").Value = value
		End Set
	End Property

	Public Property _UserRealName() As String
		Get
			Try
				If HttpContext.Current.Request.Cookies("_UserRealName") Is Nothing Then
					Dim c As HttpCookie = New HttpCookie("_UserRealName")
					HttpContext.Current.Response.Cookies.Add(c)
				End If
				Return HttpContext.Current.Request.Cookies("_UserRealName").Value
			Catch ex As Exception
				Return ""
			End Try
		End Get
		Set(ByVal value As String)
			If HttpContext.Current.Request.Cookies("_UserRealName") Is Nothing Then
				Dim c As HttpCookie = New HttpCookie("_UserRealName")
				c.Expires = Now.AddDays(30)
				HttpContext.Current.Response.Cookies.Add(c)
			End If
			HttpContext.Current.Response.Cookies("_UserRealName").Expires = Now.AddDays(30)
			HttpContext.Current.Response.Cookies("_UserRealName").Value = value
		End Set
	End Property

	Public Property _Language() As String
		Get
			Try
				If HttpContext.Current.Request.Cookies("_Language") Is Nothing Then
					Dim c As HttpCookie = New HttpCookie("_Language")
					HttpContext.Current.Response.Cookies.Add(c)
					HttpContext.Current.Response.Cookies("_Language").Value = "cz"
					Return "cz"
				End If
				Return HttpContext.Current.Request.Cookies("_Language").Value
			Catch ex As Exception
				Return ""
			End Try
		End Get
		Set(ByVal value As String)
			If HttpContext.Current.Request.Cookies("_Language") Is Nothing Then
				Dim c As HttpCookie = New HttpCookie("_Language")
				c.Expires = Now.AddDays(30)
				HttpContext.Current.Response.Cookies.Add(c)
			End If
			HttpContext.Current.Response.Cookies("_Language").Expires = Now.AddDays(30)
			HttpContext.Current.Response.Cookies("_Language").Value = value
		End Set
	End Property

	Public ReadOnly Property _IsAdministrator() As Boolean
		Get
			If HttpContext.Current.Request.UserHostAddress = "::1" Or
				HttpContext.Current.Request.UserHostAddress = "127.0.0.1" Or
				HttpContext.Current.Request.UserHostAddress = "188.122.213.130" Or
				HttpContext.Current.Request.UserHostAddress = "213.192.61.226" Or
				HttpContext.Current.Request.UserHostAddress = "89.248.242.69" Then
				Return True
			Else
				Return False
			End If
		End Get
	End Property

	Public ReadOnly Property _IsSuperAdministrator() As Boolean
		Get
			If HttpContext.Current.Request.UserHostAddress = "::1" Or
				HttpContext.Current.Request.UserHostAddress = "127.0.0.1" Or
				HttpContext.Current.Request.UserHostAddress = "188.122.213.130" Or
				HttpContext.Current.Request.UserHostAddress = "213.192.61.226" Then
				Return True
			Else
				Return False
			End If
		End Get
	End Property

#End Region

#Region " INFORMACNI HLASENI  "

	Public Property _NotifyText() As String
		Get
			Return HttpContext.Current.Session("_NotifyText")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Session("_NotifyText") = value
		End Set
	End Property

#End Region

#Region "  VYHLEDAT  "

	''' <summary>
	''' Retezec pro vyhledani
	''' </summary>
	''' <returns></returns>
	Public Property _Vyhledat() As String
		Get
			Return HttpContext.Current.Session("_Vyhledat")
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Session("_Vyhledat") = value
		End Set
	End Property

#End Region

#Region "  ZAROVNANI FOTOGRAFIE  "

    Enum eFotoUmisteni

        Center = 0
        TopLeft = 1
        TopCenter = 2
        TopRight = 3
        CenterLeft = 4
        CenterRight = 5
        BottomLeft = 6
        BottomCenter = 7
        BottomRight = 8

    End Enum

#End Region

End Module
