Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
GooglesitemapsWidget.php
1 <?php
2  /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 ?>
12 <?php
13 foreach ($contentList as $resultItem) {
14  if ($lvl == 1) {
15  echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
16  }
17  if ($resultItem['obj_type'] == "10002") {
18  if(isset($resultItem['children'])) {
19  $this->render('GooglesitemapsWidget', array('contentList'=>$resultItem['children'],'lvl' => $lvl+1,'hostParam' => $hostParam,'outputFormat'=>$outputFormat));
20  }
21  }
22  else {
23  echo "<url><loc>".$hostParam.$resultItem['attributes']['url']."</loc></url>\n";
24  }
25  if ($lvl == 1) {
26  echo "</urlset>";
27  }
28 }
29 ?>