Esempio n. 1
0
    function get_rich_ns()
    {
        //    global $class_path;
        //    global $rich_flag;
        //    global $rich_lang;
        $class_path = $this->get_class_path();
        $rich_flag = rich_get_rich_flag();
        $files_path = $this->files_path;
        //  if($this->absolute_path) $this->files_path = "../".$files_path;
        //      else $this->files_path = $_SERVER['DOCUMENT_ROOT'].$files_path;
        //  $this->files_path = $_SERVER['DOCUMENT_ROOT'].$files_path;
        //name of textarea element for sending text from form
        $name_area = $this->name;
        /*
            if (ereg("^([^\[]+)\[(.+)\]", $this->name, $regs)) {
                $this->name = $regs[1];
                $id = $regs[2];
            } else $id = '';
        */
        if (ereg("^([^\\[]+)\\[(.+)\\]\$", $this->name, $regs)) {
            $this->name = $regs[1];
            $parts = split('\\]\\[', $regs[2]);
            $id = implode('_', $parts);
        } else {
            $id = '';
        }
        $name = $this->name . "_ed" . $id;
        //editor name
        $name_id = $name . "_id";
        //id of editor element
        //text data in current language
        $lang = new rich_lang($this->settings['lang']);
        //set document charset settings
        if (!$this->settings['doc_lang']) {
            $this->settings['doc_lang'] = $this->settings['lang'];
        }
        if (!$this->settings['doc_charset']) {
            $this->settings['doc_charset'] = $lang->item('Charset');
        }
        $result = '';
        if ($this->caption) {
            $result .= $this->caption . ":<br />";
        }
        $user_agent = @$_SERVER["HTTP_USER_AGENT"];
        if (!$user_agent) {
            $user_agent = $GLOBALS["HTTP_USER_AGENT"];
        }
        if (ereg("Mozilla/([0-9|\\.]+)", $user_agent, $regs) && ereg("Gecko", $user_agent) && (double) $regs[1] >= 5.0 && ereg("rv:([0-9|\\.]+)", $user_agent, $v_regs) && (double) $v_regs[1] >= 1.4) {
            $is_ns = true;
            $msie_version = (double) $regs[1];
            if (ereg('Netscape', $user_agent, $regs)) {
                $is_netscape = true;
            } else {
                $is_netscape = false;
            }
            $is_netscape = true;
        } else {
            $is_ns = false;
            $is_netscape = false;
        }
        $value = $this->value;
        $value = $this->convert_php_tags($value);
        if ($is_ns && !$value) {
            $value = '<br />';
        }
        if (!$this->page_mode && $is_ns) {
            $value = '<html><head></head><body>' . $value . '</body></html>';
        }
        $this->value = htmlspecialchars($value);
        if (!$rich_flag) {
            $result .= '<iframe id="rich_fs_iframe" style="display:none;z-index:999"></iframe>';
        }
        $result .= '<!-- editor body -->

<div id="' . $name . '_div_id" name="rich_table">
<table id="' . $name . '_table_id" border="1" cellspacing="0" cellpadding="0" width="' . $this->width . '" height="' . $this->height . '" class="re_table">
';
        if ($is_ns && !$this->settings['editable_regions']) {
            $result .= '<tr><td vAlign="top">

<!-- toolbar -->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr id="' . $name . '_tb_id" ondragstart="return false;"><td class="re_toolbar">
        ';
            if ($this->is_visible('save')) {
                $result .= '
  <img id="Save_' . $name . '" onmousedown="mouse_down(true, this);" onmouseup="mouse_down(false, this);" onclick="active_rich = ' . $name_id . '; ' . str_replace('"', "'", $this->settings['on_save']) . '" title="' . $lang->item('Save') . '" src="' . $class_path . 'rich_files/images/save.gif" align="absMiddle" width="20" height="20" onmouseover="mouse_over(true, this);" onmouseout="mouse_over(false, this);" />
            ';
            }
            if ($this->is_visible('fullscreen') || $this->is_visible('preview') || $this->is_visible('find')) {
                $result .= '<nobr>';
                if ($this->is_visible('fullscreen')) {
                    $result .= $this->get_tb_action_icon_ns("FullScreen", "fullscreen", $name, $name_id, $lang);
                }
                //    if($this->is_visible('preview') || $this->is_visible('find')){
                //      $result .= '<nobr>';
                if ($this->is_visible('preview')) {
                    $result .= $this->get_tb_dialog_icon_ns("Preview", "preview", $name, $name_id, $lang);
                }
                if ($this->is_visible('find')) {
                    $result .= '
  <img id="Find_' . $name . '" onmousedown="mouse_down(true, this);" onmouseup="mouse_down(false, this);" onclick="active_rich = ' . $name_id . '; show_dialog(\'Find\')" title="' . $lang->item('Find') . '" src="' . $class_path . 'rich_files/images/find.gif" align="absMiddle" width="20" height="20" onmouseover="mouse_over(true, this);" onmouseout="mouse_over(false, this);" />
          ';
                }
                $result .= '</nobr>
            ';
            }
            if ($this->is_visible('history')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("Undo", "undo", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("Redo", "redo", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('text')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("Bold", "bold", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("Italic", "italic", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("Underline", "underline", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("Strikethrough", "strikethrough", $name, $name_id, $lang);
                $result .= '
</nobr>
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("SuperScript", "superscript", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("SubScript", "subscript", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('align')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("JustifyLeft", "left", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("JustifyCenter", "center", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("JustifyRight", "right", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("JustifyFull", "justify", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('list') || $this->is_visible('indent')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                if ($this->is_visible('list')) {
                    $result .= $this->get_tb_action_icon_ns("InsertOrderedList", "numlist", $name, $name_id, $lang);
                    $result .= $this->get_tb_action_icon_ns("InsertUnorderedList", "bullist", $name, $name_id, $lang);
                }
                if ($this->is_visible('indent')) {
                    $result .= $this->get_tb_action_icon_ns("Outdent", "outdent", $name, $name_id, $lang);
                    $result .= $this->get_tb_action_icon_ns("Indent", "indent", $name, $name_id, $lang);
                }
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('hr') || $this->is_visible('remove_format')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                if ($this->is_visible('hr')) {
                    $result .= $this->get_tb_action_icon_ns("InsertHorizontalRule", "h_line", $name, $name_id, $lang);
                }
                if ($this->is_visible('remove_format')) {
                    $result .= $this->get_tb_action_icon_ns("RemoveFormat", "rem_format", $name, $name_id, $lang);
                }
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('table')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_dialog_icon_ns("CreateTable", "table", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("EditTable", "table_prop", $name, $name_id, $lang);
                //          $result .= $this->get_tb_dialog_icon_ns("EditCell", "cell_prop", $name,
                //                                                  $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("InsertRow", "insrow", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("DeleteRow", "delrow", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("InsertColumn", "inscol", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("DeleteColumn", "delcol", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('table') && $this->is_visible('adv_table')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("InsertCell", "inscell", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("DeleteCell", "delcell", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("MergeCells", "mergecells", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("SplitCell", "splitcell", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("MergeCellsDown", "mergecellsdown", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("SplitCellDown", "splitcelldown", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('form')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_dialog_icon_ns("CreateForm", "form", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateText", "text", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateTextArea", "textarea", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateButton", "button", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateSelect", "select", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateHidden", "hidden", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateCheckBox", "checkbox", $name, $name_id, $lang);
                $result .= $this->get_tb_dialog_icon_ns("CreateRadio", "radio", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('paragraph')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= '
  <span class="re_text">' . $lang->item('FormatBlock') . ':</span>
<select onmousedown="active_rich = ' . $name_id . '; this.disabled = true; re_show_list(this, true); setTimeout(\'re_enable(\\\'FormatBlock_' . $name . '\\\')\', 100);" class="re_text" id="FormatBlock_' . $name . '">
  <option value=""></option>';
                $result .= '
  <option value="<p>">Normal (P)</option>
  <option value="<h1>">Heading 1 (H1)</option>
  <option value="<h2>">Heading 2 (H2)</option>
  <option value="<h3>">Heading 3 (H3)</option>
  <option value="<h4>">Heading 4 (H4)</option>
  <option value="<h5>">Heading 5 (H5)</option>
  <option value="<h6>">Heading 6 (H6)</option>
  <option value="<pre>">Preformatted (PRE)</option>';
                $result .= '
</select>
<iframe width="211" height="100" id="FormatBlock_' . $name . '_iframe" class="re_list_iframe" style="position: absolute; display:none; border: 1px solid #000000; z-index: 10000;" frameborder="0">&nbsp;</iframe>
</nobr>
            ';
            }
            if ($this->is_visible('font')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= '
  <span class="re_text">' . $lang->item('FontName') . ':</span>
<select onmousedown="active_rich = ' . $name_id . '; this.disabled = true; re_show_list(this, true); setTimeout(\'re_enable(\\\'FontName_' . $name . '\\\')\', 100);" class="re_text" id="FontName_' . $name . '">
  <option value="" selected></option>
            ';
                if (count($this->font_list)) {
                    foreach ($this->font_list as $k => $val) {
                        $result .= '  <option value="' . strtolower($val) . '">' . $val . '</option>' . "\n";
                    }
                } else {
                    $result .= '
  <option value="arial">Arial</option>
  <option value="arial black">Arial Black</option>
  <option value="garamond">Garamond</option>
  <option value="comic sans ms">Comic Sans MS</option>
  <option value="courier">Courier</option>
  <option value="courier new">Courier New</option>
  <option value="symbol">Symbol</option>
  <option value="times new roman">Times New Roman</option>
  <option value="verdana">Verdana</option>
  <option value="webdings">Webdings</option>
  <option value="wingdings">Wingdings</option>
                ';
                }
                $result .= '
</select>
<iframe width="121" height="100" id="FontName_' . $name . '_iframe" class="re_list_iframe" style="position: absolute; display:none; border: 1px solid #000000; z-index: 10000;" frameborder="0">&nbsp;</iframe>
</nobr>
            ';
            }
            if ($this->is_visible('style')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= '
  <span class="re_text">' . $lang->item('ClassName') . ':</span>
<select onmousedown="active_rich = ' . $name_id . '; set_stylesheet_rules(); this.disabled = true; re_show_list(this); setTimeout(\'re_enable(\\\'ClassName_' . $name . '\\\')\', 100);" class="re_text" id="ClassName_' . $name . '">
  <option value=""></option>
</select>
<iframe width="130" height="200" ini_height="200" id="ClassName_' . $name . '_iframe" class="re_list_iframe" style="position: absolute; display:none; border: 1px solid #000000; z-index: 10000;" frameborder="0">&nbsp;</iframe>
</nobr>
            ';
            }
            if ($this->is_visible('size')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= '
  <span class="re_text">' . $lang->item('FontSize') . ':</span>
<select onmousedown="active_rich = ' . $name_id . '; this.disabled = true; re_show_list(this, true); setTimeout(\'re_enable(\\\'FontSize_' . $name . '\\\')\', 100);" class="re_text" id="FontSize_' . $name . '">
  <option value="" selected></option>
            ';
                if (count($this->font_size_list)) {
                    foreach ($this->font_size_list as $k => $val) {
                        $result .= '  <option value="' . $val . '">' . $val . '</option>' . "\n";
                    }
                } else {
                    $result .= '
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
                ';
                }
                $result .= '
</select>
<iframe width="58" height="100" id="FontSize_' . $name . '_iframe" class="re_list_iframe" style="position: absolute; display:none; border: 1px solid #000000; z-index: 10000;" frameborder="0">&nbsp;</iframe>
</nobr>
            ';
            }
            if ($this->is_visible('color')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_action_icon_ns("ForeColor", "fgcolor", $name, $name_id, $lang);
                $result .= $this->get_tb_action_icon_ns("HiliteColor", "bgcolor", $name, $name_id, $lang);
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('image') || $this->is_visible('link') || $this->is_visible('anchor')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                if ($this->is_visible('image')) {
                    $result .= $this->get_tb_dialog_icon_ns("CreateImage", "image", $name, $name_id, $lang);
                }
                if ($this->is_visible('link')) {
                    $result .= $this->get_tb_dialog_icon_ns("CreateLink", "link", $name, $name_id, $lang);
                }
                if ($this->is_visible('anchor')) {
                    $result .= $this->get_tb_dialog_icon_ns("CreateAnchor", "anchor", $name, $name_id, $lang);
                }
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('paste_word') || $this->is_visible('switch_borders') || $this->is_visible('special_chars') || $this->is_visible('snippets') || $this->page_mode && $this->is_visible('page_properties')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                if ($this->is_visible('paste_word')) {
                    $result .= $this->get_tb_action_icon_ns("PasteWord", "paste_word", $name, $name_id, $lang);
                }
                if ($this->is_visible('switch_borders')) {
                    $result .= $this->get_tb_action_icon_ns("SwitchBorders", "borders", $name, $name_id, $lang);
                }
                if ($this->is_visible('special_chars')) {
                    $result .= $this->get_tb_action_icon_ns("InsertChar", "inschar", $name, $name_id, $lang);
                }
                if ($this->snippets && $this->is_visible('snippets')) {
                    $result .= $this->get_tb_dialog_icon_ns("InsertSnippet", "snippet", $name, $name_id, $lang);
                }
                if ($this->page_mode && $this->is_visible('page_properties')) {
                    $result .= $this->get_tb_dialog_icon_ns("PageProperties", "page", $name, $name_id, $lang);
                }
                if (isset($cms_curr_user) && $cms_curr_user && $cms_curr_user->id) {
                    $result .= $this->get_tb_dialog_icon_ns("CreateBlock", "block", $name, $name_id, $lang);
                }
                $result .= '
</nobr>
            ';
            }
            if ($this->is_visible('help')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= $this->get_tb_dialog_icon_ns("Help", "help", $name, $name_id, $lang);
                $result .= '
</nobr>';
            }
            if ($this->is_visible('source')) {
                $result .= '
<nobr>
            ';
                $result .= $this->get_delimiter();
                $result .= '
  <span class="re_text">' . $lang->item('Source') . ':</span><input type="checkbox" name="edit_mode" id="Source_' . $name . '" onClick="active_rich = ' . $name_id . '; change_mode();" />
</nobr>
            ';
            }
            $result .= '

</td></tr>
</table>
<!-- toolbar -->

</td></tr>';
        }
        $result .= '

<tr><td height="100%">

<!-- text -->
    ';
        $iframe_width = $is_netscape ? $this->width . 'px' : '100%';
        $iframe_height = $is_netscape ? $this->height - 31 > 0 ? $this->height - 31 . 'px' : $this->height . 'px' : '100%';
        $iframe_width = '100%';
        $iframe_height = '100%';
        if ($is_ns) {
            $result .= '<iframe class="re_editor" name="' . $name . '" id="' . $name_id . '" width="' . $iframe_width . '" height="' . $iframe_height . '" style="border: black thin; width:' . $iframe_width . '; height:' . $iframe_height . ';"';
            $result .= ' onload="var re_src_obj = document.getElementById(\'Source_' . $name . '\'); if (re_src_obj) re_src_obj.checked=\'\';';
            if ($this->settings['borders_visibility']) {
                $result .= ' active_rich = ' . $name_id . '; switch_borders(true);';
            }
            $result .= '"';
            $result .= '>&nbsp;</iframe>';
        }
        $result .= '
<textarea name="' . $name_area . '" id="' . $name . '_area_id" style="';
        if ($is_ns) {
            $result .= 'display:none; ';
        }
        $result .= 'border: 0px; padding: 0; margin: 0; width:' . $iframe_width . '; height:' . $iframe_height . ';' . ($lang->item('Direction') != '' ? ' direction:' . $lang->item('Direction') : '') . '">
' . $this->value . '</textarea>
<!-- text -->

</td></tr>
</table>
</div>
<!-- editor body -->
';
        if ($is_ns) {
            if (!$rich_flag) {
                $result .= '<iframe id="rich_temp_iframe" style="width:1px; height:1px; border:1px;">&nbsp;</iframe>';
                $result .= '<div id="re_context_div_id" style="display:none;position:absolute;z-Index:1000"></div>';
            }
            $result .= '

<script language="javascript">
    //settings
    var ' . $name . '_rich_mode = true;
    var ' . $name . '_rich_page_mode = ' . (int) $this->page_mode . ';
    var ' . $name . '_rich_border_mode = false;
    var ' . $name . '_rich_abspos_mode = false;
    var ' . $name . '_rich_active_mode = ' . (int) $this->settings['active_tb'] . ';
    var ' . $name . '_prev_is_control = null;
    var ' . $name . '_rich_full_screen_mode = false;
    var ' . $name . '_rich_absolute_path = ' . (int) $this->absolute_path . ';
    var ' . $name . '_rich_xhtml_mode = ' . (int) $this->settings['xhtml'] . ';
    var ' . $name . '_br_on_enter = ' . (int) $this->settings['br_on_enter'] . ';
    var ' . $name . '_clean_paste = ' . (int) $this->settings['clean_paste'] . ';

    var ' . $name . '_rich_doc_lang = "' . $this->settings['doc_lang'] . '";
    var ' . $name . '_rich_doc_charset = "' . $this->settings['doc_charset'] . '";

    var ' . $name . '_lang = "' . $this->settings['lang'] . '";
    var ' . $name . '_files_path = "' . $this->files_path . '";
    var ' . $name . '_files_url = "' . $this->files_url . '";

    var ' . $name . '_editable_regions = ' . (int) $this->settings['editable_regions'] . ';
    var ' . $name . '_indent = "' . $this->settings['indent'] . '";

    var ' . $name . '_first_click = 1;

    //set initial content
    var ' . $name . '_area_id = document.getElementById("' . $name . '_area_id");

    ' . $name . '_id = document.getElementById("' . $name . '_id").contentWindow;

        ';
            if (!$this->settings['editable_regions']) {
                $result .= $name . '_id.document.designMode = "On";';
            }
            $result .= '

    ' . $name . '_id.document.open();
    ' . $name . '_id.document.write(' . $name . '_area_id.value);
    ' . $name . '_id.document.close();
//  ' . $name . '_id.document.designMode = "On";

    ' . $name . '_id.document.dir = "' . $lang->item('Direction') . '";
    var ' . $name . '_rich_dir = "' . $lang->item('Direction') . '";
    var ' . $name . '_rich_mb = "' . $lang->item('Multibyte') . '";

    var ' . $name . '_rich_css = Array();
        ';
            //draw stylesheet loading code
            if ($this->default_stylesheet) {
                $result .= "\n";
                $result .= 'var head_tag = ' . $name . '_id.document.getElementsByTagName(\'HEAD\')[0];' . "\n";
                foreach ($this->default_stylesheet as $k => $val) {
                    //          $result .= $name.'_id.document.createStyleSheet("'.$val.'");'."\n";
                    $result .= 'var rich_sh_temp = \'<link rel="stylesheet" href="' . $val . '" type="text/css">\'' . "\n";
                    //          $result .= $name.'_id.document.body.innerHTML = rich_sh_temp+'.$name.'_id.document.body.innerHTML;'."\n";
                    $result .= 'head_tag.innerHTML += rich_sh_temp;' . "\n";
                    $result .= $name . '_rich_css[' . $k . '] = "' . $val . '";' . "\n";
                }
            }
            if (!$rich_flag) {
                //url of root dir of site
                if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || isset($GLOBALS['HTTPS']) && $GLOBALS['HTTPS'] == 'on') {
                    $base_url = "https";
                } else {
                    $base_url = "http";
                }
                $base_url .= '://' . $_SERVER["HTTP_HOST"];
                $result .= '
    var rich_base_url = "' . $base_url . '";
            ';
                $result .= '

    var rich_dialog_ext = "' . $this->dialog_ext . '";

            ';
                $result .= '
    var rich_sess_param = "';
                if (session_id()) {
                    $result .= 're_session_id=' . session_id();
                }
                $result .= '";
            ';
                $result .= '

    var rich_fs_mode_on = false;

            ';
            }
            $result .= '

  active_rich = ' . $name_id . ';';
            if ($this->is_visible('style')) {
                $result .= 'set_stylesheet_rules();';
            }
            $result .= '
  add_handlers(document.getElementById(\'' . $name_id . '\').contentWindow);
        ';
            //draw snippets
            $result .= "\n\n" . '  var ' . $name . '_snippets = new Array();' . "\n";
            if ($this->snippets && $this->is_visible('snippets')) {
                foreach ($this->snippets as $k => $val) {
                    $result .= "\n" . '       ' . $name . '_snippets["' . $k . '"] = new Array();' . "\n";
                    foreach ($val as $k2 => $val2) {
                        $snippet_name = str_replace("'", "\\'", $val2['name']);
                        $snippet_code = str_replace("'", "\\'", $val2['code']);
                        $result .= '  ' . $name . '_snippets["' . $k . '"][' . $k2 . '] = Array(\'' . $snippet_name . '\', \'' . $snippet_code . '\');' . "\n";
                    }
                }
            }
            $lang_name = $this->settings['lang'];
            //      if(!isset($rich_lang[$lang_name])){
            //          $rich_lang[$lang_name] = true;
            //      }
            if (!rich_get_rich_lang($lang_name)) {
                //add context menu data
                $result .= $this->get_context_menu_data($lang);
            }
        }
        if ($is_ns) {
            if (!$rich_flag) {
                $result .= '
/* copyright

Rich Editor, Version 2.1
Copyright (c) 2002-2006 V. Smolin All rights reserved.
http://www.richarea.com
re@richarea.com

copyright */
            ';
                $result .= '
//    rich_temp_iframe.document.designMode = "On";

      var rich_path = "' . $class_path . 'rich_files/";

            ';
                //          $rich_flag = true;
                $rich_flag = rich_get_rich_flag(1);
            }
        }
        $result .= '</script>';
        $result .= '
<!-- copyright

Rich Editor, Version 2.1
Copyright (c) 2002-2006 V. Smolin All rights reserved.
http://www.richarea.com
re@richarea.com

copyright -->
    ';
        return $result;
    }
Esempio n. 2
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('Link');
$uploading = $rich_lang->item('Uploading');
?>
<html>
<head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<link rel="StyleSheet" type="text/css" href="rich.css">

<script language="JavaScript" src="rich_dialog.js?yyyyyyyy"></script>

<script  language="JavaScript">

  rich_path = ''; //path to directory with editor files, here - current directory
Esempio n. 3
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('Image');
$align = $rich_lang->item('Align');
$uploading = $rich_lang->item('Uploading');
?>
<html>
<head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<link rel="StyleSheet" type="text/css" href="rich.css">

<script language="JavaScript" src="rich_dialog.js?aaa"></script>

<script  language="JavaScript">

  rich_path = ''; //path to directory with editor files, here - current directory
Esempio n. 4
0
<?php

$class_path = '../../';
//language class
require_once 'class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang, false);
//text data in current language
?>
<HTML>

<HEAD>
    <TITLE>Rich Editor Help</TITLE>

    <META name="Copyright" content="Copyright (c) 2002-2004 Vyacheslav Smolin">
    <META http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<STYLE type="text/css">
.help_tips{
  font-family: "Verdana";
  font-size: xx-small;
}
.help_text p,div{
  font-family: "Verdana";
  font-size: x-small;
}
td.help_action{
Esempio n. 5
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('Table');
$cell_text = $rich_lang->item('TableCell');
$align = $rich_lang->item('TextAlign');
$valign = $rich_lang->item('vAlign');
if (!isset($browser)) {
    $browser = '';
}
if ($browser == 'ns') {
    $postfix = '_ns';
} else {
    $postfix = '';
}
if (!isset($tab) || $tab == '') {
    $tab = 'table';
}
?>
<html><head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
Esempio n. 6
0
<?php

if (isset($_GET['re_session_id'])) {
    session_id($_GET['re_session_id']);
}
@(include 'check_auth.inc.php');
@(include 're_common_lib.inc.php');
//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
@extract($_POST);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('RemoteFiles');
if (isset($action)) {
    if (isset($file)) {
        $file = stripslashes($file);
    } else {
        $file = '';
    }
    if (isset($del_path)) {
        $del_path = stripslashes($del_path);
    } else {
        $del_path = '';
    }
    if (isset($name)) {
        $name = stripslashes($name);
    } else {
        $name = '';
    }
Esempio n. 7
0
    function draw()
    {
        global $class_path;
        global $rich_flag;
        global $rich_lang;
        $files_path = $this->files_path;
        if ($this->absolute_path) {
            $this->files_path = $files_path;
        } else {
            $this->files_path = $files_path;
        }
        //$_SERVER['DOCUMENT_ROOT'].
        //name of textarea element for sending text from form
        $name_area = $this->name;
        $name = $this->name . "_ed";
        //editor name
        $name_id = $name . "_id";
        //id of editor element
        //text data in current language
        $lang = new rich_lang($this->settings['lang'], false);
        if ($this->caption) {
            $editor_string .= $this->caption . ":<br>";
        }
        $user_agent = @$_SERVER["HTTP_USER_AGENT"];
        if (!$user_agent) {
            $user_agent = $GLOBALS["HTTP_USER_AGENT"];
        }
        //$is_msie == true, if current brouser is MSIE
        if (ereg("MSIE ([0-9|\\.]+)", $user_agent, $regs) && ereg("Win", $user_agent)) {
            $is_msie = true;
            $msie_version = (double) $regs[1];
        } else {
            $is_msie = false;
        }
        $value = $this->value;
        if (!$this->page_mode && $is_msie) {
            $value = '<body>' . $value . '</body>';
        }
        $this->value = htmlspecialchars($value);
        if (!$rich_flag) {
            $editor_string .= '<iFrame id="rich_fs_iframe" style="display:none;z-index:999"></iFrame>';
        }
        $editor_string .= '<!-- editor body -->

<div id="' . $name . '_div_id" name="rich_table">
<table id="' . $name . '_table_id" border="1" cellspacing="0" cellpadding="0" width="' . $this->width . '" height="' . $this->height . '">
';
        if ($is_msie) {
            $editor_string .= '<tr><td>

<!-- toolbar -->
<table bgcolor="buttonface" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr onmousedown="mouse_down(true);" onmouseup="mouse_down(false);" onmouseover="mouse_over(true);" onmouseout="mouse_over(false);" ondragstart="return false;"><td class="toolbar">
      ';
            if ($this->is_visible('fullscreen') && $msie_version >= 5.5 || $this->is_visible('preview')) {
                if ($this->is_visible('fullscreen') && $msie_version >= 5.5) {
                    $editor_string .= '
  <img id="FullScreen_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'FullScreen\');" alt="' . $lang->item('FullScreen') . '" src="' . $class_path . 'rich_files/images/fullscreen.gif" align="absMiddle" width="20" height="20">
</nobr>';
                }
                if ($this->is_visible('preview')) {
                    $editor_string .= '
  <img id="Preview_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'Preview\')" alt="' . $lang->item('Preview') . '" src="' . $class_path . 'rich_files/images/preview.gif" align="absMiddle" width="20" height="20">
</nobr>';
                }
                $editor_string .= '
</nobr>
        ';
            }
            if ($this->is_visible('clipboard')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
      ';
                $editor_string .= '
<nobr>
  <img id="Cut_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Cut\')" alt="' . $lang->item('Cut') . '" src="' . $class_path . 'rich_files/images/cut.gif" align="absMiddle" width="20" height="20">
  <img id="Copy_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Copy\')" alt="' . $lang->item('Copy') . '" src="' . $class_path . 'rich_files/images/copy.gif" align="absMiddle" width="20" height="20">
  <img id="Paste_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Paste\')" alt="' . $lang->item('Paste') . '" src="' . $class_path . 'rich_files/images/paste.gif" align="absMiddle" width="20" height="20">
</nobr>
        ';
            }
            if ($this->is_visible('history')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="Undo_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Undo\')" alt="' . $lang->item('Undo') . '" src="' . $class_path . 'rich_files/images/undo.gif" align="absMiddle" width="20" height="20">
  <img id="Redo_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Redo\')" alt="' . $lang->item('Redo') . '" src="' . $class_path . 'rich_files/images/redo.gif" align="absMiddle" width="20" height="20">
</nobr>
        ';
            }
            if ($this->is_visible('text')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="Bold_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Bold\')" alt="' . $lang->item('Bold') . '" src="' . $class_path . 'rich_files/images/bold.gif" align="absMiddle" width="20" height="20">
  <img id="Italic_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Italic\')" alt="' . $lang->item('Italic') . '" src="' . $class_path . 'rich_files/images/italic.gif" align="absMiddle" width="20" height="20">
  <img id="Underline_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Underline\')" alt="' . $lang->item('Underline') . '" src="' . $class_path . 'rich_files/images/underline.gif" align="absMiddle" width="20" height="20">
  <img id="Strikethrough_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Strikethrough\')" alt="' . $lang->item('Strikethrough') . '" src="' . $class_path . 'rich_files/images/strikethrough.gif" align="absMiddle" width="20" height="20">
</nobr>
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="SuperScript_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'SuperScript\')" alt="' . $lang->item('SuperScript') . '" src="' . $class_path . 'rich_files/images/superscript.gif" align="absMiddle" width="20" height="20">
  <img id="SubScript_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'SubScript\')" alt="' . $lang->item('SubScript') . '" src="' . $class_path . 'rich_files/images/subscript.gif" align="absMiddle" width="20" height="20">
</nobr>
        ';
            }
            if ($this->is_visible('align')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="JustifyLeft_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'JustifyLeft\')" alt="' . $lang->item('JustifyLeft') . '" src="' . $class_path . 'rich_files/images/left.gif" align="absMiddle" width="20" height="20">
  <img id="JustifyCenter_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'JustifyCenter\')" alt="' . $lang->item('JustifyCenter') . '" src="' . $class_path . 'rich_files/images/center.gif" align="absMiddle" width="20" height="20">
  <img id="JustifyRight_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'JustifyRight\')" alt="' . $lang->item('JustifyRight') . '" src="' . $class_path . 'rich_files/images/right.gif" align="absMiddle" width="20" height="20">
  <img id="JustifyFull_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'JustifyFull\')" alt="' . $lang->item('JustifyFull') . '" src="' . $class_path . 'rich_files/images/justify.gif" align="absMiddle" width="20" height="20">
</nobr>
        ';
            }
            if ($this->is_visible('list') || $this->is_visible('indent')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
        ';
                if ($this->is_visible('list')) {
                    $editor_string .= '
  <img id="InsertOrderedList_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertOrderedList\')" alt="' . $lang->item('InsertOrderedList') . '" src="' . $class_path . 'rich_files/images/numlist.gif" align="absMiddle" width="20" height="20">
  <img id="InsertUnorderedList_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertUnorderedList\')" alt="' . $lang->item('InsertUnorderedList') . '" src="' . $class_path . 'rich_files/images/bullist.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('indent')) {
                    $editor_string .= '
  <img id="Outdent_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Outdent\')" alt="' . $lang->item('Outdent') . '" src="' . $class_path . 'rich_files/images/outdent.gif" align="absMiddle" width="20" height="20">
  <img id="Indent_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'Indent\')" alt="' . $lang->item('Indent') . '" src="' . $class_path . 'rich_files/images/indent.gif" align="absMiddle" width="20" height="20">
          ';
                }
                $editor_string .= '
</nobr>
        ';
            }
            if ($this->is_visible('hr') || $this->is_visible('remove_format')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
        ';
                if ($this->is_visible('hr')) {
                    $editor_string .= '
  <img id="InsertHorizontalRule_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertHorizontalRule\')" alt="' . $lang->item('InsertHorizontalRule') . '" src="' . $class_path . 'rich_files/images/h_line.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('remove_format')) {
                    $editor_string .= '
  <img id="RemoveFormat_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'RemoveFormat\')" alt="' . $lang->item('RemoveFormat') . '" src="' . $class_path . 'rich_files/images/rem_format.gif" align="absMiddle" width="20" height="20">
          ';
                }
                $editor_string .= '
</nobr>
          ';
            }
            if ($this->is_visible('table')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="CreateTable_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateTable\')" alt="' . $lang->item('CreateTable') . '" src="' . $class_path . 'rich_files/images/table.gif" align="absMiddle" width="20" height="20">
  <img id="InsertRow_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertRow\')" alt="' . $lang->item('InsertRow') . '" src="' . $class_path . 'rich_files/images/insrow.gif" align="absMiddle" width="20" height="20">
  <img id="DeleteRow_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'DeleteRow\')" alt="' . $lang->item('DeleteRow') . '" src="' . $class_path . 'rich_files/images/delrow.gif" align="absMiddle" width="20" height="20">
  <img id="InsertColumn_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertColumn\')" alt="' . $lang->item('InsertColumn') . '" src="' . $class_path . 'rich_files/images/inscol.gif" align="absMiddle" width="20" height="20">
  <img id="DeleteColumn_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'DeleteColumn\')" alt="' . $lang->item('DeleteColumn') . '" src="' . $class_path . 'rich_files/images/delcol.gif" align="absMiddle" width="20" height="20">
</nobr>
          ';
            }
            if ($this->is_visible('table') && $this->is_visible('adv_table')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="InsertCell_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertCell\')" alt="' . $lang->item('InsertCell') . '" src="' . $class_path . 'rich_files/images/inscell.gif" align="absMiddle" width="20" height="20">
  <img id="DeleteCell_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'DeleteCell\')" alt="' . $lang->item('DeleteCell') . '" src="' . $class_path . 'rich_files/images/delcell.gif" align="absMiddle" width="20" height="20">
  <img id="MergeCells_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'MergeCells\')" alt="' . $lang->item('MergeCells') . '" src="' . $class_path . 'rich_files/images/mergecells.gif" align="absMiddle" width="20" height="20">
  <img id="SplitCell_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'SplitCell\')" alt="' . $lang->item('SplitCell') . '" src="' . $class_path . 'rich_files/images/splitcell.gif" align="absMiddle" width="20" height="20">
</nobr>
          ';
            }
            if ($this->is_visible('form')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="CreateForm_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateForm\')" alt="' . $lang->item('CreateForm') . '" src="' . $class_path . 'rich_files/images/form.gif" align="absMiddle" width="20" height="20">
  <img id="CreateText_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateText\')" alt="' . $lang->item('CreateText') . '" src="' . $class_path . 'rich_files/images/text.gif" align="absMiddle" width="20" height="20">
  <img id="CreateTextArea_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateTextArea\')" alt="' . $lang->item('CreateTextArea') . '" src="' . $class_path . 'rich_files/images/textarea.gif" align="absMiddle" width="20" height="20">
  <img id="CreateButton_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateButton\')" alt="' . $lang->item('CreateButton') . '" src="' . $class_path . 'rich_files/images/button.gif" align="absMiddle" width="20" height="20">
  <img id="CreateHidden_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateHidden\')" alt="' . $lang->item('CreateHidden') . '" src="' . $class_path . 'rich_files/images/hidden.gif" align="absMiddle" width="20" height="20">
  <img id="CreateCheckBox_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateCheckBox\')" alt="' . $lang->item('CreateCheckBox') . '" src="' . $class_path . 'rich_files/images/checkbox.gif" align="absMiddle" width="20" height="20">
  <img id="CreateRadio_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateRadio\')" alt="' . $lang->item('CreateRadio') . '" src="' . $class_path . 'rich_files/images/radio.gif" align="absMiddle" width="20" height="20">
</nobr>
          ';
            }
            if ($this->is_visible('paragraph')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <span class="rich_text">' . $lang->item('FormatBlock') . ':</span>
<select class="rich_text" id="FormatBlock_' . $name . '" onchange="active_rich = ' . $name_id . '; do_action(\'FormatBlock\',this)">';
                if (1 || $msie_version < 6) {
                    $editor_string .= '
  <option value="<P>">Normal (P)</option>
  <option value="<H1>">Heading 1 (H1)</option>
  <option value="<H2>">Heading 2 (H2)</option>
  <option value="<H3>">Heading 3 (H3)</option>
  <option value="<H4>">Heading 4 (H4)</option>
  <option value="<H5>">Heading 5 (H5)</option>
  <option value="<H6>">Heading 6 (H6)</option>
  <option value="<PRE>">Preformatted (PRE)</option>';
                } else {
                    $editor_string .= '
  <option value="Normal">Normal (P)</option>
  <option value="Heading 1">Heading 1 (H1)</option>
  <option value="Heading 2">Heading 2 (H2)</option>
  <option value="Heading 3">Heading 3 (H3)</option>
  <option value="Heading 4">Heading 4 (H4)</option>
  <option value="Heading 5">Heading 5 (H5)</option>
  <option value="Heading 6">Heading 6 (H6)</option>
  <option value="Formatted">Preformatted (PRE)</option>';
                }
                $editor_string .= '
</select>
</nobr>
        ';
            }
            if ($this->is_visible('font')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <span class="rich_text">' . $lang->item('FontName') . ':</span>
<select class="rich_text" id="FontName_' . $name . '" onchange="active_rich = ' . $name_id . '; do_action(\'FontName\',this)">
  <option value="Arial">Arial</option>
  <option value="Arial Black">Arial Black</option>
  <option value="Garamond">Garamond</option>
  <option value="Comic Sans MS">Comic Sans MS</option>
  <option value="Courier">Courier</option>
  <option value="Courier New">Courier New</option>
  <option value="Symbol">Symbol</option>
  <option value="Times New Roman" selected>Times New Roman</option>
  <option value="Verdana">Verdana</option>
  <option value="Webdings">Webdings</option>
  <option value="Wingdings">Wingdings</option>
</select>
</nobr>
        ';
            }
            if ($this->is_visible('style')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <span class="rich_text">' . $lang->item('ClassName') . ':</span>
<select class="rich_text" id="ClassName_' . $name . '" onchange="active_rich = ' . $name_id . '; do_action(\'ClassName\',this)" onmouseenter="active_rich = ' . $name_id . '; set_stylesheet_rules();">
  <option value=""></option>
</select>
</nobr>
        ';
            }
            if ($this->is_visible('size')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <span class="rich_text">' . $lang->item('FontSize') . ':</span>
<select class="rich_text" id="FontSize_' . $name . '" onchange="active_rich = ' . $name_id . '; do_action(\'FontSize\',this)">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3" selected>3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
</select>
</nobr>
        ';
            }
            if ($this->is_visible('color')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <img id="ForeColor_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'ForeColor\')" alt="' . $lang->item('ForeColor') . '" src="' . $class_path . 'rich_files/images/fgcolor.gif" align="absMiddle" width="20" height="20">
  <img id="BackColor_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'BackColor\')" alt="' . $lang->item('BackColor') . '" src="' . $class_path . 'rich_files/images/bgcolor.gif" align="absMiddle" width="20" height="20">
</nobr>
        ';
            }
            if ($this->is_visible('image') || $this->is_visible('flash') || $this->is_visible('link')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
        ';
                if ($this->is_visible('image')) {
                    $editor_string .= '
  <img id="CreateImage_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateImage\')" alt="' . $lang->item('CreateImage') . '" src="' . $class_path . 'rich_files/images/image.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('flash')) {
                    $editor_string .= '
  <img id="CreateFlash_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateFlash\')" alt="' . $lang->item('CreateFlash') . '" src="' . $class_path . 'rich_files/images/flash.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('link')) {
                    $editor_string .= '
  <img id="CreateLink_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateLink\')" alt="' . $lang->item('CreateLink') . '" src="' . $class_path . 'rich_files/images/link.gif" align="absMiddle" width="20" height="20">
          ';
                }
                $editor_string .= '
</nobr>
        ';
            }
            if ($this->is_visible('paste_word') || $this->is_visible('switch_borders') || $this->is_visible('special_chars') || $this->is_visible('snippets') || $this->page_mode && $this->is_visible('page_properties')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
        ';
                if ($this->is_visible('paste_word')) {
                    $editor_string .= '
  <img id="PasteWord_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'PasteWord\')" alt="' . $lang->item('PasteWord') . '" src="' . $class_path . 'rich_files/images/paste_word.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('switch_borders')) {
                    $editor_string .= '
  <img id="SwitchBorders_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'SwitchBorders\')" alt="' . $lang->item('SwitchBorders') . '" src="' . $class_path . 'rich_files/images/borders.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->is_visible('special_chars')) {
                    $editor_string .= '
  <img id="InsertChar_' . $name . '" onclick="active_rich = ' . $name_id . '; do_action(\'InsertChar\')" alt="' . $lang->item('InsertChar') . '" src="' . $class_path . 'rich_files/images/inschar.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->snippets && $this->is_visible('snippets')) {
                    $editor_string .= '
  <img id="InsertSnippet_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'InsertSnippet\')" alt="' . $lang->item('InsertSnippet') . '" src="' . $class_path . 'rich_files/images/snippet.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if ($this->page_mode && $this->is_visible('page_properties')) {
                    $editor_string .= '
  <img id="PageProterties_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'PageProperties\')" alt="' . $lang->item('PageProperties') . '" src="' . $class_path . 'rich_files/images/page.gif" align="absMiddle" width="20" height="20">
          ';
                }
                if (isset($cms_curr_user) && $cms_curr_user && $cms_curr_user->id) {
                    $editor_string .= '<img onclick="active_rich = ' . $name_id . '; show_dialog(\'CreateBlock\')" alt="Create Block" src="' . $class_path . 'rich_files/images/block.gif" align="absMiddle" width="20" height="20">';
                }
                $editor_string .= '
</nobr>
        ';
            }
            if ($this->is_visible('help')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
      ';
                $editor_string .= '
  <img id="Help_' . $name . '" onclick="active_rich = ' . $name_id . '; show_dialog(\'Help\')" alt="' . $lang->item('Help') . '" src="' . $class_path . 'rich_files/images/help.gif" align="absMiddle" width="20" height="20">
</nobr>';
            }
            if ($this->is_visible('source')) {
                $editor_string .= '
<nobr>
  <span class="delimiter"></span><span class="space"></span>
  <span class="rich_text">' . $lang->item('Source') . ':</span><input type="checkbox" name="edit_mode" onClick="active_rich = ' . $name_id . '; change_mode();">
</nobr>
      ';
            }
            $editor_string .= '

</td></tr>
</table>
<!-- toolbar -->

</td></tr>';
        }
        $editor_string .= '

<tr><td height="100%">

<!-- text -->
';
        if ($is_msie) {
            $editor_string .= '<iframe class="editor" name="' . $name . '" id="' . $name_id . '" style="border: black thin; width:100%; height:100%">&nbsp;</iframe>';
        }
        $editor_string .= '

<textarea name="' . $name_area . '" id="' . $name . '_area_id" rows="20" cols="60" style="';
        if ($is_msie) {
            $editor_string .= 'display:none; ';
        }
        $editor_string .= 'border: black thin; height=' . $this->height . '; width=' . $this->width . '">' . $this->value . '</textarea>
<!-- text -->

</td></tr>
</table>
</div>
<!-- editor body -->
';
        if ($is_msie) {
            if (!$rich_flag) {
                $editor_string .= '<iframe id="rich_temp_iframe" style="width:1; height:1;">&nbsp;</iframe>';
            }
            $editor_string .= '

<script language="javascript">
	var ' . $name . '_area_id = document.all.' . $name . '_area_id;

	' . $name . '_id.document.designMode = "On";

	' . $name . '_id.document.open();
	' . $name . '_id.document.write(' . $name . '_area_id.value);
	' . $name . '_id.document.close();

	' . $name . '_id.document.body.dir = "' . $lang->item('Direction') . '";
	var ' . $name . '_rich_dir = "' . $lang->item('Direction') . '";
	var ' . $name . '_rich_mb = "' . $lang->item('Multibyte') . '";

	var ' . $name . '_rich_css = Array();
      ';
            //draw stylesheet loading code
            if ($this->default_stylesheet) {
                $editor_string .= "\n";
                foreach ($this->default_stylesheet as $k => $val) {
                    $editor_string .= $name . '_id.document.createStyleSheet("' . $val . '");' . "\n";
                    $editor_string .= $name . '_rich_css[' . $k . '] = "' . $val . '";' . "\n";
                }
            }
            if (!$rich_flag) {
                $editor_string .= '
      var rich_msie_version = "' . $msie_version . '";
        ';
                //url of root dir of site
                if (@$_SERVER['HTTPS'] == "on") {
                    $base_url = "https";
                } else {
                    $base_url = "http";
                }
                $base_url .= '://' . $_SERVER["HTTP_HOST"];
                $editor_string .= '
  var rich_base_url = "' . $base_url . '";
		';
            }
            $editor_string .= '

  active_rich = ' . $name_id . ';';
            if ($this->is_visible('style')) {
                $editor_string .= 'set_stylesheet_rules();';
            }
            $editor_string .= '
  add_handlers(' . $name_id . ');

  ' . $name . '_rich_mode = true;
  ' . $name . '_rich_page_mode = ' . (int) $this->page_mode . ';
  ' . $name . '_rich_border_mode = false;
  ' . $name . '_rich_active_mode = ' . (int) $this->settings[active_tb] . ';
  ' . $name . '_prev_is_control = null;
  ' . $name . '_rich_full_screen_mode = false;
  ' . $name . '_rich_absolute_path = ' . (int) $this->absolute_path . ';

  ' . $name . '_lang = "' . $this->settings['lang'] . '";
  ' . $name . '_files_path = "' . $this->files_path . '";
  ' . $name . '_files_url = "' . $this->files_url . '";';
            //draw snippets
            $editor_string .= "\n\n" . '  var ' . $name . '_snippets = new Array();' . "\n";
            if ($this->snippets && $this->is_visible('snippets')) {
                foreach ($this->snippets as $k => $val) {
                    $snippet_name = str_replace("'", "\\'", $val[name]);
                    $snippet_code = str_replace("'", "\\'", $val[code]);
                    $editor_string .= '  ' . $name . '_snippets[' . $k . '] = Array(\'' . $snippet_name . '\', \'' . $snippet_code . '\');' . "\n";
                }
            }
            $lang_name = $this->settings['lang'];
            if (!isset($rich_lang[$lang_name])) {
                $rich_lang[$lang_name] = true;
                //context menu data
                $cx_name = 'rich_cx_' . $lang_name;
                $editor_string .= "\nvar rich_cx_item_{$lang_name} = Array('InsertRow', 'DeleteRow', 'InsertColumn',\n\t\t\t\t\t\t'DeleteColumn', 'InsertCell', 'DeleteCell');\nvar rich_cx_name_{$lang_name} = Array('" . $lang->item('InsertRow') . "', '" . $lang->item('DeleteRow') . "', '" . $lang->item('InsertColumn') . "',\n\t\t\t\t\t\t'" . $lang->item('DeleteColumn') . "', '" . $lang->item('InsertCell') . "', '" . $lang->item('DeleteCell') . "');\nvar rich_cx_image_{$lang_name} = Array('insrow', 'delrow', 'inscol',\n\t\t\t\t\t\t'delcol', 'inscell', 'delcell');\nvar rich_cx_length_{$lang_name} = rich_cx_item_" . $lang_name . ".length;\nvar {$cx_name} = Array();\n" . $cx_name . "['TABLE'] = Array('" . $lang->item('EditTable') . "', 'CreateTable', 'table');\n" . $cx_name . "['IMG'] = Array('" . $lang->item('EditImage') . "', 'CreateImage', 'image');\n" . $cx_name . "['OBJECT'] = Array('" . $lang->item('EditFlash') . "', 'CreateFlash', 'flash');\n" . $cx_name . "['HIDDEN'] = Array('" . $lang->item('EditHidden') . "', 'CreateHidden', 'hidden');\n" . $cx_name . "['TEXT'] = " . $cx_name . "['PASSWORD'] =\nArray('" . $lang->item('EditText') . "', 'CreateText', 'text');\n" . $cx_name . "['BUTTON'] = " . $cx_name . "['RESET'] = " . $cx_name . "['SUBMIT'] =\nArray('" . $lang->item('EditButton') . "', 'CreateButton', 'button');\n" . $cx_name . "['CHECKBOX'] = Array('" . $lang->item('EditCheckBox') . "', 'CreateCheckBox', 'checkbox');\n" . $cx_name . "['RADIO'] = Array('" . $lang->item('EditButton') . "', 'CreateRadio', 'radio');\n" . $cx_name . "['TEXTAREA'] = Array('" . $lang->item('EditTextArea') . "', 'CreateTextArea', 'textarea');\n" . $cx_name . "['CUT'] = '" . $lang->item('Cut') . "';\n" . $cx_name . "['COPY'] = '" . $lang->item('Copy') . "';\n" . $cx_name . "['PASTE'] = '" . $lang->item('Paste') . "';\n" . $cx_name . "['PASTEWORD'] = '" . $lang->item('PasteWord') . "';\n" . $cx_name . "['ADDIMAGE'] = '" . $lang->item('CreateImage') . "';\n" . $cx_name . "['ADDLINK'] = '" . $lang->item('CreateLink') . "';\n" . $cx_name . "['EDITLINK'] = '" . $lang->item('EditLink') . "';\n" . $cx_name . "['ADDFLASH'] = '" . $lang->item('CreateFlash') . "';\n" . $cx_name . "['EDITFORM'] = '" . $lang->item('EditForm') . "';\n" . $cx_name . "['ADDTABLE'] = '" . $lang->item('CreateTable') . "';\n" . $cx_name . "['EDITCELL'] = '" . $lang->item('EditCell') . "';\n" . $cx_name . "['MERGE'] = '" . $lang->item('MergeCells') . "';\n" . $cx_name . "['SPLIT'] = '" . $lang->item('SplitCell') . "';\n\t\t";
            }
        }
        if ($is_msie) {
            if (!$rich_flag) {
                $editor_string .= '
/* copyright

Rich Editor, Version 1.6
Copyright (c) 2002-2003 V. Smolin All rights reserved.
http://www.chel.tv/rich/
smolin@chel.tv

copyright */
        ';
                $editor_string .= '
	  rich_temp_iframe.document.designMode = "On";

	  var rich_path = "' . $class_path . 'rich_files/";

        ';
                $editor_string .= 'var rich_popup = ';
                if ($msie_version >= 5.5) {
                    $editor_string .= 'window.createPopup();
          ';
                } else {
                    $editor_string .= 'null;
          ';
                }
                $rich_flag = true;
            }
        }
        $editor_string .= '</script>';
        return $editor_string;
    }
Esempio n. 8
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('Flash');
$align = $rich_lang->item('Align');
?>
<html>
<head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<link rel="StyleSheet" type="text/css" href="rich.css">

<script language="JScript.Encode" src="rich.js"></script>

<script  language="JavaScript">

  var rich_path = ''; //path to directory with editor files, here - current directory
Esempio n. 9
0
<?php

if (isset($_GET['re_session_id'])) {
    session_id($_GET['re_session_id']);
}
@(include 'check_auth.inc.php');
@(include 're_common_lib.inc.php');
//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
@extract($_POST);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('LocalFiles');
$rem_text = $rich_lang->item('RemoteFiles');
if (isset($action) && $action == "upload_file" && $re_set_can_upload) {
    $uploaded = false;
    //check if have permissions to make any action
    if (!$re_set_avail_paths) {
        $avail = true;
    } else {
        $avail = false;
        foreach ($re_set_avail_paths as $key => $val) {
            $pos = strpos($files_path, $val);
            if ($pos !== false && $pos == 0) {
                $avail = true;
                break;
            }
        }
    }
Esempio n. 10
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
if (!isset($browser)) {
    $browser = '';
}
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('CharacterMap');
$chars[1] = array('nbsp', 'euro', 'fnof', 'permil', 'Scaron', 'OElig', '#381', 'trade', 'scaron', 'oelig', '#382', 'Yuml', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'nbsp; &shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml');
$chars[2] = array('Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'there4', 'perp', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'oline', 'le', 'frasl', 'infin', 'int', 'clubs', 'diams', 'hearts', 'spades', 'harr', 'larr', 'rarr', 'uarr', 'darr', 'ldquo', 'rdquo', 'bdquo', 'ge', 'prop', 'part', 'bull', 'ne', 'equiv', 'asymp', 'hellip', 'mdash', 'cap', 'cup', 'sup', 'supe', 'sub', 'sube', 'isin', 'ni', 'forall', 'exist', 'lsquo', 'rsquo', 'iexcl', 'ang', 'nabla', 'prod', 'radic', 'and', 'or', 'hArr', 'rArr', 'loz', 'sum');
?>
<html>
<head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<link rel="StyleSheet" type="text/css" href="rich<?php 
echo $browser == 'ns' ? '_ns' : '';
?>
.css">
Esempio n. 11
0
<?php

//language class
require_once 'lang/class.rich_lang.php';
//extract variables submitted to this page
@extract($_GET);
$rich_lang = new rich_lang($lang);
//text data in current language
$text = $rich_lang->item('ColorPicker');
?>
<html>
<head>
<title><?php 
echo $text['Title'];
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $rich_lang->item("Charset");
?>
">

<link rel="StyleSheet" type="text/css" href="rich_ns.css">

<script language="JavaScript" src="rich_dialog_ns.js"></script>

<script language="JavaScript">
function select_color(e){
var td;

  element = e.target;