Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -15,6 +15,7 @@ namespace IPS\core\modules\front\modcp;
use IPS\Application;
use IPS\core\DataLayer;
use IPS\Dispatcher\Controller;
use IPS\Extensions\ModCpAbstract;
use IPS\Http\Url;
use IPS\Lang;
use IPS\Member;
@@ -24,6 +25,7 @@ use IPS\Settings;
use IPS\Theme;
use function defined;
use function method_exists;
use function ucfirst;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -98,12 +100,14 @@ class modcp extends Controller
$activeTab = Request::i()->tab ?: 'overview';
$tabs = array( 'reports' => array(), 'approval' => array() );
$content = '';
$approvalQueueCount = 0;
$counters = [];
foreach ( Application::allExtensions( 'core', 'ModCp' ) as $key => $extension )
{
/* We use this to group the sidebar for the ModCP */
$tabType = 'other';
/* @var ModCpAbstract $extension */
if ( $extension->manageType() )
{
$tabType = in_array( $extension->manageType(), array( 'content', 'members' ) ) ? $extension->manageType() : 'other';
@@ -116,10 +120,15 @@ class modcp extends Controller
$tabs[ $tabType ][ $tab ][] = $key;
}
/* Get the count for the approval queue from the extension */
if( $tab == 'approval' )
/* Get any counts that should show at the top */
foreach( $extension->getCounters() as $index => $counter )
{
$approvalQueueCount = $extension->getApprovalQueueCount( false );
if( empty( $counter['id'] ) )
{
$counter['id'] = "elModCP" . ucfirst( $tab ) . $index . "Counter";
}
$counters[] = $counter;
}
if( mb_strtolower( (string) $extension->getTab() ) == mb_strtolower( (string) $activeTab ) )
@@ -161,7 +170,7 @@ class modcp extends Controller
}
else
{
Output::i()->output = Theme::i()->getTemplate( 'modcp' )->template( $content, $tabs, $activeTab, $approvalQueueCount );
Output::i()->output = Theme::i()->getTemplate( 'modcp' )->template( $content, $tabs, $activeTab, $counters );
}
}
}