Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+17 -3
View File
@@ -57,11 +57,25 @@ class _Database extends \IPS\Widget
}
$databases = array();
$disabled = array();
foreach( \IPS\cms\Databases::databases() as $db )
{
if ( ! $db->page_id )
$databases[ $db->id ] = $db->_title;
if ( $db->page_id )
{
$databases[ $db->id ] = $db->_title;
$disabled[] = $db->id;
try
{
$page = \IPS\cms\Pages\Page::load( $db->page_id );
$databases[ $db->id ] = \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_in_use_by_page', NULL, array( 'sprintf' => array( $db->_title, $page->full_path ) ) );
}
catch( \OutOfRangeException $ex )
{
unset( $databases[ $db->id ] );
}
}
}
@@ -71,7 +85,7 @@ class _Database extends \IPS\Widget
}
else
{
$form->add( new \IPS\Helpers\Form\Select( 'database', ( isset( $this->configuration['database'] ) ? $this->configuration['database'] : NULL ), FALSE, array( 'options' => $databases ) ) );
$form->add( new \IPS\Helpers\Form\Select( 'database', ( isset( $this->configuration['database'] ) ? $this->configuration['database'] : NULL ), FALSE, array( 'options' => $databases, 'disabled' => $disabled ) ) );
}
return $form;