Пример #1
0
 /**
  * Get the Records
  *
  * @param integer                                        $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @throws Exception
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) {
         return $nodes;
     }
     if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($GLOBALS['TSFE']->tmpl->setup['plugin.']['tt_news.']['singlePid'])) {
         throw new Exception('You have to set tt_news singlePid.');
     }
     $singlePid = intval($GLOBALS['TSFE']->tmpl->setup['plugin.']['tt_news.']['singlePid']);
     $news = $this->getRecordsByField('tt_news', 'pid', implode(',', $basePages));
     foreach ($news as $record) {
         // Alternative Single PID
         $alternativeSinglePid = $this->alternativeSinglePid($record['uid']);
         $linkPid = $alternativeSinglePid ? $alternativeSinglePid : $singlePid;
         // Build URL
         $url = $obj->getUriBuilder()->setArguments(array('tx_ttnews' => array('tt_news' => $record['uid'])))->setTargetPageUid($linkPid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($record));
         $node->setChangefreq('monthly');
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #2
0
 /**
  * Get the Records
  * 
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node 
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     foreach ($basePages as $uid) {
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $uid);
         // exclude Doctypes
         if (in_array($record['doktype'], array(4))) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($startPage, $record));
         $node->setChangefreq(Tx_GoogleServices_Service_SitemapDataService::mapTimeout2Period($record['cache_timeout']));
         $node->setLastmod($this->getModifiedDate($record));
         #$geo = new Tx_GoogleServices_Domain_Model_Node_Geo();
         #$geo->setFormat('kml');
         #$node->setGeo($geo);
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #3
0
 /**
  * Get the Records
  *
  * @param integer                                        $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     $database = $this->getDatabaseConnection();
     $res = $database->exec_SELECTquery('*', 'tt_content', 'CType="list" AND list_type="googleservices_pisitemap" AND hidden=0 AND deleted=0');
     while ($row = $database->sql_fetch_assoc($res)) {
         $uid = $row['pid'];
         if ($uid == $GLOBALS['TSFE']->id) {
             continue;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $uid);
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #4
0
 /**
  * Get the Records
  *
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     foreach ($basePages as $uid) {
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = t3lib_BEfunc::getRecord('pages', $uid, "*", " AND tx_googleservicesext_hide_in_sitemap = 0");
         if (!is_array($record)) {
             continue;
         }
         // exclude Doctypes
         if (in_array($record['doktype'], array(4))) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($startPage, $record));
         $node->setChangefreq(Tx_GoogleServices_Service_SitemapDataService::mapTimeout2Period($record['cache_timeout']));
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #5
0
 /**
  * Get the Records
  *
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     $rows = $this->getRecordsByField('tx_winkelproducts_domain_model_profile', 'pid', 10);
     foreach ($rows as $record) {
         # 1 "Standard U-Profile" 									= 1778
         # 2 "Präzisions U-Profile" 									= 1793
         # 3 "Standard U-Profile gebohrt Typ PG" 					= 1794
         # 5 "Doppel-T Profile NbV" 									= 1779
         # 6 "Jumbo Profile" 										= 1780
         # 7 "U-Profile INOX in Edelstahl" 							= 1781
         # 8 "U-Profile Speed + Silent / U-Profile Speed + Force"	= 1782
         # 9 "U-Profile Typ L" 										= 1783
         # 10 "U-Profile Typ PG- L gebohrt" 							= 1796
         switch ($record['profile_group']) {
             case 1:
                 $singlePid = 1778;
                 break;
             case 2:
                 $singlePid = 1793;
                 break;
             case 3:
                 $singlePid = 1794;
                 break;
             case 5:
                 $singlePid = 1779;
                 break;
             case 6:
                 $singlePid = 1780;
                 break;
             case 7:
                 $singlePid = 1781;
                 break;
             case 8:
                 $singlePid = 1782;
                 break;
             case 9:
                 $singlePid = 1783;
                 break;
             case 10:
                 $singlePid = 1796;
                 break;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setArguments(array('tx_winkelproducts_pi1' => array('controller' => 'Bearing', 'action' => 'show', 'bearing' => $record['uid'])))->setTargetPageUid($singlePid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($record));
         $node->setChangefreq('monthly');
         $node->setLastmod($this->getModifiedDate($record));
         $nodes['profile' . uniqid()] = $node;
     }
     return $nodes;
 }
Пример #6
0
 /**
  * Get the records
  *
  * @param int                                            $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @return array|Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     foreach ($basePages as $uid) {
         $images = $this->getImagesByPages(array($uid));
         if (!sizeof($images)) {
             continue;
         }
         $imageNodes = array();
         foreach ($images as $imageReference) {
             /** @var $imageReference \TYPO3\CMS\Core\Resource\FileReference */
             $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') . '/' . $imageReference->getOriginalFile()->getPublicUrl();
             // Build Node
             $nodeImage = new Tx_GoogleServices_Domain_Model_Node_Image();
             $nodeImage->setLoc($url);
             $nodeImage->setTitle($imageReference->getTitle());
             $nodeImage->setCaption($imageReference->getDescription());
             $imageNodes[] = $nodeImage;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = BackendUtility::getRecord('pages', $uid);
         // exclude Doctypes
         if (in_array($record['doktype'], array(4))) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($startPage, $record));
         $node->setChangefreq(\Tx_GoogleServices_Service_SitemapDataService::mapTimeout2Period($record['cache_timeout']));
         $node->setLastmod($this->getModifiedDate($record));
         $node->setImages($imageNodes);
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #7
0
 /**
  * Get the Records
  *
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     $newsItems = $this->getRecordsByField('tt_news', 'pid', implode(',', $basePages));
     foreach ($newsItems as $record) {
         $singlePid = 0;
         switch ($record['pid']) {
             #Home
             case 117:
                 $singlePid = 13;
                 break;
                 #Beratungsservice
             #Beratungsservice
             case 19:
                 $singlePid = 22;
                 break;
             default:
                 continue;
                 break;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setArguments(array('tx_ttnews' => array('tt_news' => $record['uid'])))->setTargetPageUid($singlePid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($record));
         $node->setChangefreq('monthly');
         $node->setLastmod($this->getModifiedDate($record));
         $nodes['tt_news' . uniqid()] = $node;
     }
     return $nodes;
 }
Пример #8
0
 /**
  * @param int                                            $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @return array|Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     foreach ($basePages as $uid) {
         if ($this->currentLanguageUid) {
             $fields = $this->cObject->enableFields('pages_language_overlay');
             $overlay = $this->database->exec_SELECTgetSingleRow('uid', 'pages_language_overlay', ' pid = ' . intval($uid) . ' AND sys_language_uid = ' . $this->currentLanguageUid . $fields);
             if (!is_array($overlay)) {
                 continue;
             }
         }
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $uid);
         // exclude Doctypes
         if (in_array($record['doktype'], array(4))) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($startPage, $record));
         $node->setChangefreq(Tx_GoogleServices_Service_SitemapDataService::mapTimeout2Period($record['cache_timeout']));
         $node->setLastmod($this->getModifiedDate($record));
         #$geo = new Tx_GoogleServices_Domain_Model_Node_Geo();
         #$geo->setFormat('kml');
         #$node->setGeo($geo);
         $nodes[] = $node;
     }
     return $nodes;
 }
Пример #9
0
 /**
  * Get the Records
  *
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     $rows = $this->getRecordsByField('tx_winkelproducts_domain_model_bearing', 'pid', 10);
     foreach ($rows as $record) {
         ### BEARING_GROUP MAPPING (bearing_group UID => PAGE UID/Plugin action = show)
         # default "Winkel-Rollen altes Plugin/Fallback" 					= 1978
         # 1 "Winkel-Rollen axial justierbar"								= 2002
         # 2 "Winkel-Präzisionsrollen										= 1991
         # 3 "Winkel-Hochtemperaturrollen									= 1992
         # 4 "WINKEL-Rolle axial über Exzenter justierbar"					= 1990
         # 5 "Präzisions-WINKEL-Rolle Axialrolle über Exzenter justierbar" 	= 2002
         # 6 "WINKEL-Rolle axial über Scheiben justierbar"					= 2002
         # 7 "Präzisions-WINKEL-Rolle über Scheiben justierbar"				= 1991
         # 8 "WINKEL-Rolle justierbar mit OLIAMID*-Einsatz"					= 2002
         # 9 "Präzisions-WINKEL-Rolle justierbar mit OLIAMID*-Einsatz" 		= 2002
         #10 "WINKEL-Rolle mit Kombibolzen"									= 1990
         #11 "Präzisions-WINKEL-Rolle mit Kombibolzen"						= 1991
         #12 "WINKEL-Rolle mit Kombibolzen und OLIAMID*-Einsatz"				= 1990
         #13 "Präzisions-WINKEL-Rolle mit Kombibolzen und OLIAMID*-Einsatz"	= 1991
         #14 "Jumbo WINKEL-Rolle Axialrolle justierbar"						= 1994
         #15 "Winkel-Radiallager"											= 1995
         #16 "Präzisions-WINKEL-Radiallager"									= 1995
         #17 "Heavy Duty WINKEL-Rolle"										= 1993
         #18 "Heavy Duty Präzisions-WINKEL-Rolle"							= 1993
         #19 "Justierbare WINKEL-Rolleneinheit für alle Standard-Profile"	= 2013
         #20 "Justierbare WINKEL-Rolleneinheit"								= 2014
         #21 "WINKEL-Rollen in Edelstahlausführung [Gleitlager aus OILAMID]"	= 1996
         #22 "WINKEL-Rollen in Edelstahlausführung"							= 1996
         #23 "SPEED + SILENT LINEARSYSTEM"									= 2015
         #24 "Justierbare WINKEL-VULKOLLAN® Rolleneinheit"					= 2015
         #25 "VULKOLLAN® Rolle"												= 2015
         #26 "VULKOLLAN® Exzenter-Rollen"									= 2015
         #27 "Angetriebene VULKOLLAN® WINKEL-Rolle"							= 2015
         #28 "SPEED + FORCE LINEARSYSTEM"									= 2016
         #29 "POLYAMID Rollen"												= 2016
         #30 "Justierbare WINKEL-POLYAMID Rolleneinheit"						= 2016
         #31 "Stützrollen für Gabelstapler"									= 2033
         switch ($record['bearing_group']) {
             case 1:
                 $singlePid = 2002;
                 break;
             case 2:
                 $singlePid = 1991;
                 break;
             case 3:
                 $singlePid = 1992;
                 break;
             case 4:
                 $singlePid = 1990;
                 break;
             case 5:
                 $singlePid = 2002;
                 break;
             case 6:
                 $singlePid = 2002;
                 break;
             case 7:
                 $singlePid = 1991;
                 break;
             case 8:
                 $singlePid = 2002;
                 break;
             case 9:
                 $singlePid = 2002;
                 break;
             case 10:
                 $singlePid = 1990;
                 break;
             case 11:
                 $singlePid = 1991;
                 break;
             case 12:
                 $singlePid = 1990;
                 break;
             case 13:
                 $singlePid = 1991;
                 break;
             case 14:
                 $singlePid = 1994;
                 break;
             case 15:
                 $singlePid = 1995;
                 break;
             case 16:
                 $singlePid = 1995;
                 break;
             case 17:
                 $singlePid = 1993;
                 break;
             case 18:
                 $singlePid = 1993;
                 break;
             case 19:
                 $singlePid = 2013;
                 break;
             case 20:
                 $singlePid = 2014;
                 break;
             case 21:
                 $singlePid = 1996;
                 break;
             case 22:
                 $singlePid = 1996;
                 break;
             case 23:
                 $singlePid = 2015;
                 break;
             case 24:
                 $singlePid = 2015;
                 break;
             case 25:
                 $singlePid = 2015;
                 break;
             case 26:
                 $singlePid = 2015;
                 break;
             case 27:
                 $singlePid = 2015;
                 break;
             case 28:
                 $singlePid = 2016;
                 break;
             case 29:
                 $singlePid = 2016;
                 break;
             case 30:
                 $singlePid = 2016;
                 break;
             case 31:
                 $singlePid = 2033;
                 break;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setArguments(array('tx_winkelproducts_pi1' => array('controller' => 'Bearing', 'action' => 'show', 'bearing' => $record['uid'])))->setTargetPageUid($singlePid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($record));
         $node->setChangefreq('monthly');
         $node->setLastmod($this->getModifiedDate($record));
         $nodes['bearing' . uniqid()] = $node;
     }
     return $nodes;
 }