mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
updated handling of long filenames in icons views of "simple" and "slik" templates, and modified output functions in exec/output.exec.php.
git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@28 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -86,21 +86,25 @@ class Path {
|
||||
return $r_files;
|
||||
}
|
||||
}
|
||||
|
||||
//>Section> path_wordwrap
|
||||
function wordbreak ($input, $length, $break=" ") {
|
||||
if (preg_match("/(.*)\.(.*)/", $input, $preg) ) {
|
||||
$words = explode(' ', $preg[1]);
|
||||
$ext = '.'.$preg[2];
|
||||
} else {
|
||||
$words = explode(' ', $input);
|
||||
$ext = '';
|
||||
//>Section> path_breakFilename
|
||||
function breakFilename ($input, $maxlength, $wordbreak = 16) {
|
||||
|
||||
if ( $wordbreak != false ) {
|
||||
if (preg_match("/(.*)\.(.*)/", $input, $preg) ) {
|
||||
$words = explode(' ', $preg[1]);
|
||||
$ext = '.'.$preg[2];
|
||||
} else {
|
||||
$words = explode(' ', $input);
|
||||
$ext = '';
|
||||
}
|
||||
foreach( $words as $key => $value ) {
|
||||
$words[$key] = wordwrap($value, $wordbreak, ' ', 1);
|
||||
}
|
||||
$input = implode(' ', $words).$ext;
|
||||
}
|
||||
|
||||
foreach( $words as $key => $value ) {
|
||||
$words[$key] = wordwrap($value, $length, $break, 1);
|
||||
}
|
||||
return implode(' ', $words).$ext;
|
||||
if ( strlen($input) > $maxlength ) return rtrim(substr($input, 0, $maxlength)).'...';
|
||||
return $input;
|
||||
}
|
||||
|
||||
//>Section> path_class.end
|
||||
|
||||
Reference in New Issue
Block a user