Skip to content

Commit

Permalink
Merge pull request #46 from alexplusde/main-menu-add
Browse files Browse the repository at this point in the history
`+`-Schaltfläche im Hauptmenü zum Hinzufügen neuer Einträge
  • Loading branch information
alxndr-w authored Jul 27, 2024
2 parents dd9ecb6 + 50c0a66 commit 1ce0ea6
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 83 deletions.
22 changes: 22 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@
$ep->setSubject(str_replace($suchmuster, $ersetzen, $ep->getSubject()));
});
}

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

if (!rex::getConsole()) {
$_csrf_key = rex_yform_manager_table::get('rex_staff')->getCSRFKey();

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

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

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

$page['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('page', $page);
}
}
28 changes: 14 additions & 14 deletions fragments/staff/json-ld.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
$person = staff::get($this->getVar('id'));

$jsonLd = [
"@context" => "https://schema.org",
"@type" => "Person",
"address" => [
"@type" => "PostalAddress",
"addressLocality" => $person->getCity(),
"addressRegion" => $person->getRegion(),
"postalCode" => $person->Zip(),
"streetAddress" => $person->getStreet()
'@context' => 'https://schema.org',
'@type' => 'Person',
'address' => [
'@type' => 'PostalAddress',
'addressLocality' => $person->getCity(),
'addressRegion' => $person->getRegion(),
'postalCode' => $person->Zip(),
'streetAddress' => $person->getStreet(),
],
"email" => "mailto:" . $person->getEmail(),
"image" => $person->getMediaUrl(),
// "jobTitle" => $person->getJobTitle(),
"name" => $person->getName() ?? $person->getFullname(),
"telephone" => $person->getPhone(),
// "url" => $person->getUrl()
'email' => 'mailto:' . $person->getEmail(),
'image' => $person->getMediaUrl(),
// "jobTitle" => $person->getJobTitle(),
'name' => $person->getName() ?? $person->getFullname(),
'telephone' => $person->getPhone(),
// "url" => $person->getUrl()
];

echo '<script type="application/ld+json">' . json_encode($jsonLd, JSON_UNESCAPED_SLASHES) . '</script>';
Loading

0 comments on commit 1ce0ea6

Please sign in to comment.