Author: jablko
Date: Fri Oct 29 11:42:49 2010
New Revision: 8654
Log:
Drop unused helper
Modified:
trunk/lib/helper/QubitHelper.php
Modified: trunk/lib/helper/QubitHelper.php
==============================================================================
--- trunk/lib/helper/QubitHelper.php Fri Oct 29 11:17:24 2010 (r8653)
+++ trunk/lib/helper/QubitHelper.php Fri Oct 29 11:42:49 2010 (r8654)
@@ -138,76 +138,6 @@
}
/**
- * Break a $longString into multiple lines at the closest $whitespaceChars,
- * so no line exceeds the $width. Truncate string if it exceeds
- * $maxLines.
- *
- * @param string $longString
- * @param integer $width
- * @param integer $maxLines
- * @param array $whitespaceChars
- * @param string $linebreak
- */
-
-function string_wrap($longString, $width, $maxLines=3, $whiteSpaceChars =
array(' ', '-', '_'), $linebreak='<br/>')
-{
- $start = 0;
- $end = 0;
- $lineCount = 0;
-
- while ($end < strlen($longString))
- {
- $thisLine = substr($longString, $start, $width);
-
- if (strlen($thisLine) < $width)
- {
- $end = $start + strlen($thisLine);
- }
- else
- {
- // find the right-most $whiteSpaceChar in $thisLine
- for ($i = strlen($thisLine); $i >= 0; $i--)
- {
- $thisChar = substr($thisLine, $i, 1);
- if (in_array($thisChar, $whiteSpaceChars))
- {
- $end = $start + $i;
- break;
- }
- }
-
- // If no $whiteSpaceChar found or resulting line length would be
- // less than 1/4 of $width, break arbitrarily at $width
- if ($i < floor($width / 4))
- {
- $end = $start + strlen($thisLine);
- }
- }
-
- if ($lineCount == ($maxLines - 1))
- {
- // If at $maxLines, maximize length of last line, and add ellipses
- $wrappedLines[$lineCount] = substr($longString, $start, $width - 3);
- if ($end < strlen($longString))
- {
- $wrappedLines[$lineCount] .= '...';
- }
- break;
- }
- else
- {
- // Add current line to $wrappedLines array
- $wrappedLines[$lineCount] = substr($longString, $start, ($end - $start));
- }
-
- $start = $end;
- $lineCount++;
- } // endwhile
-
- return implode($linebreak, $wrappedLines);
-}
-
-/**
* Return a human readable file size, using the appropriate SI prefix
*
* @param integer $val value in bytes
--
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.com/group/qubit-commits?hl=en.