| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
class de_linkm_sitemap_viewer extends midcom_baseclasses_components_request |
|---|
| 16 |
{ |
|---|
| 17 |
var $_nav; |
|---|
| 18 |
var $_current_node; |
|---|
| 19 |
var $_root_node_id; |
|---|
| 20 |
|
|---|
| 21 |
function __construct($object, $config) |
|---|
| 22 |
{ |
|---|
| 23 |
parent::__construct($object, $config); |
|---|
| 24 |
$this->_current_node = null; |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
* Initialize the request switch and the content topic. |
|---|
| 29 |
* |
|---|
| 30 |
* @access protected |
|---|
| 31 |
*/ |
|---|
| 32 |
function _on_initialize() |
|---|
| 33 |
{ |
|---|
| 34 |
|
|---|
| 35 |
// defines whether we should show the sitemap as content or |
|---|
| 36 |
if ($this->_config->get('google_sitemap_mode')) |
|---|
| 37 |
{ |
|---|
| 38 |
$this->_request_switch['sitemap'] = Array |
|---|
| 39 |
( |
|---|
| 40 |
'handler' => array ('de_linkm_sitemap_handler_sitemap', 'xml'), |
|---|
| 41 |
); |
|---|
| 42 |
} |
|---|
| 43 |
else |
|---|
| 44 |
{ |
|---|
| 45 |
$this->_request_switch['sitemap'] = Array |
|---|
| 46 |
( |
|---|
| 47 |
'handler' => array ('de_linkm_sitemap_handler_sitemap', 'sitemap'), |
|---|
| 48 |
); |
|---|
| 49 |
|
|---|
| 50 |
$this->_request_switch['xml_sitemap'] = array |
|---|
| 51 |
( |
|---|
| 52 |
'handler' => array ('de_linkm_sitemap_handler_sitemap', 'xml'), |
|---|
| 53 |
'fixed_args' => array ('sitemap.xml'), |
|---|
| 54 |
); |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
$this->_request_switch['config'] = Array |
|---|
| 59 |
( |
|---|
| 60 |
'handler' => Array('midcom_core_handler_configdm', 'configdm'), |
|---|
| 61 |
'schemadb' => 'file:/de/linkm/sitemap/config/schemadb_config.inc', |
|---|
| 62 |
'schema' => 'config', |
|---|
| 63 |
'fixed_args' => Array('config'), |
|---|
| 64 |
); |
|---|
| 65 |
} |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
* Get the list of root nodes |
|---|
| 69 |
* |
|---|
| 70 |
* @access public |
|---|
| 71 |
* @static |
|---|
| 72 |
*/ |
|---|
| 73 |
function list_root_nodes() |
|---|
| 74 |
{ |
|---|
| 75 |
$root_topic = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ROOTTOPIC); |
|---|
| 76 |
|
|---|
| 77 |
$root_nodes = array(); |
|---|
| 78 |
$root_nodes[''] = ''; |
|---|
| 79 |
|
|---|
| 80 |
$qb = midcom_db_topic::new_query_builder(); |
|---|
| 81 |
$qb->add_constraint('up', '=', $root_topic->id); |
|---|
| 82 |
$qb->add_order('score'); |
|---|
| 83 |
$qb->add_order('name'); |
|---|
| 84 |
$nodes = $qb->execute(); |
|---|
| 85 |
|
|---|
| 86 |
foreach ($nodes as $node) |
|---|
| 87 |
{ |
|---|
| 88 |
$root_nodes[$node->guid] = $node->extra; |
|---|
| 89 |
} |
|---|
| 90 |
|
|---|
| 91 |
return $root_nodes; |
|---|
| 92 |
} |
|---|
| 93 |
} |
|---|
| 94 |
?> |
|---|