Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -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 )
|
||||
|
||||
Reference in new issue
Block a user