diff options
| author | root | 2014-10-28 00:52:21 +0100 |
|---|---|---|
| committer | root | 2014-10-28 00:52:21 +0100 |
| commit | 25610c0ccb4c7c99fe0d6d82d6738dbcc40d05e3 (patch) | |
| tree | 1c4fdcee0fb7b28ca330effbcc3334de3979d555 /class/moar.php | |
| parent | fe229655401abfa5aea2dc6c8830c8b9ed71aa64 (diff) | |
| download | jungegemeinde-25610c0ccb4c7c99fe0d6d82d6738dbcc40d05e3.tar.gz | |
v4.2 Sortable table + other improvements.
Diffstat (limited to 'class/moar.php')
| -rw-r--r-- | class/moar.php | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/class/moar.php b/class/moar.php index 822640f..b917c1d 100644 --- a/class/moar.php +++ b/class/moar.php @@ -17,22 +17,36 @@ class Moar { $this->footer[] = $string; } - public function playHeader(){ + public function playHeader($output = true){ if ( ! empty( $this->header ) ){ + if ( ! $output ) + $buffer = ""; foreach( $this->header as $value ){ - echo $value; + if ( $output ) + echo $value; + else + $buffer .= $value; } } $this->deleteHeader(); + if ( isset($buffer) ) + return $buffer; } - public function playFooter(){ + public function playFooter($output = true){ if ( ! empty( $this->footer ) ){ + if ( ! $output ) + $buffer = ""; foreach( $this->footer as $value ){ - echo $value; + if ( $output ) + echo $value; + else + $buffer .= $value; } } $this->deleteFooter(); + if ( isset($buffer) ) + return $buffer; } public function deleteHeader(){ @@ -45,10 +59,7 @@ class Moar { } public function magicHeader($html){ - ob_start(); - $this->playHeader(); - $header = ob_get_contents(); - ob_end_clean(); + $header = $this->playHeader(false); return preg_replace("/\<\!\-\-%%placeholder\-head%%\-\-\>/", $header, $html); } |
