Skip to content
Code-Schnipsel Gruppen Projekte
Commit 4bd6d1fa erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: compatibility to quiqqer v2

Übergeordneter 4edc40cd
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!5Release,!3feat: use images in timeline
![QUIQQER Timeline](bin/img/Readme.png)
QUIQQER Timeline QUIQQER Timeline
======== ========
......
bin/img/Gitlab.png

9,48 KiB

bin/img/Logo.png

91,9 KiB

bin/img/Readme.png

398 KiB

...@@ -7,19 +7,17 @@ ...@@ -7,19 +7,17 @@
{ {
"name": "Michael Danielczok", "name": "Michael Danielczok",
"email": "michael@pcsg.de", "email": "michael@pcsg.de",
"homepage": "http:\/\/www.pcsg.de", "homepage": "https:\/\/www.pcsg.de",
"role": "Developer" "role": "Developer"
} }
], ],
"support": { "support": {
"email": "support@pcsg.de", "email": "support@pcsg.de",
"url": "http:\/\/www.pcsg.de" "url": "https:\/\/www.pcsg.de"
}, },
"require": { "require": {
"quiqqer\/quiqqer": "*@dev", "quiqqer\/core": "^2",
"quiqqer\/utils": ">=1.7|dev-dev", "quiqqer\/utils": "^2"
"quiqqer\/fontawesome": "*@dev",
"quiqqer\/buttons": ">=1.0.0|dev-master|dev-dev"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
......
...@@ -21,24 +21,24 @@ class Timeline extends QUI\Control ...@@ -21,24 +21,24 @@ class Timeline extends QUI\Control
* *
* @param array $attributes * @param array $attributes
*/ */
public function __construct($attributes = array()) public function __construct(array $attributes = [])
{ {
// default options // default options
$this->setAttributes(array( $this->setAttributes([
'nodeName' => 'section', 'nodeName' => 'section',
'class' => 'timeline-section', 'class' => 'timeline-section',
'order' => 'c_date ASC', 'order' => 'c_date ASC',
'parentInputList' => false, //todo später für brick 'parentInputList' => false, //todo später für brick
'showLinks' => true, 'showLinks' => true,
'display' => 'VerticalBothSides', 'display' => 'VerticalBothSides',
// Custom children template (path to html file); overwrites "display" // Custom children template (path to html file); overwrites "display"
'displayTemplate' => false, 'displayTemplate' => false,
// Custom children template css (path to css file); overwrites "display" // Custom children template css (path to css file); overwrites "display"
'displayCss' => false, 'displayCss' => false,
'itemtype' => 'http://schema.org/ItemList', 'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'https://schema.org/ListItem', 'child-itemtype' => 'https://schema.org/ListItem',
'child-itemprop' => 'itemListElement' 'child-itemprop' => 'itemListElement'
)); ]);
parent::__construct($attributes); parent::__construct($attributes);
} }
...@@ -49,10 +49,10 @@ public function __construct($attributes = array()) ...@@ -49,10 +49,10 @@ public function __construct($attributes = array())
* *
* @return String * @return String
*/ */
public function getBody() public function getBody(): string
{ {
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$Site = $this->getSite(); $Site = $this->getSite();
$Project = $this->getProject(); $Project = $this->getProject();
if (!$Site && !$this->getAttribute('parentInputList')) { if (!$Site && !$this->getAttribute('parentInputList')) {
...@@ -70,30 +70,32 @@ public function getBody() ...@@ -70,30 +70,32 @@ public function getBody()
if ($this->getAttribute('parentInputList')) { if ($this->getAttribute('parentInputList')) {
// for bricks // for bricks
$children = Utils::getSitesByInputList($Project, $parents, array( $children = Utils::getSitesByInputList($Project, $parents, [
'where' => $where, 'where' => $where,
'order' => $this->getAttribute('order') 'order' => $this->getAttribute('order')
)); ]);
} else { } else {
// for site types // for site types
$children = $Site->getChildren(array( $children = $Site->getChildren([
'where' => $where, 'where' => $where,
)); ]);
} }
$Engine->assign(array( $Engine->assign([
'this' => $this, 'this' => $this,
'Site' => $Site, 'Site' => $Site,
'Project' => $this->getProject(), 'Project' => $this->getProject(),
'children' => $children, 'children' => $children,
'showLinks' => $this->getAttribute('showLinks') 'showLinks' => $this->getAttribute('showLinks')
)); ]);
// load custom template (if set) // load custom template (if set)
if ($this->getAttribute('displayTemplate') if (
$this->getAttribute('displayTemplate')
&& file_exists($this->getAttribute('displayTemplate')) && file_exists($this->getAttribute('displayTemplate'))
) { ) {
if ($this->getAttribute('displayCss') if (
$this->getAttribute('displayCss')
&& file_exists($this->getAttribute('displayCss')) && file_exists($this->getAttribute('displayCss'))
) { ) {
$this->addCSSFile($this->getAttribute('displayCss')); $this->addCSSFile($this->getAttribute('displayCss'));
...@@ -104,7 +106,7 @@ public function getBody() ...@@ -104,7 +106,7 @@ public function getBody()
// template // template
$css = dirname(__FILE__) . '/Timeline.' . $this->getAttribute('display') . '.css'; $css = dirname(__FILE__) . '/Timeline.' . $this->getAttribute('display') . '.css';
$template = dirname(__FILE__) . '/Timeline.' . $this->getAttribute('display') . '.html'; $template = dirname(__FILE__) . '/Timeline.' . $this->getAttribute('display') . '.html';
$this->addCSSFile($css); $this->addCSSFile($css);
...@@ -114,9 +116,9 @@ public function getBody() ...@@ -114,9 +116,9 @@ public function getBody()
/** /**
* @return mixed|QUI\Projects\Site * @return null|QUI\Projects\Site
*/ */
protected function getSite() protected function getSite(): ?QUI\Interfaces\Projects\Site
{ {
if ($this->getAttribute('Site')) { if ($this->getAttribute('Site')) {
return $this->getAttribute('Site'); return $this->getAttribute('Site');
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
* Site list * Site list
*/ */
$Timeline = new QUI\Timeline\Controls\Timeline(array( $Timeline = new QUI\Timeline\Controls\Timeline([
'Site' => $Site, 'Site' => $Site,
'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'), 'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'),
'itemtype' => 'http://schema.org/ItemList', 'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'http://schema.org/ListItem', 'child-itemtype' => 'http://schema.org/ListItem',
'display' => $Site->getAttribute('quiqqer.timeline.display') 'display' => $Site->getAttribute('quiqqer.timeline.display')
)); ]);
$Engine->assign(array( $Engine->assign([
'Timeline' => $Timeline 'Timeline' => $Timeline
)); ]);
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren