mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
wip render box person thirdparty display bloc
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* Copyright (C) 2014-2019, Champs Libres Cooperative SCRLFS,
|
||||
* Copyright (C) 2014-2019, Champs Libres Cooperative SCRLFS,
|
||||
* <http://www.champs-libres.coop>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -35,7 +35,7 @@ class PersonRender extends AbstractChillEntityRender
|
||||
private ConfigPersonAltNamesHelper $configAltNamesHelper;
|
||||
|
||||
private EngineInterface $engine;
|
||||
|
||||
|
||||
public function __construct(
|
||||
ConfigPersonAltNamesHelper $configAltNamesHelper,
|
||||
EngineInterface $engine
|
||||
@@ -43,9 +43,9 @@ class PersonRender extends AbstractChillEntityRender
|
||||
$this->configAltNamesHelper = $configAltNamesHelper;
|
||||
$this->engine = $engine;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param Person $person
|
||||
* @param array $options
|
||||
* @return string
|
||||
@@ -56,13 +56,16 @@ class PersonRender extends AbstractChillEntityRender
|
||||
[
|
||||
'person' => $person,
|
||||
'addAltNames' => $this->configAltNamesHelper->hasAltNames(),
|
||||
'addLink' => $options['addLink'] ?? false
|
||||
'addLink' => $options['addLink'] ?? false,
|
||||
'addEntity' => $options['addEntity'] ?? false,
|
||||
'addInfo' => $options['addInfo'] ?? false,
|
||||
'display' => $options['display'] ?? 'raw'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param Person $person
|
||||
* @param array $options
|
||||
* @return string
|
||||
@@ -76,7 +79,7 @@ class PersonRender extends AbstractChillEntityRender
|
||||
protected function addAltNames(Person $person, bool $addSpan)
|
||||
{
|
||||
$str = '';
|
||||
|
||||
|
||||
if ($this->configAltNamesHelper->hasAltNames()) {
|
||||
$altNames = $this->configAltNamesHelper->getChoices();
|
||||
$isFirst = true;
|
||||
@@ -94,18 +97,18 @@ class PersonRender extends AbstractChillEntityRender
|
||||
$str .= '<span class="chill-entity__person__alt-name chill-entity__person__altname--'.$altName->getKey().'">';
|
||||
}
|
||||
$str .= $altName->getLabel();
|
||||
|
||||
|
||||
if ($addSpan) {
|
||||
$str .= "</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$isFirst) {
|
||||
$str .= ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user