Author: jablko
Date: Tue Sep 29 16:13:19 2009
New Revision: 3603

Log:
Move default help text from ->getHelp() to ->configure(), following revision 
3262

Modified:
   trunk/lib/vendor/symfony/lib/widget/sfWidgetFormInputFile.class.php

Modified: trunk/lib/vendor/symfony/lib/widget/sfWidgetFormInputFile.class.php
==============================================================================
--- trunk/lib/vendor/symfony/lib/widget/sfWidgetFormInputFile.class.php Tue Sep 
29 15:59:35 2009        (r3602)
+++ trunk/lib/vendor/symfony/lib/widget/sfWidgetFormInputFile.class.php Tue Sep 
29 16:13:19 2009        (r3603)
@@ -18,20 +18,6 @@
  */
 class sfWidgetFormInputFile extends sfWidgetFormInput
 {
-  /**
-   * @param array $options     An array of options
-   * @param array $attributes  An array of default HTML attributes
-   *
-   * @see sfWidgetFormInput
-   */
-  protected function configure($options = array(), $attributes = array())
-  {
-    parent::configure($options, $attributes);
-
-    $this->setOption('type', 'file');
-    $this->setOption('needs_multipart', true);
-  }
-
   protected function getBytes($value)
   {
     $value = trim($value);
@@ -49,12 +35,18 @@
     return $value;
   }
 
-  public function getHelp()
+  /**
+   * @param array $options     An array of options
+   * @param array $attributes  An array of default HTML attributes
+   *
+   * @see sfWidgetFormInput
+   */
+  protected function configure($options = array(), $attributes = array())
   {
-    if ($this->hasOption('help'))
-    {
-      return $this->getOption('help');
-    }
+    parent::configure($options, $attributes);
+
+    $this->setOption('type', 'file');
+    $this->setOption('needs_multipart', true);
 
     $size = min($this->getBytes(ini_get('post_max_size')), 
$this->getBytes(ini_get('upload_max_filesize')));
     foreach (array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB') as 
$unit)
@@ -68,6 +60,6 @@
       $size /= 1024;
     }
 
-    return 'The maximum size of file uploads is '.round($size, 2).' 
'.$unit.'.';
+    $this->addOption('help', 'The maximum size of file uploads is 
'.round($size, 2).' '.$unit.'.');
   }
 }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to