bludit/bl-kernel/admin/views/manage-pages.php

60 lines
1.9 KiB
PHP
Raw Normal View History

2015-10-19 00:45:58 +02:00
<?php
2015-05-05 03:00:01 +02:00
2015-10-19 00:45:58 +02:00
HTML::title(array('title'=>$L->g('Manage pages'), 'icon'=>'folder'));
2015-05-05 03:00:01 +02:00
2015-10-19 00:45:58 +02:00
echo '
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>'.$L->g('Title').'</th>
<th class="uk-text-center">'.$L->g('Position').'</th>
<th>'.$L->g('Friendly URL').'</th>
</tr>
</thead>
<tbody>
';
2015-05-05 03:00:01 +02:00
2016-05-29 02:54:18 +02:00
foreach($pagesParents[NO_PARENT_CHAR] as $key=>$db)
2015-10-19 00:45:58 +02:00
{
2016-05-28 05:18:13 +02:00
// Parent page
2016-05-29 02:54:18 +02:00
$Page = $pages[$key];
2016-05-10 02:27:05 +02:00
2016-05-28 05:18:13 +02:00
$friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$Page->key() : '/'.$Url->filters('page').'/'.$Page->key();
2016-05-10 02:27:05 +02:00
2016-05-28 05:18:13 +02:00
echo '<tr>';
echo '<td>';
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->published()?'':'<span class="label-draft">'.$Language->g('Draft').'</span> ').($Page->title()?$Page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ').'</a>';
echo '</td>';
echo '<td class="uk-text-center">'.$Page->position().'</td>';
echo '<td><a target="_blank" href="'.$Page->permalink().'">'.$friendlyURL.'</a></td>';
echo '</tr>';
2016-05-10 02:27:05 +02:00
2016-05-29 02:54:18 +02:00
// If the page has children
if(isset($pagesParents[$Page->key()]))
2016-05-28 05:18:13 +02:00
{
2016-05-29 02:54:18 +02:00
// Get the children
$children = $pagesParents[$Page->key()];
foreach($children as $keyChildren=>$dbChildren)
{
// Parent page
$Page = $pages[$keyChildren];
$friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$Page->key() : '/'.$Url->filters('page').'/'.$Page->key();
echo '<tr class="children">';
echo '<td class="children">';
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->published()?'':'<span class="label-draft">'.$Language->g('Draft').'</span> ').($Page->title()?$Page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ').'</a>';
echo '</td>';
echo '<td class="uk-text-center">'.$Page->position().'</td>';
echo '<td><a target="_blank" href="'.$Page->permalink().'">'.$friendlyURL.'</a></td>';
echo '</tr>';
}
2015-05-05 03:00:01 +02:00
}
2015-10-19 00:45:58 +02:00
}
2015-05-05 03:00:01 +02:00
2015-10-19 00:45:58 +02:00
echo '
</tbody>
</table>
';