Skip to content

Commit

Permalink
[TASK] Rename category types and add coresponding icons
Browse files Browse the repository at this point in the history
  • Loading branch information
dot3media committed Jan 18, 2024
1 parent 9ce2047 commit 9f7e0d4
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 50 deletions.
6 changes: 3 additions & 3 deletions Classes/Domain/Collection/CategoryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class CategoryCollection implements Countable, Iterator, ArrayAccess
* @var array<string, AcademicCategory[]>
*/
protected array $typeSortedContainer = [
CategoryTypes::TYPE_SYSTEM_CATEGORY => [],
CategoryTypes::TYPE_RESEARCH_TOPIC => [],
CategoryTypes::TYPE_COMPETENCE_FIELD => [],
CategoryTypes::TYPE_COOPERATION => [],
CategoryTypes::TYPE_DEPARTMENT => [],
CategoryTypes::TYPE_INSTITUTE => [],
CategoryTypes::TYPE_FUNDING_PARTNER => [],
];

public function current(): AcademicCategory|false
Expand Down
6 changes: 3 additions & 3 deletions Classes/Domain/Enumeration/CategoryTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

final class CategoryTypes extends Enumeration
{
public const TYPE_SYSTEM_CATEGORY = 'system_category';
public const TYPE_COMPETENCE_FIELD = 'competence_field';

public const TYPE_RESEARCH_TOPIC = 'research_topic';
public const TYPE_COOPERATION = 'cooperation';

public const TYPE_DEPARTMENT = 'department';

public const TYPE_INSTITUTE = 'institute';
public const TYPE_FUNDING_PARTNER = 'funding_partner';
}
12 changes: 6 additions & 6 deletions Configuration/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
};

return [
$identifierString(CategoryTypes::TYPE_SYSTEM_CATEGORY) => [
$identifierString(CategoryTypes::TYPE_COMPETENCE_FIELD) => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => $sourceString(CategoryTypes::TYPE_SYSTEM_CATEGORY),
'source' => $sourceString(CategoryTypes::TYPE_COMPETENCE_FIELD),
],
$identifierString(CategoryTypes::TYPE_RESEARCH_TOPIC) => [
$identifierString(CategoryTypes::TYPE_COOPERATION) => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => $sourceString(CategoryTypes::TYPE_RESEARCH_TOPIC),
'source' => $sourceString(CategoryTypes::TYPE_COOPERATION),
],
$identifierString(CategoryTypes::TYPE_DEPARTMENT) => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => $sourceString(CategoryTypes::TYPE_DEPARTMENT),
],
$identifierString(CategoryTypes::TYPE_INSTITUTE) => [
$identifierString(CategoryTypes::TYPE_FUNDING_PARTNER) => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => $sourceString(CategoryTypes::TYPE_INSTITUTE),
'source' => $sourceString(CategoryTypes::TYPE_FUNDING_PARTNER),
],
];
30 changes: 15 additions & 15 deletions Configuration/TCA/Overrides/sys_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@
$sysCategoryTypesTcaTypeIconOverrides = [
'ctrl' => [
'typeicon_classes' => [
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_SYSTEM_CATEGORY
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_SYSTEM_CATEGORY),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_RESEARCH_TOPIC
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_RESEARCH_TOPIC),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COMPETENCE_FIELD
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COMPETENCE_FIELD),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COOPERATION
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COOPERATION),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_DEPARTMENT
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_DEPARTMENT),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_INSTITUTE
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_INSTITUTE),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_FUNDING_PARTNER
=> $iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_FUNDING_PARTNER),
],
],
];
$addItems = [
[
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_SYSTEM_CATEGORY),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_SYSTEM_CATEGORY,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_SYSTEM_CATEGORY),
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COMPETENCE_FIELD),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COMPETENCE_FIELD,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COMPETENCE_FIELD),
'projects',
],
[
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_RESEARCH_TOPIC),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_RESEARCH_TOPIC,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_RESEARCH_TOPIC),
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COOPERATION),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COOPERATION,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_COOPERATION),
'projects',
],
[
Expand All @@ -48,9 +48,9 @@
'projects',
],
[
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_INSTITUTE),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_INSTITUTE,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_INSTITUTE),
$llBackendType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_FUNDING_PARTNER),
\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_FUNDING_PARTNER,
$iconType(\FGTCLB\AcademicProjects\Domain\Enumeration\CategoryTypes::TYPE_FUNDING_PARTNER),
'projects',
],
];
Expand Down
24 changes: 12 additions & 12 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
<target>Academic Projekte</target>
</trans-unit>

<trans-unit id="sys_category.type.system_category">
<source>System Category (17 targets)</source>
<target>Systemkategorie (17 Ziele)</target>
</trans-unit>
<trans-unit id="sys_category.type.research_topic">
<source>Research Topic</source>
<target>Forschungsschwerpunkt</target>
</trans-unit>
<trans-unit id="sys_category.type.department">
<source>Department</source>
<target>Abteilung</target>
<target>Organisationseinheit</target>
</trans-unit>
<trans-unit id="sys_category.type.competence_field">
<source>Competence field</source>
<target>Kompetenzfeld</target>
</trans-unit>
<trans-unit id="sys_category.type.cooperation">
<source>Cooperation</source>
<target>Kooperation</target>
</trans-unit>
<trans-unit id="sys_category.type.institute">
<source>Institute</source>
<target>Institut</target>
<trans-unit id="sys_category.type.funding_partner">
<source>Funding partner</source>
<target>Mittelgebender</target>
</trans-unit>
</body>
</file>
Expand Down
16 changes: 8 additions & 8 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
<source>Academic Projects</source>
</trans-unit>

<trans-unit id="sys_category.type.system_category">
<source>System Category (17 targets)</source>
</trans-unit>
<trans-unit id="sys_category.type.research_topic">
<source>Research Topic</source>
</trans-unit>
<trans-unit id="sys_category.type.department">
<source>Department</source>
</trans-unit>
<trans-unit id="sys_category.type.institute">
<source>Institute</source>
<trans-unit id="sys_category.type.competence_field">
<source>Competence field</source>
</trans-unit>
<trans-unit id="sys_category.type.cooperation">
<source>Cooperation</source>
</trans-unit>
<trans-unit id="sys_category.type.funding_partner">
<source>Funding partner</source>
</trans-unit>

<trans-unit id="filter.sorting.lastUpdated.asc">
Expand Down
1 change: 1 addition & 0 deletions Resources/Public/Icons/competenceField.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Resources/Public/Icons/cooperation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Resources/Public/Icons/fundingPartner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Resources/Public/Icons/institute.svg

This file was deleted.

1 change: 0 additions & 1 deletion Resources/Public/Icons/researchTopic.svg

This file was deleted.

1 change: 0 additions & 1 deletion Resources/Public/Icons/systemCategory.svg

This file was deleted.

0 comments on commit 9f7e0d4

Please sign in to comment.