Development

Changeset 20809

You must first sign up to be able to contribute.

Changeset 20809

Show
Ignore:
Timestamp:
08/05/09 19:52:22 (4 years ago)
Author:
boutell
Message:

https://punkave.fogbugz.com/default.asp?W89

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/pkToolkitPlugin/trunk/lib/helper/PkFormHelper.php

    r17097 r20809  
    33use_helper('Form'); 
    44 
    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 
    616// Symfony 1.0 fillin helper to see the linked hidden field as a 
    717// 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// 
    1022// http://trac.symfony-project.com/ticket/732 
    1123 
    1224function pk_textarea_tag($name, $value, $options) 
    1325{ 
     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  } 
    1436  $result = textarea_tag($name, $value, $options); 
    1537  if (isset($options['rich']) && $options['rich']) 
  • plugins/pkToolkitPlugin/trunk/lib/widget/sfWidgetFormRichTextarea.class.php

    r20384 r20809  
    4848      throw new sfConfigurationException(sprintf('The editor "%s" must extend sfRichTextEditor.', $editor)); 
    4949    } 
    50  
    5150    $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     
    5265    $editor->initialize($name, $value, $attributes); 
    5366