Skip to content

Commit

Permalink
Merge pull request #45 from alexplusde/4.0.0
Browse files Browse the repository at this point in the history
4.0.0
  • Loading branch information
alxndr-w authored Dec 17, 2023
2 parents 8f933b2 + e5ce79f commit 31b1b83
Show file tree
Hide file tree
Showing 20 changed files with 1,031 additions and 41 deletions.
45 changes: 40 additions & 5 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,64 @@
/* YForm Rest API */
$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(),
'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',
],
],
],
Expand All @@ -76,7 +109,7 @@
/* YForm Rest API */
$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(),
Expand All @@ -85,7 +118,7 @@
'rex_neues_category' => [
'id',
'name',
'description',
'image',
'status',
],
],
Expand All @@ -94,6 +127,8 @@
'fields' => [
'rex_neues_category' => [
'name',
'image',
'status',
],
],
],
Expand Down Expand Up @@ -150,7 +185,7 @@ static function ($a) {
$category_ids = array_filter(array_map('intval', explode(',', $a['value'])));

foreach ($category_ids as $category_id) {
/* @var $neues_category neues_category */
/** @var neues_category $neues_category */
$neues_category = neues_category::get($category_id);
if ($neues_category) {
$return[] = '<a href="' . rex_url::backendPage('neues/category', $params) . '">' . $neues_category->getName() . '</a>';
Expand Down
28 changes: 26 additions & 2 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,40 @@
/* Tablesets aktualisieren */
rex_yform_manager_table_api::importTablesets(rex_file::get(rex_path::addon(rex_addon::get('neues')->getName(), 'install/tableset.json')));

if(!rex_media::get('neues_entry_fallback_image.png')) {
if (!rex_media::get('neues_entry_fallback_image.png')) {

rex_file::copy(rex_path::addon('neues', '/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",
'name' => 'neues_entry_fallback_image.png',
'path' => rex_path::media('neues_entry_fallback_image.png'),
];

rex_media_service::addMedia($data, false);
}

/* Cronjob installieren */
$cronjob = array_filter(rex_sql::factory()->getArray("SELECT * FROM rex_category WHERE `type` = 'rex_cronjob_neues_publish'"));
if (!$cronjob) {
$query = rex_file::get(rex_path::addon('neues', 'install/rex_cronjob_neues_publish.sql'));
rex_sql::factory()->setQuery($query);
}

/* URL-Profile installieren */
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(rex_path::addon('neues', '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(rex_path::addon('neues', '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);
}
4 changes: 4 additions & 0 deletions install/rex_cronjob_neues_publish.sql
Original file line number Diff line number Diff line change
@@ -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');
4 changes: 4 additions & 0 deletions install/rex_url_profile_neues_category.sql
Original file line number Diff line number Diff line change
@@ -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');
4 changes: 4 additions & 0 deletions install/rex_url_profile_neues_entry.sql
Original file line number Diff line number Diff line change
@@ -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'),
Loading

0 comments on commit 31b1b83

Please sign in to comment.