/** * visualize differences for some attribute * * @param string name of the target attribute * @param string previous value * @return string HTML showing differences */ function &diff($name, $value) { global $context; // previous text $value = Codes::beautify($value); // target attribute does not exist if (!isset($this->item[$name])) { $output = '<ins>' . $value . '</ins>'; return $output; } // current text $current = Codes::beautify($this->item[$name]); // highlight differences include_once $context['path_to_root'] . 'scripts/scripts.php'; $output =& Scripts::hdiff($value, $current); return $output; }