00001 <?php
00002
00003
00004
00005 function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
00006
00007
00008
00009
00010 if (!isset($options[0]) || $options[0] == '') {
00011 $options[0] = 0;
00012 }
00013
00014 if (!isset($options[1]) || $options[1] == '') {
00015 $options[1] = 'all';
00016 }
00017
00018 if (!isset($options[2]) || $options[2] == '') {
00019 $options[2] = '...';
00020 }
00021
00022 $newtext = '';
00023 if ($options[1] != 'all') {
00024 $newtext = PMA_substr($buffer, $options[0], $options[1]);
00025 } else {
00026 $newtext = PMA_substr($buffer, $options[0]);
00027 }
00028
00029 $length = strlen($newtext);
00030 $baselength = strlen($buffer);
00031 if ($length != $baselength) {
00032 if ($options[0] != 0) {
00033 $newtext = $options[2] . $newtext;
00034 }
00035
00036 if (($length + $options[0]) != $baselength) {
00037 $newtext .= $options[2];
00038 }
00039 }
00040
00041 return $newtext;
00042 }
00043
00044 ?>