diff options
| -rw-r--r-- | admin/admin_liberty_inc.php | 2 | ||||
| -rw-r--r-- | content_history_inc.php | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/admin/admin_liberty_inc.php b/admin/admin_liberty_inc.php index 0b9690a..205b1ac 100644 --- a/admin/admin_liberty_inc.php +++ b/admin/admin_liberty_inc.php @@ -22,7 +22,7 @@ $formLibertyFeatures = array( ), "liberty_inline_diff" => array( 'label' => 'Use Inline Diff', - 'note' => 'Use inline diff tool when diffing revisions instead of the line based unified diff tool. This is particularly useful when using a WYSIWYG editor which tends to put things all on one line. Note that this diff can take advantage of the PECL xdiff package for speed if you have that installed.', + 'note' => 'Uses PEAR Text_Wiki, which is installed with the command pear install Text_Wiki, for an inline diff of revisions instead of the line based unified diff tool. This is particularly useful when using a WYSIWYG editor which tends to put things all on one line. Note that this diff can take advantage of the PECL xdiff package for speed if you have that installed.', ), ); diff --git a/content_history_inc.php b/content_history_inc.php index 49e1049..45d397a 100644 --- a/content_history_inc.php +++ b/content_history_inc.php @@ -30,13 +30,17 @@ if (isset($_REQUEST["delete"]) && isset($_REQUEST["hist"])) { $to_version = $gContent->mInfo["version"]; $to_lines = explode("\n",$gContent->mInfo["data"]); - if ( $gBitSystem->isFeatureActive('liberty_inline_diff') ) { - include_once( UTIL_PKG_PATH.'pear/Text/Diff/Diff.php' ); - include_once( UTIL_PKG_PATH.'pear/Text/Diff/Diff/Renderer.php' ); - include_once( UTIL_PKG_PATH.'pear/Text/Diff/Diff/Renderer/inline.php' ); - $diff = &new Text_Diff($from_lines,$to_lines); - $renderer = &new Text_Diff_Renderer_inline(); - $html = $renderer->render($diff); + /** + * run 'pear install Text_Diff' to install the library, + */ + require_once('PEAR.php'); + + if( $gBitSystem->isFeatureActive('liberty_inline_diff') && + @include_once( 'Text/Diff.php' ) ) { + include_once( 'Text/Diff/Renderer/inline.php' ); + $diff = &new Text_Diff($from_lines,$to_lines); + $renderer = &new Text_Diff_Renderer_inline(); + $html = $renderer->render($diff); } else { include_once( UTIL_PKG_PATH.'diff.php'); |
