verifyPermission( 'p_admin' ); $gContent = new LibertyContent(); // logging options $logSettings = [ 'liberty_action_log' => [ 'label' => 'Action Logs', 'note' => 'Log all changes made to liberty content.', 'type' => 'toggle', 'page' => 'page tag', ], ]; $gBitSmarty->assign( 'logSettings', $logSettings ); // form processing if( !empty( $_REQUEST['apply_settings'] ) ) { $settings = array_merge( $logSettings ); foreach( array_keys( $settings ) as $item ) { simple_set_toggle( $item, LIBERTY_PKG_NAME ); } if( !empty( $_REQUEST['log_prune'] ) ) { $gContent->expungeActionLog( $_REQUEST['log_prune'] ); } } // get list of log entries $listHash = $_REQUEST; // since this is all just text and we don't want to search through hundreds of pages $listHash['max_records'] = $gBitSystem->getConfig( 'max_records', 10 ) * 5; $actionLogs = $gContent->getActionLogs( $listHash ); $gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); $gBitSmarty->assign( 'actionLogs', $actionLogs ); $gBitSystem->display( 'bitpackage:liberty/action_logs.tpl', KernelTools::tra( 'Action Logs' ) , [ 'display_mode' => 'admin' ]);