summaryrefslogtreecommitdiff
path: root/message_box.php
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2026-02-02 21:05:12 +0000
committerlsces <lester@lsces.co.uk>2026-02-02 21:05:12 +0000
commitbebc6163d8c123b646d068437e06954a745e9f6b (patch)
tree1201acd38954a623edfbc906bbbd3e0e217c4986 /message_box.php
parent302401f8a856a16ea04b0f08c8facb22e4ebd719 (diff)
downloadmessages-bebc6163d8c123b646d068437e06954a745e9f6b.tar.gz
messages-bebc6163d8c123b646d068437e06954a745e9f6b.tar.bz2
messages-bebc6163d8c123b646d068437e06954a745e9f6b.zip
Restructure layout in line with namespace addition and PHP8.4 style rules
Diffstat (limited to 'message_box.php')
-rwxr-xr-x[-rw-r--r--]message_box.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/message_box.php b/message_box.php
index 5a84d2b..177f876 100644..100755
--- a/message_box.php
+++ b/message_box.php
@@ -1,4 +1,5 @@
<?php
+
/**
* message package modules
*
@@ -16,10 +17,12 @@
* required setup
*/
require_once( '../kernel/includes/setup_inc.php' );
-require_once( MESSAGES_PKG_CLASS_PATH.'Messages.php' );
+use Bitweaver\Messages\Messages;
+use Bitweaver\KernelTools;
+
if( !$gBitUser->isRegistered() ) {
- $gBitSmarty->assign('msg', tra("You are not logged in"));
+ $gBitSmarty->assign('msg', KernelTools::tra("You are not logged in"));
$gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'display' ));
die;
}
@@ -35,11 +38,11 @@ $max_records = $gBitSystem->getConfig( 'max_records', 20 );
if (isset($_REQUEST["mark"]) && isset($_REQUEST["msg"])) {
foreach( array_keys( $_REQUEST["msg"] ) as $msg_id ) {
$parts = explode( '_', $_REQUEST['action'] );
- $flagHash = array(
- 'msg_id' => $msg_id ,
- 'act' => $parts[0].'_'.$parts[1],
+ $flagHash = [
+ 'msg_id' => $msg_id,
+ 'act' => "$parts[0]_$parts[1]",
'actval' => $parts[2],
- );
+ ];
$messages->flagMessage( $flagHash );
}
}
@@ -60,22 +63,13 @@ if( !empty( $_REQUEST['filter'] ) ) {
}
}
-if ( empty( $_REQUEST["sort_mode"] ) ) {
- $_REQUEST['sort_mode'] = 'msg_date_desc';
-} else {
- $_REQUEST['sort_mode'] = $_REQUEST["sort_mode"];
-}
+$_REQUEST['sort_mode'] = ( empty( $_REQUEST["sort_mode"] ) ) ? 'msg_date_desc' : $_REQUEST["sort_mode"];
-if (isset($_REQUEST["find"])) {
- $find = $_REQUEST["find"];
-} else {
- $find = '';
-}
+$find = ( isset( $_REQUEST["find"] ) ) ? $_REQUEST["find"] : '';
$listHash = $_REQUEST;
$items = $messages->getList( $listHash );
$gBitSmarty->assign( 'items', $items );
$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
-$gBitSystem->display( 'bitpackage:messages/mailbox.tpl', 'Message box' , array( 'display_mode' => 'display' ));
-?>
+$gBitSystem->display( 'bitpackage:messages/mailbox.tpl', 'Message box' , [ 'display_mode' => 'display' ]);