diff options
Diffstat (limited to 'ckeditor/editor.php')
-rw-r--r-- | ckeditor/editor.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ckeditor/editor.php b/ckeditor/editor.php new file mode 100644 index 0000000..658000a --- /dev/null +++ b/ckeditor/editor.php @@ -0,0 +1,27 @@ +<?php + +header("Content-Type: application/javascript"); +$base = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/ckeditor/ckeditor-build.js"); +$iconAmount = 87; + +$icons = []; +$index = 0; + +while (true) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/ckeditor/icons/delta/" . $index . ".svg")) { + $icons[] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/ckeditor/icons/delta/" . $index . ".svg"); + } elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . "/ckeditor/icons/original/" . $index . ".svg")) { + $icons[] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/ckeditor/icons/original/" . $index . ".svg"); + } else { + $icons[] = ""; + } + + $iconAmount--; $index++; + if ($iconAmount === 0) break; +} + +foreach ($icons as $index => $icon) { + $base = str_replace("$\${Delta.CKEditor.Icon[$index]}$$", $icon, $base); +} + +die($base);
\ No newline at end of file |