FEATURE: move static pages into own repository

This commit is contained in:
Michal Kváček
2017-08-22 20:16:24 +02:00
commit 7bc4f86967
13 changed files with 152 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'name' => 'StaticPages',
'translatedName' => 'staticpages::module.name',
'translatedDescription' => 'staticpages::module.description',
'alias' => 'staticpages',
'handler' => '\\Modules\\StaticPages\\Handlers\\StaticPage',
'providers' => [\Modules\Staticpages\Providers\StaticPagesServiceProvider::class],
'files' => ['start.php'],
'order' => 0,
];
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace Modules\StaticPages\Handlers;
use App\CMS\Contracts\Content\ContentTitles;
use App\CMS\Handlers\AdminHandler;
use App\Models\Content\Content;
use App\Models\User;
class StaticPage extends AdminHandler implements ContentTitles
{
public static function registerAdminMenu(User $user)
{
// register links in admin menu
$menu = \Menu::instance('mainMenu');
$submenu = $menu->whereTitle(trans('admin/mainMenu.contentPages'));
$submenu->dropdown(trans('staticpages::adminMenu.staticPages'), function ($submenu) use ($user) {
$submenu->route('content.new', trans('staticpages::adminMenu.new'), ['module' => config('staticpages.alias')], 10, ['icon' => 'fa fa-plus']);
$submenu->route('content.overview', trans('staticpages::adminMenu.overview'), ['module' => config('staticpages.alias')], 20, ['icon' => 'fa fa-list']);
}, 15, ['icon' => 'fa fa-newspaper-o']);
}
/**
* 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('staticpages::module.allPages');
}
/**
* Title displayed above for for creating new content page
*
* @return string
*/
public static function getCreateNewTitle()
{
return trans('staticpages::module.newPage');
}
/**
* Title for form displayed for editin content page
*
* @param Content $content
*
* @return mixed
*/
public static function getEditTitle(Content $content)
{
return trans('staticpages::module.editPage');
}
/**
* Does this module support categories?
*
* @return boolean
*/
public static function supportCategories()
{
return true;
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php namespace Modules\Staticpages\Providers;
use App\CMS\Modules\ServiceProviders\ServiceProvider;
class StaticPagesServiceProvider extends ServiceProvider
{
protected function setModuleAlias()
{
$this->alias = 'staticpages';
}
protected function setModulePath()
{
$this->path = __DIR__;
}
}
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"new" => "Nová stránka",
"overview" => "Seznam všech statických stránek",
"templatePath" => "Statické stránky",
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"new" => "Vytvořit novou",
"overview" => "Přehled",
"staticPages" => "Statické stránky",
];
+8
View File
@@ -0,0 +1,8 @@
<?php
return [
"allPages" => "Všechny statické stránky",
"description" => "Statické stránky jsou určeny k zobrazování statického obsahu na stránkách.",
"editPage" => "Upravuji statickou stránku",
"name" => "Statické stránky",
"newPage" => "Vytvářím novou stránku",
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'overview' => 'List of all static pages',
'templatePath' => 'Static pages',
'new' => 'nova stranka'
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'staticPages' => 'Static pages',
'new' => 'Create new',
'overview' => 'Overview'
];
+8
View File
@@ -0,0 +1,8 @@
<?php
return [
'name' => 'Static pages',
'description' => 'Static pages are intended for displaying static content on webpage.',
'allPages' => 'All static pages',
'editPage' => 'Editing static page',
'newPage' => 'Create new static page'
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"new" => "Nová stránka",
"overview" => "Zoznam všetkých statických stránok",
"templatePath" => "Statické stránky",
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"new" => "Vytvoriť novú",
"overview" => "Prehľad",
"staticPages" => "Statické stránky",
];
+5
View File
@@ -0,0 +1,5 @@
<?php
return [
"description" => "Statické stránky sú určené k zobrazovaniu statického obsahu na webe.",
"name" => "Statické stránky",
];
Executable
+1
View File
@@ -0,0 +1 @@
<?php