Skip to content

Commit

Permalink
fix ydeploy deployment (request object not available in cli)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed Jul 20, 2024
1 parent 00af9a6 commit bb52f3d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 23 additions & 1 deletion boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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 = Category::get($category_id);
if ($neues_category) {
$return[] = '<a href="' . rex_url::backendPage('neues/category', $params) . '">' . $neues_category->getName() . '</a>';
Expand All @@ -105,3 +105,25 @@ static function ($a) {
);
}
});

if (rex::isBackend() && \rex_addon::get('neues') && \rex_addon::get('neues')->isAvailable() && !rex::isSafeMode()) {
$addon = rex_addon::get('neues');
$pages = $addon->getProperty('pages');

if($_REQUEST) {
$_csrf_key = rex_yform_manager_table::get('rex_neues_entry')->getCSRFKey();

$token = rex_csrf_token::factory($_csrf_key)->getUrlParams();

$params = [];
$params['table_name'] = 'rex_neues_entry'; // Tabellenname anpassen
$params['rex_yform_manager_popup'] = '0';
$params['_csrf_token'] = $token['_csrf_token'];
$params['func'] = 'add';

$href = rex_url::backendPage('neues/entry', $params);

$pages['neues']['title'] .= ' <a class="label label-primary tex-primary" style="position: absolute; right: 18px; top: 10px; padding: 0.2em 0.6em 0.3em; border-radius: 3px; color: white; display: inline; width: auto;" href="' . $href . '">+</a>';
$addon->setProperty('pages', $pages);
}
}
3 changes: 1 addition & 2 deletions lib/rex_cronjob_neues_publish.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use rex_cronjob;
use rex_i18n;


use function count;

Expand Down

0 comments on commit bb52f3d

Please sign in to comment.