<commit_before><?php

/**
 * Anhang form.
 *
 * @package    openZIM
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class AnhangForm extends BaseAnhangForm
{
  public function configure()
  {
    unset($this['anlage_id'],$this['name']);
    $this->validatorSchema['path'] = new sfValidatorFile(array(
      'required'   => false,
      'path'       => sfConfig::get('sf_upload_dir').'/anhaenge',
//      'mime_types' => 'web_images',
    ));

    $this->widgetSchema['path'] = new sfWidgetFormInputFileEditable(array(
        'file_src'    => '/'.basename(sfConfig::get('sf_upload_dir')).'/anhaenge/'.$this->getObject()->getPath(),
        'edit_mode'   => !$this->isNew(),
        'is_image'    => false,
        'with_delete' => !$this->isNew(),
	'label'     => $this->isNew() ? 'Anhang hinzufügen' : $this->getObject()->getName(),
    ));

    $this->validatorSchema['path_delete'] = new sfValidatorPass();

  }

  public function updateObject($values = null)
  {
    $object = parent::updateObject($values);
 
    $object->setName($this->getValue('path')->getOriginalName());
 
    return $object;
  }
}<commit_msg>AnhangForm: revert unwanted changes from last commit<commit_after><?php

/**
 * Anhang form.
 *
 * @package    openZIM
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class AnhangForm extends BaseAnhangForm
{
  public function configure()
  {
    unset($this['anlage_id'],$this['name']);
    $this->validatorSchema['path'] = new sfValidatorFile(array(
      'required'   => false,
      'path'       => sfConfig::get('sf_upload_dir').'/anhaenge',
//      'mime_types' => 'web_images',
    ));

    $this->widgetSchema['path'] = new sfWidgetFormInputFileEditable(array(
        'file_src'    => '/'.basename(sfConfig::get('sf_upload_dir')).'/anhaenge/'.$this->getObject()->getPath(),
        'edit_mode'   => !$this->isNew(),
        'is_image'    => false,
        'with_delete' => !$this->isNew(),
	'label'     => $this->isNew() ? 'Anhang hinzufügen' : $this->getObject()->getName(),
    ));

    $this->validatorSchema['path_delete'] = new sfValidatorPass();

  }
}
{'fraction_non_alphanumeric': 0.188646288209607, 'fraction_numerical': 0.016593886462882096, 'mean_word_length': 3.5098425196850394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '5510967', 'n_tokens_mistral': 802, 'n_tokens_neox': 765, 'n_words': 125}