FEATURE: add translatable titles to static pages and contact form modules

This commit is contained in:
Michal Kváček
2016-09-27 21:57:25 +02:00
parent e0357d0003
commit 4e6fc7c074
4 changed files with 81 additions and 4 deletions
+36 -1
View File
@@ -2,13 +2,14 @@
namespace Modules\ContactForm\Handlers;
use App\Enumerations\ModulesHandlerToId;
use App\Handlers\Contracts\ContentTitles;
use App\Handlers\Handler;
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
{
public static function getHistoryHandler()
{
@@ -171,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,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'
];