' . $glist[$i] . ' | ';
$ret_ele .= '';
$ret_ele .= '';
$ii = 0;
- $option_ids = array();
+ $option_ids = [];
foreach ($perms as $perm) {
++$ii;
- if ($ii % 5 == 0) {
+ if (0 == $ii % 5) {
$ret_ele .= ' ';
}
$checked = in_array('forum_' . $perm, $selected) ? ' checked' : '';
@@ -315,7 +315,7 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()
case 'apply':
$perm_template = $newbbpermHandler->getTemplate();
- if ($perm_template === null) {
+ if (null === $perm_template) {
redirect_header('admin_permissions.php?action=template', 2, _AM_NEWBB_PERM_TEMPLATE);
}
xoops_cp_header();
@@ -324,11 +324,11 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', 'get');
$op_select = new XoopsFormSelect('', 'action');
$op_select->setExtra('onchange="document.forms.actionform.submit()"');
- $op_select->addOptionArray(array(
+ $op_select->addOptionArray([
'no' => _SELECT,
'template' => _AM_NEWBB_PERM_TEMPLATE,
'apply' => _AM_NEWBB_PERM_TEMPLATEAPP
- ));
+ ]);
$opform->addElement($op_select);
$opform->display();
@@ -399,32 +399,32 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', 'get');
$op_select = new XoopsFormSelect('', 'action');
$op_select->setExtra('onchange="document.forms.actionform.submit()"');
- $op_select->addOptionArray(array(
+ $op_select->addOptionArray([
'no' => _SELECT,
'template' => _AM_NEWBB_PERM_TEMPLATE,
'apply' => _AM_NEWBB_PERM_TEMPLATEAPP,
'default' => _AM_NEWBB_PERM_SETBYGROUP
- ));
+ ]);
$opform->addElement($op_select);
$opform->display();
- $op_options = array('category' => _AM_NEWBB_CAT_ACCESS);
- $fm_options = array(
- 'category' => array(
+ $op_options = ['category' => _AM_NEWBB_CAT_ACCESS];
+ $fm_options = [
+ 'category' => [
'title' => _AM_NEWBB_CAT_ACCESS,
'item' => 'category_access',
'desc' => '',
'anonymous' => true
- )
- );
+ ]
+ ];
foreach ($perms as $perm) {
$op_options[$perm] = constant('_AM_NEWBB_CAN_' . strtoupper($perm));
- $fm_options[$perm] = array(
+ $fm_options[$perm] = [
'title' => constant('_AM_NEWBB_CAN_' . strtoupper($perm)),
'item' => 'forum_' . $perm,
'desc' => '',
'anonymous' => true
- );
+ ];
}
$op_keys = array_keys($op_options);
@@ -451,7 +451,7 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()
$criteriaCategory = new CriteriaCompo(new criteria('1', 1));
$criteriaCategory->setSort('cat_order');
$categories = $categoryHandler->getList($criteriaCategory);
- if ($op === 'category') {
+ if ('category' === $op) {
foreach (array_keys($categories) as $key) {
$form->addItem($key, $categories[$key]);
}
diff --git a/admin/admin_report.php b/admin/admin_report.php
index 176eeeeb..ba393d15 100644
--- a/admin/admin_report.php
+++ b/admin/admin_report.php
@@ -47,7 +47,7 @@
if (0 === count($report_ids)) {
redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
}
- $report_memos = XoopsRequest::getArray('report_memo', array(), 'POST'); // isset($_POST['report_memo']) ? $_POST['report_memo'] : array();
+ $report_memos = XoopsRequest::getArray('report_memo', [], 'POST'); // isset($_POST['report_memo']) ? $_POST['report_memo'] : array();
foreach ($report_ids as $rid => $value) {
if (!$value) {
continue;
@@ -63,7 +63,7 @@
break;
case 'delete':
- $report_ids = XoopsRequest::getArray('report_id', array(), 'POST');// $_POST['report_id'];
+ $report_ids = XoopsRequest::getArray('report_id', [], 'POST');// $_POST['report_id'];
// irmtfan add error redirect header
if (0 === count($report_ids)) {
redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
@@ -86,7 +86,7 @@
include_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/xoopsformloader.php');
mod_loadFunctions('user', 'newbb');
- if ($item !== 'processed') {
+ if ('processed' !== $item) {
$process_result = 0;
$item_other = 'processed';
$title_other = _AM_NEWBB_PROCESSEDREPORT;
@@ -118,7 +118,7 @@
$reports = $reportHandler->getAllReports(0, 'ASC', $limit, $start, $process_result);
foreach ($reports as $report) {
- $post_link = ""
+ . '&viewmode=thread" target="checkreport">'
. $myts->htmlSpecialChars($report['subject'])
. '';
$checkbox = '';
- if ($item !== 'processed') {
+ if ('processed' !== $item) {
$memo = '';
} else {
$memo = $myts->htmlSpecialChars($report['report_memo']);
@@ -146,7 +146,7 @@
echo '' . _AM_NEWBB_REPORTTEXT . ': ' . $myts->htmlSpecialChars($report['report_text']) . ' | ';
$uid = (int)$report['reporter_uid'];
$reporter_name = newbb_getUnameFromId($uid, $GLOBALS['xoopsModuleConfig']['show_realname']);
- $reporter = (!empty($uid)) ? "" . $reporter_name . ' ' : '';
+ $reporter = !empty($uid) ? "" . $reporter_name . ' ' : '';
echo "" . $reporter . long2ip($report['reporter_ip']) . ' | ';
echo ' ';
@@ -157,7 +157,7 @@
echo " | ";
}
$buttons = '';
- if ($item !== 'processed') {
+ if ('processed' !== $item) {
$submit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
$buttons .= $submit->render() . ' ';
}
diff --git a/admin/admin_synchronization.php b/admin/admin_synchronization.php
index 8c353c5b..a43c222a 100644
--- a/admin/admin_synchronization.php
+++ b/admin/admin_synchronization.php
@@ -36,7 +36,7 @@
}
$criteria->setStart($start);
$criteria->setLimit($limit);
- $topicObjs = array();
+ $topicObjs = [];
$topicObjs = $topicHandler->getAll($criteria);
foreach ($topicObjs as $tObj) {
$topicHandler->synchronization($tObj);
@@ -87,7 +87,7 @@
break;
// START irmtfan add read sync
case 'read':
- $result = newbb_synchronization(array('readtopic', 'readforum'));
+ $result = newbb_synchronization(['readtopic', 'readforum']);
if (!empty($result)) {
redirect_header('admin_synchronization.php', 2, _AM_NEWBB_SYNC_TYPE_READ . ' ' . _AM_NEWBB_DATABASEUPDATED);
}
diff --git a/admin/admin_type_manager.php b/admin/admin_type_manager.php
index 79b5f47b..31d757fe 100644
--- a/admin/admin_type_manager.php
+++ b/admin/admin_type_manager.php
@@ -30,7 +30,7 @@
*
*/
$op = XoopsRequest::getCmd('op', XoopsRequest::getCmd('op', '', 'POST'), 'GET');// !empty($_GET['op'])? $_GET['op'] : ( !empty($_POST['op']) ? $_POST['op'] : "" );
-if (!in_array($op, array(
+if (!in_array($op, [
'save_type',
'delete',
'template',
@@ -41,7 +41,7 @@
'edit_forum',
'save_forum',
'add'
-), true)
+], true)
) {
$op = '';
}
@@ -52,7 +52,7 @@
case 'save_type':
$type_names0 = $_POST['type_name'];
$type_names = XoopsRequest::getArray('type_name', null, 'POST');// $_POST['type_name'];
- $type_del = array();
+ $type_del = [];
foreach (array_keys($type_names) as $key) {
if (XoopsRequest::getBool('isnew', '', 'POST')) {
$type_obj = $typeHandler->create();
@@ -66,7 +66,7 @@
$type_del[] = $key;
continue;
} else {
- foreach (array('type_name', 'type_color', 'type_description') as $var) {
+ foreach (['type_name', 'type_color', 'type_description'] as $var) {
// if ($type_obj->getVar($var) != @$_POST[$var][$key]) {
// $type_obj->setVar($var, @$_POST[$var][$key]);
// }
@@ -83,7 +83,7 @@
}
if (count($type_del) > 0) {
$type_list = $typeHandler->getList(new Criteria('type_id', '(' . implode(', ', $type_del) . ')', 'IN'));
- xoops_confirm(array('op' => 'delete', 'type_del' => serialize($type_del)), xoops_getenv('PHP_SELF'), sprintf(_AM_NEWBB_TODEL_TYPE, implode(', ', array_values($type_list))), '', false);
+ xoops_confirm(['op' => 'delete', 'type_del' => serialize($type_del)], xoops_getenv('PHP_SELF'), sprintf(_AM_NEWBB_TODEL_TYPE, implode(', ', array_values($type_list))), '', false);
} else {
redirect_header(xoops_getenv('PHP_SELF'), 2, _MD_DBUPDATED);
}
@@ -103,7 +103,7 @@
case 'template':
$types_obj = $typeHandler->getAll();
- if (count($types_obj) === 0) {
+ if (0 === count($types_obj)) {
redirect_header(xoops_getenv('PHP_SELF'), 2, _AM_NEWBB_TYPE_ADD);
}
@@ -173,7 +173,7 @@
break;
case 'save_template':
- $templates = array_flip(array_filter(XoopsRequest::getArray('type_order', array(), 'POST')));
+ $templates = array_flip(array_filter(XoopsRequest::getArray('type_order', [], 'POST')));
mod_createCacheFile($templates, 'type_template');
redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _MD_DBUPDATED);
break;
@@ -263,7 +263,7 @@
if (!$templates = mod_loadCacheFile('type_template')) {
redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE);
}
- foreach (XoopsRequest::getArray('forums', array(), 'POST') as $forum) {
+ foreach (XoopsRequest::getArray('forums', [], 'POST') as $forum) {
if ($forum < 1) {
continue;
}
@@ -339,7 +339,7 @@
}
$types_obj = $typeHandler->getAll();
- if (count($types_obj) === 0) {
+ if (0 === count($types_obj)) {
redirect_header(xoops_getenv('PHP_SELF'), 2, _AM_NEWBB_TYPE_ADD);
}
@@ -373,7 +373,7 @@
echo '';
$types = $typeHandler->getByForum(XoopsRequest::getInt('forum', 0, 'POST'));
- $types_order = array();
+ $types_order = [];
foreach ($types as $key => $type) {
$types_order[] = $type['type_order'];
}
@@ -422,14 +422,14 @@
case 'add':
default:
$types_obj = $typeHandler->getAll();
- if (count($types_obj) === 0) {
+ if (0 === count($types_obj)) {
$op = 'add';
$title = _AM_NEWBB_TYPE_ADD;
} else {
$title = _AM_NEWBB_TYPE_LIST;
}
- if ($op !== 'add') {
+ if ('add' !== $op) {
echo "
|
|