/** * Generate module * @return void */ protected function compile() { $objProduct = IsotopeFrontend::getProductByAlias($this->Input->get('product'), IsotopeFrontend::getReaderPageId()); if (!$objProduct) { $this->Template = new FrontendTemplate('mod_message'); $this->Template->type = 'empty'; $this->Template->message = $GLOBALS['TL_LANG']['MSC']['invalidProductInformation']; return; } $this->Template->product = $objProduct->generate(strlen($this->iso_reader_layout) ? $this->iso_reader_layout : $objProduct->reader_template, $this); $this->Template->referer = 'javascript:history.go(-1)'; $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack']; global $objPage; $objPage->pageTitle = strip_insert_tags($objProduct->name); $objPage->description = $this->prepareMetaDescription($objProduct->description_meta); $GLOBALS['TL_KEYWORDS'] .= (strlen($GLOBALS['TL_KEYWORDS']) ? ', ' : '') . $objProduct->keywords_meta; }
/** * The ids of all pages we take care of. This is what should later be used eg. for filter data. * @param string * @return array */ protected function findCategories($strCategoryScope) { if ($this->defineRoot && $this->rootPage > 0) { $objPage = $this->getPageDetails($this->rootPage); } else { global $objPage; } switch ($strCategoryScope) { case 'global': $arrCategories = $this->getChildRecords($objPage->rootId, 'tl_page'); $arrCategories[] = $objPage->rootId; break; case 'current_and_first_child': $arrCategories = $this->Database->execute("SELECT id FROM tl_page WHERE pid={$objPage->id}")->fetchEach('id'); $arrCategories[] = $objPage->id; break; case 'current_and_all_children': $arrCategories = $this->getChildRecords($objPage->id, 'tl_page'); $arrCategories[] = $objPage->id; break; case 'parent': $arrCategories = array($objPage->pid); break; case 'product': $objProduct = IsotopeFrontend::getProductByAlias($this->Input->get('product')); if ($objProduct !== null) { $arrCategories = $objProduct->categories; } else { return array(0); } break; case 'current_category': default: $arrCategories = array($objPage->id); break; } return empty($arrCategories) ? array(0) : $arrCategories; }
/** * Shortcut for a single product by alias (from url?) * @deprecated * @see IsotopeFrontend::getProducts() */ protected function getProductByAlias($strAlias, $blnCheckAvailability = true) { trigger_error('Using ContentIsotope::getProductByAlias() is deprecated. Please use IsotopeFrontend::getProductByAlias()', E_USER_NOTICE); return IsotopeFrontend::getProductByAlias($strAlias, IsotopeFrontend::getReaderPageId(null, $this->iso_reader_jumpTo), $blnCheckAvailability); }