Internal rework pending editframe

This commit is contained in:
Deon George
2019-07-12 10:42:01 +07:00
parent 4f79a1a997
commit 264747e2f3
14 changed files with 611 additions and 428 deletions

View File

@@ -10,7 +10,7 @@ use App\Classes\Frame\Videotex as VideotexFrame;
class Videotex extends AbstractParser
{
protected function parse($startline): string
protected function parse(int $startline,string $content,int $width): string
{
// Our starting coordinates
$output = '';
@@ -32,13 +32,13 @@ class Videotex extends AbstractParser
$posn = $y*VideotexFrame::$frame_width+$x;
// If the frame is not big enough, fill it with spaces.
$byte = ord(isset($this->content{$posn}) ? $this->content{$posn} : ' ')%128;
$byte = ord(isset($content{$posn}) ? $content{$posn} : ' ')%128;
// Check for start-of-field
if ($byte == ord(ESC)) { // Esc designates start of field (Esc-K is end of edit)
$infield = TRUE;
$fieldlength = 1;
$fieldtype = ord(substr($this->content,$posn+1,1))%128;
$fieldtype = ord(substr($content,$posn+1,1))%128;
$output .= VideotexFrame::$if_filler;
} else {
@@ -107,8 +107,8 @@ class Videotex extends AbstractParser
}
// truncate end of lines @todo havent validated this code or used it?
if (isset($pageflags['tru']) && substr($this->content,$posn,40-$x) === str_repeat(' ',40-$x)) {
$output .= CR . LF;
if (isset($pageflags['tru']) && substr($content,$posn,$width-$x) === str_repeat(' ',$width-$x)) {
$output .= CR.LF;
break;
}