init
This commit is contained in:
36
mysyde/common/logparser/class.log.output.php
Normal file
36
mysyde/common/logparser/class.log.output.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// include the interface class
|
||||
require_once(CMS_PATH . 'common/logparser/class.log.processor.php');
|
||||
|
||||
// -------------------------
|
||||
// log_output
|
||||
//
|
||||
// very basic class to output data in a very simple format
|
||||
//
|
||||
// -------------------------
|
||||
class log_output implements log_processor {
|
||||
|
||||
// process
|
||||
//
|
||||
// the function called by the log class
|
||||
//
|
||||
final function process( $data ) {
|
||||
// open a <p> tag
|
||||
$r = '<p>';
|
||||
|
||||
// loop through each field of the data
|
||||
foreach ($data as $key => $value) {
|
||||
// build a <span> with a class of $key containing $value
|
||||
$r .= "<span class=\"{$key}\">{$value}</span> ";
|
||||
}
|
||||
|
||||
// close the </p>
|
||||
$r .= '</p>';
|
||||
|
||||
// output the html
|
||||
print $r;
|
||||
|
||||
// return it too, just in case
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user