/** * Create an instance of HTML Editor. * * @param string $formid the id of the container form * @param string $textarea_name id of textarea to use * @param string $value initial content of text area * * @return string html for include the htmleditor **/ function loadHtmlEditor($id_form, $id, $name, $value, $css_text, $extra_param_for = false, $simple = false) { if (!isset($GLOBALS["HTML_EDITOR_SETUP"])) { loadHeaderHTMLEditor(); $GLOBALS["HTML_EDITOR_SETUP"] = TRUE; } if (getAccessibilityStatus() === false) { $ht = Get::sett('hteditor'); } else { $ht = 'accesseditor'; } $value = htmlspecialchars($value, ENT_COMPAT); switch ($ht) { //using tiny_mce case 'tinymce': $txt = '<textarea id="' . $id . '" name="' . $name . '" cols="52" rows="7" class="' . ($simple ? 'tinymce_simple' : 'tinymce_complex') . '">' . "\n" . $value . "\n" . '</textarea>' . "\n"; return $txt; break; case 'yui': $txt = '<textarea class="' . $css_text . '" id="' . $id . '" name="' . $name . '" cols="52" rows="7">' . htmlspecialchars($value, ENT_NOQUOTES) . '</textarea>'; $txt .= '<script>var yuiEditor' . $id . ' = new YAHOO.widget.Editor(\'' . $id . '\', { height: \'250px\', width: \'100%\', dompath: true, animate: true }); yuiEditor' . $id . '.render();'; $txt .= 'YAHOO.util.Event.on(yuiEditor' . $id . '.get(\'element\').form, \'submit\', function onSubmitOperation' . $id . '()' . '{' . 'yuiEditor' . $id . '.saveHTML();' . '}' . ', yuiEditor' . $id . ', true);</script>'; return $txt; break; //using normal textarea //using normal textarea case 'accesseditor': default: if (!$css_text) { $css_text = 'textarea'; } return '<textarea class="' . $css_text . '" id="' . $id . '" name="' . $name . '" cols="52" rows="7">' . htmlspecialchars($value, ENT_NOQUOTES) . '</textarea>'; break; } }
/** * @param mixed $type specify wich type of chat to open; if not specified * then the type will be auto-detected. **/ function getOpenChatCommand($open_text, $open_text_wa, $platform, $id_room, $basepath = FALSE, $type = FALSE, $use_room = TRUE) { if ($basepath === FALSE) { $basepath = ""; } if ($type === FALSE) { if (getAccessibilityStatus()) { $chat_type = "accessible"; } else { $chat_type = "default"; } } else { $chat_type = $type; } $use_room = $use_room ? 1 : 0; $out = ''; $url = urlencode($_SERVER["REQUEST_URI"]); switch ($chat_type) { case "default": case "accessible": $link = $basepath; $link .= $GLOBALS['where_scs_relative'] . '/modules/htmlframechat/index.php?sn=' . $platform . '&ri=' . $id_room; //$link.="&use_room=".$use_room; $link .= "&use_room=0"; $link .= "&backurl=" . htmlentities(urlencode($url)); $text = $open_text; break; case "accessible2": $link = $basepath; $link .= $GLOBALS['where_scs_relative'] . '/modules/htmlwachat/index.php?use_room=0&sn=' . $platform . '&ri=' . $id_room; $link .= "&use_room=" . $use_room; $link .= "&backurl=" . htmlentities(urlencode($url)); $text = $open_text_wa; break; } $out .= '<p><a href="' . $link . '" onclick="window.open(\'' . $link . '\', \'DoceboChat\',\'toolbar=no,menubar=no,directories=no\'); return false;" onkeypress="window.open(\'' . $link . '\', \'DoceboChat\',\'toolbar=no,menubar=no,directories=no\'); return false;">' . $text . '</a></p>'; return $out; }
public static function accessibility() { if (getAccessibilityStatus() === false) { return '<style type="text/css">' . "\n" . '.access-only {display: none;}' . "\n" . '</style>' . "\n"; } }