diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-27 15:26:05 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-27 15:26:05 +0100 |
| commit | 2da9ac4036cbef4ce4cad3f99c9a359633840e53 (patch) | |
| tree | f0829724b386aa89c3a222b1094bde97183183a7 /includes/content_history_inc.php | |
| parent | 9718d623a0b1d61144bb4779fd989baac08db35d (diff) | |
| download | liberty-2da9ac4036cbef4ce4cad3f99c9a359633840e53.tar.gz liberty-2da9ac4036cbef4ce4cad3f99c9a359633840e53.tar.bz2 liberty-2da9ac4036cbef4ce4cad3f99c9a359633840e53.zip | |
Remaining code changes to cover namespace and style changes for PHP8.4
Diffstat (limited to 'includes/content_history_inc.php')
| -rwxr-xr-x[-rw-r--r--] | includes/content_history_inc.php | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/includes/content_history_inc.php b/includes/content_history_inc.php index 5b1da31..e7d833e 100644..100755 --- a/includes/content_history_inc.php +++ b/includes/content_history_inc.php @@ -5,10 +5,13 @@ * @subpackage functions */ +use Bitweaver\KernelTools; +use Bitweaver\Liberty\LibertyContent; +use Bitweaver\BitBase; $gBitSmarty->assign( 'source', 0 ); // If we have to include a preview please show it -$gBitSmarty->assign( 'preview', FALSE ); +$gBitSmarty->assign( 'preview', false ); $gBitSmarty->assign( 'compare', 'n' ); $gBitSmarty->assign( 'diff2', 'n' ); @@ -26,15 +29,15 @@ if( isset( $_REQUEST["delete"] ) && isset( $_REQUEST["hist"] )) { $gBitSmarty->assign( 'sourcev', nl2br( htmlentities( $version["data"][0]["data"] ))); } -} elseif( @BitBase::verifyId( $_REQUEST["preview"] )) { +} elseif( BitBase::verifyId( $_REQUEST["preview"] )) { if( $version = $gContent->getHistory( $_REQUEST["preview"] )) { - $version['data'][0]['no_cache'] = TRUE; + $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"] ); + $gBitSmarty->assign( $smartyContentRef, $version['data'][0] ); + $gBitSmarty->assign( 'version', $_REQUEST["preview"] ); } -} elseif( @BitBase::verifyId( $_REQUEST["diff2"] ) ) { +} elseif( BitBase::verifyId( $_REQUEST["diff2"] ) ) { $from_version = $_REQUEST["diff2"]; $from_page = $gContent->getHistory( $from_version ); $from_lines = explode( "\n",$from_page["data"][0]["data"] ); @@ -49,15 +52,15 @@ if( isset( $_REQUEST["delete"] ) && isset( $_REQUEST["hist"] )) { /** * 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(); + 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_INCLUDE_PATH.'diff.php'); - $diffx = new WikiDiff( $from_lines,$to_lines ); - $fmt = new WikiUnifiedDiffFormatter; + include_once UTIL_PKG_INCLUDE_PATH.'diff.php'; + $diffx = new \WikiDiff( $from_lines,$to_lines ); + $fmt = new \WikiUnifiedDiffFormatter; $html = $fmt->format( $diffx, $from_lines ); } $gBitSmarty->assign( 'diffdata', $html ); @@ -65,22 +68,22 @@ if( isset( $_REQUEST["delete"] ) && isset( $_REQUEST["hist"] )) { $gBitSmarty->assign( 'version_from', $from_version ); $gBitSmarty->assign( 'version_to', $to_version ); -} elseif( @BitBase::verifyId( $_REQUEST["compare"] )) { +} elseif( BitBase::verifyId( $_REQUEST["compare"] )) { $from_version = $_REQUEST["compare"]; $from_page = $gContent->getHistory( $from_version ); - $from_page['data'][0]['no_cache'] = TRUE; + $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 ); + $gBitSmarty->assign( 'version_from', $from_version ); -} elseif( @BitBase::verifyId( $_REQUEST["rollback"] )) { +} 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() ); + KernelTools::bit_redirect( $gContent->getDisplayUrl() ); } } |
