Navigation:  thinBasic language > Script structure > Pre Parsing directives > #INCLUDE >

#INCLUDE "Includes\Theme.inc"

Previous pageReturn to chapter overviewNext page

 

Global gTheme As Long

 

'-------------------------------------------------------------------------

' .

'-------------------------------------------------------------------------

Function Theme_Load() As Long

 

Dim sFileName   As String

Dim sThemeDir   As String

Dim sThemeDef   As String

Dim sThemeBody As String

 

sThemeDir   = LL_DataByName(gConfig, "Theme_Dir")  

sThemeDef   = LL_DataByName(gConfig, "Theme_Name")

sThemeBody  = LL_DataByName(gConfig, "Theme_Body")

 

sFileName = APP_SourcePath & sThemeDir & "\" & sThemeDef & "\" & sThemeBody

 

gTheme = LL_Add(gTheme, "Theme_BodyBuffer", File_Load(sFileName))

        LL_Add(gTheme, "Theme_AbsolutePath", APP_SourcePath & sThemeDir & "\" & sThemeDef & "\")

        LL_Add(gTheme, "Theme_BasePath", sThemeDir & "\" & sThemeDef & "\")

 

End Function

'-------------------------------------------------------------------------

' .

'-------------------------------------------------------------------------

Function Theme_SetBlock(sBlockName As String, sBlockBuffer As String) As Long

Dim sBuffer As String

 

sBuffer = LL_DataByName(gTheme, "Theme_BodyBuffer")

sBuffer = REPLACE$(sBuffer, sBlockName, sBlockBuffer)

LL_UpdateByName(gTheme, "Theme_BodyBuffer", sBuffer)

 

End Function

 

'-------------------------------------------------------------------------

' .

'-------------------------------------------------------------------------

Function Theme_ResolveVars() As Long

 

Dim sBuffer As String

 

sBuffer = LL_DataByName(gTheme, "Theme_BodyBuffer")

sBuffer = REPLACE$(sBuffer, "[Theme_BasePath]", LL_DataByName(gTheme, "Theme_BasePath"))

LL_UpdateByName(gTheme, "Theme_BodyBuffer", sBuffer)

End Function

 

'-------------------------------------------------------------------------

' .

'-------------------------------------------------------------------------

Function Theme_Echo() As Long

 

Echo LL_DataByName(gTheme, "Theme_BodyBuffer")

 

End Function

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com