PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/extensions/DataCenter/DataCenter.php

https://github.com/ChuguluGames/mediawiki-svn
PHP | 185 lines | 100 code | 12 blank | 73 comment | 1 complexity | f8afe1e56d3b6fe03f400e36bc6f2cf9 MD5 | raw file
  1. <?php
  2. /**
  3. * DataCenter extension
  4. *
  5. * @file
  6. * @ingroup Extensions
  7. *
  8. * This file contains the main include file for the DataCenter
  9. * extension of MediaWiki.
  10. *
  11. * Usage: Add the following line in LocalSettings.php:
  12. * require_once( "$IP/extensions/DataCenter/DataCenter.php" );
  13. *
  14. * @author Trevor Parscal <tparscal@wikimedia.org>
  15. * @license GPL v2
  16. * @version 0.1.0
  17. */
  18. // Check environment
  19. if ( !defined( 'MEDIAWIKI' ) ) {
  20. echo( "This is a MediaWiki extension and cannot be run standalone.\n" );
  21. die( 1 );
  22. }
  23. /* Configuration */
  24. // GoogleMaps API Key - to get one for your own installation, go to
  25. // http://code.google.com/apis/maps/signup.XML
  26. $egDataCenterGoogleMapsAPIKey =
  27. 'ABQIAAAAo3BpqDgnwu31qtxQuWSXxhRfg0gREfvmgqiKvmq8TMsZGNFQPxRj0C9gpgXFOwUITevSg6mG9zBHCQ';
  28. /* MediaWiki Integration */
  29. // Credits
  30. $wgExtensionCredits['other'][] = array(
  31. 'path' => __FILE__,
  32. 'name' => 'DataCenter',
  33. 'version' => '0.1.0',
  34. 'author' => 'Trevor Parscal',
  35. 'url' => 'http://www.mediawiki.org/wiki/Extension:DataCenter',
  36. 'descriptionmsg' => 'datacenter-desc',
  37. );
  38. // User permissions
  39. $wgGroupPermissions['dc-viewer']['datacenter-view'] = true;
  40. $wgGroupPermissions['dc-viewer']['datacenter-export'] = true;
  41. $wgGroupPermissions['dc-admin']['datacenter-view'] = true;
  42. $wgGroupPermissions['dc-admin']['datacenter-export'] = true;
  43. $wgGroupPermissions['dc-admin']['datacenter-change'] = true;
  44. $wgGroupPermissions['dc-admin']['datacenter-remove'] = true;
  45. // Shortcut to this extension directory
  46. $dir = dirname( __FILE__ ) . '/';
  47. // Internationalization
  48. $wgExtensionMessagesFiles['DataCenter'] = $dir . 'DataCenter.i18n.php';
  49. // Ajax Hooks
  50. $wgAjaxExportList[] = 'DataCenterAjax::getComponent';
  51. $wgAjaxExportList[] = 'DataCenterAjax::getComponents';
  52. // Spacial Pages
  53. $wgSpecialPages['DataCenter'] = 'DataCenterPage';
  54. // Class Autoloading
  55. $wgAutoloadClasses = array_merge( $wgAutoloadClasses, array(
  56. // Controllers/*
  57. 'DataCenterControllerAssets' => $dir . 'Controllers/Assets.php',
  58. 'DataCenterControllerFacilities' => $dir . 'Controllers/Facilities.php',
  59. 'DataCenterControllerModels' => $dir . 'Controllers/Models.php',
  60. 'DataCenterControllerOverview' => $dir . 'Controllers/Overview.php',
  61. 'DataCenterControllerPlans' => $dir . 'Controllers/Plans.php',
  62. 'DataCenterControllerSearch' => $dir . 'Controllers/Search.php',
  63. 'DataCenterControllerSettings' => $dir . 'Controllers/Settings.php',
  64. // UI/Inputs/*
  65. 'DataCenterInputBoolean' => $dir . 'UI/Inputs/Boolean.php',
  66. 'DataCenterInputButton' => $dir . 'UI/Inputs/Button.php',
  67. 'DataCenterInputList' => $dir . 'UI/Inputs/List.php',
  68. 'DataCenterInputNumber' => $dir . 'UI/Inputs/Number.php',
  69. 'DataCenterInputPosition' => $dir . 'UI/Inputs/Position.php',
  70. 'DataCenterInputString' => $dir . 'UI/Inputs/String.php',
  71. 'DataCenterInputTense' => $dir . 'UI/Inputs/Tense.php',
  72. 'DataCenterInputText' => $dir . 'UI/Inputs/Text.php',
  73. // UI/Layouts/*
  74. 'DataCenterLayoutColumns' => $dir . 'UI/Layouts/Columns.php',
  75. 'DataCenterLayoutRows' => $dir . 'UI/Layouts/Rows.php',
  76. 'DataCenterLayoutTabs' => $dir . 'UI/Layouts/Tabs.php',
  77. // UI/Widgets/*
  78. 'DataCenterWidgetActions' => $dir . 'UI/Widgets/Actions.php',
  79. 'DataCenterWidgetBody' => $dir . 'UI/Widgets/Body.php',
  80. 'DataCenterWidgetDetails' => $dir . 'UI/Widgets/Details.php',
  81. 'DataCenterWidgetExport' => $dir . 'UI/Widgets/Export.php',
  82. 'DataCenterWidgetFieldLinks' => $dir . 'UI/Widgets/FieldLinks.php',
  83. 'DataCenterWidgetForm' => $dir . 'UI/Widgets/Form.php',
  84. 'DataCenterWidgetGallery' => $dir . 'UI/Widgets/Gallery.php',
  85. 'DataCenterWidgetHeading' => $dir . 'UI/Widgets/Heading.php',
  86. 'DataCenterWidgetHistory' => $dir . 'UI/Widgets/History.php',
  87. 'DataCenterWidgetMap' => $dir . 'UI/Widgets/Map.php',
  88. 'DataCenterWidgetModel' => $dir . 'UI/Widgets/Model.php',
  89. 'DataCenterWidgetPlan' => $dir . 'UI/Widgets/Plan.php',
  90. 'DataCenterWidgetSearch' => $dir . 'UI/Widgets/Search.php',
  91. 'DataCenterWidgetSearchResults' => $dir . 'UI/Widgets/SearchResults.php',
  92. 'DataCenterWidgetSpace' => $dir . 'UI/Widgets/Space.php',
  93. 'DataCenterWidgetTable' => $dir . 'UI/Widgets/Table.php',
  94. // Views/Facilities/*
  95. 'DataCenterViewFacilitiesLocation' => $dir . 'Views/Facilities/Location.php',
  96. 'DataCenterViewFacilitiesSpace' => $dir . 'Views/Facilities/Space.php',
  97. // Views/Plans/*
  98. 'DataCenterViewPlansObject' => $dir . 'Views/Plans/Object.php',
  99. 'DataCenterViewPlansPlan' => $dir . 'Views/Plans/Plan.php',
  100. 'DataCenterViewPlansRack' => $dir . 'Views/Plans/Rack.php',
  101. // Views/Settings/*
  102. 'DataCenterViewSettingsField' => $dir . 'Views/Settings/Field.php',
  103. // Views/*
  104. 'DataCenterViewAssets' => $dir . 'Views/Assets.php',
  105. 'DataCenterViewFacilities' => $dir . 'Views/Facilities.php',
  106. 'DataCenterViewModels' => $dir . 'Views/Models.php',
  107. 'DataCenterViewOverview' => $dir . 'Views/Overview.php',
  108. 'DataCenterViewPlans' => $dir . 'Views/Plans.php',
  109. 'DataCenterViewSearch' => $dir . 'Views/Search.php',
  110. 'DataCenterViewSettings' => $dir . 'Views/Settings.php',
  111. // DB
  112. 'DataCenterDB' => $dir . 'DataCenter.db.php',
  113. 'DataCenterDBRow' => $dir . 'DataCenter.db.php',
  114. 'DataCenterDBComponent' => $dir . 'DataCenter.db.php',
  115. 'DataCenterDBAsset' => $dir . 'DataCenter.db.php',
  116. 'DataCenterDBModel' => $dir . 'DataCenter.db.php',
  117. 'DataCenterDBAssetLink' => $dir . 'DataCenter.db.php',
  118. 'DataCenterDBModelLink' => $dir . 'DataCenter.db.php',
  119. 'DataCenterDBMetaFieldLink' => $dir . 'DataCenter.db.php',
  120. 'DataCenterDBLocation' => $dir . 'DataCenter.db.php',
  121. 'DataCenterDBSpace' => $dir . 'DataCenter.db.php',
  122. 'DataCenterDBMetaField' => $dir . 'DataCenter.db.php',
  123. 'DataCenterDBMetaValue' => $dir . 'DataCenter.db.php',
  124. 'DataCenterDBChange' => $dir . 'DataCenter.db.php',
  125. 'DataCenterDBPlan' => $dir . 'DataCenter.db.php',
  126. // Page
  127. 'DataCenterPage' => $dir . 'DataCenter.page.php',
  128. 'DataCenterView' => $dir . 'DataCenter.page.php',
  129. 'DataCenterController' => $dir . 'DataCenter.page.php',
  130. // UI
  131. 'DataCenterCss' => $dir . 'DataCenter.ui.php',
  132. 'DataCenterJs' => $dir . 'DataCenter.ui.php',
  133. 'DataCenterXml' => $dir . 'DataCenter.ui.php',
  134. 'DataCenterRenderable' => $dir . 'DataCenter.ui.php',
  135. 'DataCenterInput' => $dir . 'DataCenter.ui.php',
  136. 'DataCenterLayout' => $dir . 'DataCenter.ui.php',
  137. 'DataCenterWidget' => $dir . 'DataCenter.ui.php',
  138. 'DataCenterUI' => $dir . 'DataCenter.ui.php',
  139. ) );
  140. /**
  141. * About this project
  142. *
  143. * This project uses a model-view-controller paradigm throughout. This helps
  144. * to keep the database, user interface and data processing separated, which
  145. * among other things makes it possible to replace any one of them with a
  146. * new system which lends itself to a different goal more effectively. One such
  147. * adaptation that would be likely in the future might be a iPhone/iPod Touch
  148. * oriented user interface.
  149. *
  150. * Throughout the code, but most especially in the design and use of classes,
  151. * there is a vocabulary which is hopefully intuitive, but if nothing else
  152. * consistent. Below is a simple glossary denoting the project-specific meanings
  153. * of various terms.
  154. *
  155. * View: User interface
  156. * Controller: Data processing
  157. * DB: Data model
  158. * Component: Data of which changes are logged
  159. * Asset: Record of a physical item
  160. * Rack: Enclosure in which objects with a rack-unit form-factor may exist
  161. * Object: Rack-unit, module, desktop or portable piece of equipment
  162. * Port: Physical or virtual point of connection
  163. * Connection: Set of 2 ports which are connected to each other
  164. * Model: Description of a physical item
  165. * Plan: Arrangment of physical items
  166. * Facility: Physical location or space
  167. * Location: Geographical location which may have any number of spaces
  168. * Space: Basic 3 dimensional box which is representative of a room
  169. * Layout: Visual structure containing one or more rectangular areas
  170. * Widget: Visual representation of data
  171. * Input: Visual interactive control for modifying data
  172. * Renderable: Rectangular area of a UI
  173. */