Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+14
View File
@@ -113,6 +113,20 @@ class Codemirror extends TextArea
{
if( $this->options['simple'] )
{
if ( isset( $this->options['mode'] ) )
{
if ( empty( $this->options['codeModeAllowedLanguages'] ) )
{
$this->options['codeModeAllowedLanguages'] = [];
}
$this->options['codeModeAllowedLanguages'][] = $this->options['mode'];
}
if ( is_array( $this->options['codeModeAllowedLanguages'] ) )
{
// HTMLMixed is not a valid option for Monaco
$this->options['codeModeAllowedLanguages'] = array_unique( array_map( function ($lang) { return $lang === 'htmlmixed' ? 'html' : $lang; }, $this->options['codeModeAllowedLanguages'] ) );
}
return parent::html();
}
+23 -2
View File
@@ -38,6 +38,7 @@ use IPS\Theme;
use IPS\Xml\SimpleXML;
use OutOfBoundsException;
use UnderflowException;
use UnexpectedValueException;
use function count;
use function defined;
use function file_get_contents;
@@ -45,6 +46,8 @@ use function in_array;
use function is_array;
use function is_null;
use function is_string;
use function md5;
use function session_id;
use function strlen;
use const IPS\ROOT_PATH;
@@ -140,6 +143,9 @@ class Editor extends FormAbstract
"external_video",
'og_embed',
"raw_embed",
'native_emoji',
'custom_emoji',
'fa_icons'
];
/**
@@ -296,9 +302,13 @@ class Editor extends FormAbstract
which creates a discrepency between wheat displays in a post and what displays in the editor */
// $value = preg_replace( '/<p>\s*<\/p>/', '', $value );
/* It is possible that the autosave key was updated, so we make doubly sure the uploader's post key matches our own */
$finalPostKey = md5( $this->options['autoSaveKey'] . ':' . session_id() );
/* Show full uploader */
if ( $this->uploader )
{
$this->uploader->options['postKey'] = $finalPostKey;
$attachmentArea = $this->uploader->html();
}
/* Or show a loading icon where the uploader will go if the editor is minimized */
@@ -320,7 +330,7 @@ class Editor extends FormAbstract
/* Or if the user can't attach, just show a bar */
else
{
$attachmentArea = Theme::i()->getTemplate( 'forms', 'core', 'global' )->editorAttachmentsPlaceholder( $this->name, $this->postKey, $this->noUploaderError, $this->canUseMediaExtension() );
$attachmentArea = Theme::i()->getTemplate( 'forms', 'core', 'global' )->editorAttachmentsPlaceholder( $this->name, $finalPostKey, $this->noUploaderError, $this->canUseMediaExtension() );
}
if ( Member::loggedIn()->group['g_bypass_badwords'] )
@@ -1000,7 +1010,18 @@ class Editor extends FormAbstract
$editorFile = Application::getRootPath( $app->directory ) . "/applications/" . $app->directory . "/data/editor.xml";
if( file_exists( $editorFile ) )
{
$xml = SimpleXML::loadFile( $editorFile );
try
{
$xml = SimpleXML::loadFile( $editorFile );
if ( !isset( $xml->plugin ) or !is_iterable( $xml->plugin ) )
{
throw new UnexpectedValueException;
}
}
catch ( Exception $e )
{
continue;
}
foreach( $xml->plugin as $plugin )
{
$contents = (string) $plugin;
+1 -1
View File
@@ -112,7 +112,7 @@ class Radio extends Select
if ( $this->options['parse'] === 'image' )
{
return Theme::i()->getTemplate( 'forms', 'core', 'global' )->radioImages( $this->name, $value, $this->required, $this->options['options'], $this->options['disabled'], $this->options['toggles'], $descriptions, $warnings, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId, $this->options['gridspan'] );
return Theme::i()->getTemplate( 'forms', 'core', 'global' )->radioImages( $this->name, $value, $this->required, $this->options['options'], $this->options['disabled'], $this->options['toggles'], $descriptions, $warnings, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId );
}
else
{
+1 -3
View File
@@ -42,7 +42,6 @@ class Select extends FormAbstract
'class' => '', // CSS class
'disabled' => FALSE, // Disables input. Default is FALSE.
'parse' => 'lang', // Sets how the values for options should be parsed. Acceptable values are "lang" (language keys), "normal" (htmlentities), "raw" (no parsing) or "image" (image URLs, only for Radio fields). Default is "lang".
'gridspan' => 3, // If 'parse' is set to 'image', this controls the gridspan to use when creating the option layout
'unlimited' => -1, // If any value other than NULL is provided, an "Unlimited" checkbox will be displayed. If checked, the value specified will be sent.
'unlimitedLang' => 'unlimited', // Language string to use for unlimited checkbox label
'unlimitedToggles' => array(...), // Names of other input fields that should show/hide when the "Unlimited" checkbox is toggled.
@@ -62,7 +61,6 @@ class Select extends FormAbstract
'class' => '',
'disabled' => FALSE,
'parse' => 'lang',
'gridspan' => 3,
'unlimited' => NULL,
'unlimitedLang' => 'all',
'unlimitedToggles' => array(),
@@ -230,7 +228,7 @@ class Select extends FormAbstract
if( isset( $this->options['userSuppliedInput'] ) )
{
$name = $this->options['userSuppliedInput'] . '_' . $this->name;
$userInputValue = Request::i()->$name;
$userInputValue = mb_strpos( $name, '[' ) ? Request::i()->valueFromArray( $name ) : Request::i()->$name;
if( is_array( $userInputValue ) )
{
$userInputValue = $userInputValue[0];