Version 5.0.0 beta 10
This commit is contained in:
1 parent
56979f8ee8
commit
264eeb97e0
325 files changed
+6442
-1849
No files matched your search
@@ -16,6 +16,7 @@ use IPS\Developer\Controller;
|
||||
use IPS\Helpers\Form\Matrix;
|
||||
use IPS\IPS;
|
||||
use IPS\Output;
|
||||
use UnderflowException;
|
||||
use function defined;
|
||||
use const IPS\ROOT_PATH;
|
||||
|
||||
@@ -95,7 +96,17 @@ class settings extends Controller
|
||||
{
|
||||
if( !in_array( $values[ $key ]['key'], $existingKeys ) )
|
||||
{
|
||||
$insert[] = array( 'conf_key' => $values[ $key ]['key'], 'conf_value' => $values[ $key ]['default'], 'conf_default' => $values[ $key ]['default'], 'conf_app' => $this->application->directory );
|
||||
/* It's possible that this is a setting that was moved from a plugin to an app.
|
||||
Check if the setting exists, and if so, claim it. */
|
||||
try
|
||||
{
|
||||
$settingRow = Db::i()->select( '*', 'core_sys_conf_settings', [ 'conf_key=? and conf_app is null', $values[ $key ]['key'] ] )->first();
|
||||
Db::i()->update( 'core_sys_conf_settings', array( 'conf_app' => $this->application->directory, 'conf_default' => $values[ $key ]['default'] ), array( 'conf_key=?', $values[ $key ]['key'] ) );
|
||||
}
|
||||
catch( UnderflowException )
|
||||
{
|
||||
$insert[] = array( 'conf_key' => $values[ $key ]['key'], 'conf_value' => $values[ $key ]['default'], 'conf_default' => $values[ $key ]['default'], 'conf_app' => $this->application->directory );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4280,14 +4280,11 @@ class members extends Controller
|
||||
/* Run callbacks */
|
||||
foreach ( Application::allExtensions( 'core', 'MemberFilter', TRUE, 'core' ) as $key => $extension )
|
||||
{
|
||||
if( method_exists( $extension, 'queryCallback' ) )
|
||||
/* Grab our fields and add to the form */
|
||||
if( !empty( $wizardData['filters'][ $key ] ) )
|
||||
{
|
||||
/* Grab our fields and add to the form */
|
||||
if( !empty( $wizardData['filters'][ $key ] ) )
|
||||
{
|
||||
$data = $wizardData['filters'][ $key ];
|
||||
$extension->queryCallback( $data, $query );
|
||||
}
|
||||
$data = $wizardData['filters'][ $key ];
|
||||
$extension->queryCallback( $data, $query );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4488,19 +4485,16 @@ class members extends Controller
|
||||
$lastApp = 'core';
|
||||
foreach ( Application::allExtensions( 'core', 'MemberFilter', FALSE, 'core' ) as $key => $extension )
|
||||
{
|
||||
if( method_exists( $extension, 'getSettingField' ) )
|
||||
$_key = explode( '_', $key );
|
||||
if( $_key[0] != $lastApp )
|
||||
{
|
||||
$_key = explode( '_', $key );
|
||||
if( $_key[0] != $lastApp )
|
||||
{
|
||||
$lastApp = $_key[0];
|
||||
$form->addHeader( $lastApp . '_bm_filters' );
|
||||
}
|
||||
|
||||
foreach ( $extension->getSettingField( $wizardData['filters'][$key] ?? array() ) as $field )
|
||||
{
|
||||
$form->add( $field );
|
||||
}
|
||||
$lastApp = $_key[0];
|
||||
$form->addHeader( $lastApp . '_bm_filters' );
|
||||
}
|
||||
|
||||
foreach ( $extension->getSettingField( $wizardData['filters'][$key] ?? array() ) as $field )
|
||||
{
|
||||
$form->add( $field );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4510,13 +4504,10 @@ class members extends Controller
|
||||
|
||||
foreach ( Application::allExtensions( 'core', 'MemberFilter', TRUE, 'core' ) as $key => $extension )
|
||||
{
|
||||
if( method_exists( $extension, 'save' ) )
|
||||
$_value = $extension->save( $values );
|
||||
if( $_value )
|
||||
{
|
||||
$_value = $extension->save( $values );
|
||||
if( $_value )
|
||||
{
|
||||
$wizardData['filters'][ $key ] = $_value;
|
||||
}
|
||||
$wizardData['filters'][ $key ] = $_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -460,10 +460,7 @@ class moderators extends Controller
|
||||
/* Allow extensions an opportunity to inspect the values and make adjustments */
|
||||
foreach ( Application::allExtensions( 'core', 'ModeratorPermissions', FALSE ) as $k => $ext )
|
||||
{
|
||||
if( method_exists( $ext, 'preSave' ) )
|
||||
{
|
||||
$ext->preSave( $values );
|
||||
}
|
||||
$ext->preSave( $values );
|
||||
}
|
||||
|
||||
if( $values['mod_use_restrictions'] == 'no' )
|
||||
|
||||
@@ -58,7 +58,7 @@ class alerts extends Controller
|
||||
{
|
||||
$alert = Alert::load( Request::i()->id );
|
||||
|
||||
if( $alert->reply == 2 and Member::loggedIn()->member_id and Member::loggedIn()->canUseMessenger() )
|
||||
if( $alert->reply == Alert::REPLY_REQUIRED and Member::loggedIn()->member_id and Member::loggedIn()->canUseMessenger() )
|
||||
{
|
||||
Output::i()->error( 'alert_cant_dismiss', '3C428/1', 403, '' );
|
||||
}
|
||||
|
||||
@@ -165,7 +165,6 @@ class register extends Controller
|
||||
if ( Login::registrationType() == 'normal' )
|
||||
{
|
||||
$form = $this->_registrationForm( $postBeforeRegister );
|
||||
$form->class = 'ipsForm_fullWidth';
|
||||
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('registration');
|
||||
|
||||
@@ -286,6 +285,11 @@ class register extends Controller
|
||||
{
|
||||
$form = static::buildRegistrationForm( $postBeforeRegister );
|
||||
|
||||
if( Login::registrationType() == 'normal' )
|
||||
{
|
||||
$form->class = 'ipsForm_fullWidth';
|
||||
}
|
||||
|
||||
/* Handle submissions */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Email;
|
||||
use IPS\Extensions\AccountSettingsAbstract;
|
||||
use IPS\Extensions\SSOAbstract;
|
||||
use IPS\File;
|
||||
use IPS\GeoLocation;
|
||||
@@ -122,7 +123,9 @@ class settings extends Controller
|
||||
{
|
||||
foreach( Application::allExtensions( 'core', 'AccountSettings', TRUE, 'core' ) as $ext )
|
||||
{
|
||||
if( $ext->getTab() == $area )
|
||||
/* @var AccountSettingsAbstract $ext */
|
||||
$tabName = $ext->getTab();
|
||||
if( $tabName == $area )
|
||||
{
|
||||
if( isset( Request::i()->action ) AND method_exists( $ext, Request::i()->action ) )
|
||||
{
|
||||
@@ -136,6 +139,12 @@ class settings extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have no output, then we couldn't find the tab */
|
||||
if( !isset( $output ) )
|
||||
{
|
||||
Output::i()->error( 'node_error', '2C122/2', 404 );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('settings');
|
||||
|
||||
Reference in new issue
Block a user