diff --git a/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-06-01.sql b/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-06-01.sql deleted file mode 100644 index 8394d2b2098f2..0000000000000 --- a/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-06-01.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file is a dummy which can be removed or renamed and filled with content --- when the first update SQL script for Joomla 6 will be added. diff --git a/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-08-11.sql b/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-08-11.sql new file mode 100644 index 0000000000000..fa9269cf76003 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/6.0.0-2024-08-11.sql @@ -0,0 +1,6 @@ +-- Update link to featured + +UPDATE `#__menu` +SET `link` = 'index.php?option=com_content&view=articles&filter[featured]=1' +WHERE `link` = 'index.php?option=com_content&view=featured' +AND `client_id` = 1; diff --git a/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-06-01.sql b/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-06-01.sql deleted file mode 100644 index 8394d2b2098f2..0000000000000 --- a/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-06-01.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file is a dummy which can be removed or renamed and filled with content --- when the first update SQL script for Joomla 6 will be added. diff --git a/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-08-11.sql b/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-08-11.sql new file mode 100644 index 0000000000000..e6fba47a2cfaa --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/6.0.0-2024-08-11.sql @@ -0,0 +1,6 @@ +-- Update link to featured + +UPDATE "#__menu" +SET "link" = 'index.php?option=com_content&view=articles&filter[featured]=1' +WHERE "link" = 'index.php?option=com_content&view=featured' +AND "client_id" = 1; diff --git a/administrator/components/com_content/forms/filter_articles.xml b/administrator/components/com_content/forms/filter_articles.xml index a79e0f62f4c76..129e938ade06d 100644 --- a/administrator/components/com_content/forms/filter_articles.xml +++ b/administrator/components/com_content/forms/filter_articles.xml @@ -14,8 +14,8 @@ name="featured" type="list" label="JFEATURED" + filtermode="selector" class="js-select-submit-on-change" - default="" validate="options" > diff --git a/administrator/components/com_content/forms/filter_featured.xml b/administrator/components/com_content/forms/filter_featured.xml deleted file mode 100644 index 8e4a479156c83..0000000000000 --- a/administrator/components/com_content/forms/filter_featured.xml +++ /dev/null @@ -1,152 +0,0 @@ - -
diff --git a/administrator/components/com_content/presets/content.xml b/administrator/components/com_content/presets/content.xml index 214cf4c8ce64c..3b64b9cbb73da 100644 --- a/administrator/components/com_content/presets/content.xml +++ b/administrator/components/com_content/presets/content.xml @@ -32,7 +32,7 @@ title="COM_CONTENT_MENUS_FEATURED" type="component" element="com_content" - link="index.php?option=com_content&view=featured" + link="index.php?option=com_content&view=articles&filter[featured]=1" class="class:featured" /> diff --git a/administrator/components/com_content/src/Controller/ArticlesController.php b/administrator/components/com_content/src/Controller/ArticlesController.php index dc86b71f090e5..485864b1b78e1 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -16,6 +16,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Response\JsonResponse; use Joomla\CMS\Router\Route; +use Joomla\Component\Content\Administrator\Model\ArticlesModel; use Joomla\Input\Input; use Joomla\Utilities\ArrayHelper; @@ -145,9 +146,7 @@ public function getQuickiconContent() { $model = $this->getModel('articles'); - $model->setState('filter.published', 1); - - $amount = (int) $model->getTotal(); + $amount = (int) $model->getTotal($featured = ''); $result = []; @@ -157,4 +156,31 @@ public function getQuickiconContent() echo new JsonResponse($result); } + + /** + * Method to get the number of published featured articles for quickicons + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function getQuickiconFeatured() + { + /** + * @var ArticlesModel $model + */ + $model = $this->getModel('articles'); + + $model->setState('filter.featured', '1'); + + $amount = (int) $model->getTotal(); + + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_CONTENT_FEATURED_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_CONTENT_FEATURED_N_QUICKICON', $amount); + + echo new JsonResponse($result); + } } diff --git a/administrator/components/com_content/src/Controller/DisplayController.php b/administrator/components/com_content/src/Controller/DisplayController.php index 158c8f3a17ce3..1afb8032bd43d 100644 --- a/administrator/components/com_content/src/Controller/DisplayController.php +++ b/administrator/components/com_content/src/Controller/DisplayController.php @@ -62,6 +62,11 @@ public function display($cachable = false, $urlparams = []) return false; } + if ($view === 'featured' || $this->input->getInt('featured')) { + $this->setRedirect(Route::_('index.php?option=com_content&view=articles&filter[featured]=1', false)); + return false; + } + return parent::display(); } } diff --git a/administrator/components/com_content/src/Controller/FeaturedController.php b/administrator/components/com_content/src/Controller/FeaturedController.php index 92756c9fc89c6..021c7b92bba5c 100644 --- a/administrator/components/com_content/src/Controller/FeaturedController.php +++ b/administrator/components/com_content/src/Controller/FeaturedController.php @@ -6,13 +6,12 @@ * * @copyright (C) 2009 Open Source Matters, Inc.| - + | -- - | ++ + | - + |
@@ -156,6 +158,9 @@
endif; ?>>
items as $i => $item) :
$item->max_ordering = 0;
+ $ordering = ($listOrder == 'fp.ordering');
+ $assetId = 'com_content.article.' . $item->id;
+ $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid);
$canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
$canEditOwn = $user->authorise('core.edit.own', 'com_content.article.' . $item->id) && $item->created_by == $userId;
diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php
deleted file mode 100644
index df58b6aa66b58..0000000000000
--- a/administrator/components/com_content/tmpl/featured/default.php
+++ /dev/null
@@ -1,400 +0,0 @@
-
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-
-defined('_JEXEC') or die;
-
-use Joomla\CMS\Button\FeaturedButton;
-use Joomla\CMS\Button\PublishedButton;
-use Joomla\CMS\Button\TransitionButton;
-use Joomla\CMS\Component\ComponentHelper;
-use Joomla\CMS\Factory;
-use Joomla\CMS\HTML\HTMLHelper;
-use Joomla\CMS\Language\Associations;
-use Joomla\CMS\Language\Multilanguage;
-use Joomla\CMS\Language\Text;
-use Joomla\CMS\Layout\LayoutHelper;
-use Joomla\CMS\Router\Route;
-use Joomla\CMS\Session\Session;
-use Joomla\Component\Content\Administrator\Helper\ContentHelper;
-use Joomla\Utilities\ArrayHelper;
-
-/** @var \Joomla\Component\Content\Administrator\View\Featured\HtmlView $this */
-
-/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
-$wa = $this->getDocument()->getWebAssetManager();
-$wa->useScript('table.columns')
- ->useScript('multiselect');
-
-$app = Factory::getApplication();
-$user = $this->getCurrentUser();
-$userId = $user->id;
-$listOrder = $this->escape($this->state->get('list.ordering'));
-$listDirn = $this->escape($this->state->get('list.direction'));
-$saveOrder = $listOrder == 'fp.ordering';
-
-if (strpos($listOrder, 'publish_up') !== false) {
- $orderingColumn = 'publish_up';
-} elseif (strpos($listOrder, 'publish_down') !== false) {
- $orderingColumn = 'publish_down';
-} elseif (strpos($listOrder, 'modified') !== false) {
- $orderingColumn = 'modified';
-} else {
- $orderingColumn = 'created';
-}
-
-
-if ($saveOrder && !empty($this->items)) {
- $saveOrderingUrl = 'index.php?option=com_content&task=featured.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
- HTMLHelper::_('draggablelist.draggable');
-}
-
-$workflow_enabled = ComponentHelper::getParams('com_content')->get('workflow_enabled');
-$workflow_state = false;
-$workflow_featured = false;
-
-if ($workflow_enabled) :
- $wa->getRegistry()->addExtensionRegistryFile('com_workflow');
- $wa->useScript('com_workflow.admin-items-workflow-buttons')
- ->useScript('com_content.articles-status');
-
- $workflow_state = Factory::getApplication()->bootComponent('com_content')->isFunctionalityUsed('core.state', 'com_content.article');
- $workflow_featured = Factory::getApplication()->bootComponent('com_content')->isFunctionalityUsed('core.featured', 'com_content.article');
-endif;
-
-$assoc = Associations::isEnabled();
-
-?>
-
-
diff --git a/administrator/components/com_content/tmpl/featured/default.xml b/administrator/components/com_content/tmpl/featured/default.xml
deleted file mode 100644
index 34a2929f6e8e1..0000000000000
--- a/administrator/components/com_content/tmpl/featured/default.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
diff --git a/administrator/components/com_content/tmpl/featured/default_stage_footer.php b/administrator/components/com_content/tmpl/featured/default_stage_footer.php
deleted file mode 100644
index 8c6d2bfccdad4..0000000000000
--- a/administrator/components/com_content/tmpl/featured/default_stage_footer.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-
-defined('_JEXEC') or die;
-
-use Joomla\CMS\Language\Text;
-
-/** @var \Joomla\Component\Content\Administrator\View\Featured\HtmlView $this */
-
-/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
-$wa = $this->getDocument()->getWebAssetManager();
-$wa->useScript('com_content.admin-articles-stage');
-
-?>
-
-
diff --git a/administrator/components/com_content/tmpl/featured/emptystate.php b/administrator/components/com_content/tmpl/featured/emptystate.php
deleted file mode 100644
index 3f20dbd6f98e9..0000000000000
--- a/administrator/components/com_content/tmpl/featured/emptystate.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-
-defined('_JEXEC') or die;
-
-use Joomla\CMS\Layout\LayoutHelper;
-
-/** @var \Joomla\Component\Content\Administrator\View\Featured\HtmlView $this */
-
-$displayData = [
- 'textPrefix' => 'COM_CONTENT',
- 'formURL' => 'index.php?option=com_content&view=featured',
- 'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Adding_a_new_article',
-];
-
-$user = $this->getCurrentUser();
-
-if ($user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0) {
- $displayData['createURL'] = 'index.php?option=com_content&task=article.add';
-}
-
-echo LayoutHelper::render('joomla.content.emptystate', $displayData);
diff --git a/administrator/components/com_menus/presets/alternate.xml b/administrator/components/com_menus/presets/alternate.xml
index 3f2a69d0b8d9f..8f824b0bceded 100644
--- a/administrator/components/com_menus/presets/alternate.xml
+++ b/administrator/components/com_menus/presets/alternate.xml
@@ -294,7 +294,7 @@
title="COM_CONTENT_MENUS_FEATURED"
type="component"
element="com_content"
- link="index.php?option=com_content&view=featured"
+ link="index.php?option=com_content&view=articles&filter[featured]=1"
/>
diff --git a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
index caad7839758ea..ba902e6402cd6 100644
--- a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
+++ b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
@@ -258,14 +258,14 @@ public function getButtons(Registry $params, ?CMSApplication $application = null
if ($params->get('show_featured')) {
$tmp = [
'image' => 'icon-star featured',
- 'link' => Route::_('index.php?option=com_content&view=featured'),
+ 'link' => Route::_('index.php?option=com_content&view=articles&filter[featured]=1'),
'name' => 'MOD_QUICKICON_FEATURED_MANAGER',
'access' => ['core.manage', 'com_content'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_featured') == 2) {
- $tmp['ajaxurl'] = 'index.php?option=com_content&task=featured.getQuickiconContent&format=json';
+ $tmp['ajaxurl'] = 'index.php?option=com_content&task=articles.getQuickiconFeatured&format=json';
}
$this->buttons[$key][] = $tmp;
-
-
-
-
-
-
- |
|---|