Source for file interfaces.php

Documentation is available at interfaces.php

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

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