Minor changes

This commit is contained in:
Diego Najar 2017-12-20 20:37:17 +01:00
parent af8ef33e2d
commit db5c02e731
2 changed files with 37 additions and 17 deletions

View File

@ -98,24 +98,15 @@
<div class="uk-width-1-3"> <div class="uk-width-1-3">
<div class="uk-panel"> <?php if (pluginEnabled('SimpleStats')) {
<h4 class="panel-title"><?php $L->p('Scheduled content') ?></h4> $SimpleStats = getPlugin('SimpleStats');
<ul class="uk-list"> echo '<div class="uk-panel">';
<?php echo '<h4 class="panel-title">'.$SimpleStats->getValue('label').'</h4>';
$scheduledPages = $dbPages->getScheduledDB(); echo $SimpleStats->dashboard();
if( empty($scheduledPages) ) { echo '</div>';
echo '<li>'.$Language->g('There are no scheduled content').'</li>';
}
else {
$keys = array_keys($scheduledPages);
foreach($keys as $key) {
$page = buildPage($key);
echo '<li><span class="label-time">'.$page->dateRaw(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
} }
?> ?>
</ul>
</div>
<div class="uk-panel"> <div class="uk-panel">
<h4 class="panel-title"><?php $L->p('Statistics') ?></h4> <h4 class="panel-title"><?php $L->p('Statistics') ?></h4>
@ -140,6 +131,25 @@
<div class="uk-width-1-3"> <div class="uk-width-1-3">
<div class="uk-panel">
<h4 class="panel-title"><?php $L->p('Scheduled content') ?></h4>
<ul class="uk-list">
<?php
$scheduledPages = $dbPages->getScheduledDB();
if( empty($scheduledPages) ) {
echo '<li>'.$Language->g('There are no scheduled content').'</li>';
}
else {
$keys = array_keys($scheduledPages);
foreach($keys as $key) {
$page = buildPage($key);
echo '<li><span class="label-time">'.$page->dateRaw(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'.($page->title()?$page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
}
?>
</ul>
</div>
<div class="uk-panel"> <div class="uk-panel">
<h4 class="panel-title"><?php $L->p('Draft content') ?></h4> <h4 class="panel-title"><?php $L->p('Draft content') ?></h4>
<ul class="uk-list"> <ul class="uk-list">

View File

@ -251,6 +251,16 @@ function buildAllpages($publishedPages=true, $staticPages=true, $draftPages=true
return $tmp; return $tmp;
} }
function getPlugin($pluginName) {
global $plugins;
if (pluginEnabled($pluginName)) {
$pluginClass = 'plugin'.Text::firstCharUp($pluginName);
return $plugins['all'][$pluginClass];
}
return false;
}
// Returns TRUE if the plugin is enabled, FALSE otherwise // Returns TRUE if the plugin is enabled, FALSE otherwise
function pluginEnabled($pluginName) { function pluginEnabled($pluginName) {
global $plugins; global $plugins;