Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+20 -11
View File
@@ -212,8 +212,15 @@ class _Block extends \IPS\Node\Model implements \IPS\Node\Permissions
{
unset( \IPS\Data\Store::i()->$functionName );
}
return call_user_func( 'IPS\\Theme\\'. $functionName );
$html = call_user_func( 'IPS\\Theme\\'. $functionName );
if( $block->getConfig('editor') == 'editor' )
{
$html = \IPS\Theme::i()->getTemplate( 'widgets', 'cms', 'front' )->Wysiwyg( $html, $orientation );
}
return $html;
}
catch ( \ParseError $e )
{
@@ -351,7 +358,7 @@ EOF;
/**
* @brief Orientation for an embedded widget
*/
protected $orientation = NULL;
public $orientation = NULL;
/**
* Get config as an array if no $key, or as whatever type corresponds to key
@@ -639,14 +646,16 @@ EOF;
}
else
{
$form->add( new \IPS\Helpers\Form\Codemirror( 'block_content', htmlentities( $this->content, \IPS\HTMLENTITIES, 'UTF-8', TRUE ), FALSE, array(), function( $val ) {
$form->add( new \IPS\Helpers\Form\Codemirror( 'block_content', htmlentities( $this->content, ENT_DISALLOWED, 'UTF-8', TRUE ), FALSE, array(), function( $val ) {
if ( \IPS\Request::i()->block_editor == 'php' )
{
try
{
ob_start();
@eval( $val );
ob_get_clean();
}
catch ( \ParseError $e )
catch ( \Exception $e )
{
throw new \DomainException( $e->getMessage() );
}
@@ -763,7 +772,7 @@ EOF;
/* It's taken... */
if ( $this->id != $block->id )
{
$values['block_key'] .= '_' . uniqid();
$values['block_key'] .= '_' . mt_rand();
}
}
catch( \OutOfRangeException $ex )
@@ -864,7 +873,7 @@ EOF;
$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];
$templateArray = array(
'key' => 'template_' . $templateBit['template_name'] . '.' . uniqid(),
'key' => 'template_' . $templateBit['template_name'] . '.' . mt_rand(),
'title' => str_replace( '-', '_', \IPS\Http\Url\Friendly::seoTitle( $values['block_save_as_template_name'] ? $values['block_save_as_template_name'] : $templateBit['template_name'] . '_' . \IPS\Member::loggedIn()->language()->get('copy_noun') ) ),
'desc' => null,
'content' => $values['block_content'],
@@ -884,7 +893,7 @@ EOF;
$template = \IPS\cms\Templates::load( $values['block_template_id'] );
$templateArray = array(
'key' => 'template_' . $template->name . '.' . uniqid(),
'key' => 'template_' . $template->name . '.' . mt_rand(),
'title' => str_replace( '-', '_', \IPS\Http\Url\Friendly::seoTitle( $values['block_save_as_template_name'] ? $values['block_save_as_template_name'] : $template->name . '_' . \IPS\Member::loggedIn()->language()->get('copy_noun') ) ),
'desc' => null,
'content' => $values['block_content'],
@@ -991,7 +1000,7 @@ EOF;
if ( ! $this->widgetLoaded )
{
$this->widgetLoaded = \IPS\Widget::load( $this->plugin_app ? \IPS\Application::load( $this->plugin_app ) : \IPS\Plugin::load( $this->plugin_plugin ), $this->plugin, uniqid(), $this->_plugin_config, NULL, $this->orientation );
$this->widgetLoaded = \IPS\Widget::load( $this->plugin_app ? \IPS\Application::load( $this->plugin_app ) : \IPS\Plugin::load( $this->plugin_plugin ), $this->plugin, mt_rand(), $this->_plugin_config, NULL, $this->orientation );
}
return $this->widgetLoaded;
@@ -1016,7 +1025,7 @@ EOF;
/* Copy language bits to make them unique */
$config = $this->_plugin_config;
$wordKey = 'widget_title_' . md5( uniqid() );
$wordKey = 'widget_title_' . md5( mt_rand() );
if ( isset( $config['language_key'] ) )
{
@@ -1035,7 +1044,7 @@ EOF;
$this->plugin_config = json_encode( $config );
}
$this->key .= '_' . uniqid();
$this->key .= '_' . mt_rand();
$this->save();
}
}