summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-05 15:35:14 +0200
committermsquare <msquare@notrademark.de>2018-10-30 22:50:22 +0100
commit90e1a949623ead173c0952f802d7b5c5487251b1 (patch)
tree544d29dde573cb135b514d0a84c2d95e9207392c /includes
parent0aa5f079258afd5276917c1aff565ec1c6411821 (diff)
Make application name configurable
* Added app_name configuration option * Extended `EngelsystemMailer` to prepend the application name to all mails Closes #426
Diffstat (limited to 'includes')
-rw-r--r--includes/engelsystem.php4
-rw-r--r--includes/mailer/shifts_mailer.php8
-rw-r--r--includes/mailer/users_mailer.php7
-rw-r--r--includes/pages/guest_login.php5
-rw-r--r--includes/pages/user_atom.php2
-rw-r--r--includes/pages/user_ical.php2
-rw-r--r--includes/view/EventConfig_view.php3
-rw-r--r--includes/view/User_view.php5
8 files changed, 24 insertions, 12 deletions
diff --git a/includes/engelsystem.php b/includes/engelsystem.php
index a5dee186..caebe09b 100644
--- a/includes/engelsystem.php
+++ b/includes/engelsystem.php
@@ -16,7 +16,9 @@ require __DIR__ . '/includes.php';
* Check for maintenance
*/
if ($app->get('config')->get('maintenance')) {
- echo file_get_contents(__DIR__ . '/../resources/views/layouts/maintenance.html');
+ $maintenance = file_get_contents(__DIR__ . '/../resources/views/layouts/maintenance.html');
+ $maintenance = str_replace('%APP_NAME%', $app->get('config')->get('app_name'), $maintenance);
+ echo $maintenance;
die();
}
diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php
index 4dd430d3..0c4e381c 100644
--- a/includes/mailer/shifts_mailer.php
+++ b/includes/mailer/shifts_mailer.php
@@ -65,7 +65,7 @@ function mail_shift_change($old_shift, $new_shift)
if ($user['email_shiftinfo']) {
engelsystem_email_to_user(
$user,
- '[engelsystem] ' . __('Your Shift has changed'),
+ __('Your Shift has changed'),
$message,
true
);
@@ -90,7 +90,7 @@ function mail_shift_delete($shift)
foreach ($users as $user) {
if ($user['email_shiftinfo']) {
- engelsystem_email_to_user($user, '[engelsystem] ' . __('Your Shift was deleted'), $message, true);
+ engelsystem_email_to_user($user, __('Your Shift was deleted'), $message, true);
}
}
}
@@ -113,7 +113,7 @@ function mail_shift_assign($user, $shift)
$message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n";
$message .= $room['Name'] . "\n";
- engelsystem_email_to_user($user, '[engelsystem] ' . __('Assigned to Shift'), $message, true);
+ engelsystem_email_to_user($user, __('Assigned to Shift'), $message, true);
}
/**
@@ -134,5 +134,5 @@ function mail_shift_removed($user, $shift)
$message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n";
$message .= $room['Name'] . "\n";
- engelsystem_email_to_user($user, '[engelsystem] ' . __('Removed from Shift'), $message, true);
+ engelsystem_email_to_user($user, __('Removed from Shift'), $message, true);
}
diff --git a/includes/mailer/users_mailer.php b/includes/mailer/users_mailer.php
index 5f1e6e79..23a13806 100644
--- a/includes/mailer/users_mailer.php
+++ b/includes/mailer/users_mailer.php
@@ -8,7 +8,10 @@ function mail_user_delete($user)
{
return engelsystem_email_to_user(
$user,
- '[engelsystem] ' . __('Your account has been deleted'),
- __('Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.')
+ __('Your account has been deleted'),
+ __(
+ 'Your %s account has been deleted. If you have any questions regarding your account deletion, please contact heaven.',
+ [config('app_name')]
+ )
);
}
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index 797aaea7..95e63bbc 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -309,7 +309,10 @@ function guest_register()
form_email('mail', __('E-Mail') . ' ' . entry_required(), $mail),
form_checkbox(
'email_shiftinfo',
- __('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
+ __(
+ 'The %s is allowed to send me an email (e.g. when my shifts change)',
+ [config('app_name')]
+ ),
$email_shiftinfo
),
form_checkbox(
diff --git a/includes/pages/user_atom.php b/includes/pages/user_atom.php
index 9934fb92..f6a67a15 100644
--- a/includes/pages/user_atom.php
+++ b/includes/pages/user_atom.php
@@ -47,7 +47,7 @@ function make_atom_entries_from_news($news_entries)
$request = app('request');
$html = '<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <title>Engelsystem</title>
+ <title>' . config('app_name') . '</title>
<id>' . $request->getHttpHost()
. htmlspecialchars(preg_replace(
'#[&?]key=[a-f\d]{32}#',
diff --git a/includes/pages/user_ical.php b/includes/pages/user_ical.php
index 3430c3b3..f7ed64dd 100644
--- a/includes/pages/user_ical.php
+++ b/includes/pages/user_ical.php
@@ -36,7 +36,7 @@ function send_ical_from_shifts($shifts)
{
header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=shifts.ics');
- $output = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//-//Engelsystem//DE\r\nCALSCALE:GREGORIAN\r\n";
+ $output = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//-//" . config('app_name') . "//DE\r\nCALSCALE:GREGORIAN\r\n";
foreach ($shifts as $shift) {
$output .= make_ical_entry_from_shift($shift);
}
diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php
index cd657c67..730593b1 100644
--- a/includes/view/EventConfig_view.php
+++ b/includes/view/EventConfig_view.php
@@ -1,6 +1,7 @@
<?php
use Carbon\Carbon;
+use Illuminate\Support\Str;
/**
* Shows basic event infos and countdowns.
@@ -24,7 +25,7 @@ function EventConfig_countdown_page()
$elements[] = div('col-sm-12 text-center', [
heading(sprintf(
__('Welcome to the %s!'),
- $name . ' <span class="icon-icon_angel"></span> ENGELSYSTEM'
+ $name . ' <span class="icon-icon_angel"></span> ' . Str::upper(config('app_name'))
), 2)
]);
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index ddf49885..fb541619 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -54,7 +54,10 @@ function User_settings_view(
form_text('mail', __('E-Mail') . ' ' . entry_required(), $user_source['email']),
form_checkbox(
'email_shiftinfo',
- __('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
+ __(
+ 'The %s is allowed to send me an email (e.g. when my shifts change)',
+ [config('app_name')]
+ ),
$user_source['email_shiftinfo']
),
form_checkbox(