refactor layouts module to domain/di and prepare 0.256 release

This commit is contained in:
2026-02-12 22:54:47 +01:00
parent 5e9b998043
commit 76287923e8
24 changed files with 970 additions and 315 deletions

View File

@@ -187,6 +187,26 @@ class LanguagesRepository
return is_array($rows) ? $rows : [];
}
public function defaultLanguageId(): string
{
$languages = $this->languagesList();
if (empty($languages)) {
return 'pl';
}
foreach ($languages as $language) {
if ((int)($language['start'] ?? 0) === 1 && !empty($language['id'])) {
return (string)$language['id'];
}
}
if (!empty($languages[0]['id'])) {
return (string)$languages[0]['id'];
}
return 'pl';
}
public function deleteLanguage(string $languageId): bool
{
$languageId = $this->sanitizeLanguageId($languageId);
@@ -327,4 +347,3 @@ class LanguagesRepository
return ($value === 'on' || $value === 1 || $value === '1' || $value === true) ? 1 : 0;
}
}

View File

@@ -0,0 +1,343 @@
<?php
namespace Domain\Layouts;
class LayoutsRepository
{
private const MAX_PER_PAGE = 100;
private $db;
public function __construct($db)
{
$this->db = $db;
}
public function delete(int $layoutId): bool
{
if ((int)$this->db->count('pp_layouts') <= 1) {
return false;
}
return (bool)$this->db->delete('pp_layouts', ['id' => $layoutId]);
}
public function find(int $layoutId): array
{
$layout = $this->db->get('pp_layouts', '*', ['id' => $layoutId]);
if (!is_array($layout)) {
return $this->defaultLayout();
}
$layout['pages'] = $this->db->select('pp_layouts_pages', 'page_id', ['layout_id' => $layoutId]);
$layout['categories'] = $this->db->select('pp_layouts_categories', 'category_id', ['layout_id' => $layoutId]);
return $layout;
}
public function save(array $data): ?int
{
$layoutId = (int)($data['id'] ?? 0);
$status = $this->toSwitchValue($data['status'] ?? 0);
$categoriesDefault = $this->toSwitchValue($data['categories_default'] ?? 0);
$row = [
'name' => (string)($data['name'] ?? ''),
'html' => (string)($data['html'] ?? ''),
'css' => (string)($data['css'] ?? ''),
'js' => (string)($data['js'] ?? ''),
'm_html' => (string)($data['m_html'] ?? ''),
'm_css' => (string)($data['m_css'] ?? ''),
'm_js' => (string)($data['m_js'] ?? ''),
'status' => $status,
'categories_default' => $categoriesDefault,
];
if ($status === 1) {
$this->db->update('pp_layouts', ['status' => 0]);
}
if ($categoriesDefault === 1) {
$this->db->update('pp_layouts', ['categories_default' => 0]);
}
if ($layoutId <= 0) {
$this->db->insert('pp_layouts', $row);
$layoutId = (int)$this->db->id();
if ($layoutId <= 0) {
return null;
}
} else {
$this->db->update('pp_layouts', $row, ['id' => $layoutId]);
}
$this->db->delete('pp_layouts_pages', ['layout_id' => $layoutId]);
$this->syncPages($layoutId, $data['pages'] ?? []);
$this->db->delete('pp_layouts_categories', ['layout_id' => $layoutId]);
$this->syncCategories($layoutId, $data['categories'] ?? []);
\S::delete_dir('../temp/');
return $layoutId;
}
public function listAll(): array
{
$rows = $this->db->select('pp_layouts', '*', ['ORDER' => ['name' => 'ASC']]);
return is_array($rows) ? $rows : [];
}
public function menusWithPages(): array
{
$menus = $this->db->select('pp_menus', '*', ['ORDER' => ['id' => 'ASC']]);
if (!is_array($menus)) {
return [];
}
foreach ($menus as $key => $menu) {
$menuId = (int)($menu['id'] ?? 0);
$menus[$key]['pages'] = $this->menuPages($menuId, null);
}
return $menus;
}
public function categoriesTree($parentId = null): array
{
$rows = $this->db->select('pp_shop_categories', ['id'], [
'parent_id' => $parentId,
'ORDER' => ['o' => 'ASC'],
]);
if (!is_array($rows)) {
return [];
}
$categories = [];
foreach ($rows as $row) {
$categoryId = (int)($row['id'] ?? 0);
if ($categoryId <= 0) {
continue;
}
$category = $this->db->get('pp_shop_categories', '*', ['id' => $categoryId]);
if (!is_array($category)) {
continue;
}
$translations = $this->db->select('pp_shop_categories_langs', '*', ['category_id' => $categoryId]);
$category['languages'] = [];
if (is_array($translations)) {
foreach ($translations as $translation) {
$langId = (string)($translation['lang_id'] ?? '');
if ($langId !== '') {
$category['languages'][$langId] = $translation;
}
}
}
$category['subcategories'] = $this->categoriesTree($categoryId);
$categories[] = $category;
}
return $categories;
}
/**
* @return array{items: array<int, array<string, mixed>>, total: int}
*/
public function listForAdmin(
array $filters,
string $sortColumn = 'name',
string $sortDir = 'ASC',
int $page = 1,
int $perPage = 15
): array {
$allowedSortColumns = [
'id' => 'pl.id',
'name' => 'pl.name',
'status' => 'pl.status',
'categories_default' => 'pl.categories_default',
];
$sortSql = $allowedSortColumns[$sortColumn] ?? 'pl.name';
$sortDir = strtoupper(trim($sortDir)) === 'DESC' ? 'DESC' : 'ASC';
$page = max(1, $page);
$perPage = min(self::MAX_PER_PAGE, max(1, $perPage));
$offset = ($page - 1) * $perPage;
$where = ['1 = 1'];
$params = [];
$name = trim((string)($filters['name'] ?? ''));
if ($name !== '') {
if (strlen($name) > 255) {
$name = substr($name, 0, 255);
}
$where[] = 'pl.name LIKE :name';
$params[':name'] = '%' . $name . '%';
}
$status = trim((string)($filters['status'] ?? ''));
if ($status === '0' || $status === '1') {
$where[] = 'pl.status = :status';
$params[':status'] = (int)$status;
}
$categoriesDefault = trim((string)($filters['categories_default'] ?? ''));
if ($categoriesDefault === '0' || $categoriesDefault === '1') {
$where[] = 'pl.categories_default = :categories_default';
$params[':categories_default'] = (int)$categoriesDefault;
}
$whereSql = implode(' AND ', $where);
$sqlCount = "
SELECT COUNT(0)
FROM pp_layouts AS pl
WHERE {$whereSql}
";
$stmtCount = $this->db->query($sqlCount, $params);
$countRows = $stmtCount ? $stmtCount->fetchAll() : [];
$total = isset($countRows[0][0]) ? (int)$countRows[0][0] : 0;
$sql = "
SELECT
pl.id,
pl.name,
pl.status,
pl.categories_default
FROM pp_layouts AS pl
WHERE {$whereSql}
ORDER BY {$sortSql} {$sortDir}, pl.id ASC
LIMIT {$perPage} OFFSET {$offset}
";
$stmt = $this->db->query($sql, $params);
$items = $stmt ? $stmt->fetchAll() : [];
return [
'items' => is_array($items) ? $items : [],
'total' => $total,
];
}
private function syncPages(int $layoutId, $pages): void
{
foreach ($this->normalizeIds($pages) as $pageId) {
$this->db->delete('pp_layouts_pages', ['page_id' => $pageId]);
$this->db->insert('pp_layouts_pages', [
'layout_id' => $layoutId,
'page_id' => $pageId,
]);
}
}
private function syncCategories(int $layoutId, $categories): void
{
foreach ($this->normalizeIds($categories) as $categoryId) {
$this->db->delete('pp_layouts_categories', ['category_id' => $categoryId]);
$this->db->insert('pp_layouts_categories', [
'layout_id' => $layoutId,
'category_id' => $categoryId,
]);
}
}
/**
* @return int[]
*/
private function normalizeIds($values): array
{
if (!is_array($values)) {
$values = [$values];
}
$ids = [];
foreach ($values as $value) {
$id = (int)$value;
if ($id > 0) {
$ids[$id] = $id;
}
}
return array_values($ids);
}
private function toSwitchValue($value): int
{
return ($value === 'on' || $value === 1 || $value === '1' || $value === true) ? 1 : 0;
}
private function defaultLayout(): array
{
return [
'id' => 0,
'name' => '',
'status' => 0,
'categories_default' => 0,
'html' => '',
'css' => '',
'js' => '',
'm_html' => '',
'm_css' => '',
'm_js' => '',
'pages' => [],
'categories' => [],
];
}
private function menuPages(int $menuId, $parentId = null): array
{
if ($menuId <= 0) {
return [];
}
$rows = $this->db->select('pp_pages', ['id', 'menu_id', 'status', 'parent_id', 'start'], [
'AND' => [
'menu_id' => $menuId,
'parent_id' => $parentId,
],
'ORDER' => ['o' => 'ASC'],
]);
if (!is_array($rows)) {
return [];
}
$pages = [];
foreach ($rows as $row) {
$pageId = (int)($row['id'] ?? 0);
if ($pageId <= 0) {
continue;
}
$row['title'] = $this->pageTitle($pageId);
$row['subpages'] = $this->menuPages($menuId, $pageId);
$pages[] = $row;
}
return $pages;
}
private function pageTitle(int $pageId): string
{
$result = $this->db->select('pp_pages_langs', [
'[><]pp_langs' => ['lang_id' => 'id'],
], 'title', [
'AND' => [
'page_id' => $pageId,
'title[!]' => '',
],
'ORDER' => ['o' => 'ASC'],
'LIMIT' => 1,
]);
if (is_array($result) && isset($result[0])) {
return (string)$result[0];
}
return '';
}
}

