diff --git a/.github/workflows/publish-to-redaxo-org.yml b/.github/workflows/publish-to-redaxo-org.yml index 192bbba..4fecc19 100644 --- a/.github/workflows/publish-to-redaxo-org.yml +++ b/.github/workflows/publish-to-redaxo-org.yml @@ -1,5 +1,6 @@ -name: publish to redaxo.org +# Instructions: https://github.com/FriendsOfREDAXO/installer-action/ +name: Publish to REDAXO.org on: release: types: @@ -9,10 +10,18 @@ jobs: redaxo_publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: FriendsOfREDAXO/installer-action@v1 - with: - myredaxo-username: ${{ secrets.MYREDAXO_USERNAME }} - myredaxo-api-key: ${{ secrets.MYREDAXO_API_KEY }} - description: ${{ github.event.release.body }} - version: ${{ github.event.release.tag_name }} + - uses: actions/checkout@v3 + - if: hashFiles('composer.json') != '' + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + - if: hashFiles('composer.json') != '' + uses: ramsey/composer-install@v2 + with: + composer-options: "--no-dev" + - uses: FriendsOfREDAXO/installer-action@v1 + with: + myredaxo-username: ${{ secrets.MYREDAXO_USERNAME }} + myredaxo-api-key: ${{ secrets.MYREDAXO_API_KEY }} + description: ${{ github.event.release.body }} + version: ${{ github.event.release.tag_name }} diff --git a/.gitignore b/.gitignore index 925011d..4fb60ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.idea /composer.lock /.php-cs-fixer.cache /vendor diff --git a/README.md b/README.md index e37b3a8..f1759d5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # News-Verwaltung für REDAXO 5 (Aktuelles, Pressemitteilungen, Pressestimmen, ...) -![friendsofredaxo neues](https://github.com/alexplusde/neues/assets/3855487/9baa05e7-17d3-46a2-ad62-36223a896e94) +![friendsofredaxo neues](https://github.com/FriendsOfREDAXO/neues/assets/3855487/e6ead321-154e-4a1f-be29-53bbabadec06) + Mit diesem Addon können News-Beiträge anhand von YForm und YOrm im Backend verwaltet und im Frontend ausgegeben werden. Auf Wunsch auch multidomainfähig und mehrsprachig. diff --git a/assets/jetzt-beauftragen.svg b/assets/jetzt-beauftragen.svg deleted file mode 100644 index 59ac24a..0000000 --- a/assets/jetzt-beauftragen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/boot.php b/boot.php index 00dfcd6..0fdc2f8 100644 --- a/boot.php +++ b/boot.php @@ -1,20 +1,44 @@ isAvailable() && !rex::isSafeMode()) { +namespace FriendsOfRedaxo\Neues; + +use rex; +use rex_addon; +use rex_be_controller; +use rex_config; +use rex_cronjob_manager; +use rex_csrf_token; +use rex_extension; +use rex_extension_point; +use rex_plugin; +use rex_url; +use rex_yform_manager_dataset; +use rex_yform_manager_table; +use rex_yform_rest; +use rex_yform_rest_route; + + +if (rex_addon::get('cronjob')->isAvailable() && !rex::isSafeMode()) { + rex_cronjob_manager::registerType(rex_cronjob_neues_publish::class); +} +if (rex_addon::get('yform')->isAvailable() && !rex::isSafeMode()) { rex_yform_manager_dataset::setModelClass( 'rex_neues_entry', - neues_entry::class, + Entry::class, ); rex_yform_manager_dataset::setModelClass( 'rex_neues_category', - neues_category::class, + Category::class, ); rex_yform_manager_dataset::setModelClass( 'rex_neues_author', - neues_author::class, + Author::class, + ); + rex_yform_manager_dataset::setModelClass( + 'rex_neues_entry_lang', + EntryLang::class, ); - } if (rex::isBackend() && 'neues/entry' == rex_be_controller::getCurrentPage() || 'yform/manager/data_edit' == rex_be_controller::getCurrentPage()) { @@ -27,33 +51,66 @@ if (rex_plugin::get('yform', 'rest')->isAvailable() && !rex::isSafeMode()) { /* YForm Rest API */ - $rex_neues_entry_route = new \rex_yform_rest_route( + $rex_neues_entry_route = new rex_yform_rest_route( [ - 'path' => '/neues/3/date/', + 'path' => '/neues/4/date/', 'auth' => '\rex_yform_rest_auth_token::checkToken', - 'type' => \neues_entry::class, - 'query' => \neues_entry::query(), + 'type' => Entry::class, + 'query' => Entry::query(), 'get' => [ 'fields' => [ 'rex_neues_entry' => [ 'id', + 'status', 'name', + 'teaser', 'description', + 'domain_ids', + 'lang_id', + 'publishdate', + 'author_id', + 'url', + 'image', 'images', - 'status', + 'createdate', + 'createuser', + 'updatedate', + 'updateuser', ], 'rex_neues_category' => [ 'id', 'name', + 'image', + 'status', + ], + 'rex_neues_author' => [ + 'id', + 'name', + 'nickname', + 'text', + 'image', + 'be_user_id', ], ], ], 'post' => [ 'fields' => [ 'rex_neues_entry' => [ + 'status', 'name', + 'teaser', 'description', + 'domain_ids', + 'lang_id', + 'publishdate', + 'author_id', + 'url', + 'image', 'images', + 'createdate', + 'createuser', + 'updatedate', + 'updateuser', ], ], ], @@ -67,20 +124,22 @@ ], ); - \rex_yform_rest::addRoute($rex_neues_entry_route); + rex_yform_rest::addRoute($rex_neues_entry_route); /* YForm Rest API */ - $rex_neues_category_route = new \rex_yform_rest_route( + $rex_neues_category_route = new rex_yform_rest_route( [ - 'path' => '/v0.dev/neues/category/', + 'path' => '/neues/4/category/', 'auth' => '\rex_yform_rest_auth_token::checkToken', - 'type' => \neues_category::class, - 'query' => \neues_category::query(), + 'type' => Category::class, + 'query' => Category::query(), 'get' => [ 'fields' => [ 'rex_neues_category' => [ 'id', 'name', + 'image', + 'status', ], ], ], @@ -88,6 +147,8 @@ 'fields' => [ 'rex_neues_category' => [ 'name', + 'image', + 'status', ], ], ], @@ -101,7 +162,7 @@ ], ); - \rex_yform_rest::addRoute($rex_neues_category_route); + rex_yform_rest::addRoute($rex_neues_category_route); } rex_extension::register('YFORM_DATA_LIST', static function ($ep) { @@ -144,9 +205,10 @@ static function ($a) { $category_ids = array_filter(array_map('intval', explode(',', $a['value']))); foreach ($category_ids as $category_id) { - $neues = neues_category::get($category_id); - if ($neues) { - $return[] = '' . $neues->getName() . ''; + /** @var neues_category $neues_category */ + $neues_category = Category::get($category_id); + if ($neues_category) { + $return[] = '' . $neues_category->getName() . ''; } } return implode('
', $return); diff --git a/composer.json b/composer.json index 5855596..e8dda5e 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,10 @@ "redaxo/php-cs-fixer-config": "^2.0", "friendsofphp/php-cs-fixer": "^3.14" }, + "replace": { + "psr/log": "*", + "psr/container": "*" + }, "scripts": { "cs-dry": "php-cs-fixer fix -v --ansi --dry-run --config=.php-cs-fixer.dist.php", "cs-fix": "php-cs-fixer fix -v --ansi --config=.php-cs-fixer.dist.php" diff --git a/docs/01_a_intro.md b/docs/01_a_intro.md index e69de29..e37b3a8 100644 --- a/docs/01_a_intro.md +++ b/docs/01_a_intro.md @@ -0,0 +1,49 @@ +# News-Verwaltung für REDAXO 5 (Aktuelles, Pressemitteilungen, Pressestimmen, ...) + +![friendsofredaxo neues](https://github.com/alexplusde/neues/assets/3855487/9baa05e7-17d3-46a2-ad62-36223a896e94) + +Mit diesem Addon können News-Beiträge anhand von YForm und YOrm im Backend verwaltet und im Frontend ausgegeben werden. Auf Wunsch auch multidomainfähig und mehrsprachig. + +## Features + +* Vollständig mit **YForm** umgesetzt: Alle Features und Anpassungsmöglichkeiten von YForm verfügbar +* Einfach: Die Ausgabe erfolgt über [`rex_sql`](https://redaxo.org/doku/master/datenbank-queries) oder objektorientiert über [YOrm](https://github.com/yakamara/redaxo_yform/blob/master/docs/04_yorm.md) +* Flexibel: **Zugriff** über die [YForm Rest-API](https://github.com/yakamara/redaxo_yform/blob/master/docs/05_rest.md) +* Sinnvoll: Nur ausgewählte **Rollen**/Redakteure haben Zugriff +* Bereit für Multidomain-Newsverwaltung mit YRewrite +* Bereit für **mehrsprachige** Websites: Reiter für Sprachen auf Wunsch anzeigen oder ausblenden +* Bereit für viel mehr: Kompatibel zum [URL2-Addon](https://github.com/tbaddade/redaxo_url) + +> **Hinweis:** Neues benötigt ab Version 3 [`yform_field`](https://github.com/alexplusde/yform_field/) für die Auswahl von (YRewrite-)Domains und Dem Auswahldatum für Veröffentlichungen + +> **Tipp:** Neues arbeitet hervorragend zusammen mit den Addons [`yform_usability`](https://github.com/FriendsOfREDAXO/yform_usability/) und [`yform_geo_osm`](https://github.com/FriendsOfREDAXO/yform_geo_osm) + +> **Steuere eigene Verbesserungen** dem [GitHub-Repository von neues](https://github.com/alexplusde/neues) bei. Oder **unterstütze dieses Addon:** Mit einer [Beauftragung unterstützt du die Weiterentwicklung dieses AddOns](https://github.com/sponsors/alexplusde) + +## Installation + +Im REDAXO-Installer das Addon `neues` herunterladen und installieren. Anschließend erscheint im Hauptmenü ein neuer Menüpunkt `Aktuelles`. + +![image](https://user-images.githubusercontent.com/3855487/209792457-b6f824dc-7fd8-4295-a7c7-2eab046d19c7.png) + +## Lizenz + +MIT Lizenz, siehe [LICENSE.md](https://github.com/alexplusde/neues/blob/master/LICENSE) + +## Autor + +**Alexander Walther** + + + +**Paul Götz** + + + +**Projekt-Lead** +[Alexander Walther](https://github.com/alexplusde) + +## Credits + +neues basiert auf: [YForm](https://github.com/yakamara/redaxo_yform) +Danke an [Gregor Harlan](https://github.com/gharlan) sowie [Norbert Micheel](https://github.com/tyrant88) für die Unterstützung diff --git a/docs/01_c_migration.md b/docs/01_c_migration.md index 0c2221a..b40b749 100644 --- a/docs/01_c_migration.md +++ b/docs/01_c_migration.md @@ -1,42 +1,51 @@ -# Migration von REDAXO `FOR News Manager 3` und `alexplusde\Neues` v3 zu `FriendsOfREEAXO\Neues` v4 +# Migration von REDAXO `FOR News Manager 3`, `Blogger 1.3.2` und `alexplusde\Neues` 3.x zu `FriendsOfREEAXO\Neues` 4.1 ## Warum der Wechsel? -Das FOR-Addon News-Manager befindet sich nicht mehr in aktiver Entwicklung. Es wurde nur noch bis Ende 2022 gewartet. Potentielle Sicherheitslücken werden nicht mehr geschlossen. +Das FOR-Addon News-Manager und das FOR-Addon Blogger befinden sich nicht mehr in aktiver Entwicklung. Sie wurden nur noch bis Ende 2022 bzw. Anfang 2024 gewartet. Potentielle Sicherheitslücken werden nicht mehr geschlossen. Um die Lücke zu schließen, wird das Addon `Neues` von @alexplus_de zu FriendsOfREDAXO gespendet. Die Weiterentwicklung des Neues ist gesichert. Es wird ständig an die neuesten REDAXO-Versionen angepasst und erweitert. -Ein wesentlicher Vorteil gegenüber dem News Manager ist die Unterstützung von YForm. Damit lassen sich die News-Einträge und Kategorien komfortabel verwalten und erweitern, viele Funktionen von YForm und YOrm können genutzt werden. +Ein wesentlicher Vorteil gegenüber News Manager oder Blogger ist die Unterstützung von YForm. Damit lassen sich die News-Einträge und Kategorien komfortabel verwalten und erweitern, viele Funktionen von YForm und YOrm können genutzt werden. Wir danken Alex für die Bereitschaft, das Addon in die Hände von FriendsOfREDAXO zu geben, Alex bleibt Projekt-Lead des Addons. Sowie @schorschy @skerbis und @eace für die Unterstützung bei der Entwicklung. ## Funktions-Parität und Unterschiede -Was | News Manager `3.0.3` | Neues `^4.0` ---- | --- | --- -Letzte Weiterentwicklung und Wartung | ❌ 28. Dez. 2022 | ✅ aktuell -REDAXO Core-Version | ab `^5.4` | ab `^5.15` -PHP-Version | ab `^5.6` | ab `^7.2` -Addon-Abhängigkeiten | URL ab `^2` | URL ab `^2`, YForm ab `^4`, YForm Field ab `^2` -Position im Backend | `Addons > News Manager` | `Aktuelles` (oben) -News-Übersicht | ✅ `News Manager > "News anlegen"` | ✅ `Aktuelles > Einträge` -Kategorien | ✅ `News Manager > "Kategorien"` | ✅ `Aktuelles > Kategorien` -Kommentare | ✅ als Plugin: `News Manager > "Kommentare"` | ❌ nein -Autoren | ❌ nein | `Aktuelles > Autoren` -Mehrsprachigkeit | ✅ `News Manager > (Sprache auswählen)` | ✅ `Aktuelles > Sprachen` -Dokumentation | ✅ als Plugin | ✅ `Aktuelles > Hilfe` -Einstellungen | ❌ nein | ✅ `Aktuelles > Einstellungen` -WYSIWYG-Editor | ✅ ausschließlich `redactor2` | ✅ frei wählbar (`cke5`, `redactor`, `markitup`, `tinymce`) -Backend-Sprachen | `de,en,es,se` | `de,en,es,se,da,el,fi,nl,no,pl,ro,tr,uk` -RSS | ✅ ja | 🚧 in Arbeit -Fertige Fragmente | ✅ ja | 🚧 in Arbeit -Multi-Domain-Unterstützung | ❌ über Umwege | ✅ ja -YOrm-Model | ❌ nein | ✅ ja (News-Einträge, Kategorien, Autoren, Sprachen) -CSV-Import | ❌ nein | ✅ ja (via YForm) -CSV-Export | ❌ nein | ✅ ja (via YForm) -RESTful API | ❌ nein | ✅ ja (via YForm) - -## Migration von News Manager zu Neues 4 +| Was | News Manager `3.0.3` | Blogger `1.3.2` | Neues `^4.1` | +| ------------------------------------ | ------------------------------------------- | --------------- | ------------------------------------------------------------- | +| Letzte Weiterentwicklung und Wartung | ❌ 28. Dez. 2022 | ❌ 31. März 2024 | ✅ aktuell | +| REDAXO Core-Version | ab `^5.4` | ❌ n/a | ab `^5.15` | +| PHP-Version | ab `^5.6` | ❌ n/a | ab `^7.2` | +| Addon-Abhängigkeiten | URL ab `^2` | Keine | URL ab `^2`, YForm ab `^4`, YForm Field ab `^2` | +| Position im Backend | `Addons > News Manager` | `Addons > Blogger` | `Aktuelles` (oben) | +| News-Übersicht | ✅ `News Manager > "News anlegen"` | `Blogger > Einträge` | ✅ `Aktuelles > Einträge` | +| Kategorien | ✅ `News Manager > "Kategorien"` | `Blogger > Kategorien` | ✅ `Aktuelles > Kategorien` | +| Kommentare | ✅ als Plugin: `News Manager > "Kommentare"` | ❌ nein | ❌ nein | +| Autoren | ❌ nein | ❌ nein | ✅ `Aktuelles > Autoren` | +| Mehrsprachigkeit | ✅ `News Manager > (Sprache auswählen)` | ❌ nein | ✅ `Aktuelles > Sprachen` | +| Dokumentation | ✅ als Plugin | ❌ nein | ✅ `Aktuelles > Hilfe` | +| Einstellungen | ❌ nein | `Blogger > Einstellungen` | ✅ `Aktuelles > Einstellungen` | +| WYSIWYG-Editor | ✅ ausschließlich `redactor2` | ✅ frei wählbar | ✅ frei wählbar (`cke5`, `redactor`, `markitup`, `tinymce`) | +| Backend-Sprachen | ✅ ja `de,en,es,se` | ✅ ja `de, en` | ✅ ja `da,de,en,el,fi,nl,no,pl,ro,se,es,tr,uk` | +| RSS | ✅ ja | ❌ nein | ✅ ja | +| Fertige Fragmente | ✅ ja | ✅ ja | ✅ ja | +| Multi-Domain-Unterstützung | ❌ über Umwege | ❌ n/a | ✅ ja | +| Frei erweiterbare Felder | ❌ nein | ❌ nein | ✅ ja (via YForm) | +| YOrm-Model | ❌ nein | ❌ nein | ✅ ja (News-Einträge, Kategorien, Autoren, Sprachen) | +| CSV-Import | ❌ nein | ❌ nein | ✅ ja (via YForm) | +| CSV-Export | ❌ nein | ❌ nein | ✅ ja (via YForm) | +| RESTful API | ❌ nein | ❌ nein | ✅ ja (via YForm) | + +## Migration von News Manager zu Neues + +### Automatische Daten-Migration von News Manager zu Neues 4 + +Es gibt eine automatische Migration von News Manager-Einträgen zu Neues 4. + +Diese liegt der finalen Version des News Managers bei. Alternativ müssen folgenden Schritte erfolgen. + +### Manuelle Daten-Migration von News Manager zu Neues 4 1. Backup der Datenbank und des Dateisystems 2. `Neues` installieren (`YForm`, `YForm Field`, `URL` müssen bereits installiert und aktiviert sein) @@ -44,6 +53,77 @@ RESTful API | ❌ nein | ✅ ja (via YForm) 4. Module, Templates und URL-Profile anpassen 5. `News Manager` deinstallieren. +### SQL-Befehle zur Migration der Daten + +> Hinweis: Die Autoren müssen manuell oder mit eigenen Anpassungen übertragen werden, da es hierfür eine eigene Tabelle gibt. + +```SQL +INSERT INTO rex_neues_category + (id, name, image, status, createuser, createdate, updateuser, updatedate) +SELECT + pid, + name, + '', + '1', + createuser, + createdate, + updateuser, + updatedate +FROM rex_newsmanager_categories; + +INSERT INTO rex_neues_entry + (id, status, name, teaser, description, domain_ids, lang_id, publishdate, author_id, url, image, images, createdate, createuser, updatedate, updateuser) +SELECT + pid, + IF(status=1, '1', '0'), + title, + subtitle, + richtext, + '', + clang_id, + createdate, + 0, + seo_canonical, + '', + images, + createdate, + createuser, + updatedate, + updateuser +FROM rex_newsmanager; + +INSERT INTO rex_neues_entry_category_rel (entry_id, category_id) +SELECT rex_newsmanager.pid , rex_newsmanager_categories.id +FROM rex_newsmanager +INNER JOIN rex_newsmanager_categories +ON FIND_IN_SET(rex_newsmanager_categories.id, REPLACE(REPLACE(rex_newsmanager.newsmanager_category_id, '|', ','), ' ', '')) > 0; +``` + +## Migration von Blogger zu Neues + +### Automatische Daten-Migration von Blogger zu Neues 4.1 + +Es wird eine automatische Migration von Blogger-Einträgen zu Neues 4.1. + +Diese liegt der finalen Version des News Managers bei. Alternativ müssen folgenden Schritte erfolgen. + +### Manuelle Daten-Migration von Blogger zu Neues 4 + +1. Backup der Datenbank und des Dateisystems +2. `Neues` installieren (`YForm`, `YForm Field`, `URL` müssen bereits installiert und aktiviert sein) +3. Bestehende News-Einträge und Kategorien in Neues importieren +4. Module, Templates und URL-Profile anpassen +5. `News Manager` deinstallieren. + +### SQL-Befehle zur Migration der Daten von Blogger zu Neues 4 + +> Hinweis: Die Tags müssen manuell oder mit eigenen Anpassungen übertragen werden, da es hierfür eine eigene Tabelle gibt. + +folgt... + +```SQL +``` + ## Migration von Neues 3 zu Neues 4 Der Wechsel von Neues 3 zu 4 sollte vergleichsweise einfach vonstatten gehen. Im Zuge des Versionswechsels wurden lange verschobene, jedoch notwendige kleine Änderungen vorgenommen, die zwingend beachtet werden müssen: diff --git a/docs/01_d_example.md b/docs/01_d_example.md new file mode 100644 index 0000000..3979a42 --- /dev/null +++ b/docs/01_d_example.md @@ -0,0 +1,46 @@ +# Beispiel und Fragmente + +Wurde Neues mit dem URL-Addon installiert und entsprechend der [Anleitung](/redaxo/index.php?page=neues/docs&mdfile=06_url) konfiguriert, kannst du dir eine Beispielvorlage für die Ausgabe im Template ausgeben lassen. + +Die Ausgabe erfolgt über Fragment-Dateien. Diese findest du im Ordner `fragments/neues`. Die Fragmente können nach Belieben angepasst werden. Weitere Informationen zu Fragmenten findest du in der [Redaxo-Dokumentation](https://redaxo.org/doku/main/fragmente). + +Im Template, in dem du die Ausgabe von Neues realisieren möchtest, fügst du folgenden Code ein: + +```php +getDatasetId(); + echo neues::getEntry($postId); + } else { + // Ausgabe einer Liste + echo neues::getList(); + } +?> +``` + + +## Methoden + +### getEntry(int $postId) + +Gibt einen einzelnen Datensatz aus. Benötigt wird die ID des Datensatzes. + +```php +$entry = neues::getEntry(1); +``` + +### getList(int $rowsPerPage = 10, string $pageCursor = 'page') + +Gibt eine Liste aller Datensätze als HTML aus. + +- rowsPerPage: Anzahl der Datensätze pro Seite. Standard: `10` +- pageCursor: Name des GET-Parameters, der die aktuelle Seite enthält. Standard: `page` + + +```php +$list = neues::getList(); +``` \ No newline at end of file diff --git a/docs/07_rss.md b/docs/07_rss.md index 3e627b0..02c67a0 100644 --- a/docs/07_rss.md +++ b/docs/07_rss.md @@ -2,4 +2,12 @@ > Hinweis: Der RSS-Feed befindet sich noch in Arbeit, es gibt noch kein Datum für die Fertigstellung. Beteilige dich an der Entwicklung, wenn du möchtest. -Das Addon `Neues` bietet einen RSS-Feed für die News-Einträge an. Der Feed kann über die URL `index.php?rex-api-call=neues_rss` aufgerufen werden. Die Ausgabe kann über die URL-Parameter `lang` und `category` beeinflusst werden. +Die `rex_api_neues_rss`-Klasse ist Teil des `Neues`-Addons und ermöglicht die Generierung eines RSS-Feeds für News-Einträge. Der Feed wird über die URL `index.php?rex-api-call=neues_rss` aufgerufen. Die Ausgabe wird durch verschiedene URL-Parameter beeinflusst: + +- `domain_id`: Dieser Parameter ermöglicht es, den Feed auf eine bestimmte Domain zu beschränken. Zum Beispiel wird `index.php?rex-api-call=neues_rss&domain_id=1` verwendet, um den Feed für die Domain mit der ID 1 zu generieren. + +- `lang_id`: Mit diesem Parameter wird der Feed auf eine bestimmte Sprache beschränkt. Zum Beispiel wird `index.php?rex-api-call=neues_rss&lang_id=2` verwendet, um den Feed in der Sprache mit der ID 2 zu generieren. + +- `category_id`: Dieser Parameter ermöglicht es, den Feed auf eine bestimmte Kategorie zu beschränken. Zum Beispiel wird `index.php?rex-api-call=neues_rss&category_id=3` verwendet, um den Feed für die Kategorie mit der ID 3 zu generieren. + +Die Parameter `domain_id`, `lang_id` und `category_id` sind optional und der Feed kann auch ohne diese Parameter generiert werden. Wenn sie nicht angegeben werden, werden alle Domains, Sprachen und Kategorien in den Feed einbezogen. diff --git a/fragments/neues/entry.php b/fragments/neues/entry.php new file mode 100644 index 0000000..13723ca --- /dev/null +++ b/fragments/neues/entry.php @@ -0,0 +1,78 @@ +getVar('post'); +?> + +
+
+
+
+ + + getName()) : ?> +

