Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class EditFileViewer extends FullDocumentViewer {
- protected function getHtml($item, $full) {
- $resourceUrl = $this->getResourceUrl();
- $settings = $this->getSettings();
- // read file
- $html = '';
- $stream = $item->read();
- while (!feof($stream))
- $html .= fread($stream, 1024);
- fclose($stream);
- return <<<HTML
- <html>
- <head>
- <title>{$item->name()}</title>
- <style type="text/css">
- textarea {
- font: normal normal normal 1em/1.5em "Courier New", Courier, serif;
- width:100%;
- height:100%
- }
- </style>
- </head>
- <body>
- <textarea>$html</textarea>
- </body>
- </html>
- HTML;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment