Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions formats/iframecode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

class IFrameCodeFormat implements Format {
public $title = 'IFRAME';
public $mime = 'text/html';
public $can_attach = false;

public function export( $data ) {
global $scodeid, $base_path;

$s = isset($scodeid) ?
'<iframe src="'.$base_path.'/'.$scodeid.'?format=iframe&direct' :
'<iframe src="'.$base_path.'/?format=iframe&direct&bbcode='.array_to_mapbbcode($data);
$f = '" width="600" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>';
$iframe = $s.$f;

$html =
'<!DOCTYPE html><html><head><title>IFRAME export</title><meta charset="utf-8"></head><body>'.
'<p>If you would like to link to this route, just copy the code and paste it into your source code:</p>'.
'<p><textarea readonly onclick="this.focus();this.select();" style="width: 100%;">'.htmlspecialchars($iframe).'</textarea></p>'.
'</body></html>';
return $html;
}

public function test( $header ) {
return false;
}

public function import( $file ) {
}
}

$formats['iframecode'] = new IFrameCodeFormat();