Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+19 -1
View File
@@ -11,8 +11,11 @@
namespace IPS\cms\widgets;
use Error;
use Exception;
use IPS\Application\Module;
use IPS\Data\Store;
use IPS\Dispatcher;
use IPS\Helpers\Form;
use IPS\Http\Url;
use IPS\Log;
@@ -46,6 +49,18 @@ class Codemirror extends Widget
public bool $allowNoBox = true;
/**
* Constructor
*
* @param array|string $app Application key (core,cms,gallery, etc)
* @return bool
*/
public function isExecutableByApp( array|string $app ): bool
{
$module = Module::get( 'core', 'customization', 'admin' );
return Dispatcher::i()->checkAcpPermission( 'theme_sets_manage', 'core', $module, true );
}
/**
* Specify widget configuration
*
@@ -102,6 +117,9 @@ class Codemirror extends Widget
unset( Store::i()->$functionName );
}
/* Escape ${ */
$values['content'] = preg_replace('/(?<!\\\\)\$\{/', '\\\${', $values['content'] );
return $values;
}
@@ -141,7 +159,7 @@ class Codemirror extends Widget
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_core.js', 'core' ) );
return $this->output( $themeFunction() );
}
catch( Exception $e )
catch( Error | Exception $e )
{
Log::log( $e->getMessage(), 'codeblock' );
return "";
@@ -56,6 +56,22 @@ class DatabaseFilters extends Widget
*/
public string $app = 'cms';
/**
* Can this widget be used on this page?
*
* @param string $app
* @param string $module
* @param string $controller
* @return bool
*/
public function isExecutableByPage( string $app, string $module, string $controller ) : bool
{
/* This is only available on database pages. It's a little tricky to narrow it down further than the app,
as all the databases are piped through the page controller. */
return $app == 'cms';
}
/**
* Render a widget
*
+4 -2
View File
@@ -93,8 +93,6 @@ implements Polymorphic
return new $widgetClass( $uniqueKey, $configuration, $access, $orientation, $layout );
}
parent::__construct( $uniqueKey, $configuration, $access, $orientation, $layout );
/* Force the database to be set to the DatabaseID */
if( !isset( $this->configuration['cms_rf_database'] ) )
{
@@ -104,6 +102,10 @@ implements Polymorphic
$this->key = 'RecordFeed' . static::$customDatabaseId;
static::$class = 'IPS\cms\Records' . static::$customDatabaseId;
parent::__construct( $uniqueKey, $configuration, $access, $orientation, $layout );
/* Load block title and description */
Member::loggedIn()->language()->words[ 'block_RecordFeed' . static::$customDatabaseId ] = Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name', FALSE, array('sprintf' => array( Member::loggedIn()->language()->addToStack('content_db_' . static::$customDatabaseId ) ) ) );
Member::loggedIn()->language()->words[ 'block_RecordFeed' . static::$customDatabaseId . '_desc' ] = Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name_desc', false, array( 'sprintf' => array( Member::loggedIn()->language()->addToStack( 'content_db_lang_pl_' . static::$customDatabaseId ) ) ) );