From fd69475e4e0a72403735a3aaa08322b04cb3c868 Mon Sep 17 00:00:00 2001
From: Kazhnuz
Date: Sat, 25 Jan 2025 13:25:33 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20(content):=20merge=20sticky=20to?=
=?UTF-8?q?=20other=20lists?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bl-kernel/admin/controllers/content.php | 4 +-
bl-kernel/admin/views/content.php | 78 +++++++++++--------------
2 files changed, 36 insertions(+), 46 deletions(-)
diff --git a/bl-kernel/admin/controllers/content.php b/bl-kernel/admin/controllers/content.php
index 7e2852a0..7ec0d696 100644
--- a/bl-kernel/admin/controllers/content.php
+++ b/bl-kernel/admin/controllers/content.php
@@ -35,11 +35,10 @@ function filterContentOwner($list) {
// Main after POST
// ============================================================================
-$published = $pages->getList($url->pageNumber(), ITEMS_PER_PAGE_ADMIN, ['article'], ['published'], false, false);
+$published = $pages->getList($url->pageNumber(), ITEMS_PER_PAGE_ADMIN, ['article'], ['published'], true, true);
$drafts = $pages->getDraftDB(['article'], true);
$scheduled = $pages->getScheduledDB(['article'],true);
$static = $pages->getStaticDB(['published'],true);
-$sticky = $pages->getStickyDB(['article'],['published'],true);
$autosave = $pages->getAutosaveDB(['article'],true);
// If the user is an Author filter the content he/she can edit
@@ -48,7 +47,6 @@ if (checkRole(array('author'), false)) {
$drafts = filterContentOwner($drafts);
$scheduled = filterContentOwner($scheduled);
$static = filterContentOwner($static);
- $sticky = filterContentOwner($sticky);
}
// Check if out of range the pageNumber
diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php
index c9247117..18777e11 100644
--- a/bl-kernel/admin/views/content.php
+++ b/bl-kernel/admin/views/content.php
@@ -9,7 +9,6 @@ function table($type) {
global $drafts;
global $scheduled;
global $static;
- global $sticky;
global $autosave;
if ($type=='published') {
@@ -44,14 +43,6 @@ function table($type) {
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;
- }
} elseif ($type=='autosave') {
$list = $autosave;
}
@@ -64,7 +55,7 @@ function table($type) {
'.$L->g('Title').' |
';
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ if ($type=='published' || $type=='static') {
echo ''.$L->g('URL').' | ';
}
@@ -81,22 +72,27 @@ function table($type) {
if (!$page->isChild()) {
echo '
-
-
- '.( ((ORDER_BY=='position') || ($type!='published'))?$L->g('Position').': '.$page->position():$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'
+ '
+ .($page->sticky()?'
':'')
+ .'
+
+
+ '.( ((ORDER_BY=='position') || ($type!='published'))?$L->g('Position').': '.$page->position():$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'
+
+
| ';
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ if ($type=='published' || $type=='static') {
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
echo ''.$friendlyURL.' | ';
}
- echo ''.PHP_EOL;
+ echo ' | '.PHP_EOL;
echo ''.$L->g('View').''.PHP_EOL;
echo ''.$L->g('Edit').''.PHP_EOL;
if (count($page->children())==0) {
@@ -120,13 +116,13 @@ function table($type) {
| ';
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ if ($type=='published' || $type=='static') {
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$child->key() : '/'.$url->filters('page').'/'.$child->key();
echo ''.$friendlyURL.' | ';
}
- echo ''.PHP_EOL;
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ echo ' | '.PHP_EOL;
+ if ($type=='published' || $type=='static') {
echo ''.$L->g('View').''.PHP_EOL;
}
echo ''.$L->g('Edit').''.PHP_EOL;
@@ -146,24 +142,28 @@ function table($type) {
try {
$page = new Page($pageKey);
echo ' |
';
- echo '
-
-
- '.( ($type=='scheduled')?$L->g('Scheduled').': '.$page->date(SCHEDULED_DATE_FORMAT):$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'
-
+ echo ' |
+ '
+ .($page->sticky()?'
':'')
+ .'
+
+
+ '.( ($type=='scheduled')?$L->g('Scheduled').': '.$page->date(SCHEDULED_DATE_FORMAT):$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'
+
+
| ';
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ if ($type=='published' || $type=='static') {
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
- echo ''.$friendlyURL.' | ';
+ echo ''.$friendlyURL.' | ';
}
- echo ''.PHP_EOL;
- if ($type=='published' || $type=='static' || $type=='sticky') {
+ echo ' | '.PHP_EOL;
+ if ($type=='published' || $type=='static') {
echo ''.$L->g('View').''.PHP_EOL;
}
echo ''.$L->g('Edit').''.PHP_EOL;
@@ -196,9 +196,6 @@ function table($type) {
-
-
-
@@ -252,11 +249,6 @@ function table($type) {
-
-
-
-
-
|