bug fixes

This commit is contained in:
Dennis Eichhorn 2024-05-12 00:06:29 +00:00
parent a2d420bb8b
commit adac80cbbd
54 changed files with 297 additions and 869 deletions

View File

@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'

View File

@ -0,0 +1,9 @@
[
{
"name": "profile_image",
"l11n": {
"en": "Profile Image",
"de": "Profilbild"
}
}
]

43
Admin/Install/Tag.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Tag\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Tag\Admin\Install;
use phpOMS\Application\ApplicationAbstract;
/**
* Tag class.
*
* @package Modules\Tag\Admin\Install
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Tag
{
/**
* Install media providing
*
* @param ApplicationAbstract $app Application
* @param string $path Module path
*
* @return void
*
* @since 1.0.0
*/
public static function install(ApplicationAbstract $app, string $path) : void
{
\Modules\Tag\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Tag.install.json']);
}
}

View File

@ -9,6 +9,11 @@
"primary": true,
"autoincrement": true
},
"tag_name": {
"name": "tag_name",
"type": "VARCHAR(255)",
"null": false
},
"tag_color": {
"name": "tag_color",
"type": "VARCHAR(9)",

View File

@ -14,7 +14,15 @@ declare(strict_types=1);
namespace Modules\Tag\Admin;
use Modules\Admin\Models\AccountMapper;
use Modules\Admin\Models\NullAccount;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Config\SettingsInterface;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\System\File\PathException;
/**
* Installer class.
@ -33,4 +41,97 @@ final class Installer extends InstallerAbstract
* @since 1.0.0
*/
public const PATH = __DIR__;
/**
* {@inheritdoc}
*/
public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void
{
parent::install($app, $info, $cfgHandler);
}
/**
* Install data from providing modules.
*
* The data can be either directories which should be created or files which should be "uploaded"
*
* @param ApplicationAbstract $app Application
* @param array $data Additional data
*
* @return array
*
* @throws PathException
* @throws \Exception
*
* @since 1.0.0
*/
public static function installExternal(ApplicationAbstract $app, array $data) : array
{
if (!\is_file($data['path'] ?? '')) {
throw new PathException($data['path'] ?? '');
}
$tagFile = \file_get_contents($data['path'] ?? '');
if ($tagFile === false) {
throw new PathException($data['path'] ?? ''); // @codeCoverageIgnore
}
$tagData = \json_decode($tagFile, true) ?? [];
if ($tagData === false) {
throw new \Exception(); // @codeCoverageIgnore
}
/** @var \Modules\Tag\Controller\ApiController $module */
$module = $app->moduleManager->get('Tag', 'Api');
$tags = [];
foreach ($tagData as $tag) {
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', $tag['name'] ?? '');
$request->setData('color', $tag['color'] ?? '#3697db');
if (!empty($tag['l11n'])) {
$request->setData('title', \reset($tag['l11n']));
$request->setData('lang', \array_keys($tag['l11n'])[0] ?? 'en');
}
$module->apiTagCreate($request, $response);
$responseData = $response->getData('');
if (!\is_array($responseData)) {
return [];
}
$type = $responseData['response'];
$id = $type->id;
$isFirst = true;
foreach ($tag['l11n'] as $language => $l11n) {
if ($isFirst) {
$isFirst = false;
continue;
}
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', $l11n);
$request->setData('lang', $language);
$request->setData('type', $id);
$module->apiTagL11nCreate($request, $response);
}
$tags[] = \is_array($type)
? $type
: $type->toArray();
}
return $tags;
}
}

View File