View File

@@ -3,16 +3,23 @@ namespace admin\Controllers;
use Domain\Article\ArticleRepository;
use Domain\Languages\LanguagesRepository;
use Domain\Layouts\LayoutsRepository;
class ArticlesController
{
private ArticleRepository $repository;
private LanguagesRepository $languagesRepository;
private LayoutsRepository $layoutsRepository;
public function __construct(ArticleRepository $repository, LanguagesRepository $languagesRepository)
public function __construct(
ArticleRepository $repository,
LanguagesRepository $languagesRepository,
LayoutsRepository $layoutsRepository
)
{
$this->repository = $repository;
$this->languagesRepository = $languagesRepository;
$this->layoutsRepository = $layoutsRepository;
}
/**
@@ -189,7 +196,7 @@ class ArticlesController
'article' => $this->repository->find((int)\S::get('id')),
'menus' => \admin\factory\Pages::menus_list(),
'languages' => $this->languagesRepository->languagesList(),
'layouts' => \admin\factory\Layouts::layouts_list(),
'layouts' => $this->layoutsRepository->listAll(),
'user' => $user
]);
}

View File

@@ -0,0 +1,172 @@
<?php
namespace admin\Controllers;
use Domain\Layouts\LayoutsRepository;
use Domain\Languages\LanguagesRepository;
class LayoutsController
{
private LayoutsRepository $repository;
private LanguagesRepository $languagesRepository;
public function __construct(LayoutsRepository $repository, LanguagesRepository $languagesRepository)
{
$this->repository = $repository;
$this->languagesRepository = $languagesRepository;
}
public function list(): string
{
$sortableColumns = ['name', 'status', 'categories_default'];
$filterDefinitions = [
[
'key' => 'name',
'label' => 'Nazwa',
'type' => 'text',
],
[
'key' => 'status',
'label' => 'Szablon domyslny',
'type' => 'select',
'options' => [
'' => '- domyslny -',
'1' => 'tak',
'0' => 'nie',
],
],
[
'key' => 'categories_default',
'label' => 'Domyslny (kategorie)',
'type' => 'select',
'options' => [
'' => '- kategorie -',
'1' => 'tak',
'0' => 'nie',
],
],
];
$listRequest = \admin\Support\TableListRequestFactory::fromRequest(
$filterDefinitions,
$sortableColumns,
'name'
);
$sortDir = $listRequest['sortDir'];
if (trim((string)\S::get('sort')) === '') {
$sortDir = 'ASC';
}
$result = $this->repository->listForAdmin(
$listRequest['filters'],
$listRequest['sortColumn'],
$sortDir,
$listRequest['page'],
$listRequest['perPage']
);
$rows = [];
$lp = ($listRequest['page'] - 1) * $listRequest['perPage'] + 1;
foreach ($result['items'] as $item) {
$id = (int)($item['id'] ?? 0);
$name = trim((string)($item['name'] ?? ''));
$rows[] = [
'lp' => $lp++ . '.',
'name' => '<a href="/admin/layouts/layout_edit/id=' . $id . '">' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '</a>',
'status' => ((int)($item['status'] ?? 0) === 1) ? '<span class="text-system">tak</span>' : 'nie',
'categories_default' => ((int)($item['categories_default'] ?? 0) === 1) ? '<span class="text-system">tak</span>' : 'nie',
'_actions' => [
[
'label' => 'Edytuj',
'url' => '/admin/layouts/layout_edit/id=' . $id,
'class' => 'btn btn-xs btn-primary',
],
[
'label' => 'Usun',
'url' => '/admin/layouts/layout_delete/id=' . $id,
'class' => 'btn btn-xs btn-danger',
'confirm' => 'Na pewno chcesz usunac wybrany szablon?',
],
],
];
}
$total = (int)$result['total'];
$totalPages = max(1, (int)ceil($total / $listRequest['perPage']));
$viewModel = new \admin\ViewModels\Common\PaginatedTableViewModel(
[
['key' => 'lp', 'label' => 'Lp.', 'class' => 'text-center', 'sortable' => false],
['key' => 'name', 'sort_key' => 'name', 'label' => 'Nazwa', 'sortable' => true, 'raw' => true],
['key' => 'status', 'sort_key' => 'status', 'label' => 'Szablon domyslny', 'class' => 'text-center', 'sortable' => true, 'raw' => true],
['key' => 'categories_default', 'sort_key' => 'categories_default', 'label' => 'Domyslny (kategorie)', 'class' => 'text-center', 'sortable' => true, 'raw' => true],
],
$rows,
$listRequest['viewFilters'],
[
'column' => $listRequest['sortColumn'],
'dir' => $sortDir,
],
[
'page' => $listRequest['page'],
'per_page' => $listRequest['perPage'],
'total' => $total,
'total_pages' => $totalPages,
],
array_merge($listRequest['queryFilters'], [
'sort' => $listRequest['sortColumn'],
'dir' => $sortDir,
'per_page' => $listRequest['perPage'],
]),
$listRequest['perPageOptions'],
$sortableColumns,
'/admin/layouts/view_list/',
'Brak danych w tabeli.',
'/admin/layouts/layout_edit/',
'Dodaj szablon'
);
return \Tpl::view('layouts/layouts-list', [
'viewModel' => $viewModel,
]);
}
public function edit(): string
{
return \Tpl::view('layouts/layout-edit', [
'layout' => $this->repository->find((int)\S::get('id')),
'menus' => $this->repository->menusWithPages(),
'categories' => $this->repository->categoriesTree(),
'dlang' => $this->languagesRepository->defaultLanguageId(),
]);
}
public function save(): void
{
$response = ['status' => 'error', 'msg' => 'Podczas zapisywania szablonu wystapil blad. Prosze sprobowac ponownie.'];
$values = json_decode((string)\S::get('values'), true);
if (is_array($values)) {
$id = $this->repository->save($values);
if (!empty($id)) {
$response = ['status' => 'ok', 'msg' => 'Szablon zostal zapisany.', 'id' => $id];
}
}
echo json_encode($response);
exit;
}
public function delete(): void
{
if ($this->repository->delete((int)\S::get('id'))) {
\S::alert('Szablon zostal usuniety.');
}
header('Location: /admin/layouts/view_list/');
exit;
}
}

View File

@@ -207,7 +207,8 @@ class Site
return new \admin\Controllers\ArticlesController(
new \Domain\Article\ArticleRepository( $mdb ),
new \Domain\Languages\LanguagesRepository( $mdb )
new \Domain\Languages\LanguagesRepository( $mdb ),
new \Domain\Layouts\LayoutsRepository( $mdb )
);
},
'Banners' => function() {
@@ -266,6 +267,14 @@ class Site
new \Domain\Languages\LanguagesRepository( $mdb )
);
},
'Layouts' => function() {
global $mdb;
return new \admin\Controllers\LayoutsController(
new \Domain\Layouts\LayoutsRepository( $mdb ),
new \Domain\Languages\LanguagesRepository( $mdb )
);
},
];
return self::$newControllers;
@@ -309,6 +318,9 @@ class Site
'unit_edit' => 'edit',
'unit_save' => 'save',
'unit_delete' => 'delete',
'layout_edit' => 'edit',
'layout_save' => 'save',
'layout_delete' => 'delete',
];
public static function route()

View File

@@ -1,43 +0,0 @@
<?php
namespace admin\controls;
class Layouts
{
public static function layout_delete()
{
if ( \admin\factory\Layouts::layout_delete( \S::get( 'id' ) ) )
\S::alert( 'Szablon został usunięty.' );
header( 'Location: /admin/layouts/view_list/' );
exit;
}
public static function layout_save()
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania szablonu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = json_decode( \S::get( 'values' ), true );
if ( $id = \admin\factory\Layouts::layout_save( $values['id'], $values['name'], $values['status'], $values['pages'], $values['html'], $values['css'], $values['js'], $values['m_html'],
$values['m_css'], $values['m_js'], $values['categories'], $values['categories_default'] )
)
$response = [ 'status' => 'ok', 'msg' => 'Szablon został zapisany.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function layout_edit()
{
return \Tpl::view( 'layouts/layout-edit', [
'layout' => \admin\factory\Layouts::layout_details( \S::get( 'id' ) ),
'menus' => \admin\factory\Layouts::menus_list(),
'categories' => \admin\factory\ShopCategory::subcategories( null ),
'dlang' => \front\factory\Languages::default_language()
] );
}
public static function view_list()
{
return \admin\view\Layouts::layouts_list();
}
}
?>

View File

@@ -1,190 +1,78 @@
<?php
namespace admin\factory;
use Domain\Layouts\LayoutsRepository;
class Layouts
{
public static function layout_delete( $layout_id )
{
global $mdb;
if ( $mdb -> count( 'pp_layouts' ) > 1 )
return $mdb -> delete( 'pp_layouts', [ 'id' => (int)$layout_id ] );
return false;
}
public static function layout_details( $layout_id )
{
global $mdb;
$layout = $mdb -> get( 'pp_layouts', '*', [ 'id' => (int)$layout_id ] );
$layout['pages'] = $mdb -> select( 'pp_layouts_pages', 'page_id', [ 'layout_id' => (int)$layout_id ] );
$layout['categories'] = $mdb -> select( 'pp_layouts_categories', 'category_id', [ 'layout_id' => (int)$layout_id ] );
return $layout;
}
public static function layout_save( $layout_id, $name, $status, $pages, $html, $css, $js, $m_html, $m_css, $m_js, $categories, $categories_default )
{
global $mdb;
if ( !$layout_id )
public static function layout_delete($layout_id)
{
if ( $status == 'on' )
$mdb -> update( 'pp_layouts', [ 'status' => 0 ] );
if ( $categories_default == 'on' )
$mdb -> update( 'pp_layouts', [ 'categories_default' => 0 ] );
$mdb -> insert( 'pp_layouts', [
'name' => $name,
'html' => $html,
'css' => $css,
'js' => $js,
'm_html' => $m_html,
'm_css' => $m_css,
'm_js' => $m_js,
'status' => $status == 'on' ? 1 : 0,
'categories_default' => $categories_default == 'on' ? 1 : 0
] );
$id = $mdb -> id();
if ( $id )
{
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$page ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$id,
'page_id' => (int)$page
] );
}
else if ( $pages )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$pages ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$id,
'page_id' => (int)$pages
] );
}
if ( is_array( $categories ) ) foreach ( $categories as $category )
{
$mdb -> delete( 'pp_layouts_categories', [ 'category_id' => (int)$category ] );
$mdb -> insert( 'pp_layouts_categories', [
'layout_id' => (int)$id,
'category_id' => (int)$category
] );
}
else if ( $categories )
{
$mdb -> delete( 'pp_layouts_categories', [ 'category_id' => (int)$categories ] );
$mdb -> insert( 'pp_layouts_categories', [
'layout_id' => (int)$id,
'category_id' => (int)$categories
] );
}
\S::delete_dir( '../temp/' );
return $id;
}
return self::repository()->delete((int)$layout_id);
}
else
public static function layout_details($layout_id)
{
if ( $status == 'on' )
$mdb -> update( 'pp_layouts', [ 'status' => 0 ] );
if ( $categories_default == 'on' )
$mdb -> update( 'pp_layouts', [ 'categories_default' => 0 ] );
$mdb -> update( 'pp_layouts', [
'name' => $name,
'html' => $html,
'css' => $css,
'js' => $js,
'm_html' => $m_html,
'm_css' => $m_css,
'm_js' => $m_js,
'status' => $status == 'on' ? 1 : 0,
'categories_default' => $categories_default == 'on' ? 1 : 0
], [
'id' => $layout_id
] );
$mdb -> delete( 'pp_layouts_pages', [ 'layout_id' => (int)$layout_id ] );
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$page ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$layout_id,
'page_id' => (int)$page
] );
}
else if ( $pages )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$pages ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$layout_id,
'page_id' => (int)$pages
] );
}
$mdb -> delete( 'pp_layouts_categories', [ 'layout_id' => (int)$layout_id ] );
if ( is_array( $categories ) ) foreach ( $categories as $category )
{
$mdb -> delete( 'pp_layouts_categories', [ 'category_id' => (int)$category ] );
$mdb -> insert( 'pp_layouts_categories', [
'layout_id' => (int)$layout_id,
'category_id' => (int)$category
] );
}
else if ( $categories )
{
$mdb -> delete( 'pp_layouts_categories', [ 'category_id' => (int)$categories ] );
$mdb -> insert( 'pp_layouts_categories', [
'layout_id' => (int)$layout_id,
'category_id' => (int)$categories
] );
}
\S::delete_dir( '../temp/' );
return $layout_id;
return self::repository()->find((int)$layout_id);
}
return false;
}
public static function menus_list()
{
global $mdb;
$results = $mdb -> select( 'pp_menus', 'id', [ 'ORDER' => [ 'id' => 'ASC' ] ] );
if ( is_array( $results ) ) foreach ( $results as $row )
public static function layout_save(
$layout_id,
$name,
$status,
$pages,
$html,
$css,
$js,
$m_html,
$m_css,
$m_js,
$categories,
$categories_default
) {
return self::repository()->save([
'id' => $layout_id,
'name' => $name,
'status' => $status,
'pages' => $pages,
'html' => $html,
'css' => $css,
'js' => $js,
'm_html' => $m_html,
'm_css' => $m_css,
'm_js' => $m_js,
'categories' => $categories,
'categories_default' => $categories_default,
]);
}
public static function menus_list()
{
$menu = \admin\factory\Pages::menu_details( $row );
$menu['pages'] = \admin\factory\Pages::menu_pages( $row );
$menus[] = $menu;
$menus = \admin\factory\Pages::menus_list();
if (!is_array($menus)) {
return [];
}
foreach ($menus as $key => $menu) {
$menuId = (int)($menu['id'] ?? 0);
if ($menuId <= 0) {
continue;
}
$menus[$key]['pages'] = \admin\factory\Pages::menu_pages($menuId);
}
return $menus;
}
public static function layouts_list()
{
return self::repository()->listAll();
}
private static function repository(): LayoutsRepository
{
global $mdb;
return new LayoutsRepository($mdb);
}
return $menus;
}
public static function layouts_list()
{
global $mdb;
return $mdb -> select( 'pp_layouts', '*', [ 'ORDER' => [ 'name' => 'ASC' ] ] );
}
}
?>

View File

@@ -1,21 +0,0 @@
<?php
namespace admin\view;
class Layouts
{
public static function subpages_list( $pages, $layout_pages, $parent_id = null, $step = 1 )
{
$tpl = new \Tpl;
$tpl -> pages = $pages;
$tpl -> step = $step;
$tpl -> layout_pages = $layout_pages;
return $tpl -> render( 'layouts/subpages-list' );
}
public static function layouts_list()
{
$tpl = new \Tpl;
return $tpl -> render( 'layouts/layouts-list' );
}
}
?>