Skip to content
Code-Schnipsel Gruppen Projekte
Commit 7a9e29ff erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Issue #32 In den Bausteinen werden keine CSS-Klassen übernommen

Übergeordneter bad61d87
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
Pipeline #677 übersprungen
......@@ -298,7 +298,7 @@ define('package/quiqqer/bricks/bin/BrickEdit', [
var data = this.getAttribute('data');
this.$unload();
console.log(data);
this.setAttribute('data', data);
this.$Active = Button;
......@@ -354,7 +354,7 @@ define('package/quiqqer/bricks/bin/BrickEdit', [
var Form = this.getContent().getElement('form'),
unload = this.$Active.getAttribute('name'),
data = this.getAttribute('data');
console.log(unload);
if (unload == 'information') {
data.attributes = Object.merge(
data.attributes,
......
......@@ -69,15 +69,15 @@ public function __construct($params = array())
{
// default
$default = array(
'type' => 'content',
'content' => '',
'title' => '',
'type' => 'content',
'content' => '',
'title' => '',
'description' => '',
'project' => '',
'areas' => '',
'height' => '',
'width' => '',
'classes' => ''
'project' => '',
'areas' => '',
'height' => '',
'width' => '',
'classes' => ''
);
$this->setAttributes($default);
......@@ -96,6 +96,16 @@ public function __construct($params = array())
$this->uniqueId = $params['uniqueId'];
}
if (isset($params['classes'])) {
$cssClasses = json_decode($params['classes'], true);
foreach ($cssClasses as $cssClass) {
$this->addCSSClass($cssClass);
}
unset($params['classes']);
}
// default settings from control
$Control = $this->getControl();
$Manager = Manager::init();
......@@ -326,6 +336,8 @@ protected function getControl()
*/
public function getSettings()
{
$this->settings['classes'] = $this->getCSSClasses();
return $this->settings;
}
......@@ -356,6 +368,10 @@ public function setSettings($settings)
*/
public function getSetting($name)
{
if ($name === 'classes') {
return $this->getCSSClasses();
}
if (isset($this->settings[$name])) {
return $this->settings[$name];
}
......@@ -397,7 +413,19 @@ public function getCustomFields()
*/
public function addCSSClass($cssClass)
{
$this->cssClasses[] = $cssClass;
if (!empty($cssClass)) {
$this->cssClasses[] = $cssClass;
}
}
/**
* Return all css classes
*
* @return array
*/
public function getCSSClasses()
{
return $this->cssClasses;
}
/**
......
......@@ -615,7 +615,6 @@ public function saveBrick($brickId, array $brickData)
}
}
// update
QUI::getDataBase()->update($this->getTable(), array(
'title' => $Brick->getAttribute('title'),
......@@ -627,7 +626,7 @@ public function saveBrick($brickId, array $brickData)
'areas' => $areaString,
'height' => $Brick->getAttribute('height'),
'width' => $Brick->getAttribute('width'),
'classes' => $Brick->getAttribute('classes')
'classes' => json_encode($Brick->getCSSClasses())
), array(
'id' => (int)$brickId
));
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren