diff --git a/modules/cms/classes/CmsCompoundObject.php b/modules/cms/classes/CmsCompoundObject.php index deb9f8673..33a286331 100644 --- a/modules/cms/classes/CmsCompoundObject.php +++ b/modules/cms/classes/CmsCompoundObject.php @@ -43,6 +43,12 @@ class CmsCompoundObject extends CmsObject */ public $markup; + /** + * @var array Contains the view bag properties. + * This property is used by the page editor internally. + */ + public $viewBag = []; + protected static $fillable = [ 'markup', 'settings', @@ -417,6 +423,18 @@ class CmsCompoundObject extends CmsObject */ protected function parseSettings() { + $this->fillViewBagArray(); + } + + /* + * Copies view bag properties to the view bag array. + * This is required for the back-end editors. + */ + protected function fillViewBagArray() + { + $viewBag = $this->getViewBag(); + foreach ($viewBag->getProperties() as $name=>$value) + $this->viewBag[$name] = $value; } /** diff --git a/modules/cms/controllers/Index.php b/modules/cms/controllers/Index.php index 3c4f23d93..ae5498df6 100644 --- a/modules/cms/controllers/Index.php +++ b/modules/cms/controllers/Index.php @@ -440,6 +440,9 @@ class Index extends Controller $settings[$section] = $properties; } + if (array_key_exists('viewBag', $_POST)) + $settings['viewBag'] = $_POST['viewBag']; + return $settings; }