The Inx_Api_DesignTemplate_DesignCollectionMananger can be used to access Inx_Api_DesignTemplate_DesignCollections.
The Inx_Api_DesignTemplate_DesignCollectionMananger can be used to access Inx_Api_DesignTemplate_DesignCollections. You can import design collections from itc files into a specific list or all lists (by using the SystemListContext). You can also retrieve the collections available in a specific list or all lists (by ommitting the list parameter). Inx_Api_DesignTemplate_DesignCollections are returned in an Inx_Api_BOResultSet that may be used to access the individual collections. Inx_Api_DesignTemplate_DesignCollections may contain multiple templates with possibly multiple text and HTML styles. These styles can be used to create new mailings based on the chosen template.
The following snippet shows how to generate a mailing based on a newly imported design collection:
$oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" ); $oMailing = $oSession->getMailingManager()->createMailing( $oListContext ); $oMailing->setContentHandler( "Inx_Api_Mailing_XsltMultiPartContentHandler" ); $oDesignCollectionManager = $oSession->getDesignCollectionManager(); $stream = fopen( "test.itc", "rb"); $oDesignCollection = $oDesignCollectionManager->importDesignCollection( $stream, $oListContext ); fclose($stream); $aTemplates = $oDesignCollection->getTemplates(); $oContentHandler = $oMailing->getContentHandler(); $aStyles = $aTemplates[0]->getHTMLStyles(); $oContentHandler->updateStyle( $aStyles[0] ); $oMailing->commitUpdate();
The following snippet shows how to list all available HTML styles of all design collections in a certain list:
$oDesignCollectionManager = $oSession->getDesignCollectionManager(); $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" ); $oBOResultSet = $oDesignCollectionManager->select($oListContext); for( $i = 0; $i<$oBOResultSet->getSize(); $i++) { $oDesignCollection = $oBOResultSet->get($i); echo $oDesignCollection->getVendor(); echo $oDesignCollection->getVendorURL(); ... $aTemplates = $oDesignCollection->getTemplates(); for($j = 0; $j<count($aTemplates); $j++) { $oTemplate = $aTemplates[j]; echo $oTemplate->getName(); echo $oTemplate->getId(); $aHtmlStyles = $oTemplate->getHTMLStyles(); for ($k = 0; $k<count($aHtmlStyles); $k++) { echo $aHtmlStyles[k]->getTemplateID(); echo $aHtmlStyles[k]->getStyleName(); } } } $oBOResultSet->close();
Note: The usage of Inx_Api_DesignTemplate_DesignCollections requires the api user right: Inx_Api_UserRights::TEMPLATE_FEATURE_USE For more information on design collections, see the Inx_Api_DesignTemplate_DesignCollection documentation.
Located in /Api/DesignTemplate/DesignCollectionManager.php (line 86)
Inx_Api_BOManager | --Inx_Api_DesignTemplate_DesignCollectionManager
Returns the preview image, provided by the design collection.
Returns the preview image, provided by the design collection. Can be null, if no image was provided. This method does not return an actual screenshot of a mailing generated with this Inx_Api_DesignTemplate_Style, but an image provided and generated by the design collection author.
Imports the desired itc file into the specified list to be used there.
Imports the desired itc file into the specified list to be used there. Importing an itc into the system list will make the design collection available in all lists. The following snippet retrieves the system list context:
$oListContextManager = $oSession->getListContextManager(); $oListContextc = $oListContextManager->findByName( Inx_Api_SystemListContext::NAME );
Returns the Inx_Api_DesignTemplate_DesignCollections available in the specified list.
Returns the Inx_Api_DesignTemplate_DesignCollections available in the specified list. To retrieve all design collections from all lists, pass on a null value.
Inherited From Inx_Api_BOManager
Inx_Api_BOManager::get()
Inx_Api_BOManager::remove()
Inx_Api_BOManager::selectAll()
Documentation generated on Thu, 17 Sep 2015 14:27:24 +0200 by phpDocumentor 1.3.2