7.0
Table Of Contents
8.1 Storefront class
The Storefront class lets web designers and developers retrieve publication type and document information to
create custom store front pages. The following sections describe the functions of this class:
getTree();
getTree();
Description
getTree( string $searchfor, string $delimiter, int $publicationtypeid)
Parameters
• $searchfor: the string to search for (leave emtpy to return all publication types and templates).
• $delimiter: the boundary string to create virutal sub folders.
• $publicationtypeid: return the documents of the specified publicationtype id.
Return Values
An associative array.
The following PHP code shows how to implement this getTree() function:
<?php
//Retrieve the publication types and templates for the logged on user
$storeFront = New Storefront();
$treeData = $storeFront->getTree();
?>
The following code is a sample of the array returned by the getTree() function.
[1] => Array
(
[id] => 1
[name] => Business Cards
...
[documents] => Array
(
[1] => Array
(
[id] => 1
[name] => BC-Portrait
...
)
[2] => Array
(
[id] => 2
[name] => BC-Landscape
...
)
)
)
The snippet below shows how to use this information in a link (<a>). In order to show the correct subsequent
page in the ordering workflow the link should refer the preview_init_form page (fromid parameter of the url).
Objectif Lune Inc. © 2010 52