/** * Adds all texts belonging to an catalog item. * * @param \Aimeos\MW\Container\Content\Iface $contentItem Content item * @param \Aimeos\MShop\Catalog\Item\Iface $item product item object * @param string $langid Language id */ protected function addItem(\Aimeos\MW\Container\Content\Iface $contentItem, \Aimeos\MShop\Catalog\Item\Iface $item, $langid) { $listTypes = array(); foreach ($item->getListItems('text') as $listItem) { $listTypes[$listItem->getRefId()] = $listItem->getType(); } foreach ($this->getTextTypes('catalog') as $textTypeItem) { $textItems = $item->getRefItems('text', $textTypeItem->getCode()); if (!empty($textItems)) { foreach ($textItems as $textItem) { $listType = isset($listTypes[$textItem->getId()]) ? $listTypes[$textItem->getId()] : ''; $items = array($langid, $item->getLabel(), $item->getId(), $listType, $textTypeItem->getCode(), '', ''); // use language of the text item because it may be null if (($textItem->getLanguageId() == $langid || is_null($textItem->getLanguageId())) && $textItem->getTypeId() == $textTypeItem->getId()) { $items[0] = $textItem->getLanguageId(); $items[5] = $textItem->getId(); $items[6] = $textItem->getContent(); } $contentItem->add($items); } } else { $items = array($langid, $item->getLabel(), $item->getId(), 'default', $textTypeItem->getCode(), '', ''); $contentItem->add($items); } } }
/** * Closes the site map content object * * @param \Aimeos\MW\Container\Content\Iface $content */ protected function closeContent(\Aimeos\MW\Container\Content\Iface $content) { $config = $this->getContext()->getConfig(); /** controller/jobs/product/export/standard/template-footer * Relative path to the XML site map footer template of the product site map job controller. * * The template file contains the XML code and processing instructions * to generate the site map footer. The configuration string is the path * to the template file relative to the templates directory (usually in * controller/jobs/templates). * * You can overwrite the template file configuration in extensions and * provide alternative templates. These alternative templates should be * named like the default one but with the string "standard" replaced by * an unique name. You may use the name of your project for this. If * you've implemented an alternative client class as well, "standard" * should be replaced by the name of the new class. * * @param string Relative path to the template creating XML code for the site map footer * @since 2015.01 * @category Developer * @see controller/jobs/product/export/standard/template-header * @see controller/jobs/product/export/standard/template-items * @see controller/jobs/product/export/standard/template-index */ $tplconf = 'controller/jobs/product/export/standard/template-footer'; $default = 'product/export/items-footer-default.xml'; $view = $this->getContext()->getView(); $content->add($view->render($this->getTemplate($tplconf, $default))); }