LEPTON CMS 7.5.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
function.display_fe_wysiwyg_editor.php
Go to the documentation of this file.
1<?php
2
17
18
19// include secure.php to protect this file and the whole CMS!
20if(!defined("SEC_FILE")){define("SEC_FILE",'/framework/secure.php' );}
21if (defined('LEPTON_PATH')) {
22 include LEPTON_PATH.SEC_FILE;
23} else {
24 $oneback = "../";
25 $root = $oneback;
26 $level = 1;
27 while (($level < 10) && (!file_exists($root.SEC_FILE))) {
28 $root .= $oneback;
29 $level += 1;
30 }
31 if (file_exists($root.SEC_FILE)) {
32 include $root.SEC_FILE;
33 } else {
34 trigger_error(sprintf("[ <b>%s</b> ] Can't include secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
35 }
36}
37// end include secure file
38
39
53 string $name,
54 string $id,
55 string $content,
56 int|null $width = null,
57 int|null $height = null,
58 bool $prompt = false
59): string
60{
61 // using constant in buffering causes sometimes errors!
62 $classname = WYSIWYG_EDITOR.'_frontend';
63 if($classname == 'none')
64 {
65 $result = '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
66 }
67 else
68 {
69 ob_start();
70 $classname::show_fe_wysiwyg_editor($name, $id, $content, $width, $height, true);
71 $result = ob_get_clean();
72 }
73
74
75 if ($prompt == true)
76 {
77 echo $result;
78 return "";
79 }
80 else
81 {
82 return $result;
83 }
84}
$root
Definition index.php:25
$level
Definition index.php:26
display_fe_wysiwyg_editor(string $name, string $id, string $content, int|null $width=null, int|null $height=null, bool $prompt=false)