/** * Add news items to the indexer * @param array * @param integer * @param boolean * @return array */ public function getSearchablePages($arrPages, $intRoot = 0, $blnIsSitemap = false) { $arrRoot = array(); if ($intRoot > 0) { $arrRoot = $this->Database->getChildRecords($intRoot, 'tl_page'); } $time = time(); $arrProcessed = array(); // Get all news archives $objArchive = \SermonArchiveModel::findByProtected(''); // Walk through each archive if ($objArchive !== null) { while ($objArchive->next()) { // Skip news archives without target page if (!$objArchive->jumpTo) { continue; } // Skip news archives outside the root nodes if (!empty($arrRoot) && !in_array($objArchive->jumpTo, $arrRoot)) { continue; } // Get the URL of the jumpTo page if (!isset($arrProcessed[$objArchive->jumpTo])) { $objParent = \PageModel::findWithDetails($objArchive->jumpTo); // The target page does not exist if ($objParent === null) { continue; } // The target page has not been published (see #5520) if (!$objParent->published || $objParent->start != '' && $objParent->start > $time || $objParent->stop != '' && $objParent->stop < $time) { continue; } // The target page is exempt from the sitemap (see #6418) if ($blnIsSitemap && $objParent->sitemap == 'map_never') { continue; } // Set the domain (see #6421) $domain = ($objParent->rootUseSSL ? 'https://' : 'http://') . ($objParent->domain ?: \Environment::get('host')) . TL_PATH . '/'; // Generate the URL $arrProcessed[$objArchive->jumpTo] = $domain . $this->generateFrontendUrl($objParent->row(), $GLOBALS['TL_CONFIG']['useAutoItem'] && !$GLOBALS['TL_CONFIG']['disableAlias'] ? '/%s' : '/items/%s', $objParent->language); } $strUrl = $arrProcessed[$objArchive->jumpTo]; // Get the items $objSermons = \SermonerItemsModel::findPublishedDefaultByPid($objArchive->id); if ($objSermons !== null) { while ($objSermons->next()) { $arrPages[] = $this->getLink($objSermons, $strUrl); } } } } return $arrPages; }