Changeset 20809
- Timestamp:
- 08/05/09 19:52:22 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/pkToolkitPlugin/trunk/lib/helper/PkFormHelper.php
r17097 r20809 3 3 use_helper('Form'); 4 4 5 // Symfony contains an unfortunate "fix" to enable the old 5 // This wrapper for textarea_tag serves two purposes: 6 // 7 // 1. The Symfony textarea_tag allows you to specify a custom 8 // FCK .js config file via the 'config' option, but doesn't 9 // have support for an application-wide one, which is good to have 10 // because customizing fckconfig.js creates maintenance problems 11 // when FCK is upgraded. This version loads 12 // web/js/fckextraconfig.js from the app level if it exists 13 // and there is no explicit config option passed to the helper. 14 // 15 // 2. Symfony contains an unfortunate "fix" to enable the old 6 16 // Symfony 1.0 fillin helper to see the linked hidden field as a 7 17 // type="text" field. This breaks any text with newlines in it in 8 // Safari and Chrome. Un-fix the fix until this gets corrected 9 // in an official Symfony 1.2 release. 18 // Safari and Chrome. We fix that here. This has also been fixed 19 // in Symfony 1.2.6 (1.2.7?) but keeping the fix here does no harm 20 // and increases portability. 21 // 10 22 // http://trac.symfony-project.com/ticket/732 11 23 12 24 function pk_textarea_tag($name, $value, $options) 13 25 { 26 if (isset($options['rich']) && (strtolower($options['rich']) === 'fck')) 27 { 28 if (!isset($options['config'])) 29 { 30 if (file_exists(sfConfig::get('sf_web_dir') . '/js/fckextraconfig.js')) 31 { 32 $options['config'] = '/js/fckextraconfig.js'; 33 } 34 } 35 } 14 36 $result = textarea_tag($name, $value, $options); 15 37 if (isset($options['rich']) && $options['rich']) plugins/pkToolkitPlugin/trunk/lib/widget/sfWidgetFormRichTextarea.class.php
r20384 r20809 48 48 throw new sfConfigurationException(sprintf('The editor "%s" must extend sfRichTextEditor.', $editor)); 49 49 } 50 51 50 $attributes = array_merge($attributes, $this->getOptions()); 51 52 // TBB: a sitewide additional config settings file is used, if it 53 // exists and a different one has not been explicitly specified 54 if (isset($attributes['editor']) && (strtolower($attributes['editor']) === 'fck')) 55 { 56 if (!isset($attributes['config'])) 57 { 58 if (file_exists(sfConfig::get('sf_web_dir') . '/js/fckextraconfig.js')) 59 { 60 $attributes['config'] = '/js/fckextraconfig.js'; 61 } 62 } 63 } 64 52 65 $editor->initialize($name, $value, $attributes); 53 66