@ -223,6 +223,7 @@ final class ApiController extends Controller
private function createTagFromRequest(RequestAbstract $request) : Tag
{
$tag = new Tag();
$tag->name = $request->getDataString('name') ?? '';
$tag->color = \str_pad($request->getDataString('color') ?? '#000000ff', 9, 'f');
$tag->icon = $request->getDataString('icon') ?? '';

View File

@ -36,6 +36,8 @@ class Tag implements \JsonSerializable
*/
public int $id = 0;
public string $name = '';
/**
* Title.
*

117
Models/TagListTrait.php Normal file
View File

@ -0,0 +1,117 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Tag\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Tag\Models;
/**
* Tag class.
*
* @package Modules\Tag\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @property \Modules\Tag\Models\Tag[] $tags
*/
trait TagListTrait
{
/**
* Tags.
*
* @var Tag[]
* @since 1.0.0
*/
public array $tags = [];
/**
* Get media tag by type
*
* @param int $type Tag type
*
* @return Tag
*
* @since 1.0.0
*/
public function getTagByType(int $type) : Tag
{
foreach ($this->tags as $tag) {
if ($tag->id === $type) {
return $tag;
}
}
return new NullTag();
}
/**
* Get all media tags by type name
*
* @param string $type Tag type
*
* @return Tag
*
* @since 1.0.0
*/
public function getTagByTypeName(string $type) : Tag
{
foreach ($this->tags as $tag) {
if ($tag->name === $type) {
return $tag;
}
}
return new NullTag();
}
/**
* Get all media tags by type name
*
* @param string $type Tag type
*
* @return Tag[]
*
* @since 1.0.0
*/
public function getTagsByTypeName(string $type) : array
{
$tags = [];
foreach ($this->tags as $tag) {
if ($tag->name === $type) {
$tags[] = $tag;
}
}
return $tags;
}
/**
* Check if tag with a certain type name exists
*
* @param string $type Type name
*
* @return bool
*
* @since 1.0.0
*/
public function hasTagTypeName(string $type) : bool
{
foreach ($this->tags as $tag) {
if ($tag->name === $type) {
return true;
}
}
return false;
}
}

View File

@ -37,6 +37,7 @@ final class TagMapper extends DataMapperFactory
*/
public const COLUMNS = [
'tag_id' => ['name' => 'tag_id', 'type' => 'int', 'internal' => 'id'],
'tag_name' => ['name' => 'tag_name', 'type' => 'string', 'internal' => 'name'],
'tag_color' => ['name' => 'tag_color', 'type' => 'string', 'internal' => 'color'],
'tag_icon' => ['name' => 'tag_icon', 'type' => 'string', 'internal' => 'icon'],
'tag_type' => ['name' => 'tag_type', 'type' => 'int', 'internal' => 'type'],

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'يخلق',
'List' => 'قائمة',
'Tag' => 'بطاقة شعار',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Vytvořit',
'List' => 'Seznam',
'Tag' => 'Štítek',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'skab',
'List' => 'Liste',
'Tag' => 'Tag.',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Δημιουργώ',
'List' => 'Λίστα',
'Tag' => 'Ετικέτα',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Crear',
'List' => 'Lista',
'Tag' => 'Etiqueta',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Luoda',
'List' => 'Lista',
'Tag' => 'Tag',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Créer',
'List' => 'Lister',
'Tag' => 'Étiqueter',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Teremt',
'List' => 'Lista',
'Tag' => 'Címke',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Creare',
'List' => 'Elenco',
'Tag' => 'Etichetta',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => '作成',
'List' => 'リスト',
'Tag' => '鬼ごっこ',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => '만들다',
'List' => '목록',
'Tag' => '꼬리표',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Skape',
'List' => 'Liste',
'Tag' => 'stikkord',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Tworzyć',
'List' => 'Lista',
'Tag' => 'Etykietka',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Crio',
'List' => 'Lista',
'Tag' => 'Marcação',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Создавать',
'List' => 'Список',
'Tag' => 'Тег',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Skapa',
'List' => 'Lista',
'Tag' => 'Märka',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'สร้าง',
'List' => 'รายการ',
'Tag' => 'แท็ก',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Yaratmak',
'List' => 'Liste',
'Tag' => 'Etiket',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => 'Створювати',
'List' => 'Список',
'Tag' => 'Тег',
]];

