diff --git a/ajax/getBrick.php b/ajax/getBrick.php index 745ca27c53798f6bbb818bea950d2a8071833ad0..36113b6f5a1833a264e61e610ccf9e7918b224e4 100644 --- a/ajax/getBrick.php +++ b/ajax/getBrick.php @@ -18,9 +18,9 @@ function ($brickId) { $Brick = $BrickManager->getBrickById($brickId); return array( - 'attributes' => $Brick->getAttributes(), - 'settings' => $Brick->getSettings(), - 'customfields' => $Brick->getCustomFields(), + 'attributes' => $Brick->getAttributes(), + 'settings' => $Brick->getSettings(), + 'customfields' => $Brick->getCustomFields(), 'availableSettings' => $BrickManager->getAvailableBrickSettingsByBrickType( $Brick->getAttribute('type') ) diff --git a/bin/BrickEdit.js b/bin/BrickEdit.js index aea46ba1209ac11ccd01cf7793960ea47c915223..7b8009035d1765b31365bdc254a97f7e11d88ea0 100644 --- a/bin/BrickEdit.js +++ b/bin/BrickEdit.js @@ -174,6 +174,16 @@ define('package/quiqqer/bricks/bin/BrickEdit', [ }) }); + // brick xml settings + var type = brick.attributes.type; + var data = bricks.filter(function (entry) { + return entry.control === type; + }); + + if (data.length && data[0].hasContent === 0) { + this.getCategory('content').hide(); + } + this.refresh(); this.fireEvent('loaded', [this]); diff --git a/bricks.xml b/bricks.xml index 0678fc4ef7d97d9917ef3eaa4799217e564992fd..4da1eeadf0d31568e830a1b00d23a363cd3b052a 100644 --- a/bricks.xml +++ b/bricks.xml @@ -2,7 +2,7 @@ <quiqqer> <bricks> <!-- available standard bricks --> - <brick control="\QUI\Controls\Breadcrumb"> + <brick control="\QUI\Controls\Breadcrumb" hasContent="0"> <title> <locale group="quiqqer/bricks" var="brick.control.breadcrumb.title"/> </title> diff --git a/src/QUI/Bricks/Brick.php b/src/QUI/Bricks/Brick.php index 6c8b0b61fc7beb034c624ef1d2e82c9acf99a105..6f207eb2b0bc10707eaf510d84d5f8f55e9a2a34 100644 --- a/src/QUI/Bricks/Brick.php +++ b/src/QUI/Bricks/Brick.php @@ -79,7 +79,8 @@ public function __construct($params = array()) 'height' => '', 'width' => '', 'classes' => '', - 'frontendTitle' => '' + 'frontendTitle' => '', + 'hasContent' => 1 ); $this->setAttributes($default); diff --git a/src/QUI/Bricks/Utils.php b/src/QUI/Bricks/Utils.php index a026be586aa3c3199b26527704ed905388fbf55c..e8e44ea76d60af42548c665559dd7bde125bd701 100644 --- a/src/QUI/Bricks/Utils.php +++ b/src/QUI/Bricks/Utils.php @@ -121,8 +121,16 @@ public static function getTypeTemplateAreasFromXML($file, $siteType) */ public static function parseAreaToArray(\DOMElement $Brick, \DOMXPath $Path) { - $control = $Brick->getAttribute('control'); - $name = $Brick->getAttribute('name'); + $control = $Brick->getAttribute('control'); + $name = $Brick->getAttribute('name'); + + $hasContent = 1; + + if ($Brick->hasAttribute('hasContent') + && (int)$Brick->getAttribute('hasContent') === 0) { + $hasContent = 0; + } + $title = array(); $description = array(); @@ -145,6 +153,7 @@ public static function parseAreaToArray(\DOMElement $Brick, \DOMXPath $Path) return array( 'control' => $control, + 'hasContent' => $hasContent, 'name' => $name, 'title' => $title, 'description' => $description,