FEATURE: add customizable settings for create/edit/overview of content pages

This commit is contained in:
Michal Kváček
2016-09-24 02:55:51 +02:00
parent b7434d0a0b
commit 6d107d0881
10 changed files with 131 additions and 14 deletions
+37 -5
View File
@@ -2,6 +2,7 @@
namespace Modules\Blog\Article\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;
@@ -11,7 +12,7 @@ use App\Models\User;
use Illuminate\Support\Facades\Artisan;
use Modules\Blog\Article\Entities\Comment;
class Article extends Handler
class Article extends Handler implements ContentTitles
{
/**
* Render given module into visitor area.
@@ -89,10 +90,7 @@ class Article extends Handler
return $changedColumns;
}
public static function getOverviewTitle()
{
return trans('article::module.allArticles');
}
/**
*
@@ -139,4 +137,38 @@ class Article extends Handler
// seed action log types
// Artisan::call('')
}
/**
* 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('article::module.allArticles');
}
/**
* Title displayed above for for creating new content page
*
* @return string
*/
public static function getCreateNewTitle()
{
return trans('article::module.newArticle');
}
/**
* Title for form displayed for editin content page
*
* @param Content $content
*
* @return mixed
*/
public static function getEditTitle(Content $content)
{
return trans('article::module.editArticle');
}
}
@@ -2,5 +2,5 @@
return [
"allowComments" => "Povolit komentáře?",
"new" => "Napsat",
"overview" => "Všchny články",
"overview" => "Všechny články",
];
@@ -5,5 +5,7 @@ return [
"comments" => "Komentáře",
"commentsOverview" => "Všechny komentáře",
"description" => "Základní submodul pro blog. Tento modul umožňuje psát články.",
"editArticle" => "Upravuji článek",
"name" => "Články",
"newArticle" => "Napsat nový článek",
];
@@ -4,6 +4,8 @@ return [
'description' => 'Base submodule for blog',
'comments' => 'Comments',
'commentsOverview' => 'All comments',
'allArticles' => 'All articles',
'blog' => 'Blog'
'blog' => 'Blog',
'allArticles' => 'All articles',
'newArticle' => 'Write new article',
'editArticle' => 'Editing article'
];