Thread: [Pieforms-commit] SF.net SVN: pieforms:[296] pieforms-php5/trunk/src/pieform/elements/bytes. php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2008-07-23 22:55:28
|
Revision: 296 http://pieforms.svn.sourceforge.net/pieforms/?rev=296&view=rev Author: oracleshinoda Date: 2008-07-23 22:55:36 +0000 (Wed, 23 Jul 2008) Log Message: ----------- Updated Japanese translation of bytes element from Mits. Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/bytes.php Modified: pieforms-php5/trunk/src/pieform/elements/bytes.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/bytes.php 2008-07-13 03:58:37 UTC (rev 295) +++ pieforms-php5/trunk/src/pieform/elements/bytes.php 2008-07-23 22:55:36 UTC (rev 296) @@ -140,9 +140,9 @@ 'invalidvalue' => 'Valeur doit être un nombre', ), 'ja.utf8' => array( - 'bytes' => 'バイト', - 'kilobytes' => 'キロバイト', - 'megabytes' => 'メガバイト', + 'bytes' => 'B', + 'kilobytes' => 'KB', + 'megabytes' => 'MB', 'invalidvalue' => '値は数値にしてください', ), ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2009-11-10 03:23:30
|
Revision: 316 http://pieforms.svn.sourceforge.net/pieforms/?rev=316&view=rev Author: oracleshinoda Date: 2009-11-10 03:23:05 +0000 (Tue, 10 Nov 2009) Log Message: ----------- Make the input box for the bytes element a little shorter. It doesn't need to be 8 characters long. I guess people who want to give someone a billion terabytes of storage might complain, but it's only a cosmetic thing anyway. Signed-off-by: Nigel McNie <ni...@ca...> Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/bytes.php Modified: pieforms-php5/trunk/src/pieform/elements/bytes.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/bytes.php 2009-09-20 23:46:49 UTC (rev 315) +++ pieforms-php5/trunk/src/pieform/elements/bytes.php 2009-11-10 03:23:05 UTC (rev 316) @@ -66,7 +66,7 @@ // @todo probably create with an actual input element, as tabindex doesn't work here for one thing // Same with the select. And do the events using mochikit signal instead of dom events $numberinput = '<input'; - $numberinput .= ' type="text" size="8" name="' . $name . '"'; + $numberinput .= ' type="text" size="6" name="' . $name . '"'; $numberinput .= ' id="' . $formname . '_' . $name . '" value="' . $values['number'] . '" tabindex="' . $element['tabindex'] . '"'; $numberinput .= (isset($element['error']) ? ' class="error"' : '') . ">\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2009-11-10 03:32:02
|
Revision: 320 http://pieforms.svn.sourceforge.net/pieforms/?rev=320&view=rev Author: oracleshinoda Date: 2009-11-10 03:31:47 +0000 (Tue, 10 Nov 2009) Log Message: ----------- Make the bytes element support "gigabytes". I even had a go at doing the translations for all the languages. Also, fix a bug where specifying a value that was exactly 1GB ended up showing up as 1024MB. This happens at the other unit boundaries too. Signed-off-by: Nigel McNie <ni...@ca...> Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/bytes.php Modified: pieforms-php5/trunk/src/pieform/elements/bytes.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/bytes.php 2009-11-10 03:29:47 UTC (rev 319) +++ pieforms-php5/trunk/src/pieform/elements/bytes.php 2009-11-10 03:31:47 UTC (rev 320) @@ -26,7 +26,7 @@ /** * Provides a size chooser, with a text box for a number and a - * select box to choose the units, in bytes, kilobytes, or megabytes + * select box to choose the units, in bytes, kilobytes, megabytes or gigabytes * * @param Pieform $form The form to render the element for * @param array $element The element to render @@ -108,6 +108,9 @@ function pieform_element_bytes_in($units) {/*{{{*/ switch ($units) { + case 'gigabytes': + return 1073741824; + break; case 'megabytes': return 1048576; break; @@ -126,48 +129,56 @@ 'bytes' => 'Bytes', 'kilobytes' => 'Kilobytes', 'megabytes' => 'Megabytes', + 'gigabytes' => 'Gigabytes', 'invalidvalue' => 'Value must be a number', ), 'de.utf8' => array( 'bytes' => 'Bytes', 'kilobytes' => 'Kilobytes', 'megabytes' => 'Megabytes', + 'gigabytes' => 'Gigabytes', 'invalidvalue' => 'Wert muss eine Zahl sein', ), 'fr.utf8' => array( 'bytes' => 'Octets', 'kilobytes' => 'Kilooctets', 'megabytes' => 'Mégaoctets', + 'gigabytes' => 'Gigaoctets', 'invalidvalue' => 'Valeur doit être un nombre', ), 'ja.utf8' => array( 'bytes' => 'B', 'kilobytes' => 'KB', 'megabytes' => 'MB', + 'gigabytes' => 'GB', 'invalidvalue' => '値は数値にしてください', ), 'es.utf8' => array( 'bytes' => 'Bytes', 'kilobytes' => 'Kilobytes', 'megabytes' => 'Megabytes', + 'gigabytes' => 'Gigabytes', 'invalidvalue' => 'El valor debe ser un número', ), 'sl.utf8' => array( 'bytes' => 'B', 'kilobytes' => 'kB', 'megabytes' => 'MB', + 'gigabytes' => 'GB', 'invalidvalue' => 'Vrednost mora biti število', ), 'nl.utf8' => array( 'bytes' => 'Bytes', 'kilobytes' => 'Kilobytes', 'megabytes' => 'Megabytes', + 'gigabytes' => 'Gigabytes', 'invalidvalue' => 'Waarde moet een getal zijn', ), 'cs.utf8' => array( 'bytes' => 'B', 'kilobytes' => 'kB', 'megabytes' => 'MB', + 'gigabytes' => 'GB', 'invalidvalue' => 'Hodnota musí být číselná', ), 'zh_tw.utf8' => array( @@ -181,7 +192,7 @@ }/*}}}*/ function pieform_element_bytes_get_bytes_units() {/*{{{*/ - return array('bytes', 'kilobytes', 'megabytes'); + return array('bytes', 'kilobytes', 'megabytes', 'gigabytes'); }/*}}}*/ function pieform_element_bytes_get_bytes_from_bytes($bytes) {/*{{{*/ @@ -189,8 +200,8 @@ return array('number' => '0', 'units' => 'bytes'); } - foreach (array('megabytes', 'kilobytes') as $units) { - if ( $bytes > pieform_element_bytes_in($units) ) { + foreach (array('gigabytes', 'megabytes', 'kilobytes') as $units) { + if ( $bytes >= pieform_element_bytes_in($units) ) { return array('number' => $bytes / pieform_element_bytes_in($units) , 'units' => $units); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |