Fix for the Open in New Window in Patient/Client->Patients search gui, take 2.
[openemr.git] / phpmyadmin / libraries / transformations / text_plain__substr.inc.php
blob958e956f9096ed31d023bfa16723937461e92a93
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
11 function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
12 // possibly use a global transform and feed it with special options:
13 // include './libraries/transformations/global.inc.php';
15 // further operations on $buffer using the $options[] array.
16 if (!isset($options[0]) || $options[0] == '') {
17 $options[0] = 0;
20 if (!isset($options[1]) || $options[1] == '') {
21 $options[1] = 'all';
24 if (!isset($options[2]) || $options[2] == '') {
25 $options[2] = '...';
28 $newtext = '';
29 if ($options[1] != 'all') {
30 $newtext = PMA_substr($buffer, $options[0], $options[1]);
31 } else {
32 $newtext = PMA_substr($buffer, $options[0]);
35 $length = strlen($newtext);
36 $baselength = strlen($buffer);
37 if ($length != $baselength) {
38 if ($options[0] != 0) {
39 $newtext = $options[2] . $newtext;
42 if (($length + $options[0]) != $baselength) {
43 $newtext .= $options[2];
47 return $newtext;