cvs: pear /HTML_Progress2/Progress2 Upload.php

[email protected] ("Laurent Laville")
Newsgroups php.pear.cvs
Message-ID <cvsfarell1208625973@cvsserver>
farell		Sat Apr 19 17:26:13 2008 UTC

  Modified files:              
    /pear/HTML_Progress2/Progress2	Upload.php 
  Log:
  basic implementation of request 12532 : Add addional info to apc5
  need more compatibility todo on other backend 
  
http://cvs.php.net/viewvc.cgi/pear/HTML_Progress2/Progress2/Upload.php?r1=1.5&r2=1.6&diff_format=u
Index: pear/HTML_Progress2/Progress2/Upload.php
diff -u pear/HTML_Progress2/Progress2/Upload.php:1.5 pear/HTML_Progress2/Progress2/Upload.php:1.6
--- pear/HTML_Progress2/Progress2/Upload.php:1.5	Thu Mar 20 21:27:55 2008
+++ pear/HTML_Progress2/Progress2/Upload.php	Sat Apr 19 17:26:12 2008
@@ -36,7 +36,7 @@
  * @author    Laurent Laville <[email protected]>
  * @copyright 2007-2008 Laurent Laville
  * @license   http://www.opensource.org/licenses/bsd-license.php  New BSD License
- * @version   CVS: $Id: Upload.php,v 1.5 2008/03/20 21:27:55 farell Exp $
+ * @version   CVS: $Id: Upload.php,v 1.6 2008/04/19 17:26:12 farell Exp $
  * @link      http://pear.php.net/package/HTML_Progress2
  * @since     File available since Release 2.3.0RC1
  */
@@ -159,7 +159,10 @@
                 $info['bytes_uploaded'] = $tmp['current'];
                 $info['bytes_total']    = $tmp['total'];
                 $info['files_uploaded'] = $tmp['done'];
-                $info['cancel_upload']  = $tmp['cancel_upload'];
+                $info['current_file']   = $tmp['filename'];
+                if (isset($tmp['cancel_upload'])) {
+                    $info['cancel_upload'] = $tmp['cancel_upload'];
+                }
             } else {
                 $info = false;
             }
@@ -178,6 +181,7 @@
      *  T - for display total file size
      *  C - for display current file size uploaded
      *  P - for display percentage of file size uploaded
+     *  F - for display file name to upload
      *
      * @param string $format conversion specification
      * @param array  $info   current upload information
@@ -212,6 +216,10 @@
             }
             $format = str_replace('%P', $percent, $format);
         }
+        $pos = strpos($format, '%F');
+        if ($pos !== false) {
+            $format = str_replace('%F', $info['current_file'], $format);
+        }
         return $format;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.