getName()) ?>

+ + + + getPublishDate()) : ?> + + + + + getImage()) : ?> + getImage()); + ?> + +
+ <?= htmlspecialchars($media->getTitle()) ?> +
+ + + + + + getDescription()) : ?> +
+ getDescription() ?> +
+ + + + getImages()) : ?> +
+ getImages() as $image) : ?> + + +
+ + <?= htmlspecialchars($media->getTitle()) ?> + +
+ + +
+ + +
+ +
+
+
\ No newline at end of file diff --git a/fragments/neues/list-entry.php b/fragments/neues/list-entry.php new file mode 100644 index 0000000..effc3d6 --- /dev/null +++ b/fragments/neues/list-entry.php @@ -0,0 +1,52 @@ +getVar('post'); +?> + +
+
+ + + getCategories()) : ?> +

+ getCategories()->toKeyValue('id', 'name'))) ?> +

+ + + + getName()) : ?> +

+ getName() ?> +

+ + + + getPublishDate()) : ?> +
+ getFormattedPublishDate() ?> +
+ + + + getTeaser()) : ?> +

+ getTeaser()) ?> +

+ +
+ + + getImage()) : ?> + getImage()); + $mediaUrl = rex_media_manager::getUrl('rex_media_medium', $post->getImage()); + ?> + +
+ <?= htmlspecialchars($media->getTitle()) ?> +
+ + +
\ No newline at end of file diff --git a/fragments/neues/list.php b/fragments/neues/list.php new file mode 100644 index 0000000..3de9301 --- /dev/null +++ b/fragments/neues/list.php @@ -0,0 +1,31 @@ +getVar('pager'); + +/** @var rex_yform_manager_collection $posts */ +$posts = $this->getVar('posts'); +?> + + +
+
+ +
+ setVar('post', $post); + echo $fragment->parse('neues/list-entry.php'); + ?> +
+ +
+
+ + +setVar('pager', $pager); +echo $fragment->parse('neues/pagination.php'); +?> \ No newline at end of file diff --git a/fragments/neues/pagination.php b/fragments/neues/pagination.php new file mode 100644 index 0000000..63bc4b4 --- /dev/null +++ b/fragments/neues/pagination.php @@ -0,0 +1,72 @@ +getVar('pager'); + +$currentPage = $pager->getCurrentPage(); +$prevPage = $pager->getPrevPage(); +$firsPage = $pager->getFirstPage(); +$nextPage = $pager->getNextPage(); +$lastPage = $pager->getLastPage(); +$articleLink = rex_article::getCurrent()->getUrl(); +?> + + + +getPageCount() > 1) : $page = 0 ?> + + \ No newline at end of file diff --git a/install.php b/install.php index ddeb7f9..325f788 100644 --- a/install.php +++ b/install.php @@ -1,4 +1,57 @@ getName(), 'install/tableset.json'))); +if (rex_addon::get('yform') && rex_addon::get('yform')->isAvailable()) { + rex_yform_manager_table_api::importTablesets(rex_file::get(__DIR__ . '/install/tableset.json')); +} + +if (!rex_media::get('neues_entry_fallback_image.png')) { + rex_file::copy(__DIR__ . '/install/neues_entry_fallback_image.png', rex_path::media('neues_entry_fallback_image.png')); + $data = []; + $data['title'] = 'Aktuelles - Fallback-Image'; + $data['category_id'] = 0; + $data['file'] = [ + 'name' => 'neues_entry_fallback_image.png', + 'path' => rex_path::media('neues_entry_fallback_image.png'), + ]; + + rex_media_service::addMedia($data, false); +} + +/* Cronjob installieren */ +if (rex_addon::get('cronjob') && rex_addon::get('cronjob')->isAvailable()) { + $cronjob = array_filter(rex_sql::factory()->getArray("SELECT * FROM rex_cronjob WHERE `type` = 'rex_cronjob_neues_publish'")); + if (!$cronjob) { + $query = rex_file::get(__DIR__ . '/install/rex_cronjob_neues_publish.sql'); + rex_sql::factory()->setQuery($query); + } +} + +/* URL-Profile installieren */ +if (rex_addon::get('url') && rex_addon::get('url')->isAvailable()) { + if (false === rex_config::get('neues', 'url_profile', false)) { + $rex_neues_category = array_filter(rex_sql::factory()->getArray("SELECT * FROM rex_url_generator_profile WHERE `table_name` = '1_xxx_rex_neues_category'")); + if (!$rex_neues_category) { + $query = rex_file::get(__DIR__ . '/install/rex_url_profile_neues_category.sql'); + rex_sql::factory()->setQuery($query); + } + $rex_neues_entry = array_filter(rex_sql::factory()->getArray("SELECT * FROM rex_url_generator_profile WHERE `table_name` = '1_xxx_rex_neues_entry'")); + if (!$rex_neues_entry) { + $query = rex_file::get(__DIR__ . 'install/rex_url_profile_neues_entry.sql'); + rex_sql::factory()->setQuery($query); + } + /* URL-Profile wurden bereits einmal installiert, daher nicht nochmals installieren und Entwickler-Einstellungen respektieren */ + rex_config::set('neues', 'url_profile', true); + } +} diff --git a/install/neues_entry_fallback_image.png b/install/neues_entry_fallback_image.png new file mode 100644 index 0000000..ac2931e Binary files /dev/null and b/install/neues_entry_fallback_image.png differ diff --git a/install/rex_cronjob_neues_publish.sql b/install/rex_cronjob_neues_publish.sql new file mode 100644 index 0000000..c637b45 --- /dev/null +++ b/install/rex_cronjob_neues_publish.sql @@ -0,0 +1,4 @@ +SET NAMES utf8mb4; + +INSERT INTO `rex_cronjob` (`name`, `description`, `type`, `parameters`, `interval`, `nexttime`, `environment`, `execution_moment`, `execution_start`, `status`, `createdate`, `createuser`, `updatedate`, `updateuser`) VALUES +('[neues] Geplante Beiträge veröffentlichen', 'Veröffentlicht alle Beiträge (status = 1), deren Status geplant (status = 0) ist und deren Veröffentlichungszeitpunkt erreicht wurde (publishdate < now()).', 'rex_cronjob_neues_publish', '[]', '{\"minutes\":\"all\",\"hours\":\"all\",\"days\":\"all\",\"weekdays\":\"all\",\"months\":\"all\"}', NOW(), '|frontend|backend|script|', 0, NOW(), 1, NOW(), 'neues', NOW(), 'neues'); diff --git a/install/rex_url_profile_neues_category.sql b/install/rex_url_profile_neues_category.sql new file mode 100644 index 0000000..f707852 --- /dev/null +++ b/install/rex_url_profile_neues_category.sql @@ -0,0 +1,4 @@ +SET NAMES utf8mb4; + +INSERT INTO `rex_url_generator_profile` (`namespace`, `article_id`, `clang_id`, `ep_pre_save_called`, `table_name`, `table_parameters`, `relation_1_table_name`, `relation_1_table_parameters`, `relation_2_table_name`, `relation_2_table_parameters`, `relation_3_table_name`, `relation_3_table_parameters`, `createdate`, `createuser`, `updatedate`, `updateuser`) VALUES +('neues-category-id', 1, 1, 0, '1_xxx_rex_neues_category', '{\"column_id\":\"id\",\"column_clang_id\":\"\",\"restriction_1_column\":\"status\",\"restriction_1_comparison_operator\":\">\",\"restriction_1_value\":\"0\",\"restriction_2_logical_operator\":\"\",\"restriction_2_column\":\"\",\"restriction_2_comparison_operator\":\"=\",\"restriction_2_value\":\"\",\"restriction_3_logical_operator\":\"\",\"restriction_3_column\":\"\",\"restriction_3_comparison_operator\":\"=\",\"restriction_3_value\":\"\",\"column_segment_part_1\":\"name\",\"column_segment_part_2_separator\":\"\\/\",\"column_segment_part_2\":\"\",\"column_segment_part_3_separator\":\"\\/\",\"column_segment_part_3\":\"\",\"relation_1_column\":\"\",\"relation_1_position\":\"BEFORE\",\"relation_2_column\":\"\",\"relation_2_position\":\"BEFORE\",\"relation_3_column\":\"\",\"relation_3_position\":\"BEFORE\",\"append_user_paths\":\"\",\"append_structure_categories\":\"0\",\"column_seo_title\":\"name\",\"column_seo_description\":\"\",\"column_seo_image\":\"\",\"sitemap_add\":\"1\",\"sitemap_frequency\":\"weekly\",\"sitemap_priority\":\"0.5\",\"column_sitemap_lastmod\":\"\"}', '', '[]', '', '[]', '', '[]', NOW(), 'neues', NOW(), 'neues'); diff --git a/install/rex_url_profile_neues_entry.sql b/install/rex_url_profile_neues_entry.sql new file mode 100644 index 0000000..84d54a2 --- /dev/null +++ b/install/rex_url_profile_neues_entry.sql @@ -0,0 +1,4 @@ +SET NAMES utf8mb4; + +INSERT INTO `rex_url_generator_profile` (`namespace`, `article_id`, `clang_id`, `ep_pre_save_called`, `table_name`, `table_parameters`, `relation_1_table_name`, `relation_1_table_parameters`, `relation_2_table_name`, `relation_2_table_parameters`, `relation_3_table_name`, `relation_3_table_parameters`, `createdate`, `createuser`, `updatedate`, `updateuser`) VALUES +('neues-entry-id', 1, 1, 0, '1_xxx_rex_neues_entry', '{\"column_id\":\"id\",\"column_clang_id\":\"\",\"restriction_1_column\":\"status\",\"restriction_1_comparison_operator\":\">\",\"restriction_1_value\":\"0\",\"restriction_2_logical_operator\":\"\",\"restriction_2_column\":\"\",\"restriction_2_comparison_operator\":\"=\",\"restriction_2_value\":\"\",\"restriction_3_logical_operator\":\"\",\"restriction_3_column\":\"\",\"restriction_3_comparison_operator\":\"=\",\"restriction_3_value\":\"\",\"column_segment_part_1\":\"name\",\"column_segment_part_2_separator\":\"\\/\",\"column_segment_part_2\":\"\",\"column_segment_part_3_separator\":\"\\/\",\"column_segment_part_3\":\"\",\"relation_1_column\":\"\",\"relation_1_position\":\"BEFORE\",\"relation_2_column\":\"\",\"relation_2_position\":\"BEFORE\",\"relation_3_column\":\"\",\"relation_3_position\":\"BEFORE\",\"append_user_paths\":\"\",\"append_structure_categories\":\"0\",\"column_seo_title\":\"name\",\"column_seo_description\":\"teaser\",\"column_seo_image\":\"image\",\"sitemap_add\":\"1\",\"sitemap_frequency\":\"daily\",\"sitemap_priority\":\"0.7\",\"column_sitemap_lastmod\":\"updatedate\"}', '', '[]', '', '[]', '', '[]', NOW(), 'neues', NOW(), 'neues'), diff --git a/install/tableset.json b/install/tableset.json index c928239..6df4f6a 100644 --- a/install/tableset.json +++ b/install/tableset.json @@ -1 +1,855 @@ -{"rex_neues_category":{"table":{"status":1,"table_name":"rex_neues_category","name":"\ud83d\udcf0 Tags","description":"","list_amount":50,"list_sortfield":"name","list_sortorder":"ASC","search":0,"hidden":1,"export":0,"import":0,"mass_deletion":0,"mass_edit":0,"schema_overwrite":1,"history":0,"createdate":"0000-00-00 00:00:00","updatedate":"0000-00-00 00:00:00","createuser":"","updateuser":""},"fields":[{"table_name":"rex_neues_category","prio":1,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":0,"search":1,"name":"date_id","label":"translate:neues_date_ids","not_required":"","attributes":"","notice":"translate:neues_date_id_notice","table":"rex_neues_entry","empty_option":"1","size":"","field":"category_ids","type":"4","empty_value":"","relation_table":"rex_neues_entry_category_rel","filter":""},{"table_name":"rex_neues_category","prio":2,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"name","label":"translate:neues_category_title","not_required":"","attributes":"{\"required\":\"required\"}","default":"","no_db":"0","notice":"translate:neues_external_url_notice","append":"","prepend":""},{"table_name":"rex_neues_category","prio":3,"type_id":"validate","type_name":"unique","db_type":"","list_hidden":1,"search":0,"name":"name","label":"","not_required":"","table":"","empty_option":"0","message":"translate:neues_category_name_validate_unique"},{"table_name":"rex_neues_category","prio":4,"type_id":"value","type_name":"be_media_preview","db_type":"text","list_hidden":1,"search":0,"name":"image","label":"translate:neues_category_image","not_required":"","multiple":"0","notice":"","types":"jpg,jpeg,png,gif,svg","preview":"1","category":""},{"table_name":"rex_neues_category","prio":5,"type_id":"value","type_name":"choice","db_type":"text","list_hidden":1,"search":1,"name":"status","label":"translate:neues_status","not_required":"","multiple":"0","expanded":"0","choices":"translate:neues_status_offline=0,translate:neues_status_online=1","choice_attributes":"","attributes":"","default":"0","no_db":"0","notice":"translate:neues_category_status_notice","preferred_choices":"","group_by":"","placeholder":"","group_attributes":"","choice_label":""},{"table_name":"rex_neues_category","prio":6,"type_id":"value","type_name":"be_user","db_type":"varchar(191)","list_hidden":1,"search":0,"name":"createuser","label":"translate:neues_createuser","not_required":"","only_empty":"1","show_value":"0"},{"table_name":"rex_neues_category","prio":7,"type_id":"value","type_name":"be_user","db_type":"varchar(191)","list_hidden":1,"search":0,"name":"updateuser","label":"translate:neues_updateuser","not_required":"","only_empty":"0","show_value":"0"},{"table_name":"rex_neues_category","prio":8,"type_id":"value","type_name":"datestamp","db_type":"datetime","list_hidden":1,"search":0,"name":"updatedate","label":"translate:neues_updatedate","not_required":"","no_db":"0","only_empty":"0","format":"Y-m-d H:i:s","modify_default":""},{"table_name":"rex_neues_category","prio":9,"type_id":"value","type_name":"datestamp","db_type":"datetime","list_hidden":1,"search":0,"name":"createdate","label":"translate:neues_createdate","not_required":"","no_db":"0","only_empty":"1","format":"Y-m-d H:i:s","modify_default":""}]},"rex_neues_entry":{"table":{"status":1,"table_name":"rex_neues_entry","name":"\ud83d\udcf0 News","description":"","list_amount":500,"list_sortfield":"publishdate","list_sortorder":"DESC","search":1,"hidden":1,"export":1,"import":1,"mass_deletion":0,"mass_edit":0,"schema_overwrite":1,"history":0,"createdate":"0000-00-00 00:00:00","updatedate":"0000-00-00 00:00:00","createuser":"","updateuser":""},"fields":[{"table_name":"rex_neues_entry","prio":1,"type_id":"value","type_name":"html","db_type":"none","list_hidden":0,"search":0,"name":"row_start","label":"","not_required":"","html":"
\r\n
"},{"table_name":"rex_neues_entry","prio":2,"type_id":"value","type_name":"choice","db_type":"text","list_hidden":1,"search":0,"name":"status","label":"translate:neues_status","not_required":"","multiple":"0","expanded":"0","choices":"translate:neues_status_offline=-1,translate:neues_status_draft=0,translate:neues_status_online=1","choice_attributes":"","attributes":"","default":"","no_db":"0","notice":"translate:neues_status_notice","preferred_choices":"","group_by":"","placeholder":"","group_attributes":"","choice_label":""},{"table_name":"rex_neues_entry","prio":3,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"name","label":"translate:neues_name","not_required":"","attributes":"{\"required\":\"required\"}","default":"","no_db":"0","notice":"transalte:neues_name_notice","append":"","prepend":""},{"table_name":"rex_neues_entry","prio":4,"type_id":"validate","type_name":"empty","db_type":"","list_hidden":1,"search":0,"name":"name","label":"","not_required":"","message":"translate:neues_name_validate_empty"},{"table_name":"rex_neues_entry","prio":5,"type_id":"value","type_name":"textarea","db_type":"text","list_hidden":1,"search":0,"name":"teaser","label":"translate:neues_teaser","not_required":"","attributes":"{\"style\":\"max-height: 100px;\"}","default":"","no_db":"0","notice":"translate:neues_teaser_notice"},{"table_name":"rex_neues_entry","prio":6,"type_id":"value","type_name":"textarea","db_type":"text","list_hidden":1,"search":0,"name":"description","label":"translate:neues_description","not_required":"","attributes":"{\"class\":\"###neues-settings-editor###\"}","default":"","no_db":"0","notice":"translate:neues_description_notice"},{"table_name":"rex_neues_entry","prio":7,"type_id":"value","type_name":"domain","db_type":"text","list_hidden":1,"search":1,"name":"domain_ids","label":"translate:neues_domain_ids","not_required":"","attributes":"","notice":"translate:neues_domain_ids_notice"},{"table_name":"rex_neues_entry","prio":8,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":1,"search":0,"name":"lang_id","label":"translate:neues_language","not_required":"","attributes":"","notice":"","table":"rex_neues_entry_lang","empty_option":"1","size":"","field":"name","type":"0","empty_value":"","relation_table":"","filter":""},{"table_name":"rex_neues_entry","prio":9,"type_id":"value","type_name":"html","db_type":"none","list_hidden":0,"search":0,"name":"col","label":"","not_required":"","html":"<\/div>\r\n
"},{"table_name":"rex_neues_entry","prio":10,"type_id":"value","type_name":"datetime_local","db_type":"datetime","list_hidden":0,"search":0,"name":"publishdate","label":"translate:neues_publishdate","not_required":"","attributes":"{\"requried\":\"required\"}","no_db":"0","notice":"","current_date":"1","max":"","min":""},{"table_name":"rex_neues_entry","prio":11,"type_id":"value","type_name":"be_manager_relation","db_type":"int(10) unsigned","list_hidden":0,"search":1,"name":"author_id","label":"translate:neues_entry_author_id","not_required":"","attributes":"","notice":"","table":"rex_neues_author","empty_option":"1","size":"","field":"name","type":"2","empty_value":"","relation_table":"","filter":""},{"table_name":"rex_neues_entry","prio":12,"type_id":"validate","type_name":"compare_value","db_type":"","list_hidden":1,"search":0,"name":"publishdate","label":"","not_required":"","message":"translate:neues_publishdate_validate_compare_value","compare_type":"==","compare_value":"0000-00-00 00:00:00"},{"table_name":"rex_neues_entry","prio":13,"type_id":"value","type_name":"html","db_type":"none","list_hidden":0,"search":0,"name":"col2","label":"","not_required":"","html":"<\/div>\r\n
"},{"table_name":"rex_neues_entry","prio":14,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":1,"search":0,"name":"url","label":"translate:neues_external_url","not_required":"","attributes":"","default":"","no_db":"0","notice":"translate:neues_external_url_notice","append":"","prepend":""},{"table_name":"rex_neues_entry","prio":15,"type_id":"validate","type_name":"type","db_type":"","list_hidden":1,"search":0,"name":"url","label":"","not_required":"1","type":"url","message":"translate:neues_external_url_validate_url"},{"table_name":"rex_neues_entry","prio":16,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":0,"search":1,"name":"category_ids","label":"translate:neues_category_ids","not_required":"","attributes":"","notice":"","table":"rex_neues_category","empty_option":"1","size":"","field":"name","type":"3","empty_value":"","relation_table":"rex_neues_entry_category_rel","filter":""},{"table_name":"rex_neues_entry","prio":17,"type_id":"value","type_name":"be_media_preview","db_type":"text","list_hidden":0,"search":0,"name":"image","label":"translate:neues_image","not_required":"","multiple":"0","notice":"","types":"svg,jpg,jpeg,gif,png","preview":"1","category":""},{"table_name":"rex_neues_entry","prio":18,"type_id":"value","type_name":"be_media","db_type":"text","list_hidden":1,"search":0,"name":"images","label":"translate:neues_images","not_required":"","multiple":"1","notice":"","types":"jpg,png","preview":"1","category":""},{"table_name":"rex_neues_entry","prio":19,"type_id":"value","type_name":"html","db_type":"none","list_hidden":0,"search":0,"name":"row_end","label":"","not_required":"","html":"<\/div>\r\n<\/div>"},{"table_name":"rex_neues_entry","prio":20,"type_id":"value","type_name":"datestamp","db_type":"datetime","list_hidden":1,"search":0,"name":"createdate","label":"translate:neues_createdate","not_required":"","no_db":"0","only_empty":"1","format":"","modify_default":""},{"table_name":"rex_neues_entry","prio":21,"type_id":"value","type_name":"be_user","db_type":"varchar(191)","list_hidden":1,"search":0,"name":"createuser","label":"translate:neues_createuser","not_required":"","only_empty":"1","show_value":"0"},{"table_name":"rex_neues_entry","prio":22,"type_id":"value","type_name":"datestamp","db_type":"datetime","list_hidden":1,"search":0,"name":"updatedate","label":"translate:neues_updateuser","not_required":"","no_db":"0","only_empty":"0","format":"","modify_default":""},{"table_name":"rex_neues_entry","prio":23,"type_id":"value","type_name":"be_user","db_type":"varchar(191)","list_hidden":1,"search":0,"name":"updateuser","label":"translate:neues_updateuser","not_required":"","only_empty":"0","show_value":"0"}]},"rex_neues_entry_lang":{"table":{"status":1,"table_name":"rex_neues_entry_lang","name":"\ud83d\udcf0 Sprache","description":"","list_amount":50,"list_sortfield":"id","list_sortorder":"ASC","search":0,"hidden":1,"export":0,"import":0,"mass_deletion":0,"mass_edit":0,"schema_overwrite":1,"history":0,"createdate":"0000-00-00 00:00:00","updatedate":"0000-00-00 00:00:00","createuser":"","updateuser":""},"fields":[{"table_name":"rex_neues_entry_lang","prio":1,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":0,"search":0,"name":"entry","label":"translate:neues_language_entry","not_required":"","attributes":"","notice":"translate:neues_language_entry_notice","table":"rex_neues_entry","empty_option":"1","size":"","field":"lang_id","type":"4","empty_value":"","relation_table":"rex_neues_entry","filter":""},{"table_name":"rex_neues_entry_lang","prio":2,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"code","label":"translate:neues_language_code","not_required":"","attributes":"","default":"de","no_db":"0","notice":"translate:neues_language_code_notice","append":"","prepend":""},{"table_name":"rex_neues_entry_lang","prio":3,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"name","label":"translate:neues_language_name","not_required":"","attributes":"","default":"Deutsch","no_db":"0","notice":"translate:neues_language_name_notice","append":"","prepend":""}]},"rex_neues_author":{"table":{"status":1,"table_name":"rex_neues_author","name":"translate:neues_author_table","description":"","list_amount":50,"list_sortfield":"id","list_sortorder":"ASC","search":1,"hidden":1,"export":1,"import":1,"mass_deletion":0,"mass_edit":0,"schema_overwrite":1,"history":0,"createdate":"0000-00-00 00:00:00","updatedate":"0000-00-00 00:00:00","createuser":"","updateuser":""},"fields":[{"table_name":"rex_neues_author","prio":1,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"name","label":"translate:neues_author_name","not_required":"","attributes":"","default":"","no_db":"0","notice":"","append":"","prepend":""},{"table_name":"rex_neues_author","prio":2,"type_id":"value","type_name":"text","db_type":"varchar(191)","list_hidden":0,"search":1,"name":"nickname","label":"translate:neues_author_nickname","not_required":"","attributes":"","default":"","no_db":"0","notice":"","append":"","prepend":""},{"table_name":"rex_neues_author","prio":3,"type_id":"value","type_name":"textarea","db_type":"text","list_hidden":1,"search":0,"name":"text","label":"translate:neues_author_text","not_required":"","attributes":"","default":"","no_db":"0","notice":""},{"table_name":"rex_neues_author","prio":4,"type_id":"value","type_name":"choice","db_type":"text","list_hidden":0,"search":1,"name":"be_user_id","label":"translate:neues_author_be_user_id","not_required":"","multiple":"0","expanded":"0","choices":"select id as value, login as label from rex_user","choice_attributes":"","attributes":"","default":"","no_db":"0","notice":"","preferred_choices":"","group_by":"","placeholder":"Bitte w\u00e4hlen","group_attributes":"","choice_label":""}]},"rex_neues_entry_category_rel":{"table":{"status":1,"table_name":"rex_neues_entry_category_rel","name":"\ud83d\udcf0 translate:neues_entry_category_rel","description":"","list_amount":50,"list_sortfield":"id","list_sortorder":"ASC","search":0,"hidden":1,"export":0,"import":0,"mass_deletion":0,"mass_edit":0,"schema_overwrite":1,"history":0,"createdate":"0000-00-00 00:00:00","updatedate":"0000-00-00 00:00:00","createuser":"","updateuser":""},"fields":[{"table_name":"rex_neues_entry_category_rel","prio":1,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":0,"search":0,"name":"entry_id","label":"translate:neues_entry","not_required":"","attributes":"","notice":"","table":"rex_neues_entry","empty_option":"0","size":"","field":"name","type":"0","empty_value":"","relation_table":"","filter":""},{"table_name":"rex_neues_entry_category_rel","prio":2,"type_id":"value","type_name":"be_manager_relation","db_type":"text","list_hidden":1,"search":0,"name":"category_id","label":"translate:neues_category_title","not_required":"","attributes":"","notice":"","table":"rex_neues_category","empty_option":"0","size":"","field":"name","type":"0","empty_value":"","relation_table":"","filter":""}]}} +{ + "rex_neues_author": { + "table": { + "status": 1, + "table_name": "rex_neues_author", + "name": "translate:neues_author_table", + "description": "", + "list_amount": 50, + "list_sortfield": "id", + "list_sortorder": "ASC", + "search": 1, + "hidden": 1, + "export": 1, + "import": 1, + "mass_deletion": 0, + "mass_edit": 0, + "schema_overwrite": 1, + "history": 0, + "createdate": "0000-00-00 00:00:00", + "updatedate": "0000-00-00 00:00:00", + "createuser": "", + "updateuser": "" + }, + "fields": [ + { + "table_name": "rex_neues_author", + "prio": 1, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "name", + "label": "translate:neues_author_name", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_author", + "prio": 2, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "nickname", + "label": "translate:neues_author_nickname", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_author", + "prio": 3, + "type_id": "value", + "type_name": "textarea", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "text", + "label": "translate:neues_author_text", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "" + }, + { + "table_name": "rex_neues_author", + "prio": 4, + "type_id": "value", + "type_name": "choice", + "db_type": "text", + "list_hidden": 0, + "search": 1, + "name": "be_user_id", + "label": "translate:neues_author_be_user_id", + "not_required": "", + "multiple": "0", + "expanded": "0", + "choices": "select id as value, login as label from rex_user", + "choice_attributes": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "", + "preferred_choices": "", + "group_by": "", + "placeholder": "Bitte wählen", + "group_attributes": "", + "choice_label": "" + } + ] + }, + "rex_neues_category": { + "table": { + "status": 1, + "table_name": "rex_neues_category", + "name": "📰 Tags", + "description": "", + "list_amount": 50, + "list_sortfield": "name", + "list_sortorder": "ASC", + "search": 0, + "hidden": 1, + "export": 0, + "import": 0, + "mass_deletion": 0, + "mass_edit": 0, + "schema_overwrite": 1, + "history": 0, + "createdate": "0000-00-00 00:00:00", + "updatedate": "0000-00-00 00:00:00", + "createuser": "", + "updateuser": "" + }, + "fields": [ + { + "table_name": "rex_neues_category", + "prio": 1, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "text", + "list_hidden": 1, + "search": 1, + "name": "date_id", + "label": "translate:neues_date_ids", + "not_required": "", + "attributes": "", + "notice": "translate:neues_date_id_notice", + "table": "rex_neues_entry", + "empty_option": "1", + "size": "", + "field": "name", + "type": "3", + "empty_value": "", + "relation_table": "rex_neues_entry_category_rel", + "filter": "" + }, + { + "table_name": "rex_neues_category", + "prio": 2, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "name", + "label": "translate:neues_category_title", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "{\"required\":\"required\"}", + "notice": "translate:neues_external_url_notice", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_category", + "prio": 3, + "type_id": "validate", + "type_name": "unique", + "db_type": "", + "list_hidden": 1, + "search": 0, + "name": "name", + "label": "", + "not_required": "", + "message": "translate:neues_category_name_validate_unique", + "table": "", + "empty_option": "0" + }, + { + "table_name": "rex_neues_category", + "prio": 4, + "type_id": "value", + "type_name": "be_media_preview", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "image", + "label": "translate:neues_category_image", + "not_required": "", + "multiple": "0", + "notice": "", + "types": "jpg,jpeg,png,gif,svg", + "preview": "1", + "category": "" + }, + { + "table_name": "rex_neues_category", + "prio": 5, + "type_id": "value", + "type_name": "choice", + "db_type": "text", + "list_hidden": 1, + "search": 1, + "name": "status", + "label": "translate:neues_status", + "not_required": "", + "multiple": "0", + "expanded": "0", + "choices": "translate:neues_status_draft=-1,translate:neues_status_online=1", + "choice_attributes": "", + "default": "0", + "no_db": "0", + "attributes": "", + "notice": "translate:neues_category_status_notice", + "preferred_choices": "", + "group_by": "", + "placeholder": "", + "group_attributes": "", + "choice_label": "" + }, + { + "table_name": "rex_neues_category", + "prio": 6, + "type_id": "value", + "type_name": "be_user", + "db_type": "varchar(191)", + "list_hidden": 1, + "search": 0, + "name": "createuser", + "label": "translate:neues_createuser", + "not_required": "", + "only_empty": "1", + "show_value": "0" + }, + { + "table_name": "rex_neues_category", + "prio": 7, + "type_id": "value", + "type_name": "be_user", + "db_type": "varchar(191)", + "list_hidden": 1, + "search": 0, + "name": "updateuser", + "label": "translate:neues_updateuser", + "not_required": "", + "only_empty": "0", + "show_value": "0" + }, + { + "table_name": "rex_neues_category", + "prio": 8, + "type_id": "value", + "type_name": "datestamp", + "db_type": "datetime", + "list_hidden": 1, + "search": 0, + "name": "updatedate", + "label": "translate:neues_updatedate", + "not_required": "", + "no_db": "0", + "only_empty": "0", + "format": "Y-m-d H:i:s", + "modify_default": "" + }, + { + "table_name": "rex_neues_category", + "prio": 9, + "type_id": "value", + "type_name": "datestamp", + "db_type": "datetime", + "list_hidden": 1, + "search": 0, + "name": "createdate", + "label": "translate:neues_createdate", + "not_required": "", + "no_db": "0", + "only_empty": "1", + "format": "Y-m-d H:i:s", + "modify_default": "" + }, + { + "table_name": "rex_neues_category", + "prio": 10, + "type_id": "validate", + "type_name": "empty", + "db_type": "", + "list_hidden": 1, + "search": 0, + "name": "name", + "label": "", + "not_required": "", + "message": "Bitte geben Sie einen Namen ein." + } + ] + }, + "rex_neues_entry": { + "table": { + "status": 1, + "table_name": "rex_neues_entry", + "name": "📰 News", + "description": "", + "list_amount": 500, + "list_sortfield": "publishdate", + "list_sortorder": "DESC", + "search": 1, + "hidden": 1, + "export": 1, + "import": 1, + "mass_deletion": 0, + "mass_edit": 0, + "schema_overwrite": 1, + "history": 0, + "createdate": "0000-00-00 00:00:00", + "updatedate": "0000-00-00 00:00:00", + "createuser": "", + "updateuser": "" + }, + "fields": [ + { + "table_name": "rex_neues_entry", + "prio": 1, + "type_id": "value", + "type_name": "html", + "db_type": "none", + "list_hidden": 0, + "search": 0, + "name": "row_start", + "label": "", + "not_required": "", + "html": "
\r\n
" + }, + { + "table_name": "rex_neues_entry", + "prio": 2, + "type_id": "value", + "type_name": "choice_status", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "status", + "label": "translate:neues_status", + "not_required": "", + "multiple": "0", + "expanded": "0", + "choices": "translate:neues_status_deleted=2,translate:neues_status_draft=-1,translate:neues_status_planned=0,translate:neues_status_online=1", + "choice_attributes": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "translate:neues_status_notice", + "preferred_choices": "", + "group_by": "", + "placeholder": "", + "group_attributes": "", + "choice_label": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 3, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "name", + "label": "translate:neues_name", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "{\"required\":\"required\"}", + "notice": "transalte:neues_name_notice", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 4, + "type_id": "validate", + "type_name": "empty", + "db_type": "", + "list_hidden": 1, + "search": 0, + "name": "name", + "label": "", + "not_required": "", + "message": "translate:neues_name_validate_empty" + }, + { + "table_name": "rex_neues_entry", + "prio": 5, + "type_id": "value", + "type_name": "textarea", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "teaser", + "label": "translate:neues_teaser", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "{\"style\":\"max-height: 100px;\"}", + "notice": "translate:neues_teaser_notice" + }, + { + "table_name": "rex_neues_entry", + "prio": 6, + "type_id": "value", + "type_name": "textarea", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "description", + "label": "translate:neues_description", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "{\"class\":\"###neues-settings-editor###\"}", + "notice": "translate:neues_description_notice" + }, + { + "table_name": "rex_neues_entry", + "prio": 7, + "type_id": "value", + "type_name": "domain", + "db_type": "text", + "list_hidden": 1, + "search": 1, + "name": "domain_ids", + "label": "translate:neues_domain_ids", + "not_required": "", + "attributes": "", + "notice": "translate:neues_domain_ids_notice" + }, + { + "table_name": "rex_neues_entry", + "prio": 8, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "lang_id", + "label": "translate:neues_language", + "not_required": "", + "attributes": "", + "notice": "", + "table": "rex_neues_entry_lang", + "empty_option": "1", + "size": "", + "field": "name", + "type": "0", + "empty_value": "", + "relation_table": "", + "filter": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 9, + "type_id": "value", + "type_name": "html", + "db_type": "none", + "list_hidden": 0, + "search": 0, + "name": "col", + "label": "", + "not_required": "", + "html": "
\r\n
" + }, + { + "table_name": "rex_neues_entry", + "prio": 10, + "type_id": "value", + "type_name": "datetime_local", + "db_type": "datetime", + "list_hidden": 0, + "search": 0, + "name": "publishdate", + "label": "translate:neues_publishdate", + "not_required": "", + "no_db": "0", + "attributes": "{\"requried\":\"required\"}", + "notice": "", + "current_date": "1", + "max": "", + "min": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 11, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "int(10) unsigned", + "list_hidden": 0, + "search": 1, + "name": "author_id", + "label": "translate:neues_entry_author_id", + "not_required": "", + "attributes": "", + "notice": "", + "table": "rex_neues_author", + "empty_option": "1", + "size": "", + "field": "name", + "type": "2", + "empty_value": "", + "relation_table": "", + "filter": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 12, + "type_id": "validate", + "type_name": "compare_value", + "db_type": "", + "list_hidden": 1, + "search": 0, + "name": "publishdate", + "label": "", + "not_required": "", + "message": "translate:neues_publishdate_validate_compare_value", + "compare_type": "==", + "compare_value": "0000-00-00 00:00:00" + }, + { + "table_name": "rex_neues_entry", + "prio": 13, + "type_id": "value", + "type_name": "html", + "db_type": "none", + "list_hidden": 0, + "search": 0, + "name": "col2", + "label": "", + "not_required": "", + "html": "
\r\n
" + }, + { + "table_name": "rex_neues_entry", + "prio": 14, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 1, + "search": 0, + "name": "url", + "label": "translate:neues_external_url", + "not_required": "", + "default": "", + "no_db": "0", + "attributes": "", + "notice": "translate:neues_external_url_notice", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 15, + "type_id": "validate", + "type_name": "type", + "db_type": "", + "list_hidden": 1, + "search": 0, + "name": "url", + "label": "", + "not_required": "1", + "message": "translate:neues_external_url_validate_url", + "type": "url" + }, + { + "table_name": "rex_neues_entry", + "prio": 16, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "text", + "list_hidden": 0, + "search": 1, + "name": "category_ids", + "label": "translate:neues_category_ids", + "not_required": "", + "attributes": "", + "notice": "", + "table": "rex_neues_category", + "empty_option": "1", + "size": "", + "field": "name", + "type": "3", + "empty_value": "", + "relation_table": "rex_neues_entry_category_rel", + "filter": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 17, + "type_id": "value", + "type_name": "be_media_preview", + "db_type": "text", + "list_hidden": 0, + "search": 0, + "name": "image", + "label": "translate:neues_image", + "not_required": "", + "multiple": "0", + "notice": "", + "types": "svg,jpg,jpeg,gif,png", + "preview": "1", + "category": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 18, + "type_id": "value", + "type_name": "be_media", + "db_type": "text", + "list_hidden": 1, + "search": 0, + "name": "images", + "label": "translate:neues_images", + "not_required": "", + "multiple": "1", + "notice": "", + "types": "jpg,png", + "preview": "1", + "category": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 19, + "type_id": "value", + "type_name": "html", + "db_type": "none", + "list_hidden": 0, + "search": 0, + "name": "row_end", + "label": "", + "not_required": "", + "html": "
\r\n
" + }, + { + "table_name": "rex_neues_entry", + "prio": 20, + "type_id": "value", + "type_name": "datestamp", + "db_type": "datetime", + "list_hidden": 1, + "search": 0, + "name": "createdate", + "label": "translate:neues_createdate", + "not_required": "", + "no_db": "0", + "only_empty": "1", + "format": "", + "modify_default": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 21, + "type_id": "value", + "type_name": "be_user", + "db_type": "varchar(191)", + "list_hidden": 1, + "search": 0, + "name": "createuser", + "label": "translate:neues_createuser", + "not_required": "", + "only_empty": "1", + "show_value": "0" + }, + { + "table_name": "rex_neues_entry", + "prio": 22, + "type_id": "value", + "type_name": "datestamp", + "db_type": "datetime", + "list_hidden": 1, + "search": 0, + "name": "updatedate", + "label": "translate:neues_updateuser", + "not_required": "", + "no_db": "0", + "only_empty": "0", + "format": "", + "modify_default": "" + }, + { + "table_name": "rex_neues_entry", + "prio": 23, + "type_id": "value", + "type_name": "be_user", + "db_type": "varchar(191)", + "list_hidden": 1, + "search": 0, + "name": "updateuser", + "label": "translate:neues_updateuser", + "not_required": "", + "only_empty": "0", + "show_value": "0" + } + ] + }, + "rex_neues_entry_lang": { + "table": { + "status": 1, + "table_name": "rex_neues_entry_lang", + "name": "📰 Sprache", + "description": "", + "list_amount": 50, + "list_sortfield": "id", + "list_sortorder": "ASC", + "search": 0, + "hidden": 1, + "export": 0, + "import": 0, + "mass_deletion": 0, + "mass_edit": 0, + "schema_overwrite": 1, + "history": 0, + "createdate": "0000-00-00 00:00:00", + "updatedate": "0000-00-00 00:00:00", + "createuser": "", + "updateuser": "" + }, + "fields": [ + { + "table_name": "rex_neues_entry_lang", + "prio": 1, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "text", + "list_hidden": 0, + "search": 0, + "name": "entry", + "label": "translate:neues_language_entry", + "not_required": "", + "attributes": "", + "notice": "translate:neues_language_entry_notice", + "table": "rex_neues_entry", + "empty_option": "1", + "size": "", + "field": "lang_id", + "type": "4", + "empty_value": "", + "relation_table": "rex_neues_entry", + "filter": "" + }, + { + "table_name": "rex_neues_entry_lang", + "prio": 2, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "code", + "label": "translate:neues_language_code", + "not_required": "", + "default": "de", + "no_db": "0", + "attributes": "", + "notice": "translate:neues_language_code_notice", + "append": "", + "prepend": "" + }, + { + "table_name": "rex_neues_entry_lang", + "prio": 3, + "type_id": "value", + "type_name": "text", + "db_type": "varchar(191)", + "list_hidden": 0, + "search": 1, + "name": "name", + "label": "translate:neues_language_name", + "not_required": "", + "default": "Deutsch", + "no_db": "0", + "attributes": "", + "notice": "translate:neues_language_name_notice", + "append": "", + "prepend": "" + } + ] + }, + "rex_neues_entry_category_rel": { + "table": { + "status": 1, + "table_name": "rex_neues_entry_category_rel", + "name": "📰 translate:neues_entry_category_rel", + "description": "", + "list_amount": 50, + "list_sortfield": "id", + "list_sortorder": "ASC", + "search": 0, + "hidden": 1, + "export": 0, + "import": 0, + "mass_deletion": 0, + "mass_edit": 0, + "schema_overwrite": 1, + "history": 0, + "createdate": "0000-00-00 00:00:00", + "updatedate": "0000-00-00 00:00:00", + "createuser": "", + "updateuser": "" + }, + "fields": [ + { + "table_name": "rex_neues_entry_category_rel", + "prio": 1, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "int(10) unsigned", + "list_hidden": 0, + "search": 0, + "name": "entry_id", + "label": "translate:neues_entry", + "not_required": "", + "attributes": "", + "notice": "", + "table": "rex_neues_entry", + "empty_option": "0", + "size": "", + "field": "name", + "type": "0", + "empty_value": "", + "relation_table": "", + "filter": "" + }, + { + "table_name": "rex_neues_entry_category_rel", + "prio": 2, + "type_id": "value", + "type_name": "be_manager_relation", + "db_type": "int(10) unsigned", + "list_hidden": 1, + "search": 0, + "name": "category_id", + "label": "translate:neues_category_title", + "not_required": "", + "attributes": "", + "notice": "", + "table": "rex_neues_category", + "empty_option": "0", + "size": "", + "field": "name", + "type": "0", + "empty_value": "", + "relation_table": "", + "filter": "" + } + ] + } +} diff --git a/lang/de_de.lang b/lang/de_de.lang index f1eb1e1..cfe075b 100644 --- a/lang/de_de.lang +++ b/lang/de_de.lang @@ -51,7 +51,9 @@ neues_status_notice = Gibt an, ob dieser News-Beitrag aktuell sichtbar sein soll neues_category_status_notice = Gibt an, ob diese Kategorie aktuell sichtbar sein soll (veröffentlicht/geplant) oder sich noch im Entwurfsstadium befindet. neues_status_online = Veröffentlicht neues_status_offline = Offline +neues_status_planned = Geplant neues_status_draft = Entwurf +neues_status_deleted = Verworfen neues_domain_ids = Websites neues_domain_ids_notice = Hier können Sie festlegen, ob die News nur auf einer oder auf mehreren Websites innerhalb dieser REDAXO-Installation veröffentlicht werden soll. @@ -79,6 +81,7 @@ neues_author_be_user_id = REDAXO-Benutzer:in neues_docs_a_intro = Einleitung neues_docs_b_import_export = Import/Export neues_docs_c_migration = Migration +neues_docs_d_example = Beispiel neues_docs_settings = Einstellungen neues_docs_neues_entry = Einträge neues_docs_neues_category = Kategorien @@ -87,3 +90,9 @@ neues_docs_neues_language = Sprachen neues_docs_url = URL-Adon neues_docs_rss = RSS-Feed neues_docs_restful_api = YForm RESTful API + +# Cronjob + +neues_entry_publish_success = %s Beiträge wurden erfolgreich veröffentlicht. +neues_entry_publish_error = %s Beiträge konnten nicht veröffentlicht werden. +neues_entry_publish_cronjob = Geplante Beiträge veröffentlichen. (Aktuelles) diff --git a/lang/en_gb.lang b/lang/en_gb.lang index 22197d6..f4d02ec 100644 --- a/lang/en_gb.lang +++ b/lang/en_gb.lang @@ -49,10 +49,9 @@ neues_status = Published? neues_status_notice = Indicates whether this news post should currently be visible (published/scheduled) or is still in the draft stage. neues_category_status_notice = Indicates whether this category should currently be visible (published/scheduled) or is still in the draft stage. neues_status_online = Published -neues_status_offline = Offline +neues_status_planned = Planned neues_status_draft = Draft -neues_domain_ids = Websites -neues_date_ids = Entries +neues_status_deleted = Discarded neues_language = Language neues_language_name = Language @@ -61,6 +60,7 @@ neues_language_code = Language code (ISO 639-1) neues_language_code_notice = Two-letter language code according to ISO standard, e.g.en neues_language_entry = Manage entries neues_language_entry_notice = Manage linked dates + neues_domain_ids = Websites neues_domain_ids_notice = Here you can specify whether the news should be published on one or more websites within this REDAXO installation. neues_date_ids = Entries @@ -79,6 +79,7 @@ neues_author_be_user_id = REDAXO User neues_docs_a_intro = Introduction neues_docs_b_import_export = Import/Export neues_docs_c_migration = Migration +neues_docs_d_example = Example neues_docs_settings = Settings neues_docs_neues_entry = Entries neues_docs_neues_category = Categories @@ -87,3 +88,9 @@ neues_docs_neues_language = Languages neues_docs_url = URL Addon neues_docs_rss = RSS Feed neues_docs_restful_api = YForm RESTful API + +# Cronjob + +neues_entry_publish_success = %s posts have been successfully published. +neues_entry_publish_error = %s posts could not be published. +neues_entry_publish_cronjob = Publish planned posts. (Current) diff --git a/lang/es_es.lang b/lang/es_es.lang index 6f3908b..b762028 100644 --- a/lang/es_es.lang +++ b/lang/es_es.lang @@ -49,8 +49,9 @@ neues_status = ¿Publicado? neues_status_notice = Indica si esta entrada de noticias debe ser visible actualmente (publicada/programada) o si todavía está en la etapa de borrador. neues_category_status_notice = Indica si esta categoría debe ser visible actualmente (publicada/programada) o si todavía está en la etapa de borrador. neues_status_online = Publicado -neues_status_offline = Desconectado +neues_status_planned = Planeado neues_status_draft = Borrador +neues_status_deleted = Descartado neues_domain_ids = Sitios web neues_domain_ids_notice = Aquí puede determinar si las noticias deben publicarse solo en uno o en varios sitios web dentro de esta instalación de REDAXO. @@ -86,3 +87,9 @@ neues_docs_neues_language = Sprachen neues_docs_url = URL-Adon neues_docs_rss = RSS-Feed neues_docs_restful_api = YForm RESTful API + +# Cronjob + +neues_entry_publish_success = %s entradas se han publicado con éxito. +neues_entry_publish_error = %s entradas no se pudieron publicar. +neues_entry_publish_cronjob = Publicar entradas planificadas. (Actual) diff --git a/lang/fr_fr.lang b/lang/fr_fr.lang index fcf29b9..51f1029 100644 --- a/lang/fr_fr.lang +++ b/lang/fr_fr.lang @@ -50,8 +50,9 @@ neues_status = Publié ? neues_status_notice = Indique si cet article de nouvelles doit actuellement être visible (publié/prévu) ou s'il est encore à l'état de brouillon. neues_category_status_notice = Indique si cette catégorie doit actuellement être visible (publiée/prévue) ou si elle est encore à l'état de brouillon. neues_status_online = Publié -neues_status_offline = Hors ligne +neues_status_planned = Prévu neues_status_draft = Brouillon +neues_status_deleted = Supprimé neues_domain_ids = Sites web neues_domain_ids_notice = Ici, vous pouvez déterminer si les nouvelles doivent être publiées sur un ou plusieurs sites web au sein de cette installation REDAXO. @@ -87,3 +88,9 @@ neues_docs_neues_language = Langues neues_docs_url = Addon URL neues_docs_rss = Flux RSS neues_docs_restful_api = API RESTful YForm + +# Cronjob + +neues_entry_publish_success = %s articles ont été publiés avec succès. +neues_entry_publish_error = %s articles n'ont pas pu être publiés. +neues_entry_publish_cronjob = Publier des articles planifiés. (Actuel) diff --git a/lang/it_it.lang b/lang/it_it.lang index 3cb1382..2fc7ba4 100644 --- a/lang/it_it.lang +++ b/lang/it_it.lang @@ -50,8 +50,9 @@ neues_status = Pubblicato? neues_status_notice = Indica se questo articolo di notizie dovrebbe essere attualmente visibile (pubblicato/pianificato) o se è ancora in fase di bozza. neues_category_status_notice = Indica se questa categoria dovrebbe essere attualmente visibile (pubblicata/pianificata) o se è ancora in fase di bozza. neues_status_online = Pubblicato -neues_status_offline = Offline +neues_status_planned = Pianificato neues_status_draft = Bozza +neues_status_deleted = Scartato neues_domain_ids = Siti web neues_domain_ids_notice = Qui puoi decidere se le notizie devono essere pubblicate su uno o più siti web all'interno di questa installazione REDAXO. @@ -87,3 +88,9 @@ neues_docs_neues_language = Lingue neues_docs_url = Addon URL neues_docs_rss = Feed RSS neues_docs_restful_api = YForm API RESTful + +# Cronjob + +neues_entry_publish_success = %s articoli sono stati pubblicati con successo. +neues_entry_publish_error = %s articoli non sono stati pubblicati. +neues_entry_publish_cronjob = Pubblica articoli pianificati. (Corrente) diff --git a/lang/sv_se.lang b/lang/sv_se.lang index 42cb8a5..d89a151 100644 --- a/lang/sv_se.lang +++ b/lang/sv_se.lang @@ -49,8 +49,9 @@ neues_status = Publicerad? neues_status_notice = Anger om detta nyhetsinlägg ska vara synligt just nu (publicerat/schemalagt) eller om det fortfarande är i utkaststadiet. neues_category_status_notice = Anger om denna kategori ska vara synlig just nu (publicerat/schemalagt) eller om det fortfarande är i utkaststadiet. neues_status_online = Publicerad -neues_status_offline = Offline +neues_status_planned = Planerad neues_status_draft = Utkast +neues_status_deleted = Kasserad neues_domain_ids = Webbplatser neues_domain_ids_notice = Här kan du bestämma om nyheterna ska publiceras på bara en eller flera webbplatser inom denna REDAXO-installation. @@ -75,14 +76,20 @@ neues_author_be_user_id = REDAXO-användare # Doku -neues_docs_a_intro = Einleitung +neues_docs_a_intro = Introduktion neues_docs_b_import_export = Import/Export neues_docs_c_migration = Migration -neues_docs_settings = Einstellungen -neues_docs_neues_entry = Einträge -neues_docs_neues_category = Kategorien -neues_docs_neues_author = Autor:innen -neues_docs_neues_language = Sprachen -neues_docs_url = URL-Adon -neues_docs_rss = RSS-Feed +neues_docs_settings = Inställningar +neues_docs_neues_entry = Inlägg +neues_docs_neues_category = Kategorier +neues_docs_neues_author = Författare +neues_docs_neues_language = Språk +neues_docs_url = URL-Addon +neues_docs_rss = RSS-flöde neues_docs_restful_api = YForm RESTful API + +# Cronjob + +neues_entry_publish_success = %s inlägg har publicerats framgångsrikt. +neues_entry_publish_error = %s inlägg kunde inte publiceras. +neues_entry_publish_cronjob = Publicera planerade inlägg. diff --git a/lib/compatibility_classes.php b/lib/compatibility_classes.php new file mode 100644 index 0000000..7cdd2d1 --- /dev/null +++ b/lib/compatibility_classes.php @@ -0,0 +1,41 @@ +where('status', 1, '>=') + ->where('publishdate', rex_sql::datetime(), '<=') + ->orderBy('publishdate', 'desc'); + $pager = new rex_pager($rowsPerPage, $pageCursor); + $posts = $query->paginate($pager); + + $fragment = new rex_fragment(); + $fragment->setVar('posts', $posts); + $fragment->setVar('pager', $pager); + return $fragment->parse('neues/list.php'); + } + + /** + * Gibt einen einzelnen Eintrag zurück. + * Der Output wird über ein Fragment erzeugt, diese können nach Belieben angepasst werden. + * Die Beispiel-Fragmente bauen auf Bootstrap 5 auf. + * + * @param int $postId ID des Eintrags + * @return string HTML des Eintrags + * + * Beispiel / Example: + * echo neues::getEntry(2); + */ + public static function getEntry(int $postId): string + { + $post = Entry::get($postId); + $fragment = new rex_fragment(); + $fragment->setVar('post', $post); + return $fragment->parse('neues/entry.php'); + } +} diff --git a/lib/neues_author.php b/lib/neues_author.php index a9fe12b..0f741fc 100644 --- a/lib/neues_author.php +++ b/lib/neues_author.php @@ -1,4 +1,10 @@ save(); */ -class neues_author extends \rex_yform_manager_dataset +class Author extends rex_yform_manager_dataset { /* translate:neues_author_name */ /** @@ -40,10 +46,6 @@ public function getName(): ?string * Sets the name of the author. * * @param string $value Der neue Name des Autors. / The new name of the author. - * @return self - * - * Beispiel / Example: - * $author = $author->setName('Neuer Name'); * * @api */ @@ -75,10 +77,6 @@ public function getNickname(): ?string * Sets the nickname of the author. * * @param string $value Der neue Spitzname des Autors. / The new nickname of the author. - * @return self - * - * Beispiel / Example: - * $author = $author->setNickname('Neuer Spitzname'); * * @api */ @@ -114,10 +112,6 @@ public function getText(bool $asPlaintext = false): ?string * Sets the text of the author. * * @param string $value Der neue Text des Autors. / The new text of the author. - * @return self - * - * Beispiel / Example: - * $author = $author->setText('Neuer Text'); * * @api */ @@ -141,7 +135,7 @@ public function setText(string $value): self */ public function getBeUserId(): ?int { - return $this->getValue('be_user_id'); + return (int) $this->getValue('be_user_id'); } /** @@ -149,10 +143,6 @@ public function getBeUserId(): ?int * Sets the user ID of the author. * * @param int $value Die neue Benutzer-ID des Autors. / The new user ID of the author. - * @return self - * - * Beispiel / Example: - * $author = $author->setBeUserId('Neue Benutzer-ID'); * * @api */ @@ -170,6 +160,8 @@ public function setBeUserId(int $value): self * * Beispiel / Example: * $beUser = $author->getBeUser(); + * + * @api */ public function getBeUser(): ?rex_user { diff --git a/lib/neues_category.php b/lib/neues_category.php index 18ab805..b4b1316 100644 --- a/lib/neues_category.php +++ b/lib/neues_category.php @@ -1,4 +1,10 @@ setValue('name', 'Neue Kategorie'); * $category->save(); */ -class neues_category extends \rex_yform_manager_dataset +class Category extends rex_yform_manager_dataset { /** * Gibt den Namen der Kategorie zurück. @@ -40,6 +46,8 @@ public function getName(): string * * Beispiel / Example: * $category->setName('Neuer Name'); + * + * @api */ public function setName(string $name): self { @@ -60,7 +68,7 @@ public function setName(string $name): self */ public function getEntries(): ?rex_yform_manager_collection { - return $this->getRelatedDataset('entry_ids'); + return $this->getRelatedCollection('entry_ids'); } /** diff --git a/lib/neues_entry.php b/lib/neues_entry.php index 9080b5a..a4626ae 100644 --- a/lib/neues_entry.php +++ b/lib/neues_entry.php @@ -1,4 +1,16 @@ getName(); */ public function getName(): string { return $this->getValue('name'); } + /** * Setzt den Namen des Eintrags. * Sets the name of the entry. * * @param string $name Der neue Name des Eintrags. / The new name of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setName('Neuer Name'); * * @api */ @@ -43,6 +45,7 @@ public function setName(string $name): self $this->setValue('name', $name); return $this; } + /** * Gibt den Autor des Eintrags zurück. * Returns the author of the entry. @@ -54,20 +57,16 @@ public function setName(string $name): self * * @api */ - public function getAuthor(): ?neues_author + public function getAuthor(): ?Author { - return $this->getRelatedDataset('author'); + if ($this->getRelatedDataset('author_id')) { + return Author::get($this->getRelatedDataset('author_id')->getId()); + } + return null; } /** * @api - * @return string - * - * Gibt die Domain des Eintrags zurück. - * Returns the domain of the entry. - * - * Beispiel / Example: - * $domain = $entry->getDomain(); */ public function getDomain(): string { @@ -79,10 +78,6 @@ public function getDomain(): string * Sets the domain of the entry. * * @param mixed $domain Die neue Domain des Eintrags. / The new domain of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setDomain('neue-domain.com'); * * @api */ @@ -122,7 +117,9 @@ public function getTeaser(): string public function getCategories(): ?rex_yform_manager_collection { return $this->getRelatedCollection('category_ids'); - } /** + } + + /** * Gibt das Bild des Eintrags zurück. * Returns the image of the entry. * @@ -148,10 +145,6 @@ public function getImage(): string * Sets the image of the entry. * * @param string $image Das neue Bild des Eintrags. / The new image of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setImage('neues_bild.jpg'); * * @api */ @@ -182,10 +175,6 @@ public function getImages(): ?array * Sets the images of the entry. * * @param array|null $images Die neuen Bilder des Eintrags. / The new images of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setImages(['bild1.jpg', 'bild2.jpg']); * * @api */ @@ -194,6 +183,7 @@ public function setImages(?array $images): self $this->setValue('images', implode(',', $images)); return $this; } + /** * Gibt das Medium des Eintrags zurück. * Returns the media of the entry. @@ -207,7 +197,7 @@ public function setImages(?array $images): self */ public function getMedia(): ?rex_media { - if (rex_addon::get('media_manager_resposnive')->isAvailable()) { + if (rex_addon::get('media_manager_responsive')->isAvailable()) { return rex_media_plus::get($this->getImage()); } return rex_media::get($this->getImage()); @@ -218,10 +208,6 @@ public function getMedia(): ?rex_media * Sets the media of the entry. * * @param rex_media|null $media Das neue Medium des Eintrags. / The new media of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setMedia($newMedia); * * @api */ @@ -266,15 +252,12 @@ public function getDescription(): string { return $this->getValue('description'); } + /** * Setzt die Beschreibung des Eintrags. * Sets the description of the entry. * * @param string $description Die neue Beschreibung des Eintrags. / The new description of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setDescription('Neue Beschreibung'); * * @api */ @@ -305,10 +288,6 @@ public function getExternalUrl(): ?string * Sets the external URL of the entry. * * @param string $url Die neue externe URL des Eintrags. / The new external URL of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setExternalUrl('http://neue-url.com'); * * @api */ @@ -317,6 +296,7 @@ public function setExternalUrl(string $url): self $this->setValue('url', $url); return $this; } + /** * Gibt das Veröffentlichungsdatum des Eintrags zurück. * Returns the publish date of the entry. @@ -338,10 +318,6 @@ public function getPublishDate(): string * Sets the publish date of the entry. * * @param string $publishdate Das neue Veröffentlichungsdatum des Eintrags. / The new publish date of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setPublishDate('2022-01-01'); * * @api */ @@ -384,6 +360,7 @@ public function getFormattedPublishDateTime($format = [IntlDateFormatter::FULL, { return rex_formatter::intlDateTime($this->getPublishDate(), $format); } + /** * Gibt den Status des Eintrags zurück. * Returns the status of the entry. @@ -405,10 +382,6 @@ public function getStatus(): string * Sets the status of the entry. * * @param int $status Der neue Status des Eintrags. / The new status of the entry. - * @return self - * - * Beispiel / Example: - * $entry = $entry->setStatus(1); * * @api */ @@ -417,6 +390,7 @@ public function setStatus(int $status): self $this->setValue('status', $status); return $this; } + /** * Findet Online-Einträge. Wenn eine Kategorie-ID angegeben ist, werden nur Einträge aus dieser Kategorie zurückgegeben. * Finds online entries. If a category ID is provided, only entries from this category are returned. diff --git a/lib/neues_entry_lang.php b/lib/neues_entry_lang.php index 2009350..f2ce926 100644 --- a/lib/neues_entry_lang.php +++ b/lib/neues_entry_lang.php @@ -1,4 +1,10 @@ getRelatedCollection("entry"); + return $this->getRelatedCollection('entry'); } /** @@ -39,9 +45,9 @@ public function getEntries() : ?rex_yform_manager_collection * * @api */ - public function getCode() : ?string + public function getCode(): ?string { - return $this->getValue("code"); + return $this->getValue('code'); } /** @@ -49,16 +55,12 @@ public function getCode() : ?string * Sets the code of the language. * * @param string $value Der neue Code der Sprache. / The new code of the language. - * @return self - * - * Beispiel / Example: - * $language = $language->setCode('Neuer Code'); * * @api */ - public function setCode(string $value) : self + public function setCode(string $value): self { - $this->setValue("code", $value); + $this->setValue('code', $value); return $this; } @@ -73,9 +75,9 @@ public function setCode(string $value) : self * * @api */ - public function getName() : string + public function getName(): string { - return $this->getValue("name"); + return $this->getValue('name'); } /** @@ -83,16 +85,12 @@ public function getName() : string * Sets the name of the language. * * @param string $value Der neue Name der Sprache. / The new name of the language. - * @return self - * - * Beispiel / Example: - * $language = $language->setName('Neuer Name'); * * @api */ - public function setName(string $value) : self + public function setName(string $value): self { - $this->setValue("name", $value); + $this->setValue('name', $value); return $this; } } diff --git a/lib/rex_api_neues_rss.php b/lib/rex_api_neues_rss.php index 427e956..d486a12 100644 --- a/lib/rex_api_neues_rss.php +++ b/lib/rex_api_neues_rss.php @@ -1,8 +1,21 @@ getName()) . '.xml'; + $description = 'RSS-FEED: ' . rex::getServerName() . ' | ' . rex_escape($category->getName()); + } else { + $collection = Entry::findOnline(); + $description = 'RSS-FEED: ' . rex::getServerName(); + $filename = 'rss.neues.xml'; + } + + rex_response::cleanOutputBuffers(); + rex_response::sendContentType('application/xml; charset=utf-8'); + + // RSS-Feed generieren und ausgeben + echo self::getRssFeed($collection, $domain_id, $lang_id, $description, $filename); + exit; } - public static function getRssFeed(rex_yform_manager_collection $collection, $domain, $lang, $filename) + public static function getRssFeed($collection, $domain, $lang, $description, $filename) { - return self::createRssFeed($collection, $domain, $lang, $filename); + return self::createRssFeed($collection, $domain, $lang, $description, $filename); } - public static function createRssFeed(?rex_yform_manager_collection $collection = null, $domain = null, $lang = null, $filename = 'rss.neues.xml') + public static function joinUrls($url1, $url2) { - if (!$collection) { - $collection = neues_entry::findOnline(); - } - - $xml = new DOMDocument('1.0', 'utf-8'); - $xml->formatOutput = true; - - $rss = $xml->createElement('rss'); - $rss->setAttribute('version', '2.0'); - $xml->appendChild($rss); - - $channel = $xml->createElement('channel'); - $rss->appendChild($channel); + return rtrim($url1, '/') . '/' . ltrim($url2, '/'); + } - $head_title = $xml->createElement('title', rex::getServerName()); - $channel->appendChild($head_title); + public static function createRssFeed(rex_yform_manager_collection $collection, $domain, $lang, $description, $filename = 'rss.neues.xml') + { + $xml = new SimpleXMLElement(''); - $head_description = $xml->createElement('description', ''); - $channel->appendChild($head_description); + $channel = $xml->addChild('channel'); + $channel->addChild('title', rex::getServerName()); + $channel->addChild('description', $description); + $channel->addChild('link', rex::getServer()); - if ($lang) { - $head_language = $xml->createElement('language', $lang->getCode()); - $channel->appendChild($head_language); + if ($lang && $lang > 0) { + $channel->addChild('language', rex_clang::get($lang)->getCode()); } - $head_link = $xml->createElement('link', rex::getServer()); - $channel->appendChild($head_link); - foreach ($collection as $entry) { - $item = $xml->createElement('item'); - $channel->appendChild($item); - - $item_title = $xml->createElement('title', htmlspecialchars($entry->getName())); - $item->appendChild($item_title); - - $entry->setTeasertext($entry->getTeaser()); - - $entry->setDescription($entry->getDescription()); - - $item_link = $xml->createElement('link', $entry->getUrl()); - $item->appendChild($item_link); - - $item_pubDate = $xml->createElement('pubDate', date('r', strtotime($entry->getPublishDate()))); - $item->appendChild($item_pubDate); - - $item_guid = $xml->createElement('guid', $entry->getUuid()); - $item->appendChild($item_guid); + /** @var neues_entry $entry */ + $item = $channel->addChild('item'); + $item->addChild('title', htmlspecialchars($entry->getName())); + $item->addChild('description', htmlspecialchars(strip_tags($entry->getDescription()))); + $item->addChild('link', self::joinUrls(rex::getServer(), $entry->getUrl())); + $item->addChild('pubDate', date('r', strtotime($entry->getPublishDate()))); + $item->addChild('guid', self::joinUrls(rex::getServer(), $entry->getUrl()))->addAttribute('isPermaLink', 'true'); } - return $xml->save(rex_path::base($filename)); + // Speichern und ausgeben des XML + $xml->asXML(rex_path::base($filename)); + return $xml->asXML(); } } diff --git a/lib/rex_cronjob_neues_publish.php b/lib/rex_cronjob_neues_publish.php new file mode 100644 index 0000000..6eb9967 --- /dev/null +++ b/lib/rex_cronjob_neues_publish.php @@ -0,0 +1,33 @@ +where('status', 0)->where('publishdate', date('Y-m-d'), '<')->find(); + $neues_entry_to_publish->setValue('status', 1); + if (!$neues_entry_to_publish->save()) { + $this->setMessage(sprintf(rex_i18n::msg('neues_entry_publish_error'), count($neues_entry_to_publish))); + return false; + } + + $this->setMessage(sprintf(rex_i18n::msg('neues_entry_publish_success'), count($neues_entry_to_publish))); + return true; + } + + public function getTypeName() + { + return rex_i18n::msg('neues_entry_publish_cronjob'); + } + + public function getParamFields() + { + return []; + } +} diff --git a/package.yml b/package.yml index 45f22d3..b2ae852 100644 --- a/package.yml +++ b/package.yml @@ -1,6 +1,6 @@ package: neues -version: '3.3.0-dev' -author: 'Alexander Walther' +version: '4.1.0-dev' +author: 'FriendsOfREDAXO, Alexander Walther, Paul Götz, Thorben' supportpage: https://alexplusde.github.io/neues/ load: late @@ -9,10 +9,9 @@ requires: version: '>7.3,<9' redaxo: ^5.12 packages: - yform: '^4,<5' + yform: '^4' yform_field: '^2.3.0' - page: title: translate:neues prio: 100 @@ -56,6 +55,7 @@ pages: default_config: default_author: "Redaktion" - default_thumbnail: "" + default_thumbnail: "neues_entry_fallback_iamge.png" external_url_label: "Zur Website" editor: 'class="form-control redactor-editor--default"' + url_profile: false diff --git a/pages/neues.author.php b/pages/neues.author.php index 57bcc27..1640c1d 100644 --- a/pages/neues.author.php +++ b/pages/neues.author.php @@ -4,23 +4,25 @@ $currentPage = rex_be_controller::getCurrentPageObject(); $wrapper = ''; -if ($table_name = 'rex_neues_author') { - if (!rex_request('table_name', 'string', '')) { - $_REQUEST['table_name'] = $table_name; - } - - if (true !== $currentPage->getItemAttr('show_title', false)) { - rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { - if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { - return; - } - return ''; - }, rex_extension::EARLY, ['table_name' => $table_name]); - } - - if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { - echo "
"; - } + +$table_name = 'rex_neues_author'; + +if (!rex_request('table_name', 'string', '')) { + /* @phpstan-ignore-next-line */ + $_REQUEST['table_name'] = $table_name; +} + +if (true !== $currentPage->getItemAttr('show_title', '')) { + rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { + if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { + return; + } + return ''; + }, rex_extension::EARLY, ['table_name' => $table_name]); +} + +if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { + echo "
"; } include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); diff --git a/pages/neues.category.php b/pages/neues.category.php index 10e13e9..0db1623 100644 --- a/pages/neues.category.php +++ b/pages/neues.category.php @@ -4,23 +4,24 @@ $currentPage = rex_be_controller::getCurrentPageObject(); $wrapper = ''; -if ($table_name = 'rex_neues_category') { - if (!rex_request('table_name', 'string', '')) { - $_REQUEST['table_name'] = $table_name; - } - if (true !== $currentPage->getItemAttr('show_title', false)) { - rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { - if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { - return; - } - return ''; - }, rex_extension::EARLY, ['table_name' => $table_name]); - } +$table_name = 'rex_neues_category'; +if (!rex_request('table_name', 'string', '')) { + /* @phpstan-ignore-next-line */ + $_REQUEST['table_name'] = $table_name; +} + +if (true !== $currentPage->getItemAttr('show_title', '')) { + rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { + if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { + return; + } + return ''; + }, rex_extension::EARLY, ['table_name' => $table_name]); +} - if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { - echo "
"; - } +if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { + echo "
"; } include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); diff --git a/pages/neues.entry.php b/pages/neues.entry.php index af44b82..2582afb 100644 --- a/pages/neues.entry.php +++ b/pages/neues.entry.php @@ -4,23 +4,24 @@ $currentPage = rex_be_controller::getCurrentPageObject(); $wrapper = ''; -if ($table_name = 'rex_neues_entry') { - if (!rex_request('table_name', 'string', '')) { - $_REQUEST['table_name'] = $table_name; - } - if (true !== $currentPage->getItemAttr('show_title', false)) { - rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { - if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { - return; - } - return ''; - }, rex_extension::EARLY, ['table_name' => $table_name]); - } +$table_name = 'rex_neues_entry'; +if (!rex_request('table_name', 'string', '')) { + /* @phpstan-ignore-next-line */ + $_REQUEST['table_name'] = $table_name; +} + +if (true !== $currentPage->getItemAttr('show_title', '')) { + rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { + if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { + return; + } + return ''; + }, rex_extension::EARLY, ['table_name' => $table_name]); +} - if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { - echo "
"; - } +if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { + echo "
"; } include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); diff --git a/pages/neues.lang.php b/pages/neues.lang.php index dbb56c5..1e33b47 100644 --- a/pages/neues.lang.php +++ b/pages/neues.lang.php @@ -4,23 +4,24 @@ $currentPage = rex_be_controller::getCurrentPageObject(); $wrapper = ''; -if ($table_name = 'rex_neues_entry_Lang') { - if (!rex_request('table_name', 'string', '')) { - $_REQUEST['table_name'] = $table_name; - } - if (true !== $currentPage->getItemAttr('show_title', false)) { - rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { - if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { - return; - } - return ''; - }, rex_extension::EARLY, ['table_name' => $table_name]); - } +$table_name = 'rex_neues_entry_lang'; +if (!rex_request('table_name', 'string', '')) { + /* @phpstan-ignore-next-line */ + $_REQUEST['table_name'] = $table_name; +} + +if (true !== $currentPage->getItemAttr('show_title', '')) { + rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { + if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { + return; + } + return ''; + }, rex_extension::EARLY, ['table_name' => $table_name]); +} - if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { - echo "
"; - } +if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { + echo "
"; } include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); diff --git a/pages/neues.settings.php b/pages/neues.settings.php index db610ee..b657693 100644 --- a/pages/neues.settings.php +++ b/pages/neues.settings.php @@ -7,7 +7,7 @@ $form = rex_config_form::factory($addon->getName()); $field = $form->addMediaField('default_thumbnail'); -$field->setPreview(1); +$field->setPreview(true); $field->setTypes('jpg,gif,png'); $field->setLabel(rex_i18n::msg('neues_default_thumbnail')); diff --git a/uninstall.php b/uninstall.php index ef6ce04..3d3bebc 100644 --- a/uninstall.php +++ b/uninstall.php @@ -4,6 +4,7 @@ if (rex_addon::get('yform')->isAvailable() && !rex::isSafeMode()) { rex_yform_manager_table_api::removeTable('rex_neues_category'); rex_yform_manager_table_api::removeTable('rex_neues_entry'); - rex_yform_manager_table_api::removeTable('rex_neues_entry_lang'); rex_yform_manager_table_api::removeTable('rex_neues_entry_category_rel'); + rex_yform_manager_table_api::removeTable('rex_neues_author'); + rex_yform_manager_table_api::removeTable('rex_neues_entry_lang'); }