From: Michael M Slusarz Date: Wed, 10 Jun 2009 07:37:36 +0000 (-0600) Subject: Text_Filter:: -> Horde_Text_Filter:: X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7ee32238f69e45b2d5f5c37853321505118e530f;p=horde.git Text_Filter:: -> Horde_Text_Filter:: --- diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index fcecc8364..fb0e1c9b5 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -610,9 +610,7 @@ class Chora */ static public function formatLogMessage($log) { - require_once 'Horde/Text/Filter.php'; - - $log = Text_Filter::filter($log, 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'charset' => NLS::getCharset(), 'class' => '')); + $log = Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => NLS::getCharset(), 'class' => '')); return (empty($GLOBALS['conf']['tickets']['regexp']) || empty($GLOBALS['conf']['tickets']['replacement'])) ? $log diff --git a/chora/templates/checkout/checkout.inc b/chora/templates/checkout/checkout.inc index 948a12977..5055aeb05 100644 --- a/chora/templates/checkout/checkout.inc +++ b/chora/templates/checkout/checkout.inc @@ -21,7 +21,7 @@ if (strpos($mime_type, 'text/plain') !== false) { $data = $pretty->render('inline'); $data = reset($data); - echo '
' . Text_Filter::filter($data['data'], 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '
'; + echo '
' . Horde_Text_Filter::filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '
'; } elseif (strpos($mime_type, 'image/') !== false) { echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', ''); } elseif ($pretty->canRender('inline')) { diff --git a/folks/lib/Driver.php b/folks/lib/Driver.php index c76fda31e..ee2800c53 100644 --- a/folks/lib/Driver.php +++ b/folks/lib/Driver.php @@ -350,19 +350,18 @@ class Folks_Driver { } // Filter description - require_once 'Horde/Text/Filter.php'; $filters = array('text2html', 'bbcode', 'highlightquotes', 'emoticons'); - $filters_params = array(array('parselevel' => TEXT_HTML_MICRO), + $filters_params = array(array('parselevel' => Horde_Text_Filter_Text2html::MICRO), array(), array(), array()); if (($hasBBcode = strpos($profile['user_description'], '[')) !== false && strpos($profile['user_description'], '[/', $hasBBcode) !== false) { - $filters_params[0]['parselevel'] = TEXT_HTML_NOHTML; + $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML; } - $profile['user_description'] = Text_Filter::filter(trim($profile['user_description']), $filters, $filters_params); + $profile['user_description'] = Horde_Text_Filter::filter(trim($profile['user_description']), $filters, $filters_params); // Get user last external data foreach ($profile as $key => $value) { diff --git a/folks/lib/Forms/Activity.php b/folks/lib/Forms/Activity.php index 85113c0e0..e031a71b6 100644 --- a/folks/lib/Forms/Activity.php +++ b/folks/lib/Forms/Activity.php @@ -37,19 +37,18 @@ class Folks_Activity_Form extends Horde_Form { return PEAR::raiseError(_("You cannot post an empty activity message.")); } - require_once 'Horde/Text/Filter.php'; $filters = array('text2html', 'bbcode', 'highlightquotes', 'emoticons'); - $filters_params = array(array('parselevel' => TEXT_HTML_MICRO), + $filters_params = array(array('parselevel' => Horde_Text_Filter_Text2html::MICRO), array(), array(), array()); if (($hasBBcode = strpos($message, '[')) !== false && strpos($message, '[/', $hasBBcode) !== false) { - $filters_params[0]['parselevel'] = TEXT_HTML_NOHTML; + $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML; } - $message = Text_Filter::filter(trim($message), $filters, $filters_params); + $message = Horde_Text_Filter::filter(trim($message), $filters, $filters_params); $result = $GLOBALS['folks_driver']->logActivity($message, 'folks:custom'); if ($result instanceof PEAR_Error) { diff --git a/folks/lib/Notification/facebook.php b/folks/lib/Notification/facebook.php index 2a9a4bd55..fbc82bc69 100644 --- a/folks/lib/Notification/facebook.php +++ b/folks/lib/Notification/facebook.php @@ -157,9 +157,7 @@ class Folks_Notification_facebook extends Folks_Notification { */ private function _formatBody($subject, $body) { - require_once 'Horde/Text/Filter.php'; - return '' . $subject . ': ' - . Text_Filter::filter($body, 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL)); + . Horde_Text_Filter::filter($body, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)); } } diff --git a/imp/ajax.php b/imp/ajax.php index a9b900a51..7ddc147eb 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -471,17 +471,15 @@ case 'ShowPreview': break; case 'Html2Text': - require_once 'Horde/Text/Filter.php'; $result = new stdClass; // Need to replace line endings or else IE won't display line endings // properly. - $result->text = str_replace("\n", "\r\n", Text_Filter::filter(Horde_Util::getPost('text'), 'html2text')); + $result->text = str_replace("\n", "\r\n", Horde_Text_Filter::filter(Horde_Util::getPost('text'), 'html2text')); break; case 'Text2Html': - require_once 'Horde/Text/Filter.php'; $result = new stdClass; - $result->text = Text_Filter::filter(Horde_Util::getPost('text'), 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null)); + $result->text = Horde_Text_Filter::filter(Horde_Util::getPost('text'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'class' => null, 'callback' => null)); break; case 'GetForwardData': diff --git a/imp/compose.php b/imp/compose.php index b4e82bfcc..10d6ce1f5 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -60,7 +60,6 @@ $compose_page = true; $session_control = 'netscape'; require_once dirname(__FILE__) . '/lib/base.php'; require_once 'Horde/Identity.php'; -require_once 'Horde/Text/Filter.php'; /* The message text. */ $msg = ''; @@ -683,7 +682,7 @@ if (!is_null($oldrtemode) && ($oldrtemode != $rtemode)) { array('

 

', '

' . $imp_compose->text2html($sig) . '

'), $msg); } else { - $msg = Text_Filter::filter($msg, 'html2text'); + $msg = Horde_Text_Filter::filter($msg, 'html2text'); } } @@ -799,7 +798,7 @@ if (!$redirect) { foreach ($identity->getAllSignatures() as $ident => $sig) { $smf = $identity->getValue('sent_mail_folder', $ident); $js_ident[] = array( - ($rtemode) ? str_replace(' target="_blank"', '', Text_Filter::filter($sig, 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null))) : $sig, + ($rtemode) ? str_replace(' target="_blank"', '', Horde_Text_Filter::filter($sig, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'class' => null, 'callback' => null))) : $sig, $identity->getValue('sig_first', $ident), ($smf_check) ? $smf : IMP::displayFolder($smf), $identity->saveSentmail($ident), diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 0edc508d1..a68974dee 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -917,8 +917,7 @@ class IMP_Compose if (!empty($options['html'])) { $body_html = $body; - require_once 'Horde/Text/Filter.php'; - $body = Text_Filter::filter($body, 'html2text', array('wrap' => false, 'charset' => $charset)); + $body = Horde_Text_Filter::filter($body, 'html2text', array('wrap' => false, 'charset' => $charset)); } /* Get trailer message (if any). */ @@ -934,8 +933,7 @@ class IMP_Compose } if (!empty($trailer_file)) { - require_once 'Horde/Text/Filter.php'; - $trailer = Text_Filter::filter("\n" . file_get_contents($trailer_file), 'environment'); + $trailer = Horde_Text_Filter::filter("\n" . file_get_contents($trailer_file), 'environment'); /* If there is a user defined function, call it with the * current trailer as an argument. */ if (!empty($GLOBALS['conf']['hooks']['trailer'])) { @@ -2213,11 +2211,9 @@ class IMP_Compose } if ($mode == 'html') { - require_once 'Horde/Text/Filter.php'; - $msg = Text_Filter::filter($msg, 'xss', array('body_only' => true, 'strip_styles' => true, 'strip_style_attributes' => false)); + $msg = Horde_Text_Filter::filter($msg, 'xss', array('body_only' => true, 'strip_styles' => true, 'strip_style_attributes' => false)); } elseif ($type == 'text/html') { - require_once 'Horde/Text/Filter.php'; - $msg = Text_Filter::filter($msg, 'html2text', array('charset' => $charset)); + $msg = Horde_Text_Filter::filter($msg, 'html2text', array('charset' => $charset)); $type = 'text/plain'; } @@ -2375,8 +2371,7 @@ class IMP_Compose */ public function text2html($msg) { - require_once 'Horde/Text/Filter.php'; - return Text_Filter::filter($msg, 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null)); + return Horde_Text_Filter::filter($msg, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'class' => null, 'callback' => null)); } /** diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index bbc4cfa1d..0f341fa9d 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -469,9 +469,7 @@ class IMP_Contents $ptext = $pmime->getContents(); $ptext = Horde_String::convertCharset($ptext, $pmime->getCharset()); if ($pmime->getType() == 'text/html') { - require_once 'Horde/Text/Filter.php'; - $ptext = Text_Filter::filter($ptext, 'html2text', - array('charset' => NLS::getCharset())); + $ptext = Horde_Text_Filter::filter($ptext, 'html2text', array('charset' => NLS::getCharset())); } $this->_build = $oldbuild; diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 45b83038f..aa4e38902 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -508,8 +508,7 @@ class IMP global $conf, $prefs; if ($prefs->getValue('filtering') && strlen($text)) { - require_once 'Horde/Text/Filter.php'; - $text = Text_Filter::filter($text, 'words', array('words_file' => $conf['msgsettings']['filtering']['words'], 'replacement' => $conf['msgsettings']['filtering']['replacement'])); + $text = Horde_Text_Filter::filter($text, 'words', array('words_file' => $conf['msgsettings']['filtering']['words'], 'replacement' => $conf['msgsettings']['filtering']['replacement'])); } return $text; diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index f0e70ce52..10dc51979 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -136,8 +136,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html /* We are done processing if in mimp mode. */ if ($_SESSION['imp']['view'] == 'mimp') { - require_once 'Horde/Text/Filter.php'; - $data = Text_Filter::filter($data, 'html2text'); + $data = Horde_Text_Filter::filter($data, 'html2text'); // Filter bad language. return array('html' => IMP::filterText($data), 'status' => array()); @@ -231,9 +230,8 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html } } - require_once 'Horde/Text/Filter.php'; if ($GLOBALS['prefs']->getValue('emoticons')) { - $data = Text_Filter::filter($data, array('emoticons'), array(array('emoticons' => true))); + $data = Horde_Text_Filter::filter($data, array('emoticons'), array(array('emoticons' => true))); } return array( diff --git a/imp/lib/Mime/Viewer/Pgp.php b/imp/lib/Mime/Viewer/Pgp.php index 4d0552542..0656ce4e7 100644 --- a/imp/lib/Mime/Viewer/Pgp.php +++ b/imp/lib/Mime/Viewer/Pgp.php @@ -360,11 +360,10 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver $sig_text = $e->getMessage(); } - require_once 'Horde/Text/Filter.php'; $ret[$base_id]['status'][] = array( 'icon' => $icon, 'text' => array( - Text_Filter::filter($sig_text, 'text2html', array('parselevel' => TEXT_HTML_NOHTML)) + Horde_Text_Filter::filter($sig_text, 'text2html', array('parselevel' => Horde_Text_Filter::Text2html::NOHTML)) ) ); } else { diff --git a/imp/lib/Mime/Viewer/Plain.php b/imp/lib/Mime/Viewer/Plain.php index c1af81d1f..25f9757f3 100644 --- a/imp/lib/Mime/Viewer/Plain.php +++ b/imp/lib/Mime/Viewer/Plain.php @@ -67,10 +67,9 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain } // Build filter stack. Starts with HTML markup and tab expansion. - require_once 'Horde/Text/Filter.php'; $filters = array( 'text2html' => array( - 'parselevel' => TEXT_HTML_MICRO, + 'parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => NLS::getCharset() ), 'tabs2spaces' => array(), @@ -105,7 +104,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain } // Run filters. - $text = Text_Filter::filter($text, array_keys($filters), array_values($filters)); + $text = Horde_Text_Filter::filter($text, array_keys($filters), array_values($filters)); // Wordwrap. $text = str_replace(array(' ', "\n "), array('  ', "\n "), $text); diff --git a/imp/lib/UI/Message.php b/imp/lib/UI/Message.php index b73b6096c..44645afa2 100644 --- a/imp/lib/UI/Message.php +++ b/imp/lib/UI/Message.php @@ -229,8 +229,7 @@ class IMP_UI_Message } break; } else { - require_once 'Horde/Text/Filter.php'; - if ($url = Text_Filter::filter($match, 'linkurls', array('callback' => 'Horde::externalUrl'))) { + if ($url = Horde_Text_Filter::filter($match, 'linkurls', array('callback' => 'Horde::externalUrl'))) { if ($raw) { return $match; } @@ -454,9 +453,7 @@ class IMP_UI_Message */ public function getDisplaySubject($subject) { - require_once 'Horde/Text/Filter.php'; - - return Text_Filter::filter(IMP::filterText($subject), 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => null, 'callback' => null)); + return Horde_Text_Filter::filter(IMP::filterText($subject), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null, 'callback' => null)); } } diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index e33cb2dae..a08dd432f 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -46,14 +46,13 @@ class IMP_Views_Compose } /* Get user identities. */ - require_once 'Horde/Text/Filter.php'; $all_sigs = $identity->getAllSignatures(); foreach ($all_sigs as $ident => $sig) { $identities[] = array( // 0 = Plain text signature $sig, // 1 = HTML signature - str_replace(' target="_blank"', '', Text_Filter::filter($sig, 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null))), + str_replace(' target="_blank"', '', Horde_Text_Filter::filter($sig, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'class' => null, 'callback' => null))), // 2 = Signature location (bool)$identity->getValue('sig_first', $ident), // 3 = Sent mail folder name diff --git a/imp/mailbox.php b/imp/mailbox.php index bcb402db5..a4025fbfe 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -799,8 +799,7 @@ while (list(,$ob) = each($mbox_info['overview'])) { } if (!$preview_tooltip) { - require_once 'Horde/Text/Filter.php'; - $ptext = Text_Filter::filter($ptext, 'text2html', array('parselevel' => TEXT_HTML_NOHTML, 'charset' => '', 'class' => '')); + $ptext = Horde_Text_Filter::filter($ptext, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::NOHTML, 'charset' => '', 'class' => '')); } $maxlen = $prefs->getValue('preview_maxlen'); diff --git a/imp/stationery.php b/imp/stationery.php index 6c3f01d2c..f5e3b8dc5 100644 --- a/imp/stationery.php +++ b/imp/stationery.php @@ -40,8 +40,7 @@ $name = Horde_Util::getFormData('name', ''); $type = Horde_Util::getFormData('type', 'plain'); if (!empty($last_type) && $last_type != $type) { if ($type == 'plain') { - require_once 'Horde/Text/Filter.php'; - $content = Text_Filter::filter($content, 'html2text'); + $content = Horde_Text_Filter::filter($content, 'html2text'); } else { $content = nl2br(htmlspecialchars(htmlspecialchars($content))); } diff --git a/kronolith/lib/Views/Event.php b/kronolith/lib/Views/Event.php index d493ea710..eaad30f35 100644 --- a/kronolith/lib/Views/Event.php +++ b/kronolith/lib/Views/Event.php @@ -39,8 +39,6 @@ class Kronolith_View_Event { return; } - require_once 'Horde/Text/Filter.php'; - $createdby = ''; $modifiedby = ''; $userId = Auth::getAuth(); diff --git a/kronolith/templates/view/view.inc b/kronolith/templates/view/view.inc index e96a7b4a2..e97680f56 100644 --- a/kronolith/templates/view/view.inc +++ b/kronolith/templates/view/view.inc @@ -4,7 +4,7 @@    - TEXT_HTML_MICRO, 'class' => 'text')) ?> + Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?> @@ -141,7 +141,7 @@ if ($this->event->isInitialized() && $this->event->alarm > 0): - TEXT_HTML_MICRO, 'class' => 'text')) ?> + Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?>