ver 0.262 - pages module refactor and admin UX fixes
This commit is contained in:
@@ -1,77 +1,60 @@
|
||||
<? if ( is_array( $this -> pages ) ):?>
|
||||
<? $settings = \front\factory\Settings::settings_details();?>
|
||||
<ol>
|
||||
<? foreach ( $this -> pages as $page ):?>
|
||||
<li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="list_<?= $page['id'];?>" menu="<?= $page['menu_id'];?>">
|
||||
<div class="content">
|
||||
<span class="disclose"><span></span></span>
|
||||
<?
|
||||
if ( !$page['status'] )
|
||||
echo '<i class="fa fa-ban fa-lg text-danger" title="Strona nieaktywna"></i>';
|
||||
<?php
|
||||
$pages = is_array($this->pages ?? null) ? $this->pages : [];
|
||||
$step = (int)($this->step ?? 1);
|
||||
|
||||
if ( $page['start'] )
|
||||
echo '<i class="fa fa-star fa-lg text-system" title="Strona startowa"></i>';
|
||||
|
||||
echo $page['title'];
|
||||
|
||||
if ( is_array( $page['languages'] ) ):
|
||||
echo '<div class="btn-group flags" style="display: inline-block;">';
|
||||
foreach ( $page['languages'] as $lg )
|
||||
echo '<img src="/admin/layout/lang-' . $lg['lang_id'] . '.jpg" />';
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
$default_language = \front\factory\Languages::default_language();
|
||||
if ( is_array( $page['languages'] ) ):
|
||||
foreach ( $page['languages'] as $lg ):
|
||||
echo '<div class="btn-group ml20 pull-right">';
|
||||
echo '<a href="#" title="Wybierz stronę" class="btn btn-sm btn-system button url-select" url="';
|
||||
|
||||
if ( $settings['links_structure'] )
|
||||
{
|
||||
if ( $lg['seo_link'] )
|
||||
{
|
||||
$seo = '/' . \admin\factory\Pages::google_url_preview( $page['id'],
|
||||
$lg['title'], $lg['lang_id'], 0, 0,
|
||||
$lg['seo_link'] );
|
||||
echo $seo;
|
||||
}
|
||||
else
|
||||
{
|
||||
$seo = '/' . \admin\factory\Pages::google_url_preview( $page['id'],
|
||||
$lg['title'], $lg['lang_id'], 0, 0, 0 );
|
||||
echo $seo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $lg['seo_link'] )
|
||||
{
|
||||
if ( $default_language != $lg['lang_id'] )
|
||||
echo '/' . $lg['lang_id'];
|
||||
echo '/' . $lg['seo_link'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $default_language != $lg['lang_id'] )
|
||||
echo '/' . $lg['lang_id'];
|
||||
echo '/s-' . $page['id'] . '-' . \S::seo( $lg['title'] );
|
||||
}
|
||||
}
|
||||
echo '">';
|
||||
echo '<i class="fa fa-check"></i> <span class="hidden-xs">' . strtoupper( $lg['lang_id'] ) . '</span>';
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
if ( is_array( $page['subpages'] ) )
|
||||
echo \admin\view\Pages::subpages_browse_list( $page['subpages'],
|
||||
$page['id'], $this -> step + 1 );
|
||||
if (empty($pages)) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<ol>
|
||||
<?php foreach ($pages as $page): ?>
|
||||
<?php
|
||||
$pageId = (int)($page['id'] ?? 0);
|
||||
$menuId = (int)($page['menu_id'] ?? 0);
|
||||
$title = (string)($page['title'] ?? '');
|
||||
$status = (int)($page['status'] ?? 0);
|
||||
$start = (int)($page['start'] ?? 0);
|
||||
$languages = is_array($page['languages'] ?? null) ? $page['languages'] : [];
|
||||
$previewUrls = is_array($page['preview_urls'] ?? null) ? $page['preview_urls'] : [];
|
||||
?>
|
||||
</li>
|
||||
<? endforeach;?>
|
||||
</ol>
|
||||
<? endif;?>
|
||||
<li id="list_<?= $pageId; ?>" class="list_<?= $pageId; ?>" menu="<?= $menuId; ?>">
|
||||
<div class="content">
|
||||
<span class="disclose"><span></span></span>
|
||||
<?php if ($status !== 1): ?><i class="fa fa-ban fa-lg text-danger" title="Strona nieaktywna"></i><?php endif; ?>
|
||||
<?php if ($start === 1): ?><i class="fa fa-star fa-lg text-system" title="Strona startowa"></i><?php endif; ?>
|
||||
<?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); ?>
|
||||
|
||||
<?php if (!empty($languages)): ?>
|
||||
<div class="btn-group flags" style="display: inline-block;">
|
||||
<?php foreach ($languages as $language): ?>
|
||||
<?php $langId = (string)($language['lang_id'] ?? ''); ?>
|
||||
<?php if ($langId !== ''): ?>
|
||||
<img src="/admin/layout/lang-<?= htmlspecialchars($langId, ENT_QUOTES, 'UTF-8'); ?>.jpg" />
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($languages as $language): ?>
|
||||
<?php
|
||||
$langId = (string)($language['lang_id'] ?? '');
|
||||
if ($langId === '') {
|
||||
continue;
|
||||
}
|
||||
$url = (string)($previewUrls[$langId] ?? '#');
|
||||
?>
|
||||
<div class="btn-group ml20 pull-right">
|
||||
<a href="#" title="Wybierz stronę" class="btn btn-sm btn-system button url-select" url="<?= htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<i class="fa fa-check"></i> <span class="hidden-xs"><?= strtoupper(htmlspecialchars($langId, ENT_QUOTES, 'UTF-8')); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?= \Tpl::view('pages/subpages-browse-list', [
|
||||
'pages' => $page['subpages'] ?? [],
|
||||
'step' => $step + 1,
|
||||
]); ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user