Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -55,8 +55,10 @@ class themeeditor extends Controller
|
||||
|
||||
/**
|
||||
* @brief Tabs array
|
||||
*
|
||||
* @var array <string,string>
|
||||
*/
|
||||
protected array $tabs = array();
|
||||
protected array $tabs = [];
|
||||
|
||||
/**
|
||||
* @brief Active tab
|
||||
@@ -79,10 +81,10 @@ class themeeditor extends Controller
|
||||
$this->url = $this->url->setQueryString( 'set_id', $this->theme->id );
|
||||
}
|
||||
|
||||
$this->tabs = array(
|
||||
$this->tabs = [
|
||||
'settings' => 'dev_themeeditor_settings',
|
||||
'categories' => 'dev_themeeditor_categories'
|
||||
);
|
||||
];
|
||||
|
||||
/* Choose active tab */
|
||||
if ( isset( Request::i()->tab ) and array_key_exists( Request::i()->tab, $this->tabs ) )
|
||||
@@ -96,19 +98,19 @@ class themeeditor extends Controller
|
||||
}
|
||||
|
||||
/* Yummy free food */
|
||||
Output::i()->breadcrumb = array(
|
||||
array(
|
||||
Output::i()->breadcrumb = [
|
||||
[
|
||||
Url::internal('app=core&module=customization&controller=themes'),
|
||||
'menu__' . Dispatcher::i()->application->directory . '_' . Dispatcher::i()->module->key
|
||||
)
|
||||
);
|
||||
]
|
||||
];
|
||||
|
||||
Output::i()->breadcrumb[] = array(
|
||||
Output::i()->breadcrumb[] = [
|
||||
Url::internal('app=core&module=customization&controller=themeeditor&set_id=' . $this->theme->_id ),
|
||||
'themeeditor_settings'
|
||||
);
|
||||
];
|
||||
|
||||
Output::i()->breadcrumb[] = array( null, $this->theme->_title );
|
||||
Output::i()->breadcrumb[] = [ null, $this->theme->_title ];
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
@@ -136,14 +138,14 @@ class themeeditor extends Controller
|
||||
*/
|
||||
protected function _manageSettings() : string
|
||||
{
|
||||
$table = new TableDb( 'core_theme_editor_settings', $this->url, array( array( 'setting_set_id=?', $this->theme->id ) ) );
|
||||
$table = new TableDb( 'core_theme_editor_settings', $this->url, [ [ 'setting_set_id=?', $this->theme->id ] ] );
|
||||
$table->include = [ 'setting_name', 'setting_type', 'setting_category_id' ];
|
||||
$table->noSort = $table->include;
|
||||
$table->rootButtons = [
|
||||
'add' => [
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'form', 'subnode' => 1 ) )
|
||||
'link' => $this->url->setQueryString( [ 'do' => 'form', 'subnode' => 1 ] )
|
||||
]
|
||||
];
|
||||
|
||||
@@ -172,7 +174,7 @@ class themeeditor extends Controller
|
||||
*/
|
||||
protected function _manageCategories() : string
|
||||
{
|
||||
$table = new TableDb( 'core_theme_editor_categories', $this->url, array( array( 'cat_set_id=?', $this->theme->id ) ) );
|
||||
$table = new TableDb( 'core_theme_editor_categories', $this->url->setQueryString(['tab' => 'categories']), [ [ 'cat_set_id=?', $this->theme->id ] ] );
|
||||
$table->include = [ 'cat_name' ];
|
||||
$table->noSort = [ 'cat_name' ];
|
||||
$table->langPrefix = 'themeeditor_';
|
||||
@@ -180,7 +182,7 @@ class themeeditor extends Controller
|
||||
'add' => [
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'form' ) )
|
||||
'link' => $this->url->setQueryString( [ 'do' => 'form' ] )
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ use function method_exists;
|
||||
use function str_replace;
|
||||
use function strlen;
|
||||
use function strtotime;
|
||||
use const IPS\CIC;
|
||||
use const IPS\Helpers\Table\HEADER;
|
||||
use const IPS\Helpers\Table\SEARCH_CONTAINS_TEXT;
|
||||
use const IPS\Helpers\Table\SEARCH_DATE_RANGE;
|
||||
@@ -2180,7 +2181,7 @@ class members extends Controller
|
||||
Dispatcher::i()->checkAcpPermission( 'member_edit' );
|
||||
|
||||
/* Managed Only */
|
||||
if( !\IPS\CIC OR ( \IPS\CIC AND !isManaged() ) )
|
||||
if( !CIC OR !isManaged() )
|
||||
{
|
||||
Output::i()->error( 'node_error', '2C114/17', 403, '' );
|
||||
}
|
||||
@@ -2230,7 +2231,7 @@ class members extends Controller
|
||||
$form->add( new Text( 'add_login_link_identifier', NULL, TRUE, customValidationCode: function( $value ) {
|
||||
try
|
||||
{
|
||||
Db::i()->select( '*', 'core_login_links', [ 'token_login_method=? AND token_identifier=?', (int) \IPS\Request::i()->add_login_link_handler, $value ] )->first();
|
||||
Db::i()->select( '*', 'core_login_links', [ 'token_login_method=? AND token_identifier=?', (int) Request::i()->add_login_link_handler, $value ] )->first();
|
||||
throw new DomainException( 'login_identifier_exists' );
|
||||
}
|
||||
catch( UnderflowException ) {}
|
||||
@@ -4379,7 +4380,7 @@ class members extends Controller
|
||||
{
|
||||
if( $method::class != 'IPS\Login\Handler\Standard' AND $method::class != 'IPS\convert\extensions\core\LoginHandler\Converter' )
|
||||
{
|
||||
$columns[ 'core_login_' . $method->_id ] = \IPS\Member::loggedIn()->language()->addToStack( 'import_login_links_suffix', FALSE, [ 'sprintf' => [ $method->_title ] ] );
|
||||
$columns[ 'core_login_' . $method->_id ] = Member::loggedIn()->language()->addToStack( 'import_login_links_suffix', FALSE, [ 'sprintf' => [ $method->_title ] ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4685,7 +4686,7 @@ class members extends Controller
|
||||
|
||||
$valueToWrite = match( $field->type ) {
|
||||
'YesNo', 'Checkbox' => $member[ 'field_' . $fieldId ] ? Member::loggedIn()->language()->get('yes') : Member::loggedIn()->language()->get('no'),
|
||||
default => $member[ 'field_' . $fieldId ] ? Field::load( $fieldId )->displayValue( $member[ 'field_' . $fieldId ], FALSE, NULL, 0, NULL, TRUE, ',' ) : ''
|
||||
default => $member[ 'field_' . $fieldId ] ? Field::load( $fieldId )->displayValue( $member[ 'field_' . $fieldId ], FALSE, NULL, 0, NULL, TRUE ) : ''
|
||||
};
|
||||
}
|
||||
else if ( mb_substr( $column, 0, 11 ) == 'core_login_' )
|
||||
@@ -5097,7 +5098,7 @@ class members extends Controller
|
||||
return [ 'delete' => [
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $row['rule'] ? NULL : $member->acpUrl()->setQueryString( ['do' => 'deleteBadge', 'id' => $row['badge_id'], 'member_id' => $member->member_id ] ),
|
||||
'link' => $row['rule'] ? NULL : $member->acpUrl()->setQueryString( ['do' => 'deleteBadge', 'id' => $row['badge_id'], 'member_id' => $member->member_id ] )->csrf(),
|
||||
'class' => $row['rule'] ? 'ipsControlStrip_disabled' : '',
|
||||
'data' => $row['rule'] ? [] : [ 'delete' => '' ],
|
||||
'tooltip' => Member::loggedIn()->language()->addToStack( $row['rule'] ? 'acp_badge_cannot_delete' : 'delete' )
|
||||
@@ -5174,6 +5175,8 @@ class members extends Controller
|
||||
*/
|
||||
protected function deleteBadge() : void
|
||||
{
|
||||
Request::i()->confirmedDelete();
|
||||
|
||||
/* Load Member */
|
||||
try
|
||||
{
|
||||
@@ -5206,16 +5209,6 @@ class members extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that a member's email is unblocked (via ajax)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function requestEmailUnblock(): void
|
||||
{
|
||||
Bridge::i()->bounceMemberViewRequestEmailUnblock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the functionality to manually add members is enabled
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@ use UnderflowException;
|
||||
use function defined;
|
||||
use function in_array;
|
||||
use function intval;
|
||||
use const IPS\CIC;
|
||||
use const IPS\Helpers\Table\SEARCH_CONTAINS_TEXT;
|
||||
use const IPS\Helpers\Table\SEARCH_DATE_RANGE;
|
||||
use const IPS\Helpers\Table\SEARCH_NUMERIC;
|
||||
@@ -226,8 +227,19 @@ class spam extends Controller
|
||||
'options' => static::getCaptchaOptions( 'options' ),
|
||||
'toggles' => static::getCaptchaOptions( 'toggles' ),
|
||||
), NULL, NULL, NULL, 'bot_antispam_type' ) );
|
||||
$form->add( new Text( 'turnstile_site_key', Settings::i()->turnstile_site_key, id: 'turnstile_site_key' ) );
|
||||
$form->add( new Text( 'turnstile_secret_key', Settings::i()->turnstile_secret_key, id: 'turnstile_secret_key' ) );
|
||||
$form->add( new Text( 'turnstile_site_key', Settings::i()->turnstile_site_key, ( CIC ? false : null ), [], function( $val )
|
||||
{
|
||||
if( empty( $val ) and Request::i()->bot_antispam_type == 'turnstile' and !CIC )
|
||||
{
|
||||
throw new DomainException( 'field_required' );
|
||||
}
|
||||
}, id: 'turnstile_site_key' ) );
|
||||
$form->add( new Text( 'turnstile_secret_key', Settings::i()->turnstile_secret_key, ( CIC ? false : null ), [], function( $val ) {
|
||||
if( empty( $val ) and Request::i()->bot_antispam_type == 'turnstile' and !CIC )
|
||||
{
|
||||
throw new DomainException( 'field_required' );
|
||||
}
|
||||
}, id: 'turnstile_secret_key' ) );
|
||||
|
||||
if( \IPS\CIC )
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ class general extends Controller
|
||||
} ) );
|
||||
|
||||
$values['site_address'] = json_encode( $values['site_address'] );
|
||||
|
||||
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
if ( $values['site_online'] )
|
||||
|
||||
@@ -43,6 +43,7 @@ use IPS\Request;
|
||||
use IPS\Session;
|
||||
use IPS\Settings;
|
||||
use IPS\Task;
|
||||
use IPS\Text\Parser;
|
||||
use IPS\Theme;
|
||||
use IPS\Xml\XMLReader;
|
||||
use OutOfRangeException;
|
||||
@@ -50,6 +51,7 @@ use UnderflowException;
|
||||
use XMLWriter;
|
||||
use function count;
|
||||
use function defined;
|
||||
use function implode;
|
||||
use function intval;
|
||||
use function is_array;
|
||||
use function preg_match;
|
||||
@@ -465,13 +467,31 @@ class posting extends Controller
|
||||
)
|
||||
), NULL, NULL, NULL, 'embed_url_filter_any_action' ) );
|
||||
|
||||
$form->addHeader('fb_ig_oembed_header');
|
||||
$form->add( new Text( 'fb_ig_oembed_appid', Settings::i()->fb_ig_oembed_appid, FALSE ) );
|
||||
$form->add( new Text( 'fb_ig_oembed_appsecret', Settings::i()->fb_ig_oembed_appsecret, FALSE ) );
|
||||
/* Facebook/IG oembeds are deprecated. Only show this message if the site currently has them setup or they have added the manual override constant */
|
||||
$fbEnabled =false;
|
||||
if ( ( defined( "FB_DEPRECATION_BYPASS" ) and constant( "FB_DEPRECATION_BYPASS" ) ) or ( Settings::i()->fb_ig_oembed_appid and Settings::i()->fb_ig_oembed_appsecret ) )
|
||||
{
|
||||
$fbEnabled = true;
|
||||
$form->addHeader( 'fb_ig_oembed_header' );
|
||||
$form->addMessage( "fb_ig_oembed_deprecate_warning", "ipsMessage--error" );
|
||||
$form->add( new Text( 'fb_ig_oembed_appid', Settings::i()->fb_ig_oembed_appid, FALSE ) );
|
||||
$form->add( new Text( 'fb_ig_oembed_appsecret', Settings::i()->fb_ig_oembed_appsecret, FALSE ) );
|
||||
}
|
||||
|
||||
/* Iframely link */
|
||||
if ( Dispatcher::i()->checkAcpPermission( "enhancements_manage", return: true ) )
|
||||
{
|
||||
$form->addMessage( 'iframely_manage_link' );
|
||||
}
|
||||
|
||||
/* Save values */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Changed the embed app or secret? We need to clear the cached token */
|
||||
if ( $fbEnabled and ( !$values['fb_ig_oembed_appid'] or !$values['fb_ig_oembed_appsecret'] or $values['fb_ig_oembed_appid'] !== Settings::i()->fb_ig_oembed_appid or $values['fb_ig_oembed_appsecret'] !== Settings::i()->fb_ig_oembed_appsecret ) )
|
||||
{
|
||||
Settings::i()->changeValues( array( 'fb_ig_oembed_token' => '' ) );
|
||||
}
|
||||
$values['ipb_embed_url_whitelist'] = implode( ",", $values['ipb_embed_url_whitelist'] );
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
@@ -921,6 +941,21 @@ class posting extends Controller
|
||||
$form->addHtml( Theme::i()->getTemplate( 'forms' )->blurb( 'editor_simplified_mode_desc', true, true ) );
|
||||
|
||||
$dependencies = Form\Editor::getRestrictionDependencies();
|
||||
|
||||
/* Add note about iframely config */
|
||||
if ( Dispatcher::i()->checkAcpPermission( 'enhancements_manage', return: true ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$baseExternalDesc = Member::loggedIn()->language()->get( "editor_r__external_embed__desc" ) . "\n";
|
||||
}
|
||||
catch ( UnderflowException )
|
||||
{
|
||||
$baseExternalDesc = "";
|
||||
}
|
||||
Member::loggedIn()->language()->words['editor_r__external_embed__desc'] = $baseExternalDesc . Member::loggedIn()->language()->addToStack( "iframely_manage_link" );
|
||||
}
|
||||
|
||||
foreach ( Form\Editor::getAllRestrictions() as $restriction )
|
||||
{
|
||||
if ( $restriction === 'giphy' && !Settings::i()->giphy_enabled )
|
||||
|
||||
@@ -151,7 +151,7 @@ class badges extends Controller
|
||||
|
||||
if( isset( Request::i()->badgeDateStart ) AND isset( Request::i()->badgeDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->badgeDateStart ), 'end' => DateTime::ts( Request::i()->badgeDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->badgeDateStart ), 'end' => DateTime::ts( (int) Request::i()->badgeDateEnd ) );
|
||||
}
|
||||
|
||||
$form = new Form( $activeTab, 'continue' );
|
||||
@@ -216,7 +216,7 @@ class badges extends Controller
|
||||
|
||||
if( isset( Request::i()->badgeDateStart ) AND isset( Request::i()->badgeDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->badgeDateStart ), 'end' => DateTime::ts( Request::i()->badgeDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->badgeDateStart ), 'end' => DateTime::ts( (int) Request::i()->badgeDateEnd ) );
|
||||
}
|
||||
|
||||
$form = new Form( $activeTab, 'continue' );
|
||||
|
||||
@@ -109,8 +109,8 @@ class helpful extends Controller
|
||||
$form = new Form( 'form', 'go' );
|
||||
|
||||
$default = array(
|
||||
'start' => Request::i()->start ? DateTime::ts( Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( Request::i()->end ) : NULL
|
||||
'start' => Request::i()->start ? DateTime::ts( (int) Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( (int) Request::i()->end ) : NULL
|
||||
);
|
||||
|
||||
$form->add( new DateRange( 'stats_date_range', $default, FALSE, array( 'start' => array( 'max' => DateTime::ts( time() )->setTime( 0, 0, 0 ), 'time' => FALSE ), 'end' => array( 'max' => DateTime::ts( time() )->setTime( 23, 59, 59 ), 'time' => FALSE ) ) ) );
|
||||
|
||||
@@ -85,7 +85,7 @@ class membersactivity extends Controller
|
||||
|
||||
if( isset( Request::i()->postDateStart ) AND isset( Request::i()->postDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->postDateStart ), 'end' => DateTime::ts( Request::i()->postDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->postDateStart ), 'end' => DateTime::ts( (int) Request::i()->postDateEnd ) );
|
||||
}
|
||||
|
||||
$groupOptions = array_combine( array_keys( Group::groups( TRUE, FALSE ) ), array_map( function( $_group ) { return (string) $_group; }, Group::groups( TRUE, FALSE ) ) );
|
||||
|
||||
@@ -77,7 +77,7 @@ class membervisits extends Controller
|
||||
|
||||
if( isset( Request::i()->visitDateStart ) AND isset( Request::i()->visitDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->visitDateStart ), 'end' => DateTime::ts( Request::i()->visitDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->visitDateStart ), 'end' => DateTime::ts( (int) Request::i()->visitDateEnd ) );
|
||||
}
|
||||
|
||||
$groupOptions = array_combine( array_keys( Group::groups( TRUE, FALSE ) ), array_map( function( $_group ) { return (string) $_group; }, Group::groups( TRUE, FALSE ) ) );
|
||||
|
||||
@@ -75,8 +75,8 @@ class referrals extends Controller
|
||||
$form = new Form( 'form', 'go' );
|
||||
|
||||
$default = array(
|
||||
'start' => Request::i()->start ? DateTime::ts( Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( Request::i()->end ) : NULL
|
||||
'start' => Request::i()->start ? DateTime::ts( (int) Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( (int) Request::i()->end ) : NULL
|
||||
);
|
||||
|
||||
$form->add( new DateRange( 'stats_date_range', $default, FALSE, array( 'start' => array( 'max' => DateTime::ts( time() )->setTime( 0, 0, 0 ), 'time' => FALSE ), 'end' => array( 'max' => DateTime::ts( time() )->setTime( 23, 59, 59 ), 'time' => FALSE ) ) ) );
|
||||
|
||||
@@ -75,7 +75,7 @@ class recovery extends Controller
|
||||
switch( $step )
|
||||
{
|
||||
case 0: # Applications
|
||||
$appsDisabled = array();
|
||||
$appsDisabled = [];
|
||||
|
||||
/* Disable All non-IPS Applications */
|
||||
foreach( Application::applications() AS $app )
|
||||
@@ -83,7 +83,7 @@ class recovery extends Controller
|
||||
if ( !in_array( $app->directory, IPS::$ipsApps ) )
|
||||
{
|
||||
$app->_enabled = FALSE;
|
||||
$appDisabled[] = $app->_id;
|
||||
$appsDisabled[] = $app->_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user