Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Community Enhancements: MaxMind
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Nexus
|
||||
* @since 07 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\extensions\core\CommunityEnhancements;
|
||||
@@ -62,8 +61,9 @@ class _MaxMind
|
||||
public function edit()
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'maxmind_enable', (bool) \IPS\Settings::i()->maxmind_key, FALSE, array( 'togglesOn' => array( 'maxmind_key', 'maxmind_error' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'maxmind_enable', (bool) \IPS\Settings::i()->maxmind_key, FALSE, array( 'togglesOn' => array( 'maxmind_key', 'maxmind_gateways', 'maxmind_error' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'maxmind_key', \IPS\Settings::i()->maxmind_key, FALSE, array(), NULL, NULL, NULL, 'maxmind_key' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'maxmind_gateways', ( !\IPS\Settings::i()->maxmind_gateways or \IPS\Settings::i()->maxmind_gateways === '*' ) ? 0 : explode( ',', \IPS\Settings::i()->maxmind_gateways ), FALSE, array( 'class' => 'IPS\nexus\Gateway', 'multiple' => TRUE, 'zeroVal' => 'all' ), NULL, NULL, NULL, 'maxmind_gateways' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'maxmind_error', \IPS\Settings::i()->maxmind_error, FALSE, array( 'options' => array( 'okay' => 'maxmind_error_okay', 'hold' => 'maxmind_error_hold' ) ), NULL, NULL, NULL, 'maxmind_error' ) );
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -73,12 +73,14 @@ class _MaxMind
|
||||
{
|
||||
unset( $values['maxmind_enable'] );
|
||||
$this->testSettings( $values['maxmind_key'] );
|
||||
$values['maxmind_gateways'] = is_array( $values['maxmind_gateways'] ) ? implode( ',', array_keys( $values['maxmind_gateways'] ) ) : '*';
|
||||
$form->saveAsSettings( $values );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $values['maxmind_enable'] );
|
||||
$values['maxmind_key'] = '';
|
||||
$values['maxmind_gateways'] = '*';
|
||||
$form->saveAsSettings( $values );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user