View File

@ -1,19 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'Create' => '创建',
'List' => '列表',
'Tag' => '标签',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'اللون',
'Create' => 'يخلق',
'Icon' => 'أيقونة',
'Language' => 'لغة',
'List' => 'قائمة',
'Tag' => 'بطاقة شعار',
'Tags' => 'كذا',
'Title' => 'عنوان',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Barva',
'Create' => 'Vytvořit',
'Icon' => 'Ikona',
'Language' => 'Jazyk',
'List' => 'Seznam',
'Tag' => 'Štítek',
'Tags' => 'Tagy',
'Title' => 'Titul',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Farve',
'Create' => 'skab',
'Icon' => 'Ikon.',
'Language' => 'Sprog',
'List' => 'Liste',
'Tag' => 'Tag.',
'Tags' => 'Tags.',
'Title' => 'Titel',
]];

View File

@ -21,4 +21,5 @@ return ['Tag' => [
'Tag' => 'Stichwort',
'Tags' => 'Stichworte',
'Title' => 'Titel',
'InternalName' => 'Interner Name',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Χρώμα',
'Create' => 'Δημιουργώ',
'Icon' => 'Εικόνισμα',
'Language' => 'Γλώσσα',
'List' => 'Λίστα',
'Tag' => 'Ετικέτα',
'Tags' => 'Ετικέτες',
'Title' => 'Τίτλος',
]];

View File

@ -21,4 +21,5 @@ return ['Tag' => [
'Tag' => 'Tag',
'Tags' => 'Tags',
'Title' => 'Title',
'InternalName' => 'Internal Name',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Color',
'Create' => 'Crear',
'Icon' => 'Icono',
'Language' => 'Idioma',
'List' => 'Lista',
'Tag' => 'Etiqueta',
'Tags' => 'Etiquetas',
'Title' => 'Título',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Väri',
'Create' => 'Luoda',
'Icon' => 'Kuvake',
'Language' => 'Kieli',
'List' => 'Lista',
'Tag' => 'Tag',
'Tags' => 'Tunnisteet',
'Title' => 'Otsikko',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Couleur',
'Create' => 'Créer',
'Icon' => 'Icône',
'Language' => 'Langue',
'List' => 'Lister',
'Tag' => 'Étiqueter',
'Tags' => 'Mots clés',
'Title' => 'Titre',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Szín',
'Create' => 'Teremt',
'Icon' => 'Ikon',
'Language' => 'Nyelv',
'List' => 'Lista',
'Tag' => 'Címke',
'Tags' => 'Címkék',
'Title' => 'Cím',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Colore',
'Create' => 'Creare',
'Icon' => 'Icona',
'Language' => 'Lingua',
'List' => 'Elenco',
'Tag' => 'Etichetta',
'Tags' => 'Tags.',
'Title' => 'Titolo',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => '色',
'Create' => '作成',
'Icon' => 'アイコン',
'Language' => '言語',
'List' => 'リスト',
'Tag' => '鬼ごっこ',
'Tags' => 'タグ',
'Title' => 'タイトル',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => '색상',
'Create' => '만들다',
'Icon' => '상',
'Language' => '언어',
'List' => '목록',
'Tag' => '꼬리표',
'Tags' => '태그',
'Title' => '제목',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Farge',
'Create' => 'Skape',
'Icon' => 'Ikon',
'Language' => 'Språk',
'List' => 'Liste',
'Tag' => 'stikkord',
'Tags' => 'Tags.',
'Title' => 'Tittel',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Kolor',
'Create' => 'Tworzyć',
'Icon' => 'Ikona',
'Language' => 'Język',
'List' => 'Lista',
'Tag' => 'Etykietka',
'Tags' => 'Tagi.',
'Title' => 'Tytuł',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Cor',
'Create' => 'Crio',
'Icon' => 'Ícone',
'Language' => 'Língua',
'List' => 'Lista',
'Tag' => 'Marcação',
'Tags' => 'Tag',
'Title' => 'Título',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Цвет',
'Create' => 'Создавать',
'Icon' => 'Значок',
'Language' => 'Язык',
'List' => 'Список',
'Tag' => 'Тег',
'Tags' => 'Теги',
'Title' => 'Заголовок',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Färg',
'Create' => 'Skapa',
'Icon' => 'Ikon',
'Language' => 'Språk',
'List' => 'Lista',
'Tag' => 'Märka',
'Tags' => 'Tagg',
'Title' => 'Titel',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'สี',
'Create' => 'สร้าง',
'Icon' => 'ไอคอน',
'Language' => 'ภาษา',
'List' => 'รายการ',
'Tag' => 'แท็ก',
'Tags' => 'แท็ก',
'Title' => 'ชื่อ',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Renk',
'Create' => 'Yaratmak',
'Icon' => 'Simge',
'Language' => 'Dilim',
'List' => 'Liste',
'Tag' => 'Etiket',
'Tags' => 'Etiketler',
'Title' => 'Başlık',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Колір',
'Create' => 'Створювати',
'Icon' => 'Значок',
'Language' => 'Мову',
'List' => 'Список',
'Tag' => 'Тег',
'Tags' => 'Теги',
'Title' => 'Заголовок',
]];

View File

@ -1,24 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Tag' => [
'Color' => '颜色',
'Create' => '创建',
'Icon' => '图标',
'Language' => '语',
'List' => '列表',
'Tag' => '标签',
'Tags' => '标签',
'Title' => '标题',
]];

View File

@ -24,7 +24,7 @@ $next = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&offset=' .
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Tags'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table class="default sticky">
@ -33,8 +33,9 @@ echo $this->data['nav']->render(); ?>
<td><?= $this->getHtml('Color'); ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<tbody>
<?php $count = 0; foreach ($this->data['tags'] as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/tag/view?{?}&id=' . $value->id); ?>
<?php $count = 0;
foreach ($this->data['tags'] as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/tag/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><span class="tag" style="background: <?= $this->printHtml(\substr($value->color, 0, 7)); ?>">&nbsp;&nbsp;&nbsp;<?= $value->icon !== null ? '<i class="g-icon">' . $this->printHtml($value->icon ?? '') . '</i>' : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; ?>&nbsp;</span></a>
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>
@ -43,8 +44,8 @@ echo $this->data['nav']->render(); ?>
<?php if ($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</table>
</section>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>

View File

@ -52,7 +52,7 @@ $icons = [
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="portlet">
<section class="portlet">
<form id="tagForm"
method="<?= $isNew ? 'PUT' : 'POST'; ?>"
action="<?= UriFactory::build('{/api}tag?csrf={$CSRF}'); ?>"
@ -62,6 +62,11 @@ echo $this->data['nav']->render(); ?>
<?= $isNew ? 'data-redirect="' . UriFactory::build('{/base}/tag/view') . '?id={/0/response/id}"' : ''; ?>>
<div class="portlet-head"><?= $this->getHtml('Tag'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iName"><?= $this->getHtml('InternalName'); ?></label>
<input type="text" id="iName" name="name" value="<?= $this->printHtml($tag->name); ?>"<?= $isNew ? ' required' : ' disabled'; ?>>
</div>
<div class="form-group">
<label for="iColor"><?= $this->getHtml('Color'); ?></label>
<input type="color" name="color" id="iColor" value="<?= $this->printHtml(\substr($tag->color, 0, 7)); ?>" required>
@ -88,7 +93,7 @@ echo $this->data['nav']->render(); ?>
<input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</section>
</div>
</div>

View File

@ -22,7 +22,8 @@
},
"providing": {
"Admin": "*",
"Navigation": "*"
"Navigation": "*",
"Tag": "*"
},
"load": [
{