From 66c2ad84d4d493865fbc5a5fbfbbc61ff0bb3edf Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Thu, 8 Mar 2012 16:12:49 +0100 Subject: remove lib.String.php and lib.http.php which are included in the archive but not used anywhere --- app/lib/lib.String.php | 134 ------------------------------------------------- app/lib/lib.http.php | 52 ------------------- 2 files changed, 186 deletions(-) delete mode 100644 app/lib/lib.String.php delete mode 100644 app/lib/lib.http.php (limited to 'app/lib') diff --git a/app/lib/lib.String.php b/app/lib/lib.String.php deleted file mode 100644 index 151d122..0000000 --- a/app/lib/lib.String.php +++ /dev/null @@ -1,134 +0,0 @@ - -* Translation to PHP & Smarty: Edward Dale -* Modification to add a string: Sebastian Kuhlmann -* -------------------------------------------------------------- -*/ -function smarty_modifier_html_substr($string, $length, $addstring="") -{ - $addstring = " " . $addstring; - - if (strlen($string) > $length) { - if( !empty( $string ) && $length>0 ) { - $addtext = false; - $isText = true; - $ret = ""; - $i = 0; - - $currentChar = ""; - $lastSpacePosition = -1; - $lastChar = ""; - - $tagsArray = array(); - $currentTag = ""; - $tagLevel = 0; - - $noTagLength = strlen( strip_tags( $string ) ); - - // Parser loop - for( $j=0; $j" ) { - $isText = true; - - // Opening tag handler - if( ( strpos( $currentTag, "<" ) !== FALSE ) && - ( strpos( $currentTag, "/>" ) === FALSE ) && - ( strpos( $currentTag, "= $length) { - $addtext = true; - break; - } - } - - // Cut HTML string at last space position - if( $length < $noTagLength ) { - if( $lastSpacePosition != -1 ) { - $ret = substr( $string, 0, $lastSpacePosition ); - } else { - $ret = substr( $string, 0, $j ); - } - } - - // Close broken XHTML elements - while( sizeof( $tagsArray ) != 0 ) { - $aTag = array_pop( $tagsArray ); - $ret .= "\n"; - } - - } else { - $ret = ""; - } - - // only add string if text was cut - if ( $addtext ) { - return( $ret.$addstring ); - } - else { - return ( $ret ); - } - } else { - return ( $string ); - } -} - -//truncate a string -function string_truncate($string, $length){ - if (strlen($string) < $length){ - return $string; - } - else{ - return substr($string, 0, $length)."…"; - } -} - -?> \ No newline at end of file diff --git a/app/lib/lib.http.php b/app/lib/lib.http.php deleted file mode 100644 index 5fa8193..0000000 --- a/app/lib/lib.http.php +++ /dev/null @@ -1,52 +0,0 @@ - \ No newline at end of file -- cgit v1.2.1