1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3*3e02b54dSAndrew Rist<!--***********************************************************
4*3e02b54dSAndrew Rist *
5*3e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
6*3e02b54dSAndrew Rist * or more contributor license agreements.  See the NOTICE file
7*3e02b54dSAndrew Rist * distributed with this work for additional information
8*3e02b54dSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
9*3e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the
10*3e02b54dSAndrew Rist * "License"); you may not use this file except in compliance
11*3e02b54dSAndrew Rist * with the License.  You may obtain a copy of the License at
12*3e02b54dSAndrew Rist *
13*3e02b54dSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14*3e02b54dSAndrew Rist *
15*3e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing,
16*3e02b54dSAndrew Rist * software distributed under the License is distributed on an
17*3e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18*3e02b54dSAndrew Rist * KIND, either express or implied.  See the License for the
19*3e02b54dSAndrew Rist * specific language governing permissions and limitations
20*3e02b54dSAndrew Rist * under the License.
21*3e02b54dSAndrew Rist *
22*3e02b54dSAndrew Rist ***********************************************************-->
23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
24cdf0e10cSrcweir
25cdf0e10cSrcweir
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweirSub LoadLanguage()
29cdf0e10cSrcweir	If InitResources(&quot;WebWizard&quot;,&quot;wwz&quot;) Then
30cdf0e10cSrcweir		WebWiz_gErrContentNotFound = GetResText(1101)
31cdf0e10cSrcweir		WebWiz_gErrStyleNotFound = GetResText(1102)
32cdf0e10cSrcweir		WebWiz_gErrMainTemplateError = GetResText(1103)
33cdf0e10cSrcweir		WebWiz_gErrWhileReloading = GetResText(1104)
34cdf0e10cSrcweir		WebWiz_gErrWhileLoadStyles = GetResText(1105)
35cdf0e10cSrcweir		WebWiz_gErrMainDocumentError = GetResText(1106)
36cdf0e10cSrcweir		WebWiz_gErrMsg = GetResText(1107)
37cdf0e10cSrcweir	End If
38cdf0e10cSrcweirEnd Sub
39cdf0e10cSrcweir
40cdf0e10cSrcweir
41cdf0e10cSrcweirFunction GetWebWizardPaths() as Boolean
42cdf0e10cSrcweirDim TemplatePath as String
43cdf0e10cSrcweir	TextureDir = GetOfficeSubPath(&quot;Gallery&quot;,&quot;www-back&quot;)
44cdf0e10cSrcweir	If TextureDir &lt;&gt; &quot;&quot; Then
45cdf0e10cSrcweir		GraphicsDir = GetOfficeSubPath(&quot;Gallery&quot;,&quot;www-graf/&quot;)
46cdf0e10cSrcweir		If GraphicsDir &lt;&gt; &quot;&quot; Then
47cdf0e10cSrcweir			BulletDir = GetOfficeSubPath(&quot;Gallery&quot;, &quot;bullets/&quot;)
48cdf0e10cSrcweir			If BulletDir &lt;&gt; &quot;&quot; Then
49cdf0e10cSrcweir				PhotosDir = GetPathSettings(&quot;Gallery&quot;, False, 1)
50cdf0e10cSrcweir				If PhotosDir &lt;&gt; &quot;&quot; Then
51cdf0e10cSrcweir					TemplatePath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/web/&quot;)
52cdf0e10cSrcweir					If TemplatePath &lt;&gt; &quot;&quot; Then
53cdf0e10cSrcweir						SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap&quot;)
54cdf0e10cSrcweir						If SOBitmapPath &lt;&gt; &quot;&quot; Then
55cdf0e10cSrcweir							GetWebwizardPaths() = True
56cdf0e10cSrcweir							Exit Function
57cdf0e10cSrcweir							End If
58cdf0e10cSrcweir					End If
59cdf0e10cSrcweir				End If
60cdf0e10cSrcweir			End If
61cdf0e10cSrcweir		End If
62cdf0e10cSrcweir	End If
63cdf0e10cSrcweir	DisposeDocument(oBaseDocument)
64cdf0e10cSrcweir	GetWebWizardPaths() = False
65cdf0e10cSrcweirEnd Function
66cdf0e10cSrcweir
67cdf0e10cSrcweir
68cdf0e10cSrcweir
69cdf0e10cSrcweirSub OpenWebDialog()
70cdf0e10cSrcweir	Dim sBitmapPath as String
71cdf0e10cSrcweir	Dim BufferNames() as String
72cdf0e10cSrcweir	Dim SelList(0) as Integer
73cdf0e10cSrcweir	SelList(0) = 0
74cdf0e10cSrcweir	MainDialog = LoadDialog(&quot;WebWizard&quot;,&quot;WebWzrd&quot;)
75cdf0e10cSrcweir	DialogModel = MainDialog.Model
76cdf0e10cSrcweir	With DialogModel
77cdf0e10cSrcweir		.cbHelp.Label = GetResText(1000)
78cdf0e10cSrcweir		.Title = GetResText(1001)
79cdf0e10cSrcweir		.cbCancel.Label = GetResText(1002)
80cdf0e10cSrcweir		.cbGoOn.Label = GetResText(1003)
81cdf0e10cSrcweir		.lblTemplate.Label = GetResText(1004)
82cdf0e10cSrcweir		.lblStyle.Label = GetResText(1005)
83cdf0e10cSrcweir		.hlnBackground.Label = GetResText(1006)
84cdf0e10cSrcweir		.optTiled.Label = GetRestext(1007)
85cdf0e10cSrcweir		.optArea.Label = GetResText(1008)
86cdf0e10cSrcweir		.chkSaveasTemplate.Label = GetResText(1010)
87cdf0e10cSrcweir	End With
88cdf0e10cSrcweir
89cdf0e10cSrcweir	BufferNames() = ArrayfromMultiArray(Layout, 1)
90cdf0e10cSrcweir	DialogModel.lbTemplate.StringItemList() = BufferNames()
91cdf0e10cSrcweir	DialogModel.lbTemplate.SelectedItems() = SelList()
92cdf0e10cSrcweir
93cdf0e10cSrcweir
94cdf0e10cSrcweir	BufferNames() = ArrayfromMultiArray(Style, 1)
95cdf0e10cSrcweir	DialogModel.lbStyles.StringItemList() = BufferNames()
96cdf0e10cSrcweir	DialogModel.lbStyles.SelectedItems() = SelList()
97cdf0e10cSrcweir	sBitmapPath = SOBitmapPath &amp; &quot;webwizard.bmp&quot;
98cdf0e10cSrcweir
99cdf0e10cSrcweir	DialogModel.ImagePreview.ImageURL = sBitmapPath
100cdf0e10cSrcweir	ToggleOptionButtons(DialogModel, bWithBackGraphic)
101cdf0e10cSrcweir	MainDialog.GetControl(&quot;lbTemplate&quot;).SetFocus()
102cdf0e10cSrcweir	DialogModel.cbGoOn.DefaultButton = True
103cdf0e10cSrcweir	DialogModel.ImagePreview.BackGroundColor = RGB(0,60,126)
104*3e02b54dSAndrew RistEnd Sub</script:module>
105