b48903dfff5489ca2d2554762358c21c.resolve.fix_setting.resolver 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * TinyMCE MODx Integration
  4. *
  5. * Copyright 2010 by Shaun McCormick <shaun@modxcms.com>
  6. *
  7. * TinyMCE MODx Integration is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option) any
  10. * later version.
  11. *
  12. * TinyMCE MODx Integration is distributed in the hope that it will be useful, but WITHOUT ANY
  13. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  14. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * TinyMCE MODx Integration; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  18. * Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * @package tinymce
  21. */
  22. /**
  23. * Fix incorrect forced_root_block setting
  24. *
  25. * @package tinymce
  26. * @subpackage build
  27. */
  28. $success= true;
  29. if ($pluginid= $object->get('id')) {
  30. switch ($options[xPDOTransport::PACKAGE_ACTION]) {
  31. case xPDOTransport::ACTION_INSTALL:
  32. case xPDOTransport::ACTION_UPGRADE:
  33. $object->xpdo->log(xPDO::LOG_LEVEL_INFO,'Attempting to fix forced_root_block setting for TinyMCE.');
  34. $setting = $object->xpdo->getObject('modSystemSetting',array('key' => 'tiny.forced_root_block'));
  35. if ($setting && $setting->get('xtype') == 'combo-boolean') {
  36. $setting->set('xtype','textfield');
  37. $setting->set('value','p');
  38. $setting->save();
  39. }
  40. unset($setting);
  41. break;
  42. case xPDOTransport::ACTION_UNINSTALL:
  43. $success= true;
  44. break;
  45. }
  46. }
  47. return $success;