*/ /** * patTemplate modifier Wxml2txt * * * Parameter: * * @package patTemplate * @package Modifiers * @author gERD Schaufelberger */ class patTemplate_Modifier_Wxml2txt extends patTemplate_Modifier { /** * modify the value * * @access public * @param string value * @return string modified value */ public function modify($value, $params = array()) { $value = str_replace('

', "

", $value); $value = str_replace('

', "\n\n", $value); $value = strip_tags($value); $lines = explode("\n", $value); $lines = array_map('trim', $lines); $value = implode("\n", $lines); $value = str_replace("\n\n\n", "\n\n", $value); $value = htmlspecialchars_decode($value); $value = wordwrap($value, 72, "\n"); $value = trim($value); return $value; } }