fieldmap,chr($fieldtype)) ) { $field = $this->fieldmap[chr($fieldtype)]; //dump(['infield','byte'=>$byte,'fieldtype'=>$fieldtype,'field'=>$field,'strpos'=>strpos($field,'#')]); /* // address field has many lines. increment when hit on first character. if ($fieldlength == 1 && strpos($field,'#') !== false) { $field = str_replace('#',$fieldadrline,$field); dump(['field'=>$field,'fieldadrline'=>$fieldadrline,'fieldadrline'=>$fieldadrline]); $fieldadrline++; } */ // Replace field with Date if ($field == '%date') { // Drop the last dot and replace it. if ($fieldlength == 2) { $datetime = date('D d M H:ia'); $output = rtrim($output,VideotexFrame::$if_filler); $output .= $datetime{0}; } if ($fieldlength > 1 AND $fieldlength <= strlen($datetime)) $byte = ord($datetime{$fieldlength-1}); } // @todo user data /* else if (isset($user[$field])) { if ($fieldlength <= strlen($user[$field])) { $byte = ord($user[$field]{$fieldlength-1}); } } /*else // pre-load field contents. PAM or *00 ? if (isset($fields[what]['value'])) { */ } } else { $this->fields->push(new FrameFields([ 'type'=>chr($fieldtype), 'length'=>$fieldlength, 'x'=>$fieldx-1, // Adjust for the ESC char 'y'=>$fieldy, ])); Log::debug(sprintf('Frame Field found at [%s,%s], Type: %s, Length: %s',$fieldx-1,$fieldy,$fieldtype,$fieldlength)); $infield = FALSE; $fieldx = $fieldy = FALSE; } } } // truncate end of lines @todo havent validated this code or used it? if (isset($pageflags['tru']) && substr($content,$posn,$width-$x) === str_repeat(' ',$width-$x)) { $output .= CR.LF; break; } if (! $infield OR $fieldlength > 1) $output .= ($byte < 32) ? ESC.chr($byte+64) : chr($byte); } } return $output; } }