Ejemplo n.º 1
0
 /**
  * Formatted text processing.
  * @param string Event name
  * @param string Unformatted text
  * @param boolean Multiline text
  * @return multi Array with formatted text and multiline paramater
  */
 function formatted($p_event, $p_string, $p_multiline = true)
 {
     static $s_text, $s_urls, $s_buglinks;
     $t_string = $p_string;
     if (null === $s_text) {
         $s_text = plugin_config_get('process_text');
         $s_urls = plugin_config_get('process_urls');
         $s_buglinks = plugin_config_get('process_buglinks');
     }
     if (ON == $s_text) {
         $t_string = string_strip_hrefs($t_string);
         $t_string = string_html_specialchars($t_string);
         $t_string = string_restore_valid_html_tags($t_string, true);
         if ($p_multiline) {
             $t_string = string_preserve_spaces_at_bol($t_string);
             $t_string = string_nl2br($t_string);
         }
     }
     if (ON == $s_urls) {
         $t_string = string_insert_hrefs($t_string);
     }
     if (ON == $s_buglinks) {
         $t_string = string_process_bug_link($t_string);
         $t_string = string_process_bugnote_link($t_string);
     }
     return $t_string;
 }
Ejemplo n.º 2
0
function string_display($p_string)
{
    $p_string = string_strip_hrefs($p_string);
    $p_string = string_html_specialchars($p_string);
    $p_string = string_restore_valid_html_tags($p_string);
    $p_string = string_preserve_spaces_at_bol($p_string);
    $p_string = string_nl2br($p_string);
    return $p_string;
}
Ejemplo n.º 3
0
 /**
  * Plain text processing.
  *
  * @param string  $p_event     Event name
  * @param string  $p_string    Raw text to process
  * @param boolean $p_multiline True for multiline text (default), false for single-line.
  *                             Determines which html tags are used.
  *
  * @return string Formatted text
  *
  * @see $g_html_valid_tags
  * @see $g_html_valid_tags_single_line
  */
 function text($p_event, $p_string, $p_multiline = true)
 {
     static $s_text;
     $t_string = $p_string;
     if (null === $s_text) {
         $s_text = plugin_config_get('process_text');
     }
     if (ON == $s_text) {
         $t_string = string_strip_hrefs($t_string);
         $t_string = string_html_specialchars($t_string);
         $t_string = string_restore_valid_html_tags($t_string, $p_multiline);
         if ($p_multiline) {
             $t_string = string_preserve_spaces_at_bol($t_string);
             $t_string = string_nl2br($t_string);
         }
     }
     return $t_string;
 }
Ejemplo n.º 4
0
function string_prepare_note_for_viewing($p_note_string, $p_url = null)
{
    $p_note_string = htmlspecialchars($p_note_string);
    $p_note_string = string_preserve_spaces_at_bol($p_note_string);
    $p_note_string = string_hyperlink($p_note_string);
    $p_note_string = string_icq_status($p_note_string);
    if (null !== $p_url) {
        $p_note_string = string_add_note_links($p_url, $p_note_string);
    }
    $p_note_string = string_emotions($p_note_string);
    return $p_note_string;
}