Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -253,8 +253,8 @@ class _toolbar extends \IPS\Dispatcher\Controller
$form->addTab('permissions');
}
$form->add( new \IPS\Helpers\Form\Select( 'editor_permission_groups', isset( $current[ $button ] ) ? $current[ $button ]['groups'] : '*', TRUE, array( 'options' => \IPS\Member\Group::groups(), 'parse' => 'normal', 'multiple' => TRUE, 'unlimited' => '*', 'unlimitedLang' => 'everyone' ), NULL, NULL, NULL, $b64Button ) );
$form->add( new \IPS\Helpers\Form\Select( 'editor_permission_areas', isset( $current[ $button ] ) ? $current[ $button ]['areas'] : '*', TRUE, array( 'options' => $areas, 'multiple' => TRUE, 'unlimited' => '*', 'unlimitedLang' => 'everywhere' ), NULL, NULL, NULL, 'l' . $b64Button ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'editor_permission_groups', isset( $current[ $button ] ) ? $current[ $button ]['groups'] : '*', TRUE, array( 'options' => \IPS\Member\Group::groups(), 'parse' => 'normal', 'multiple' => TRUE, 'unlimited' => '*', 'unlimitedLang' => 'everyone', 'impliedUnlimited' => TRUE ), NULL, NULL, NULL, $b64Button ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'editor_permission_areas', isset( $current[ $button ] ) ? $current[ $button ]['areas'] : '*', TRUE, array( 'options' => $areas, 'multiple' => TRUE, 'unlimited' => '*', 'unlimitedLang' => 'everywhere', 'impliedUnlimited' => TRUE ), NULL, NULL, NULL, 'l' . $b64Button ) );
/* If this is a custom one, add a delete button */
if ( \in_array( mb_strtolower( $button ), explode( ',', mb_strtolower( \IPS\Settings::i()->ckeditor_extraPlugins ) ) ) or preg_match( '/^custom-\w{32}$/i', $button ) )
@@ -421,6 +421,8 @@ class _toolbar extends \IPS\Dispatcher\Controller
}
}
while( TRUE );
$pluginDirectory = \IPS\SITE_FILES_PATH . '/ckeditor_custom/' . $name;
}
else
{
@@ -435,10 +437,6 @@ class _toolbar extends \IPS\Dispatcher\Controller
}
$pluginDirectory = \IPS\ROOT_PATH . '/applications/core/interface/ckeditor/ckeditor/plugins/' . $name;
if ( \IPS\CIC2 )
{
$pluginDirectory = \IPS\SITE_FILES_PATH . '/ckeditor_custom/' . $name;
}
/* Check it isn't already installed */
if ( \in_array( $name, array_merge( static::$defaultPlugins, explode( ',', \IPS\Settings::i()->ckeditor_extraPlugins ) ) ) )
@@ -482,41 +480,50 @@ class _toolbar extends \IPS\Dispatcher\Controller
}
if ( !file_exists( $path ) )
{
/* If we just extracted some files remove them as the plugin was apparently not valid */
if ( isset( $values['editor_plugin_zip'] ) )
/* If we're on Cloud2, sleep for a few seconds to make sure the plugin isn't just still being transferred */
if( \IPS\CIC2 )
{
if( \is_dir( $pluginDirectory ) )
{
if ( \IPS\CIC2 )
{
\IPS\Cicloud\deleteFolder( 'ckeditor_custom/' . $name );
}
else
{
try
{
$iterator = new \RecursiveDirectoryIterator( $pluginDirectory, \FilesystemIterator::SKIP_DOTS );
foreach ( new \RecursiveIteratorIterator( $iterator, \RecursiveIteratorIterator::CHILD_FIRST ) as $file )
{
if ( $file->isDir() )
{
@rmdir( $file->getPathname() );
}
else
{
@unlink( $file->getPathname() );
}
}
$handle = opendir( $pluginDirectory );
closedir ( $pluginDirectory );
@rmdir( $pluginDirectory );
}
catch( \UnexpectedValueException $e ){}
}
}
sleep(5);
}
\IPS\Output::i()->error( 'editor_bad_plugin', '1C120/B', 400, '' );
if( !file_exists( $path ) )
{
/* If we just extracted some files remove them as the plugin was apparently not valid */
if ( isset( $values['editor_plugin_zip'] ) )
{
if( \is_dir( $pluginDirectory ) )
{
if ( \IPS\CIC2 )
{
\IPS\Cicloud\folderDelete( 'ckeditor_custom/' . $name );
}
else
{
try
{
$iterator = new \RecursiveDirectoryIterator( $pluginDirectory, \FilesystemIterator::SKIP_DOTS );
foreach ( new \RecursiveIteratorIterator( $iterator, \RecursiveIteratorIterator::CHILD_FIRST ) as $file )
{
if ( $file->isDir() )
{
@rmdir( $file->getPathname() );
}
else
{
@unlink( $file->getPathname() );
}
}
$handle = opendir( $pluginDirectory );
closedir ( $pluginDirectory );
@rmdir( $pluginDirectory );
}
catch( \UnexpectedValueException $e ){}
}
}
}
\IPS\Output::i()->error( 'editor_bad_plugin', '1C120/B', 400, '' );
}
}
$file = \file_get_contents( $path );
@@ -545,7 +552,16 @@ class _toolbar extends \IPS\Dispatcher\Controller
{
return str_replace( 'contextmenu', 'ipscontextmenu', $matches[0] );
}, $file );
\file_put_contents( \IPS\ROOT_PATH . '/applications/core/interface/ckeditor/ckeditor/plugins/' . $name . '/plugin.js', $file );
if( \IPS\CIC2 )
{
sleep(5); // @Mark
\IPS\Cicloud\file( 'plugin.js', $file, 'ckeditor_custom/' . $name );
}
else
{
\file_put_contents( \IPS\ROOT_PATH . '/applications/core/interface/ckeditor/ckeditor/plugins/' . $name . '/plugin.js', $file );
}
}
}
@@ -952,7 +968,7 @@ JS;
{
if ( \IPS\CIC2 )
{
\IPS\Cicloud\deleteFolder( "ckeditor_custom/{$key}" );
\IPS\Cicloud\folderDelete( "ckeditor_custom/{$key}" );
}
else
{