$L->g('Content'), 'icon'=>'layers')); function table($type) { global $url; global $L; global $published; global $drafts; global $scheduled; global $static; global $sticky; if ($type=='published') { $list = $published; if (empty($list)) { echo '

'; echo $L->g('There are no pages at this moment.'); echo '

'; return false; } } elseif ($type=='draft') { $list = $drafts; if (empty($list)) { echo '

'; echo $L->g('There are no draft pages at this moment.'); echo '

'; return false; } } elseif ($type=='scheduled') { $list = $scheduled; if (empty($list)) { echo '

'; echo $L->g('There are no scheduled pages at this moment.'); echo '

'; return false; } } elseif ($type=='static') { $list = $static; if (empty($list)) { echo '

'; echo $L->g('There are no static pages at this moment.'); echo '

'; return false; } } elseif ($type=='sticky') { $list = $sticky; if (empty($list)) { echo '

'; echo $L->g('There are no sticky pages at this moment.'); echo '

'; return false; } } echo ' '; if (ORDER_BY=='position') { foreach ($list as $pageKey) { try { $page = new Page($pageKey); if (!$page->isChild() || $type!='published') { echo ''; $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key(); echo ''; echo ''; echo ''; foreach ($page->children() as $child) { if ($child->published()) { echo ''; $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$child->key() : '/'.$url->filters('page').'/'.$child->key(); echo ''; echo ''; echo ''; } } } } catch (Exception $e) { // Continue } } } else { foreach ($list as $pageKey) { try { $page = new Page($pageKey); echo ''; echo ''; $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key(); echo ''; echo ''; echo ''; } catch (Exception $e) { // Continue } } } echo '
'.$L->g('Title').' '.$L->g('URL').' '.$L->g('Actions').'
' .($page->title()?$page->title():''.$L->g('Empty title').' ') .'

'.( ((ORDER_BY=='position') || ($type!='published'))?$L->g('Position').': '.$page->position():$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'

'.$friendlyURL.''.PHP_EOL; echo ''.$L->g('Edit').''.PHP_EOL; if (count($page->children())==0) { echo ''.$L->g('Delete').''.PHP_EOL; } echo '
' .($child->title()?$child->title():''.$L->g('Empty title').' ') .'

'.( ((ORDER_BY=='position') || ($type!='published'))?$L->g('Position').': '.$child->position():$child->date(MANAGE_CONTENT_DATE_FORMAT) ).'

'.$friendlyURL.''.PHP_EOL; echo ''.$L->g('Edit').''.PHP_EOL; echo ''.$L->g('Delete').''.PHP_EOL; echo '
' .($page->title()?$page->title():''.$L->g('Empty title').' ') .'

'.( ($type=='scheduled')?$L->g('Scheduled').': '.$page->date(SCHEDULED_DATE_FORMAT):$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'

'.$friendlyURL.''.PHP_EOL; echo ''.$L->g('Edit').''.PHP_EOL; if (count($page->children())==0) { echo ''.$L->g('Delete').''.PHP_EOL; } echo '
'; } ?>
1): ?>
$L->g('Delete'), 'buttonPrimaryClass'=>'btn-danger deletePageModalAcceptButton', 'buttonSecondary'=>$L->g('Cancel'), 'buttonSecondaryClass'=>'btn-link', 'modalTitle'=>$L->g('Delete content'), 'modalText'=>$L->g('Are you sure you want to delete this page'), 'modalId'=>'jsdeletePageModal' )); ?>