mirror of
https://github.com/flextype/flextype.git
synced 2025-08-18 19:01:40 +02:00
@@ -18,44 +18,44 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
class ThemesController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Index page
|
||||
*
|
||||
* @param Request $request PSR7 request
|
||||
* @param Response $response PSR7 response
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(/** @scrutinizer ignore-unused */ Request $request, Response $response) : Response
|
||||
{
|
||||
$themes = [];
|
||||
foreach (Filesystem::listContents(PATH['themes']) as $theme) {
|
||||
if ($theme['type'] == 'dir' && Filesystem::has($theme['path'] . '/' . 'theme.json')) {
|
||||
$themes[$theme['dirname']] = $theme['dirname'];
|
||||
}
|
||||
/**
|
||||
* Index page
|
||||
*
|
||||
* @param Request $request PSR7 request
|
||||
* @param Response $response PSR7 response
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(/** @scrutinizer ignore-unused */ Request $request, Response $response) : Response
|
||||
{
|
||||
$themes = [];
|
||||
foreach (Filesystem::listContents(PATH['themes']) as $theme) {
|
||||
if ($theme['type'] == 'dir' && Filesystem::has($theme['path'] . '/' . 'theme.json')) {
|
||||
$themes[$theme['dirname']] = $theme['dirname'];
|
||||
}
|
||||
|
||||
return $this->view->render(
|
||||
$response,
|
||||
'plugins/admin/views/templates/extends/themes/index.html',
|
||||
[
|
||||
'menu_item' => 'themes',
|
||||
'themes_list' => $themes,
|
||||
'links' => [
|
||||
'themes' => [
|
||||
'link' => $this->router->pathFor('admin.themes.index'),
|
||||
'title' => __('admin_themes'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
],
|
||||
'buttons' => [
|
||||
'templates_create' => [
|
||||
'link' => $this->router->pathFor('admin.templates.add'),
|
||||
'title' => __('admin_create_new_template'),
|
||||
'attributes' => ['class' => 'float-right btn']
|
||||
],
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->view->render(
|
||||
$response,
|
||||
'plugins/admin/views/templates/extends/themes/index.html',
|
||||
[
|
||||
'menu_item' => 'themes',
|
||||
'themes_list' => $themes,
|
||||
'links' => [
|
||||
'themes' => [
|
||||
'link' => $this->router->pathFor('admin.themes.index'),
|
||||
'title' => __('admin_themes'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
],
|
||||
'buttons' => [
|
||||
'templates_create' => [
|
||||
'link' => $this->router->pathFor('admin.templates.add'),
|
||||
'title' => __('admin_create_new_template'),
|
||||
'attributes' => ['class' => 'float-right btn']
|
||||
],
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user