Previous Topic

Next Topic

Book Contents

Template Management: templates.php

Description

The function allows to get the following information about all templates installed in SiteBuilder: template id, template status (active/not active), and template category.

Synopsis

Name of the script to call

[SiteBuilderHost]/remote_admin/templates.php

Login:password for accessing the directory

Login: Root

Password: Reseller

Parameters

cmd=get_templates

Result

The result string has the following format:

<RESULT_ACTION><RESULT NAME="Name">Result</RESULT><STATUS CODE="Status Code">Status string</STATUS></RESULT_ACTION>

Status string - a string containing information on the result of the function including description of an error if it has occurred during execution of the function. Status string always contains a value.

Name - the name of the returning value. If no errors have occurred during execution of the function, then Name = 'templates', else Name is empty

Status code - a 6-digits number containing code of the result of the function, i.e. error code or code of successful completion of the function. Status code always contains a value.

Result - the returning value. If some errors have occurred during execution of the function, then Result is empty, else if the function has been completed successfully Result contains an XML-format string, where each template is described with a tag:

<TEMPLATE ID="TemplateId" ACTIVE="TemplateActive" CATEGORY="TemplateCategory" DEFAULT_COLOR_SCHEME="DefaultColorSchemeID">
<COLOR_SCHEMAS>
<COLOR_SCHEMA ID="ColorSchemeID1" CAPTION="ColorSchemeCaption1" PREVIEW_URL="ColorSchemePreviewURL1"/>
<COLOR_SCHEMA ID="ColorSchemeID2" CAPTION="ColorSchemeCaption2" PREVIEW_URL="ColorSchemePreviewURL2"/>
<COLOR_SCHEMA ID="ColorSchemeID3" CAPTION="ColorSchemeCaption3" PREVIEW_URL="ColorSchemePreviewURL3"/>
</COLOR_SCHEMAS>
</TEMPLATE>

where: TemplateId - template id
TemplateActive - activity (1 – active, 0 - not active)
TemplateCategory - category
DefaultColorSchemeID - default color scheme ID
ColorSchemeID<1,2,..> - color scheme ID
ColorSchemeCaption<1,2,..> - color scheme title
ColorSchemePreviewURL<1,2,..> - color scheme preview URL

Example

Command

[SiteBuilderHost]/remote_admin/templates.php?cmd=get_templates

Result

<RESULT_ACTION><RESULT NAME="templates"><TEMPLATE ID="aa-03" ACTIVE="1" CATEGORY="Business company"/><TEMPLATE ID="TemplateId" ACTIVE="TemplateActive" CATEGORY="TemplateCategory" DEFAULT_COLOR_SCHEME="green"><COLOR_SCHEMAS><COLOR_SCHEMA ID="green" CAPTION="Green scheme" PREVIEW_URL="/repository/templates/aa-03/green/icon.gif"/><COLOR_SCHEMA ID="blue" CAPTION="Blue scheme" PREVIEW_URL="/repository/templates/aa-03/blue/icon.gif"/><COLOR_SCHEMA ID="orange" CAPTION="Orange scheme" PREVIEW_URL="/repository/templates/aa-03/orange/icon.gif"/></COLOR_SCHEMAS></TEMPLATE></RESULT><STATUS CODE="080008">OK</STATUS></RESULT_ACTION>

Description

The function allows to activate one or several templates.

Synopsis

Name of the script to call

[SiteBuilderHost]/remote_admin/templates.php

Login:password for accessing the directory

Login: Root

Password: Reseller

Parameters

cmd=activate
templates=TemplateId[,TemplateId]


TemplateId - template id

Result

The result string has the following format:

<RESULT_ACTION><RESULT NAME="Name">Result</RESULT><STATUS CODE="Status Code">Status string</STATUS></RESULT_ACTION>

In the case of the Activate function, the result string doesn't contain any values. It returns only status message.

Example

Command

[SiteBuilderHost]/remote_admin/templates.php?cmd=activate&templates=aa-03,aa-10

Result

<RESULT_ACTION><RESULT NAME=""></RESULT><STATUS CODE="080008">OK</STATUS></RESULT_ACTION>

Description

The function allows to deactivate one or several templates.

Synopsis

Name of the script to call

[SiteBuilderHost]/remote_admin/templates.php

Login:password for accessing the directory

Login: Root

Password: Reseller

Parameters

cmd=deactivate
templates=TemplateId[,TemplateId]


TemplateId - template id

Result

The result string has the following format:

<RESULT_ACTION><RESULT NAME="Name">Result</RESULT><STATUS CODE="Status Code">Status string</STATUS></RESULT_ACTION>

In the case of the Deactivate function, the result string doesn't contain any values. It returns only status message.

Example

Command
[SiteBuilderHost]/remote_admin/templates.php?cmd=deactivate&templates=aa-03,aa-10

Result
<RESULT_ACTION><RESULT NAME=""></RESULT><STATUS CODE="080008">OK</STATUS></RESULT_ACTION>

Description

The function allows to delete one or several templates.

Synopsis

Name of the script to call

[SiteBuilderHost]/remote_admin/templates.php

Login:password for accessing the directory

Login: Root

Password: Reseller

Parameters

cmd=delete
templates=TemplateId[,TemplateId]

TemplateId - template id

Result

The result string has the following format:

<RESULT_ACTION><RESULT NAME="Name">Result</RESULT><STATUS CODE="Status Code">Status string</STATUS></RESULT_ACTION>

In the case of the Delete function, the result string doesn't contain any values. It returns only status message

Example

Command

[SiteBuilderHost]/remote_admin/templates.php?cmd=delete&templates=aa-03,aa-10

Result

<RESULT_ACTION><RESULT NAME=""></RESULT><STATUS CODE="080008">OK</STATUS></RESULT_ACTION>