You are here

README.txt in Domain Access 5

README file for Domain Conf

File

domain_conf/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Conf
  4. */
  5. Domain Access: Site Configuration
  6. Advanced site configuration options for Domain Access.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 1.1 Use-Case
  11. 1.2 Example
  12. 1.3 Sponsors
  13. 2. Installation
  14. 2.1 Dependencies
  15. 2.2 Configuration Options
  16. 3. Batch Updates
  17. 4. Developer Notes
  18. 4.1 Extending Options with hook_domainconf()
  19. 4.2 Using domain_conf.inc
  20. 4.3 Database Schema
  21. ----
  22. 1. Introduction
  23. The Domain Access: Site Configuration module (called Domain Conf), is an
  24. optional extension of the Domain Access module. Domain Conf provides options
  25. for configuring basic settings of your affiliate sites to be different.
  26. ----
  27. 1.1 Use-Case
  28. In the original build for the Domain Access module, we had a problem. Most
  29. of our affiliates were on the East coast of the U.S. But a few were further
  30. West, in different time zones.
  31. Using a single time zone configuration for all affiliates simply would not work.
  32. So the Domain Conf module was written as an optional extension for Domain
  33. Access.
  34. This module allows each affiliate site to set specific configuration options,
  35. which will override the default site settings as needed. See section 2.2 for
  36. more details.
  37. ----
  38. 1.2 Example
  39. For an example, see http://skirt.com/map. Note that some of the affiliates
  40. may be in "offline" mode. This is accomplished using the Domain Conf module.
  41. ----
  42. 1.3 Sponsors
  43. Domain Conf is sponsored by Morris DigitalWorks.
  44. http://morrisdigitalworks.com
  45. ----
  46. 2. Installation
  47. The Domain Conf module is included in the Domain Access download. To install,
  48. untar the domain package and place the entire folder in your modules directory.
  49. When you enable the module, it will create a {domain_conf} table in your Drupal
  50. database.
  51. For the module to function correctly, you must follow the instructions in INSTALL.txt.
  52. ----
  53. 2.1 Dependencies
  54. Domain Conf requires the Domain Access module be installed and active.
  55. Domain Conf requires a change to your settings.php file, as indicated by the
  56. directions in INSTALL.txt
  57. ----
  58. 2.2 Configuration Options
  59. When active, the Domain Conf module provides a 'settings' link next to each
  60. entry in your Domain Acccess list (found at path 'admin/build/domain/list').
  61. For each registered domain, you have the option of saving settings that will
  62. replace the system settings for your root site. The currently available
  63. settings are:
  64. - Name [of site]
  65. - E-mail address
  66. - Slogan
  67. - Mission
  68. - Footer message
  69. - Default front page [untested]
  70. - Anonymous user
  71. - Default time zone
  72. - Site status
  73. - Site off-line message
  74. On page load, these values are dynamically loaded to replace your site's
  75. defaults. If you do not adjust these settings, defaults will be used for all
  76. affiliates.
  77. ----
  78. 3. Batch Updates
  79. Domain Conf allows you to make batch changes to settings for all domains.
  80. All of the current settings are available in batch mode.
  81. You may also choose to remove domain-specific configurations. This feature
  82. is useful if you wish to roll back custom changes.
  83. ----
  84. 4. Developer Notes
  85. The Domain Conf module is the model for extending Domain Acccess.
  86. The following form elements were removed during beta testing:
  87. - File system path
  88. - Temporary directory
  89. See http://drupal.org/node/197692 for the reasons.
  90. ----
  91. 4.1 Extending Options with hook_domainconf()
  92. The module works by applying hook_form_alter() to the form:
  93. 'system_settings_form' and then adding addiitonal fields from other forms.
  94. hook_domainconf() allows developers to add additional form elements.
  95. Note that you may use this hook to create variables that are independent
  96. of other Drupal modules. To do so, be sure to set the '#domain_setting' flag
  97. to TRUE before returning your $form array.
  98. - $form['myform']['#domain_setting'] = TRUE;
  99. Please see the full documentation in the API.
  100. http://therickards.com/api/function/hook_domainconf/Domain
  101. ----
  102. 4.2 Using domain_conf.inc
  103. The normal method for using hook_domainconf() is to have the hook implemented
  104. in other modules.
  105. However, the community development process may mean that it will take time for
  106. the hook to be implemented in modules that you may be using.
  107. To allow for this fact without harming the upgrade path for Domain
  108. Configuration, it is possible to create a domain_conf.inc file that you place
  109. inside the domain_conf directory.
  110. This file should be a PHP file, and it should conform to Drupal coding
  111. standards.
  112. For example, to add the user picture default setting to the module without
  113. patching user.module or domain_conf.module, you may create the following
  114. file:
  115. ====
  116. /**
  117. * Implement hook_domainconf() to add the user picture.
  118. */
  119. function user_domainconf($domain) {
  120. $form['pictures'] = array(
  121. '#type' => 'fieldset',
  122. '#title' => t('User picture'),
  123. '#collapsible' => TRUE,
  124. '#collapsed' => FALSE,
  125. );
  126. $form['pictures']['user_picture_default'] = array(
  127. '#type' => 'textfield',
  128. '#title' => t('Default picture'),
  129. '#default_value' => variable_get('user_picture_default', ''),
  130. '#size' => 30,
  131. '#maxlength' => 255,
  132. '#description' => t('URL of picture to display for users with no custom
  133. picture selected. Leave blank for none.')
  134. );
  135. return $form;
  136. }
  137. ====
  138. NOTE: Before upgrading the Domain module, be sure to save this file
  139. so that it may be replaced in the event it is deleted. Note also that the
  140. domain_conf.inc file is not included in the module package.
  141. See http://drupal.org/node/236877 for additional background.
  142. ----
  143. 4.3 Database Schema
  144. Installing the module creates a {domain_conf} table that contains:
  145. - domain_id
  146. Integer, unique
  147. The lookup key for this record, foreign key to the {domain} table.
  148. - settings
  149. Blob (bytea)
  150. A serialized array of settings for this domain.