FEATURE: more translations
This commit is contained in:
@@ -2,30 +2,15 @@
|
||||
namespace Modules\ContactForm\Handlers;
|
||||
|
||||
use App\Enumerations\ModulesHandlerToId;
|
||||
use App\Handlers\Contracts\ContentTitles;
|
||||
use App\Handlers\Handler;
|
||||
use App\Http\Controllers\Admin\EditContent;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Admin\Contents\EditContent;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Content;
|
||||
use App\Models\User;
|
||||
|
||||
class ContactForm extends Handler
|
||||
class ContactForm extends Handler implements ContentTitles
|
||||
{
|
||||
/**
|
||||
* Render given module into visitor area.
|
||||
*
|
||||
* @param Content $content DB model from table contents
|
||||
* @param array $parameters parameters used for modifications/custom settings of given model
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function render(Content $content, $parameters)
|
||||
{
|
||||
$content->module_settings = json_decode($content->module_settings);
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content]);
|
||||
}
|
||||
|
||||
public static function getHistoryHandler()
|
||||
{
|
||||
return ContactFormHistory::class;
|
||||
@@ -45,7 +30,7 @@ class ContactForm extends Handler
|
||||
$settings = [
|
||||
'phone' => $request->phone,
|
||||
'email' => $request->email,
|
||||
'contactEmail' => $request->ContactEmail,
|
||||
'contactEmail' => $request->contactEmail,
|
||||
'subject' => $request->subject,
|
||||
'companyName' => $request->companyName,
|
||||
'address' => $request->address,
|
||||
@@ -174,7 +159,6 @@ class ContactForm extends Handler
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
// TODO: Implement install() method.
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,4 +172,38 @@ class ContactForm extends Handler
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
/**
|
||||
* Get translated title for pages overview of given type.
|
||||
*
|
||||
* This value is used for rendering list of all content pages of given type in administration.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getOverviewTitle()
|
||||
{
|
||||
return trans('contactform::module.allForms');
|
||||
}
|
||||
|
||||
/**
|
||||
* Title displayed above for for creating new content page
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getCreateNewTitle()
|
||||
{
|
||||
return trans('contactform::module.newForm');
|
||||
}
|
||||
|
||||
/**
|
||||
* Title for form displayed for editin content page
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getEditTitle(Content $content)
|
||||
{
|
||||
return trans('contactform::module.editForm');
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,12 @@
|
||||
<?php
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
Route::group([
|
||||
'middleware' => ['web', 'auth', 'adminMenu'],
|
||||
'namespace' => '\Modules\ContactForm\Http\Controllers\Admin',
|
||||
'prefix' => 'admin/contactform'
|
||||
], function () {
|
||||
Route::get('messsages/sent', 'SentMessagesOverview@getList')
|
||||
->name('emails.sent');
|
||||
});
|
||||
|
||||
Route::group([
|
||||
'middleware' => ['web'],
|
||||
'namespace' => '\Modules\ContactForm\Http\Controllers\Visitor',
|
||||
'prefix' => 'contactform'
|
||||
'prefix' => LaravelLocalization::setLocale() . '/contactform'
|
||||
], function () {
|
||||
|
||||
|
||||
|
||||
// method for sending new message
|
||||
|
||||
|
||||
Route::post('/message/{formId}', 'CreateNewMessage@postMessage')
|
||||
->name('email.send');
|
||||
});
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
"allForms" => "Všechny formuláře",
|
||||
"description" => "Jednoduchý kontaktní formulář",
|
||||
"editForm" => "Upravuji formulář",
|
||||
"name" => "Kontaktní formulář",
|
||||
"newForm" => "Vytvořit nový kontaktní formulář",
|
||||
];
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
'name' => 'Contact form',
|
||||
'description' => 'Simple contact form'
|
||||
'description' => 'Simple contact form',
|
||||
'allForms' => 'All contact forms',
|
||||
'newForm' => 'Create new contact form',
|
||||
'editForm' => 'Editing contact form'
|
||||
];
|
||||
Reference in New Issue
Block a user