setup-options.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. switch ($options[xPDOTransport::PACKAGE_ACTION]) {
  3. case xPDOTransport::ACTION_INSTALL:
  4. case xPDOTransport::ACTION_UPGRADE:
  5. $isContextAware = $modx->getOption('clientconfig.context_aware', null, false);
  6. $globalChecked = $isContextAware ? '' : 'checked="checked"';
  7. $contextChecked = $isContextAware ? 'checked="checked"' : '';
  8. return <<<HTML
  9. <p>ClientConfig 2.0 comes in two different flavours: global, and multi context mode. </p>
  10. <br>
  11. <ul style="list-style: disc; padding-left: 2em; padding-bottom: 1em;">
  12. <li>In global mode, your users can manage settings that <b>affect the entire website</b>.</li>
  13. <li>In multi-context mode, a context selector is added to the top right of the configuration screen, allowing the user to set <b>different values for each independent context</b>.</li>
  14. </ul>
  15. <p>Which mode would you like to use?</p>
  16. <label>
  17. <input type="radio" name="clientconfig_context_aware" value="0" {$globalChecked}>
  18. Global mode
  19. </label>
  20. <label>
  21. <input type="radio" name="clientconfig_context_aware" value="1" {$contextChecked}>
  22. Multi-context mode
  23. </label>
  24. <p>You can change the mode later through the <code>clientconfig.context_aware</code> system setting.</p>
  25. HTML;
  26. break;
  27. }
  28. return '';