Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
package-bricks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QUIQQER
package-bricks
Commits
0ca897fb
Commit
0ca897fb
authored
Aug 19, 2019
by
Henning Leutz
🥋
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
0299085f
a05c38d1
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
182 additions
and
162 deletions
+182
-162
ajax/brick/copy.php
ajax/brick/copy.php
+2
-2
ajax/brick/delete.php
ajax/brick/delete.php
+2
-3
ajax/brick/infinite/row.php
ajax/brick/infinite/row.php
+4
-4
ajax/brick/save.php
ajax/brick/save.php
+2
-2
ajax/contact.php
ajax/contact.php
+2
-2
ajax/getBrick.php
ajax/getBrick.php
+3
-3
ajax/getPanelCategories.php
ajax/getPanelCategories.php
+1
-1
ajax/getPanelCategory.php
ajax/getPanelCategory.php
+1
-1
ajax/getSitesFromBrick.php
ajax/getSitesFromBrick.php
+3
-3
ajax/project/createBrick.php
ajax/project/createBrick.php
+1
-1
ajax/project/getAreas.php
ajax/project/getAreas.php
+1
-1
ajax/project/getBricks.php
ajax/project/getBricks.php
+3
-3
locale.xml
locale.xml
+6
-0
src/QUI/Bricks/Brick.html
src/QUI/Bricks/Brick.html
+9
-4
src/QUI/Bricks/Brick.php
src/QUI/Bricks/Brick.php
+44
-44
src/QUI/Bricks/Controls/Slider/Promoslider.html
src/QUI/Bricks/Controls/Slider/Promoslider.html
+2
-2
src/QUI/Bricks/Controls/Slider/Promoslider.php
src/QUI/Bricks/Controls/Slider/Promoslider.php
+10
-9
src/QUI/Bricks/Events.php
src/QUI/Bricks/Events.php
+25
-25
src/QUI/Bricks/Manager.php
src/QUI/Bricks/Manager.php
+49
-40
src/QUI/Bricks/Panel.php
src/QUI/Bricks/Panel.php
+5
-5
src/QUI/Bricks/Utils.php
src/QUI/Bricks/Utils.php
+7
-7
No files found.
ajax/brick/copy.php
View file @
0ca897fb
...
...
@@ -20,11 +20,11 @@ QUI::$Ajax->registerFunction(
$newId
=
$BrickManager
->
copyBrick
(
$brickId
,
json_decode
(
$params
,
true
)
\
json_decode
(
$params
,
true
)
);
return
$BrickManager
->
getBrickById
(
$newId
)
->
getAttributes
();
},
array
(
'brickId'
,
'params'
)
,
[
'brickId'
,
'params'
]
,
'Permission::checkAdminUser'
);
ajax/brick/delete.php
View file @
0ca897fb
...
...
@@ -13,12 +13,11 @@ QUI::$Ajax->registerFunction(
'package_quiqqer_bricks_ajax_brick_delete'
,
function
(
$brickIds
)
{
$BrickManager
=
QUI\Bricks\Manager
::
init
();
$brickIds
=
json_decode
(
$brickIds
,
true
);
$brickIds
=
\
json_decode
(
$brickIds
,
true
);
foreach
(
$brickIds
as
$brickId
)
{
try
{
$BrickManager
->
deleteBrick
(
$brickId
);
}
catch
(
QUI\Exception
$Exception
)
{
QUI
::
getMessagesHandler
()
->
addAttention
(
$Exception
->
getMessage
()
...
...
@@ -26,6 +25,6 @@ QUI::$Ajax->registerFunction(
}
}
},
array
(
'brickIds'
)
,
[
'brickIds'
]
,
'Permission::checkAdminUser'
);
ajax/brick/infinite/row.php
View file @
0ca897fb
...
...
@@ -23,7 +23,7 @@ QUI::$Ajax->registerFunction(
$Brick
=
$BrickManager
->
getBrickById
(
$brickId
);
}
$settings
=
array_merge
(
$settings
=
\
array_merge
(
$Brick
->
getAttributes
(),
$Brick
->
getSettings
()
);
...
...
@@ -48,12 +48,12 @@ QUI::$Ajax->registerFunction(
$result
=
''
;
for
(
$i
=
0
;
$i
<
$loadingRows
;
$i
++
)
{
$Engine
->
assign
(
array
(
$Engine
->
assign
(
[
'children'
=>
$Infinite
->
getRow
((
int
)
$row
),
'row'
=>
(
int
)
$row
,
'this'
=>
$Infinite
,
'gridClass'
=>
$Infinite
->
getAttribute
(
'gridClass'
)
)
);
]
);
$result
.
=
$Engine
->
fetch
(
$Infinite
->
getRowTemplate
());
$row
++
;
...
...
@@ -61,6 +61,6 @@ QUI::$Ajax->registerFunction(
return
$result
;
},
array
(
'brickId'
,
'brickUID'
,
'row'
)
,
[
'brickId'
,
'brickUID'
,
'row'
]
,
false
);
ajax/brick/save.php
View file @
0ca897fb
...
...
@@ -16,12 +16,12 @@ QUI::$Ajax->registerFunction(
'package_quiqqer_bricks_ajax_brick_save'
,
function
(
$brickId
,
$data
)
{
$BrickManager
=
QUI\Bricks\Manager
::
init
();
$BrickManager
->
saveBrick
(
$brickId
,
json_decode
(
$data
,
true
));
$BrickManager
->
saveBrick
(
$brickId
,
\
json_decode
(
$data
,
true
));
$Brick
=
$BrickManager
->
getBrickById
(
$brickId
);
return
$Brick
->
getAttributes
();
},
array
(
'brickId'
,
'data'
)
,
[
'brickId'
,
'data'
]
,
'Permission::checkAdminUser'
);
ajax/contact.php
View file @
0ca897fb
...
...
@@ -43,8 +43,8 @@ QUI::$Ajax->registerFunction(
$Project
=
QUI
::
getProjectManager
()
->
decode
(
$project
);
$Site
=
$Project
->
get
((
int
)
$siteId
);
$privacyPolicyCheckbox
=
boolval
(
$Site
->
getAttribute
(
'quiqqer.settings.sitetypes.contact.showPrivacyPolicyCheckbox'
));
$useCaptcha
=
boolval
(
$Site
->
getAttribute
(
'quiqqer.settings.sitetypes.contact.useCaptcha'
));
$privacyPolicyCheckbox
=
\
boolval
(
$Site
->
getAttribute
(
'quiqqer.settings.sitetypes.contact.showPrivacyPolicyCheckbox'
));
$useCaptcha
=
\
boolval
(
$Site
->
getAttribute
(
'quiqqer.settings.sitetypes.contact.useCaptcha'
));
if
((
$privacyPolicyCheckbox
||
$privacyPolicyCheckboxBrick
)
&&
!
(
int
)
$privacyPolicyAccepted
)
{
throw
new
QUI\Exception
(
...
...
ajax/getBrick.php
View file @
0ca897fb
...
...
@@ -17,15 +17,15 @@ QUI::$Ajax->registerFunction(
$BrickManager
=
QUI\Bricks\Manager
::
init
();
$Brick
=
$BrickManager
->
getBrickById
(
$brickId
);
return
array
(
return
[
'attributes'
=>
$Brick
->
getAttributes
(),
'settings'
=>
$Brick
->
getSettings
(),
'customfields'
=>
$Brick
->
getCustomFields
(),
'availableSettings'
=>
$BrickManager
->
getAvailableBrickSettingsByBrickType
(
$Brick
->
getAttribute
(
'type'
)
)
)
;
]
;
},
array
(
'brickId'
)
,
[
'brickId'
]
,
'Permission::checkAdminUser'
);
ajax/getPanelCategories.php
View file @
0ca897fb
...
...
@@ -21,6 +21,6 @@ QUI::$Ajax->registerFunction(
return
$categories
;
},
array
(
'brickId'
)
,
[
'brickId'
]
,
'Permission::checkAdminUser'
);
ajax/getPanelCategory.php
View file @
0ca897fb
...
...
@@ -12,6 +12,6 @@ QUI::$Ajax->registerFunction(
function
(
$brickId
,
$category
)
{
return
QUI\Bricks\Panel
::
getInstance
()
->
getCategoryFromBrick
(
$brickId
,
$category
);
},
array
(
'brickId'
,
'category'
)
,
[
'brickId'
,
'category'
]
,
'Permission::checkAdminUser'
);
ajax/getSitesFromBrick.php
View file @
0ca897fb
...
...
@@ -10,12 +10,12 @@
QUI
::
$Ajax
->
registerFunction
(
'package_quiqqer_bricks_ajax_getSitesFromBrick'
,
function
(
$brickId
,
$options
)
{
$options
=
json_decode
(
$options
,
true
);
$options
=
\
json_decode
(
$options
,
true
);
$Bricks
=
QUI\Bricks\Manager
::
init
();
$Brick
=
$Bricks
->
getBrickById
(
$brickId
);
$sites
=
$Bricks
->
getSitesByBrick
(
$Brick
);
$result
=
array_map
(
function
(
$Site
)
{
$result
=
\
array_map
(
function
(
$Site
)
{
/* @var $Site \QUI\Projects\Site */
return
[
'project'
=>
$Site
->
getProject
()
->
getName
(),
...
...
@@ -29,7 +29,7 @@ QUI::$Ajax->registerFunction(
$Grid
=
new
QUI\Utils\Grid
();
return
$Grid
->
parseResult
(
$result
,
count
(
$sites
));
return
$Grid
->
parseResult
(
$result
,
\
count
(
$sites
));
},
[
'brickId'
,
'options'
],
'Permission::checkAdminUser'
...
...
ajax/project/createBrick.php
View file @
0ca897fb
...
...
@@ -22,6 +22,6 @@ QUI::$Ajax->registerFunction(
return
$BrickManager
->
createBrickForProject
(
$Project
,
$Brick
);
},
array
(
'project'
,
'data'
)
,
[
'project'
,
'data'
]
,
'Permission::checkAdminUser'
);
ajax/project/getAreas.php
View file @
0ca897fb
...
...
@@ -20,6 +20,6 @@ QUI::$Ajax->registerFunction(
return
$BrickManager
->
getAreasByProject
(
$Project
,
$layout
);
},
array
(
'project'
,
'layout'
)
,
[
'project'
,
'layout'
]
,
'Permission::checkAdminUser'
);
ajax/project/getBricks.php
View file @
0ca897fb
...
...
@@ -19,7 +19,7 @@ QUI::$Ajax->registerFunction(
$BrickManager
=
QUI\Bricks\Manager
::
init
();
$bricks
=
$BrickManager
->
getBricksFromProject
(
$Project
);
$result
=
array
()
;
$result
=
[]
;
foreach
(
$bricks
as
$Brick
)
{
/* @var $Brick QUI\Bricks\Brick */
...
...
@@ -30,13 +30,13 @@ QUI::$Ajax->registerFunction(
$areas
=
$Brick
->
getAttribute
(
'areas'
);
if
(
strpos
(
$areas
,
','
.
$area
.
','
)
!==
false
)
{
if
(
\
strpos
(
$areas
,
','
.
$area
.
','
)
!==
false
)
{
$result
[]
=
$Brick
->
getAttributes
();
}
}
return
$result
;
},
array
(
'project'
,
'area'
)
,
[
'project'
,
'area'
]
,
'Permission::checkAdminUser'
);
locale.xml
View file @
0ca897fb
...
...
@@ -1517,6 +1517,12 @@ Möchten Sie die Bausteine aus der Bausteinzone entfernen?</p>]]></de>
<pl>
<![CDATA[Pokaż godzinę]]>
</pl>
</locale>
<!-- show pagination / sheets -->
<locale
name=
"brick.showSheets"
>
<de>
<![CDATA[Seitennummerierung anzeigen]]>
</de>
<en>
<![CDATA[Show sheets (pagination)]]>
</en>
</locale>
<!-- show images -->
<locale
name=
"brick.showImages"
>
<de>
<![CDATA[Bild anzeigen]]>
</de>
...
...
src/QUI/Bricks/Brick.html
View file @
0ca897fb
<div
{$
classesStr
}
>
{if $this->getAttribute('showTitle')
&&
$this->getAttribute('
t
itle')}
<header>
<h
2>
{$this->getAttribute('title')}
</h2
>
{if $this->getAttribute('showTitle')
&&
$this->getAttribute('
frontendT
itle')}
<header
class=
"control-header"
>
<h
1>
{$this->getAttribute('frontendTitle')}
</h1
>
</header>
{/if}
{$this->getAttribute('content')}
{if $this->getAttribute('content') != ""}
<div
class=
"control-content"
>
{$this->getAttribute('content')}
</div>
{/if}
</div>
\ No newline at end of file
src/QUI/Bricks/Brick.php
View file @
0ca897fb
...
...
@@ -37,14 +37,14 @@ class Brick extends QUI\QDOM
*
* @var array
*/
protected
$settings
=
array
()
;
protected
$settings
=
[]
;
/**
* Fields can be overwritten by another user
*
* @var array
*/
protected
$customfields
=
array
()
;
protected
$customfields
=
[]
;
/**
* Internal control
...
...
@@ -58,17 +58,17 @@ class Brick extends QUI\QDOM
*
* @var array
*/
protected
$cssClasses
=
array
()
;
protected
$cssClasses
=
[]
;
/**
* Constructor
*
* @param array $params - brick params
*/
public
function
__construct
(
$params
=
array
()
)
public
function
__construct
(
$params
=
[]
)
{
// default
$default
=
array
(
$default
=
[
'type'
=>
'content'
,
'content'
=>
''
,
'title'
=>
''
,
...
...
@@ -81,7 +81,7 @@ class Brick extends QUI\QDOM
'classes'
=>
''
,
'frontendTitle'
=>
''
,
'hasContent'
=>
1
)
;
]
;
$this
->
setAttributes
(
$default
);
...
...
@@ -100,10 +100,10 @@ class Brick extends QUI\QDOM
}
if
(
isset
(
$params
[
'classes'
]))
{
$cssClasses
=
json_decode
(
$params
[
'classes'
],
true
);
$cssClasses
=
\
json_decode
(
$params
[
'classes'
],
true
);
if
(
!
$cssClasses
)
{
$cssClasses
=
array
()
;
$cssClasses
=
[]
;
}
foreach
(
$cssClasses
as
$cssClass
)
{
...
...
@@ -133,7 +133,7 @@ class Brick extends QUI\QDOM
// control default settings
if
(
is_object
(
$Control
))
{
if
(
\
is_object
(
$Control
))
{
$controlSettings
=
$Control
->
getAttributes
();
foreach
(
$this
->
settings
as
$key
=>
$value
)
{
...
...
@@ -147,11 +147,11 @@ class Brick extends QUI\QDOM
if
(
isset
(
$params
[
'settings'
]))
{
$settings
=
$params
[
'settings'
];
if
(
is_string
(
$settings
))
{
$settings
=
json_decode
(
$settings
,
true
);
if
(
\
is_string
(
$settings
))
{
$settings
=
\
json_decode
(
$settings
,
true
);
}
if
(
is_array
(
$settings
))
{
if
(
\
is_array
(
$settings
))
{
foreach
(
$this
->
settings
as
$key
=>
$value
)
{
if
(
isset
(
$settings
[
$key
]))
{
$this
->
settings
[
$key
]
=
$settings
[
$key
];
...
...
@@ -164,11 +164,11 @@ class Brick extends QUI\QDOM
if
(
isset
(
$params
[
'customfields'
]))
{
$customfields
=
$params
[
'customfields'
];
if
(
is_string
(
$customfields
))
{
$customfields
=
json_decode
(
$customfields
,
true
);
if
(
\
is_string
(
$customfields
))
{
$customfields
=
\
json_decode
(
$customfields
,
true
);
}
if
(
is_array
(
$customfields
))
{
if
(
\
is_array
(
$customfields
))
{
$this
->
customfields
=
$customfields
;
}
}
...
...
@@ -183,11 +183,11 @@ class Brick extends QUI\QDOM
{
$Control
=
$this
->
getControl
();
if
(
is_object
(
$Control
))
{
return
get_class
(
$Control
);
if
(
\
is_object
(
$Control
))
{
return
\
get_class
(
$Control
);
}
return
get_class
(
$this
);
return
\
get_class
(
$this
);
}
/**
...
...
@@ -200,7 +200,7 @@ class Brick extends QUI\QDOM
{
$Control
=
$this
->
getControl
();
if
(
is_object
(
$Control
))
{
if
(
\
is_object
(
$Control
))
{
return
$Control
instanceof
$className
;
}
...
...
@@ -210,8 +210,8 @@ class Brick extends QUI\QDOM
/**
* Check, if control canbe created
*
* @throws QUI\Exception
* @return QUI\Bricks\Brick
* @throws QUI\Exception
*/
public
function
check
()
{
...
...
@@ -240,15 +240,15 @@ class Brick extends QUI\QDOM
public
function
create
()
{
if
(
$this
->
getAttribute
(
'type'
)
==
'content'
)
{
$_classes
=
array
(
$_classes
=
[
'brick-'
.
$this
->
id
)
;
]
;
//check if is json
if
(
is_string
(
$this
->
cssClasses
))
{
$jsonArray
=
json_decode
(
$this
->
cssClasses
);
if
(
\
is_string
(
$this
->
cssClasses
))
{
$jsonArray
=
\
json_decode
(
$this
->
cssClasses
);
if
(
is_array
(
$jsonArray
))
{
if
(
\
is_array
(
$jsonArray
))
{
$this
->
cssClasses
=
$jsonArray
;
}
}
...
...
@@ -260,36 +260,36 @@ class Brick extends QUI\QDOM
$oldCssClasses
=
$this
->
getAttribute
(
'classes'
);
$oldCssClassesJson
=
json_decode
(
$oldCssClasses
,
true
);
$oldCssClassesJson
=
\
json_decode
(
$oldCssClasses
,
true
);
if
(
is_array
(
$oldCssClassesJson
))
{
if
(
\
is_array
(
$oldCssClassesJson
))
{
$oldCssClasses
=
$oldCssClassesJson
;
}
$classes
=
$oldCssClasses
;
$classes
=
$oldCssClasses
;
if
(
is_string
(
$oldCssClasses
))
{
$classes
=
explode
(
' '
,
$oldCssClasses
);
if
(
\
is_string
(
$oldCssClasses
))
{
$classes
=
\
explode
(
' '
,
$oldCssClasses
);
}
foreach
(
$classes
as
$class
)
{
$class
=
trim
(
$class
);
$class
=
\
trim
(
$class
);
$_classes
[]
=
$class
;
}
$_classes
=
array_unique
(
$_classes
);
$classesStr
=
implode
(
$_classes
,
' '
);
$_classes
=
\
array_unique
(
$_classes
);
$classesStr
=
\
implode
(
$_classes
,
' '
);
$classesStr
=
'class="'
.
$classesStr
.
'"'
;
$Engine
=
QUI
::
getTemplateManager
()
->
getEngine
();
$Engine
->
assign
(
array
(
$Engine
->
assign
(
[
'this'
=>
$this
,
'classesStr'
=>
$classesStr
)
);
]
);
return
$Engine
->
fetch
(
dirname
(
__FILE__
)
.
'/Brick.html'
);
return
$Engine
->
fetch
(
\
dirname
(
__FILE__
)
.
'/Brick.html'
);
}
$Control
=
$this
->
getControl
();
...
...
@@ -341,13 +341,13 @@ class Brick extends QUI\QDOM
return
true
;
}
if
(
!
is_callable
(
$Ctrl
)
&&
!
class_exists
(
$Ctrl
))
{
if
(
!
\
is_callable
(
$Ctrl
)
&&
!
\
class_exists
(
$Ctrl
))
{
return
false
;
}
/* @var $Control \QUI\Control */
$Control
=
new
$Ctrl
(
array_merge
(
$this
->
getSettings
(),
$this
->
getAttributes
())
\
array_merge
(
$this
->
getSettings
(),
$this
->
getAttributes
())
);
$Control
->
setAttribute
(
'height'
,
$this
->
getAttribute
(
'height'
));
...
...
@@ -459,7 +459,7 @@ class Brick extends QUI\QDOM
*/
public
function
addCSSClass
(
$cssClass
)
{
if
(
!
is_string
(
$cssClass
))
{
if
(
!
\
is_string
(
$cssClass
))
{
return
;
}
...
...
@@ -468,9 +468,9 @@ class Brick extends QUI\QDOM
}
$classes
=
QUI\ControlUtils
::
clearClassName
(
$cssClass
);
$classes
=
explode
(
' '
,
$classes
);
$classes
=
\
explode
(
' '
,
$classes
);
$keys
=
array_flip
(
$this
->
cssClasses
);
$keys
=
\
array_flip
(
$this
->
cssClasses
);
foreach
(
$classes
as
$cssClass
)
{
if
(
!
isset
(
$keys
[
$cssClass
]))
{
...
...
@@ -485,7 +485,7 @@ class Brick extends QUI\QDOM
*/
public
function
clearCSSClasses
()
{
$this
->
cssClasses
=
array
()
;
$this
->
cssClasses
=
[]
;
}
/**
...
...
@@ -508,7 +508,7 @@ class Brick extends QUI\QDOM
public
function
hasCSSClass
(
$pattern
)
{
if
(
$this
->
getAttribute
(
'classes'
)
&&
fnmatch
(
$pattern
,
$this
->
getAttribute
(
'classes'
))
&&
\
fnmatch
(
$pattern
,
$this
->
getAttribute
(
'classes'
))
)
{
return
true
;
}
...
...
@@ -518,7 +518,7 @@ class Brick extends QUI\QDOM
}
foreach
(
$this
->
cssClasses
as
$cssClass
)
{
if
(
fnmatch
(
$pattern
,
$cssClass
))
{
if
(
\
fnmatch
(
$pattern
,
$cssClass
))
{
return
true
;
}
}
...
...
src/QUI/Bricks/Controls/Slider/Promoslider.html
View file @
0ca897fb
...
...
@@ -29,7 +29,7 @@
>
</div>
{elseif $slide.image}
<div
class=
"quiqqer-bricks-promoslider-slide-image"
>
{image image=$slide.image}
{image image=$slide.image
width=$imageSize
}
</div>
{/if}
...
...
@@ -78,7 +78,7 @@
>
</div>
{elseif $slide.image}
<div
class=
"quiqqer-bricks-promoslider-slide-mobile-image"
>
{image image=$slide.image}
{image image=$slide.image
width=$imageSize
}
</div>
{/if}
...
...
src/QUI/Bricks/Controls/Slider/Promoslider.php
View file @
0ca897fb
...
...
@@ -21,10 +21,10 @@ class Promoslider extends AbstractPromoslider
*
* @param array $attributes
*/
public
function
__construct
(
$attributes
=
array
()
)
public
function
__construct
(
$attributes
=
[]
)
{
// default options
$this
->
setAttributes
(
array
(
$this
->
setAttributes
(
[
'title'
=>
''
,
'text'
=>
''
,
'class'
=>
'quiqqer-bricks-promoslider'
,
...
...
@@ -36,8 +36,9 @@ class Promoslider extends AbstractPromoslider
'image-wallpaper-attachment'
=>
false
,
'autostart'
=>
false
,
'delay'
=>
5000
,
'isMobileSlidesEnabled'
=>
false
));
'isMobileSlidesEnabled'
=>
false
,
'imageSize'
=>
false
// false = use original size, do not create srcset
]);
$this
->
addCSSFile
(
dirname
(
__FILE__
)
.
'/Promoslider.css'
...
...
@@ -46,7 +47,6 @@ class Promoslider extends AbstractPromoslider
$this
->
addCSSClass
(
'grid-100'
);
$this
->
addCSSClass
(
'mobile-grid-100'
);
parent
::
__construct
(
$attributes
);
}
...
...
@@ -169,12 +169,13 @@ class Promoslider extends AbstractPromoslider
$this
->
parseSlides
(
$this
->
getAttribute
(
'desktopslides'
),
'desktop'
);
$options
=
array
(
$options
=
[
'this'
=>
$this
,
'desktopSlides'
=>
$this
->
desktopSlides
,
'Utils'
=>
new
Utils
()
);
'Utils'
=>
new
Utils
(),
'imageSize'
=>
$this
->
getAttribute
(
'imageSize'
)
];
if
(
$this
->
getAttribute
(
'isMobileSlidesEnabled'
)
===
"true"
)
{
$this
->
parseSlides
(
$this
->
getAttribute
(
'mobileslides'
),
'mobile'
);
...
...
src/QUI/Bricks/Events.php
View file @
0ca897fb
...
...
@@ -17,7 +17,7 @@ use QUI\Projects\Site\Edit;
*/
class
Events
{
protected
static
$saved
=
array
()
;
protected
static
$saved
=
[]
;
/**
* Event : on site save
...
...
@@ -35,7 +35,7 @@ class Events
QUI\Permissions\Permission
::
checkPermission
(
'quiqqer.bricks.assign'
);
$areas
=
$Site
->
getAttribute
(
'quiqqer.bricks.areas'
);
$areas
=
json_decode
(
$areas
,
true
);
$areas
=
\
json_decode
(
$areas
,
true
);
if
(
!
$areas
||
empty
(
$areas
))
{
return
;
...
...
@@ -49,7 +49,7 @@ class Events
$projectTable
=
QUI
::
getDBProjectTableName
(
Manager
::
TABLE_CACHE
,
$Project
);
$uidTable
=
QUI\Bricks\Manager
::
getUIDTable
();
$availableUniqueIds
=
array
()
;
$availableUniqueIds
=
[]
;
foreach
(
$projectAreas
as
$area
)
{
if
(
!
$area
[
'inheritance'
])
{
...
...
@@ -67,18 +67,18 @@ class Events
$bricks
=
$areas
[
$area
[
'name'
]];
// clear area and new data set
QUI
::
getDataBase
()
->
delete
(
$projectTable
,
array
(
QUI
::
getDataBase
()
->
delete
(
$projectTable
,
[
'id'
=>
$Site
->
getId
(),
'area'
=>
$area
[
'name'
]
)
);
]
);
// check if deactivated
if
(
isset
(
$bricks
[
0
])
&&
isset
(
$bricks
[
0
][
'deactivate'
]))
{
QUI
::
getDataBase
()
->
insert
(
$projectTable
,
array
(
QUI
::
getDataBase
()
->
insert
(
$projectTable
,
[
'id'
=>
$Site
->
getId
(),
'area'
=>
$area
[
'name'
],
'brick'
=>
-
1
)
);
]
);
continue
;
}
...
...
@@ -103,14 +103,14 @@ class Events
$availableUniqueIds
[]
=
$uid
;
$customFields
=
array
()
;
$customFields
=
[]
;
// Custom data cache
if
(
isset
(
$brick
[
'customfields'
])
&&
is_string
(
$brick
[
'customfields'
]))
{
$customFields
=
json_decode
(
$brick
[
'customfields'
],
true
);
if
(
isset
(
$brick
[
'customfields'
])
&&
\
is_string
(
$brick
[
'customfields'
]))
{
$customFields
=
\
json_decode
(
$brick
[
'customfields'
],
true
);
}
if
(
isset
(
$brick
[
'customfields'
])
&&
is_array
(
$brick
[
'customfields'
]))
{
if
(
isset
(
$brick
[
'customfields'
])
&&
\
is_array
(
$brick
[
'customfields'
]))
{
$customFields
=
$brick
[
'customfields'
];
}
...
...
@@ -118,45 +118,45 @@ class Events
continue
;
}
QUI
::
getDataBase
()
->
insert
(
$projectTable
,
array
(
QUI
::
getDataBase
()
->
insert
(
$projectTable
,
[
'id'
=>
$Site
->
getId
(),
'area'
=>
$area
[
'name'
],
'brick'
=>
(
int
)
$brick
[
'brickId'
]
)
);
]
);
}
}
// cleanup unique ids
$uniquerIdsInDataBase
=
QUI
::
getDataBase
()
->
fetch
(
array
(
$uniquerIdsInDataBase
=
QUI
::
getDataBase
()
->
fetch
(
[
'select'
=>
'uid'
,
'from'
=>
$uidTable
,
'where'
=>
array
(
'where'
=>
[
'project'
=>
$Project
->
getName
(),
'lang'
=>
$Project
->
getLang
(),
'siteId'
=>
$Site
->
getId
()