<commit_before><?php

/**
 * PluginContentSlot form.
 *
 * @package    form
 * @subpackage sfSympalContentSlot
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z jwage $
 */
abstract class PluginsfSympalContentSlotForm extends BasesfSympalContentSlotForm
{
  public function setup()
  {
    parent::setup();

    unset(
      $this['is_column'],
      $this['render_function'],
      $this['name'],
      $this['content_list']
    );

    $slotTypes = (sfSympalConfig::get('content_slot_types', null, array()));
    $choices = array();
    foreach ($slotTypes as $key => $value)
    {
      $choices[$key] = $value['label'];
    }
    $this->widgetSchema['type'] = new sfWidgetFormChoice(array('choices' => $choices));
    $this->validatorSchema['type'] = new sfValidatorChoice(array('choices' => array_keys($choices)));

    if (isset($this['value']))
    {<commit_msg>moving the setup of the value field to its own method so that it can be cleanly overridden from a base form if one is specified<commit_after><?php

/**
 * PluginContentSlot form.
 *
 * @package    form
 * @subpackage sfSympalContentSlot
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z jwage $
 */
abstract class PluginsfSympalContentSlotForm extends BasesfSympalContentSlotForm
{
  public function setup()
  {
    parent::setup();

    unset(
      $this['is_column'],
      $this['render_function'],
      $this['name'],
      $this['content_list']
    );

    $slotTypes = (sfSympalConfig::get('content_slot_types', null, array()));
    $choices = array();
    foreach ($slotTypes as $key => $value)
    {
      $choices[$key] = $value['label'];
    }
    $this->widgetSchema['type'] = new sfWidgetFormChoice(array('choices' => $choices));
    $this->validatorSchema['type'] = new sfValidatorChoice(array('choices' => array_keys($choices)));
    
    $this->setupValueField();
  }
  
  protected function setupValueField()
  {
    if (isset($this['value']))
    {
{'fraction_non_alphanumeric': 0.1566265060240964, 'fraction_numerical': 0.018072289156626505, 'mean_word_length': 3.8848039215686274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6342946', 'n_tokens_mistral': 662, 'n_tokens_neox': 632, 'n_words': 133}