00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009 class NewssitemapController extends ControllerBase {
00010
00011
00012
00013 public function get_routes() {
00014 return array(
00015 new ExactMatchRoute('newssitemap.xml', $this, 'newssitemap_index', new SimpleCacheManager()),
00016 );
00017 }
00018
00019
00020
00021
00022
00023
00024 public function action_newssitemap_index($page_data) {
00025 $arrret = array();
00026 EventSource::Instance()->invoke_event('newssitemap_index', '', $arrret);
00027 $c = count($arrret);
00028 if ($c == 0) {
00029 return CONTROLLER_NOT_FOUND;
00030 }
00031 $data = array();
00032 $limt = 1000 / $c;
00033 if ($limit > 300) { $limit = 300; }
00034 foreach($arrret as $news) {
00035 $news->limit($limit);
00036 $data = array_merge($data, $news->execute());
00037 }
00038
00039 $view = ViewFactory::create_view(IViewFactory::XML, 'core::newssitemap/index', $page_data);
00040 $view->assign('items', $data);
00041 $view->render();
00042 }
00043 }