16.cache.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php return '/**
  2. * ClientConfig
  3. *
  4. * Copyright 2011-2014 by Mark Hamstra <hello@markhamstra.com>
  5. *
  6. * ClientConfig is free software; you can redistribute it and/or modify it under the
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation; either version 2 of the License, or (at your option) any later
  9. * version.
  10. *
  11. * ClientConfig is distributed in the hope that it will be useful, but WITHOUT ANY
  12. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  13. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * ClientConfig; if not, write to the Free Software Foundation, Inc., 59 Temple
  17. * Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. * @package clientconfig
  20. *
  21. * @var modX $modx
  22. * @var int $id
  23. * @var string $mode
  24. * @var modResource $resource
  25. * @var modTemplate $template
  26. * @var modTemplateVar $tv
  27. * @var modChunk $chunk
  28. * @var modSnippet $snippet
  29. * @var modPlugin $plugin
  30. */
  31. $eventName = $modx->event->name;
  32. switch($eventName) {
  33. case \'OnMODXInit\':
  34. case \'OnHandleRequest\':
  35. /* Grab the class */
  36. $path = $modx->getOption(\'clientconfig.core_path\', null, $modx->getOption(\'core_path\') . \'components/clientconfig/\');
  37. $path .= \'model/clientconfig/\';
  38. $clientConfig = $modx->getService(\'clientconfig\',\'ClientConfig\', $path);
  39. /* If we got the class (gotta be careful of failed migrations), grab settings and go! */
  40. if ($clientConfig instanceof ClientConfig) {
  41. $contextKey = $modx->context instanceof modContext ? $modx->context->get(\'key\') : \'web\';
  42. $settings = $clientConfig->getSettings($contextKey);
  43. /* Make settings available as [[++tags]] */
  44. $modx->setPlaceholders($settings, \'+\');
  45. /* Make settings available for $modx->getOption() */
  46. foreach ($settings as $key => $value) {
  47. $modx->setOption($key, $value);
  48. }
  49. }
  50. break;
  51. }
  52. return;
  53. return;
  54. ';