Source for file navigation.php

Documentation is available at navigation.php

  1. <?php
  2.  
  3. class net_nemein_registrations_navigation {
  4. var $_object;
  5. var $_config;
  6. var $_auth;
  7. var $_rootevent;
  8. var $_l10n;
  9. var $_l10n_midcom;
  10. function net_nemein_registrations_navigation() {
  11. $this->_object = null;
  12. $this->_auth = null;
  13. $this->_rootevent = null;
  14. $this->_config = $GLOBALS["net_nemein_registrations__default_config"];
  15. $i18n =& $GLOBALS["midcom"]->get_service("i18n");
  16. $this->_l10n = $i18n->get_l10n("net.nemein.registrations");
  17. $this->_l10n_midcom = $i18n->get_l10n("midcom");
  18. }
  19.  
  20. function is_internal() {
  21. return false;
  22. }
  23.  
  24. function get_leaves() {
  25. $ret = Array();
  26. if (is_object ($this->_rootevent)) {
  27. $elist = new net_nemein_registrations_eventlist($this->_object, $this->_config, $this->_auth, $this->_rootevent);
  28. $events = $elist->query();
  29. $now = time();
  30. foreach ($events as $id => $event)
  31. {
  32. $regevent = $elist->get_regevent($event);
  33. if ($regevent->is_open())
  34. {
  35. $ret[$id] = array (
  36. MIDCOM_NAV_SITE => Array (
  37. MIDCOM_NAV_URL => "register/$event->extra/welcome.html",
  38. MIDCOM_NAV_NAME => $event->title),
  39. MIDCOM_NAV_ADMIN => Array (
  40. MIDCOM_NAV_URL => "view/$id.html",
  41. MIDCOM_NAV_NAME => $event->title),
  42. MIDCOM_NAV_GUID => $event->guid(),
  43. MIDCOM_NAV_TOOLBAR => null,
  44. MIDCOM_META_CREATOR => $event->creator,
  45. MIDCOM_META_EDITOR => $event->revisor,
  46. MIDCOM_META_CREATED => $event->created,
  47. MIDCOM_META_EDITED => $event->revised
  48. );
  49. }
  50. else
  51. {
  52. $ret[$id] = array (
  53. MIDCOM_NAV_SITE => null,
  54. MIDCOM_NAV_ADMIN => Array (
  55. MIDCOM_NAV_URL => "view/$id.html",
  56. MIDCOM_NAV_NAME => $event->title),
  57. MIDCOM_NAV_GUID => $event->guid(),
  58. MIDCOM_NAV_TOOLBAR => null,
  59. MIDCOM_META_CREATOR => $event->creator,
  60. MIDCOM_META_EDITOR => $event->revisor,
  61. MIDCOM_META_CREATED => $event->created,
  62. MIDCOM_META_EDITED => $event->revised
  63. );
  64. }
  65. }
  66. }
  67. return $ret;
  68. }
  69.  
  70. function get_node() {
  71. $topic = &$this->_object;
  72. // Create Toolbar
  73. $toolbar[0] = Array
  74. (
  75. MIDCOM_TOOLBAR_URL => 'create.html',
  76. MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create an event'),
  77. MIDCOM_TOOLBAR_HELPTEXT => null,
  78. MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_new-event.png',
  79. MIDCOM_TOOLBAR_ENABLED => true
  80. );
  81. $toolbar[100] = Array(
  82. MIDCOM_TOOLBAR_URL => '',
  83. MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),
  84. MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('component configuration helptext'),
  85. MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png',
  86. MIDCOM_TOOLBAR_ENABLED => true
  87. );
  88. return array (
  89. MIDCOM_NAV_URL => "",
  90. MIDCOM_NAV_NAME => $topic->extra,
  91. MIDCOM_NAV_TOOLBAR => $toolbar,
  92. MIDCOM_META_CREATOR => $topic->creator,
  93. MIDCOM_META_EDITOR => $topic->revisor,
  94. MIDCOM_META_CREATED => $topic->created,
  95. MIDCOM_META_EDITED => $topic->revised
  96. );
  97. }
  98.  
  99. function set_object($object) {
  100. $this->_object = $object;
  101. $this->_config->store_from_object($object, "net.nemein.registrations");
  102. $this->_rootevent = mgd_get_object_by_guid($this->_config->get("root_event_guid"));
  103. $this->_auth = new net_nemein_registrations__auth($this->_object, $this->_config);
  104. return true;
  105. }
  106.  
  107. function get_current_leaf() {
  108. if (array_key_exists("net_nemein_registrations_current_leaf", $GLOBALS)) {
  109. return $GLOBALS["net_nemein_registrations_current_leaf"];
  110. } else {
  111. return false;
  112. }
  113. }
  114. } // navigation
  115.  
  116. ?>

Documentation generated on Mon, 21 Nov 2005 18:19:51 +0100 by phpDocumentor 1.3.0RC3