Move shortcut functions to framework class
| | |
| | | return rcube_output::json_serialize($input); |
| | | } |
| | | |
| | | function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE) |
| | | function rep_specialchars_output($str, $enctype='', $mode='', $newlines=true) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, $enctype, $mode, $newlines); |
| | | } |
| | | |
| | | function Q($str, $mode='strict', $newlines=TRUE) |
| | | function Q($str, $mode='strict', $newlines=true) |
| | | { |
| | | return rcmail::Q($str, $mode, $newlines); |
| | | return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines); |
| | | } |
| | | |
| | | function JQ($str) |
| | | { |
| | | return rcmail::JQ($str); |
| | | return rcube_utils::rep_specialchars_output($str, 'js'); |
| | | } |
| | | |
| | | function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) |
| | |
| | | |
| | | |
| | | /** |
| | | * Quote a given string. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string HTML-quoted string |
| | | */ |
| | | public static function Q($str, $mode = 'strict', $newlines = true) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Quote a given string for javascript output. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string JS-quoted string |
| | | */ |
| | | public static function JQ($str) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'js'); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns real size (calculated) of the message part |
| | | * |
| | | * @param rcube_message_part Message part |
| | |
| | | |
| | | |
| | | /** |
| | | * Quote a given string. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string HTML-quoted string |
| | | */ |
| | | public static function Q($str, $mode = 'strict', $newlines = true) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Quote a given string for javascript output. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string JS-quoted string |
| | | */ |
| | | public static function JQ($str) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'js'); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Construct shell command, execute it and return output as string. |
| | | * Keywords {keyword} are replaced with arguments |
| | | * |
| | |
| | | break; |
| | | case 'javascript': |
| | | case 'js': |
| | | $label = rcmail::JQ($label); |
| | | $label = rcube::JQ($label); |
| | | break; |
| | | default: |
| | | $label = html::quote($label); |
| | |
| | | $i = $this->add($prefix . html::a(array( |
| | | 'href' => $url_prefix . $url, |
| | | 'target' => '_blank' |
| | | ), rcmail::Q($url)) . $suffix); |
| | | ), rcube::Q($url)) . $suffix); |
| | | } |
| | | |
| | | // Return valid link for recognized schemes, otherwise, return the unmodified string for unrecognized schemes. |
| | |
| | | |
| | | $i = $this->add(html::a(array( |
| | | 'href' => 'mailto:' . $href, |
| | | 'onclick' => "return ".rcmail::JS_OBJECT_NAME.".command('compose','".rcmail::JQ($href)."',this)", |
| | | 'onclick' => "return ".rcmail::JS_OBJECT_NAME.".command('compose','".rcube::JQ($href)."',this)", |
| | | ), rcmail::Q($href)) . $suffix); |
| | | |
| | | return $i >= 0 ? $this->get_replacement($i) : ''; |