diff options
| author | modela bitweaver <spiderr@bitweaver.org> | 2021-02-02 01:17:09 -0500 |
|---|---|---|
| committer | modela bitweaver <spiderr@bitweaver.org> | 2021-02-02 01:17:09 -0500 |
| commit | 4abf677ae556f0cf7e08d377df1e0ffb9041267a (patch) | |
| tree | 92023c1799a04fe82398beb9436d4e67f7688658 /content_history_inc.php | |
| parent | 8ad7ef38d30923bb0b8cb5bce381dc4ce87052a4 (diff) | |
| download | liberty-4abf677ae556f0cf7e08d377df1e0ffb9041267a.tar.gz liberty-4abf677ae556f0cf7e08d377df1e0ffb9041267a.tar.bz2 liberty-4abf677ae556f0cf7e08d377df1e0ffb9041267a.zip | |
move _inc and _lib to includes/ and use PKG_INCLUDE_PATH constants
Diffstat (limited to 'content_history_inc.php')
| -rw-r--r-- | content_history_inc.php | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/content_history_inc.php b/content_history_inc.php deleted file mode 100644 index d5cb3a6..0000000 --- a/content_history_inc.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php -/** - * @version $Revision$ - * @package liberty - * @subpackage functions - */ - - -$gBitSmarty->assign( 'source', 0 ); -// If we have to include a preview please show it -$gBitSmarty->assign( 'preview', FALSE ); -$gBitSmarty->assign( 'compare', 'n' ); -$gBitSmarty->assign( 'diff2', 'n' ); - -if( isset( $_REQUEST["delete"] ) && isset( $_REQUEST["hist"] )) { - foreach( array_keys( $_REQUEST["hist"] ) as $version ) { - $gContent->expungeVersion( $version ); - } - -} elseif( isset( $_REQUEST['source'] )) { - $gBitSmarty->assign( 'source', $_REQUEST['source'] ); - if( $_REQUEST['source'] == 'current' ) { - $gBitSmarty->assign( 'sourcev', nl2br( htmlentities( $gContent->mInfo["data"] ))); - } else { - $version = $gContent->getHistory( $_REQUEST["source"] ); - $gBitSmarty->assign( 'sourcev', nl2br( htmlentities( $version["data"][0]["data"] ))); - } - -} elseif( @BitBase::verifyId( $_REQUEST["preview"] )) { - if( $version = $gContent->getHistory( $_REQUEST["preview"] )) { - $version['data'][0]['no_cache'] = TRUE; - $version['data'][0]['parsed_data'] = LibertyContent::parseDataHash( $version["data"][0], $gContent ); - $gBitSmarty->assignByRef( $smartyContentRef, $version['data'][0] ); - $gBitSmarty->assignByRef( 'version', $_REQUEST["preview"] ); - } - -} elseif( @BitBase::verifyId( $_REQUEST["diff2"] ) ) { - $from_version = $_REQUEST["diff2"]; - $from_page = $gContent->getHistory( $from_version ); - $from_lines = explode( "\n",$from_page["data"][0]["data"] ); - if( isset( $_REQUEST["diff_to"] ) && $_REQUEST["diff_to"] != $gContent->mInfo["version"] ) { - $to_version = $_REQUEST["diff_to"]; - $to_page = $gContent->getHistory( $to_version ); - $to_lines = explode( "\n",$to_page["data"][0]["data"] ); - } else { - $to_version = $gContent->mInfo["version"]; - $to_lines = explode( "\n",$gContent->mInfo["data"] ); - } - /** - * run 'pear install Text_Diff' to install the library, - */ - 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_INC.'diff.php'); - $diffx = new WikiDiff( $from_lines,$to_lines ); - $fmt = new WikiUnifiedDiffFormatter; - $html = $fmt->format( $diffx, $from_lines ); - } - $gBitSmarty->assign( 'diffdata', $html ); - $gBitSmarty->assign( 'diff2', 'y' ); - $gBitSmarty->assign( 'version_from', $from_version ); - $gBitSmarty->assign( 'version_to', $to_version ); - -} elseif( @BitBase::verifyId( $_REQUEST["compare"] )) { - $from_version = $_REQUEST["compare"]; - $from_page = $gContent->getHistory( $from_version ); - $from_page['data'][0]['no_cache'] = TRUE; - $gBitSmarty->assign( 'compare', 'y' ); - $gBitSmarty->assign( 'diff_from', LibertyContent::parseDataHash( $from_page['data'][0], $gContent ) ); - $gBitSmarty->assign( 'diff_to', $gContent->getParsedData() ); - $gBitSmarty->assignByRef( 'version_from', $from_version ); - -} elseif( @BitBase::verifyId( $_REQUEST["rollback"] )) { - $gContent->verifyUserPermission( !empty( $rollbackPerm ) ? $rollbackPerm : $gContent->mUpdateContentPerm ); - if( !isset( $_REQUEST["rollback_comment"] )) { - $_REQUEST["rollback_comment"] = ''; - } - if( $gContent->rollbackVersion( $_REQUEST["rollback"], $_REQUEST["rollback_comment"] )) { - bit_redirect( $gContent->getDisplayUrl() ); - } -} - |
