From 5ada15f7205e4a6ecaec453ce112af3d176fda38 Mon Sep 17 00:00:00 2001 From: camer0n Date: Tue, 13 May 2025 10:16:22 -0700 Subject: [PATCH] Issue #5489 Corrected "Latest" permission items. --- .../shortcodes/batch/admin_shortcodes.php | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 9565a6c31..0e93dacd3 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -537,15 +537,22 @@ class admin_shortcodes extends e_shortcode // $text .= "
".E_16_UPLOADS." ".ADLAN_LAT_7.": $active_uploads
"; $oldconfigs = array(); - $oldconfigs['e-news'][0] = array('icon' =>defset('E_16_NEWS'), 'title' =>defset('ADLAN_LAT_2'), 'url' => e_ADMIN. 'newspost.php?mode=sub&action=list', 'total' =>$submitted_news); - if(empty($pref['comments_disabled']) && varset($pref['comments_engine'],'e107') === 'e107') + if(getperms('N')) + { + $oldconfigs['e-news'][0] = array('icon' =>defset('E_16_NEWS'), 'title' =>defset('ADLAN_LAT_2'), 'url' => e_ADMIN. 'newspost.php?mode=sub&action=list', 'total' =>$submitted_news); + } + + if(getperms('B') && empty($pref['comments_disabled']) && varset($pref['comments_engine'],'e107') === 'e107') { $oldconfigs['e-comment'][0] = array('icon' =>defset('E_16_COMMENT'), 'title' =>defset('ADLAN_LAT_9'), 'url' => e_ADMIN_ABS. 'comment.php?searchquery=&filter_options=comment_blocked__2', 'total' =>$comments_pending); } - $oldconfigs['e-upload'][0] = array('icon' =>defset('E_16_UPLOADS'), 'title' =>defset('ADLAN_LAT_7'), 'url' => e_ADMIN. 'upload.php', 'total' =>$active_uploads); - + if(getperms('V')) + { + $oldconfigs['e-upload'][0] = array('icon' =>defset('E_16_UPLOADS'), 'title' =>defset('ADLAN_LAT_7'), 'url' => e_ADMIN. 'upload.php', 'total' =>$active_uploads); + } + $messageTypes = array(/*'Broken Download',*/ 'Dev Team Message'); $queryString = ''; foreach($messageTypes as $types) @@ -592,23 +599,31 @@ class admin_shortcodes extends e_shortcode $allconfigs = multiarray_sort($allconfigs,'title'); //XXX FIXME - not sorting correctly. - $text = "'; + + if(empty($items)) + { + return ''; + } + + $text = "\n";; - // $text .= ""; $ns->setUniqueId('e-latest-list'); - return ($parm !== 'norender') ? $ns -> tablerender(ADLAN_LAT_1, $text, '', TRUE) : $text; + return ($parm !== 'norender') ? $ns -> tablerender(defset('ADLAN_LAT_1'), $text, '', TRUE) : $text; } }