Update of /cvsroot/phpwebapp/documentation/webobjects/displaytxt
In directory sc8-pr-cvs1:/tmp/cvs-serv20867/webobjects/displaytxt
Added Files:
displaytxt.css displaytxt.html displaytxt.php displaytxt.txt
Log Message:
--- NEW FILE: displaytxt.css ---
.txtlines
{
background-color: white;
color: #000099
}
--- NEW FILE: displaytxt.html ---
<WebBox ID="displaytxt">
<div class="txtlines">
<pre>
<Repeat rs="lines">
{{line}}
</Repeat>
</pre>
</div>
</WebBox>
--- NEW FILE: displaytxt.php ---
<?php
class displaytxt extends WebObject
{
function init()
{
$this->addSVar("file", UNDEFINED);
}
function onRender()
{
$file = $this->getSVar("file");
if (!file_exists($file))
{
$msg = "displaytxt: file '$file' does not exist.";
print WebApp::error_msg($msg);
return;
}
$lines = file($file);
$rs = new EditableRS("lines");
for ($i=0; $i < sizeof($lines); $i++)
{
$line = chop($lines[$i]);
$line = htmlentities($line);
$rec = array("line" => $line);
$rs->addRec($rec);
}
global $webPage;
$webPage->addRecordset($rs);
}
}
?>
--- NEW FILE: displaytxt.txt ---
file:
display.txt
|