Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -31,6 +31,7 @@ use IPS\Http\Url\Internal;
|
||||
use IPS\Output\Javascript;
|
||||
use IPS\Output\System as SystemOutput;
|
||||
use IPS\Session\Front;
|
||||
use IPS\Widget\Area;
|
||||
use OutOfRangeException;
|
||||
use RuntimeException;
|
||||
use UnderflowException;
|
||||
@@ -43,12 +44,18 @@ use function get_called_class;
|
||||
use function in_array;
|
||||
use function intval;
|
||||
use function is_array;
|
||||
use function json_encode;
|
||||
use function ob_start;
|
||||
use function stristr;
|
||||
use function strlen;
|
||||
use function strpos;
|
||||
use function strstr;
|
||||
use function substr;
|
||||
use const JSON_HEX_AMP;
|
||||
use const JSON_HEX_APOS;
|
||||
use const JSON_HEX_TAG;
|
||||
use const JSON_PRETTY_PRINT;
|
||||
use const JSON_UNESCAPED_SLASHES;
|
||||
use const LIVE_TOPICS_DEV;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
@@ -1165,7 +1172,17 @@ class Output
|
||||
/* VLE language bits now parseOutputForDisplay has run */
|
||||
if ( Lang::vleActive() )
|
||||
{
|
||||
$output = str_replace( '<!--ipsVleWords-->', 'var ipsVle = ' . json_encode( Member::loggedIn()->language()->vleForJson(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS ) . ';', $output );
|
||||
if ( str_contains( $output, "<!--ipsVleWords-->" ) )
|
||||
{
|
||||
$vleObj = json_encode( Member::loggedIn()->language()->vleForJson(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS );
|
||||
$vleScriptContent = <<<JS
|
||||
|
||||
window.ipsVle = window.ipsVle || {};
|
||||
Object.assign(window.ipsVle, $vleObj);
|
||||
JS;
|
||||
|
||||
$output = str_replace( '<!--ipsVleWords-->', $vleScriptContent, $output );
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for any autosave cookies */
|
||||
@@ -1615,6 +1632,37 @@ class Output
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load any areas that should be displayed on all pages
|
||||
* For example, the global footer is always loaded
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function loadGlobalAreas() : void
|
||||
{
|
||||
foreach( Db::i()->select( '*', 'core_widget_areas', [ 'app=? and module=? and controller=?', 'global', 'global', 'global'] ) as $row )
|
||||
{
|
||||
if( in_array( $row['area'], Area::$reservedAreas ) )
|
||||
{
|
||||
if( $row['tree'] )
|
||||
{
|
||||
$area = new Area( json_decode( $row['tree'], true ), $row['area'] );
|
||||
}
|
||||
elseif( $row['widgets'] )
|
||||
{
|
||||
$area = Area::create( $row['area'], json_decode( $row['widgets'], true ) );
|
||||
}
|
||||
|
||||
if( isset( $area ) )
|
||||
{
|
||||
$this->sidebar['widgetareas'] = $this->sidebar['widgetareas'] ?? [];
|
||||
$this->sidebar['widgetareas'][$area->id] = $area;
|
||||
$this->sidebar['widgets'][$area->id] = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks and rebuilds JS map if it is broken
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user