Source for file interfaces.php

Documentation is available at interfaces.php

  1. <?php
  2.  
  3. class net_nemein_registrations_midcom {
  4.  
  5. function initialize() {
  6. global $midcom;
  7.  
  8. debug_push("net.nemein.registrations midcom::initialize");
  9.  
  10. $prefix = MIDCOM_ROOT . "/net/nemein/registrations";
  11. require("{$prefix}/viewer.php");
  12. require("{$prefix}/navigation.php");
  13. require("{$prefix}/admin.php");
  14. require("{$prefix}/_auth.php");
  15. require("{$prefix}/eventlist.php");
  16. require("{$prefix}/regevent.php");
  17. require("{$prefix}/registrar_factory.php");
  18. $midcom->load_library("midcom.helper.datamanager");
  19. // default configuration
  20. debug_add("Loading default configuration", MIDCOM_LOG_DEBUG);
  21. $data = file_get_contents("${prefix}/config/config_default.dat");
  22. eval("\$component_default = Array ( {$data} );");
  23. $default_config = new midcom_helper_configuration($component_default);
  24. if (mgd_snippet_exists("/sitegroup-config/net.nemein.registrations/config")) {
  25. $snippet = mgd_get_snippet_by_path("/sitegroup-config/net.nemein.registrations/config");
  26. eval("\$local_default = Array ( " . $snippet->code . ");");
  27. if (!$default_config->store($local_default)) {
  28. debug_add("Sitegroup configuration is invalid, configuration management failed, aborting", MIDCOM_LOG_CRIT);
  29. debug_pop();
  30. return FALSE;
  31. }
  32. }
  33. $GLOBALS["net_nemein_registrations__default_config"] = new midcom_helper_configuration($default_config->get_all());
  34.  
  35. debug_pop();
  36. return TRUE;
  37. }
  38.  
  39. function properties() {
  40. $i18n =& $GLOBALS["midcom"]->get_service("i18n");
  41. $l10n = $i18n->get_l10n("net.nemein.registrations");
  42. return array(
  43. MIDCOM_PROP_NAME => $l10n->get("net.nemein.registrations"),
  44. MIDCOM_PROP_PURECODE => FALSE,
  45. MIDCOM_PROP_VERSION => 1
  46. );
  47. }
  48.  
  49. } // midcom
  50.  
  51.  
  52.  
  53. class net_nemein_registrations_component {
  54.  
  55. var $configs;
  56. var $components;
  57.  
  58. function net_nemein_registrations_component() {
  59. $this->configs = Array ();
  60. $this->components = Array ();
  61. }
  62.  
  63. function configure($configuration, $contextid) {
  64. $tmp = $GLOBALS["net_nemein_registrations__default_config"];
  65.  
  66. if (!$tmp->store($configuration))
  67. return FALSE;
  68. $this->configs[$contextid] = $tmp;
  69. return TRUE;
  70. }
  71.  
  72. function can_handle($current_object, $argc, $argv, $contextid) {
  73. $this->components[$contextid] = new net_nemein_registrations_viewer($current_object, $this->configs[$contextid]);
  74. return $this->components[$contextid]->can_handle($argc, $argv);
  75. }
  76. function handle($current_object, $argc, $argv, $contextid) {
  77. return $this->components[$contextid]->handle($argc, $argv);
  78. }
  79.  
  80. function errcode($contextid) {
  81. return $this->components[$contextid]->errcode;
  82. }
  83. function errstr($contextid) {
  84. return $this->components[$contextid]->errstr;
  85. }
  86.  
  87. function get_metadata($contextid) {
  88. return $this->components[$contextid]->get_metadata();
  89. }
  90.  
  91. function show_content($contextid) {
  92. $this->components[$contextid]->show();
  93. }
  94.  
  95. } // component
  96.  
  97.  
  98.  
  99. class net_nemein_registrations_contentadmin {
  100.  
  101. var $configs;
  102. var $components;
  103.  
  104. function net_nemein_registrations_contentadmin() {
  105. $this->configs = Array ();
  106. $this->components = Array ();
  107. }
  108.  
  109. function configure($configuration, $contextid) {
  110. $tmp = $GLOBALS["net_nemein_registrations__default_config"];
  111.  
  112. if (!$tmp->store($configuration))
  113. return FALSE;
  114. $this->configs[$contextid] = $tmp;
  115. return TRUE;
  116. }
  117.  
  118. function can_handle($current_object, $argc, $argv, $contextid) {
  119. $this->components[$contextid] = new net_nemein_registrations_admin($current_object, $this->configs[$contextid]);
  120. return $this->components[$contextid]->can_handle($argc, $argv);
  121. }
  122.  
  123. function handle($current_object, $argc, $argv, $contextid) {
  124. return $this->components[$contextid]->handle($argc, $argv);
  125. }
  126.  
  127. function errcode($contextid) {
  128. return $this->components[$contextid]->errcode;
  129. }
  130. function errstr($contextid) {
  131. return $this->components[$contextid]->errstr;
  132. }
  133.  
  134. function get_metadata($contextid) {
  135. return $this->components[$contextid]->get_metadata();
  136. }
  137.  
  138. function show_content($contextid) {
  139. $this->components[$contextid]->show();
  140. }
  141.  
  142. } // contentadmin
  143.  
  144.  
  145.  
  146. class net_nemein_registrations_nap {
  147.  
  148. var $napclass;
  149.  
  150. function net_nemein_registrations_nap() {
  151. $this->napclass = new net_nemein_registrations_navigation();
  152. }
  153.  
  154. function is_internal() {
  155. return $this->napclass->is_internal();
  156. }
  157.  
  158. function set_object($object) {
  159. return $this->napclass->set_object($object);
  160. }
  161.  
  162. function get_node() {
  163. return $this->napclass->get_node();
  164. }
  165.  
  166. function get_current_leaf() {
  167. return $this->napclass->get_current_leaf();
  168. }
  169.  
  170. function get_leaves() {
  171. return $this->napclass->get_leaves();
  172. }
  173.  
  174. } // nap
  175.  
  176. ?>

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