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
No related branches found
No related tags found
2 Merge Requests!5Release,!3feat: use images in timeline
![QUIQQER Timeline](bin/img/Readme.png)
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 @@
{
"name": "Michael Danielczok",
"email": "michael@pcsg.de",
"homepage": "http:\/\/www.pcsg.de",
"homepage": "https:\/\/www.pcsg.de",
"role": "Developer"
}
],
"support": {
"email": "support@pcsg.de",
"url": "http:\/\/www.pcsg.de"
"url": "https:\/\/www.pcsg.de"
},
"require": {
"quiqqer\/quiqqer": "*@dev",
"quiqqer\/utils": ">=1.7|dev-dev",
"quiqqer\/fontawesome": "*@dev",
"quiqqer\/buttons": ">=1.0.0|dev-master|dev-dev"
"quiqqer\/core": "^2",
"quiqqer\/utils": "^2"
},
"autoload": {
"psr-4": {
......
......@@ -21,24 +21,24 @@ class Timeline extends QUI\Control
*
* @param array $attributes
*/
public function __construct($attributes = array())
public function __construct(array $attributes = [])
{
// default options
$this->setAttributes(array(
'nodeName' => 'section',
'class' => 'timeline-section',
'order' => 'c_date ASC',
$this->setAttributes([
'nodeName' => 'section',
'class' => 'timeline-section',
'order' => 'c_date ASC',
'parentInputList' => false, //todo später für brick
'showLinks' => true,
'display' => 'VerticalBothSides',
'showLinks' => true,
'display' => 'VerticalBothSides',
// Custom children template (path to html file); overwrites "display"
'displayTemplate' => false,
// Custom children template css (path to css file); overwrites "display"
'displayCss' => false,
'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'https://schema.org/ListItem',
'child-itemprop' => 'itemListElement'
));
'displayCss' => false,
'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'https://schema.org/ListItem',
'child-itemprop' => 'itemListElement'
]);
parent::__construct($attributes);
}
......@@ -49,10 +49,10 @@ public function __construct($attributes = array())
*
* @return String
*/
public function getBody()
public function getBody(): string
{
$Engine = QUI::getTemplateManager()->getEngine();
$Site = $this->getSite();
$Engine = QUI::getTemplateManager()->getEngine();
$Site = $this->getSite();
$Project = $this->getProject();
if (!$Site && !$this->getAttribute('parentInputList')) {
......@@ -70,30 +70,32 @@ public function getBody()
if ($this->getAttribute('parentInputList')) {
// for bricks
$children = Utils::getSitesByInputList($Project, $parents, array(
$children = Utils::getSitesByInputList($Project, $parents, [
'where' => $where,
'order' => $this->getAttribute('order')
));
]);
} else {
// for site types
$children = $Site->getChildren(array(
$children = $Site->getChildren([
'where' => $where,
));
]);
}
$Engine->assign(array(
'this' => $this,
'Site' => $Site,
'Project' => $this->getProject(),
'children' => $children,
$Engine->assign([
'this' => $this,
'Site' => $Site,
'Project' => $this->getProject(),
'children' => $children,
'showLinks' => $this->getAttribute('showLinks')
));
]);
// load custom template (if set)
if ($this->getAttribute('displayTemplate')
if (
$this->getAttribute('displayTemplate')
&& file_exists($this->getAttribute('displayTemplate'))
) {
if ($this->getAttribute('displayCss')
if (
$this->getAttribute('displayCss')
&& file_exists($this->getAttribute('displayCss'))
) {
$this->addCSSFile($this->getAttribute('displayCss'));
......@@ -104,7 +106,7 @@ public function getBody()
// 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';
$this->addCSSFile($css);
......@@ -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')) {
return $this->getAttribute('Site');
......
......@@ -4,14 +4,14 @@
* Site list
*/
$Timeline = new QUI\Timeline\Controls\Timeline(array(
'Site' => $Site,
'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'),
'itemtype' => 'http://schema.org/ItemList',
$Timeline = new QUI\Timeline\Controls\Timeline([
'Site' => $Site,
'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'),
'itemtype' => 'http://schema.org/ItemList',
'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
));
]);
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