From 48645f9b625d11e5b43fae1e478e8381e52633d6 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Wed, 4 Aug 2021 23:37:33 +0530 Subject: [PATCH 01/16] add selector field dropdown --- administrator/components/com_content/tmpl/articles/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 062d2ff8782..35aa752669b 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -98,7 +98,7 @@
$this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => ['selectorFieldName' => 'featured'])); ?> items)) : ?>
From e0c6c561b9e12308c7ec5b18c032b68a90d4e03c Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 16:13:40 +0530 Subject: [PATCH 02/16] change featured from filter to selector --- .../com_content/forms/filter_articles.xml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/administrator/components/com_content/forms/filter_articles.xml b/administrator/components/com_content/forms/filter_articles.xml index 73c1bb84e6f..f95c94a423d 100644 --- a/administrator/components/com_content/forms/filter_articles.xml +++ b/administrator/components/com_content/forms/filter_articles.xml @@ -1,5 +1,18 @@
+ + + + + - - - - - - Date: Thu, 5 Aug 2021 16:16:43 +0530 Subject: [PATCH 03/16] update articles model to incorporate featurred --- .../com_content/src/Model/ArticlesModel.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index e9b8e02a02a..e92545615e3 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -39,6 +39,8 @@ class ArticlesModel extends ListModel */ public function __construct($config = array()) { + $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + if (empty($config['filter_fields'])) { $config['filter_fields'] = array( @@ -55,7 +57,6 @@ public function __construct($config = array()) 'created_by', 'a.created_by', 'created_by_alias', 'a.created_by_alias', 'ordering', 'a.ordering', - 'featured', 'a.featured', 'featured_up', 'fp.featured_up', 'featured_down', 'fp.featured_down', 'language', 'a.language', @@ -72,6 +73,10 @@ public function __construct($config = array()) 'ws.title' ); + if ($featured === '1'){ + $config['filter_fields'][] = 'fp.ordering'; + } + if (Associations::isEnabled()) { $config['filter_fields'][] = 'association'; @@ -145,7 +150,8 @@ protected function populateState($ordering = 'a.id', $direction = 'desc') $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - $featured = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', ''); + // Initialize featured to the get request value if it is set, else use the selector dropdown value. + $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); $this->setState('filter.featured', $featured); $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); @@ -232,6 +238,8 @@ protected function getListQuery() $query = $db->getQuery(true); $user = Factory::getUser(); + $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $params = ComponentHelper::getParams('com_content'); // Select the required fields from the table. @@ -304,6 +312,13 @@ protected function getListQuery() ->join('INNER', $db->quoteName('#__workflow_stages', 'ws'), $db->quoteName('ws.id') . ' = ' . $db->quoteName('wa.stage_id')) ->join('INNER', $db->quoteName('#__workflows', 'w'), $db->quoteName('w.id') . ' = ' . $db->quoteName('ws.workflow_id')); + if ($featured === '1'){ + $query->select($this->getDbo()->quoteName('fp.ordering')); + } + elseif ($featured === '0'){ + $query->where($db->quoteName('a.featured') . ' = 0'); + } + if (PluginHelper::isEnabled('content', 'vote')) { $query->select( From 1b173c29d8cebb8afa9900e91c45be279698294a Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 17:57:57 +0530 Subject: [PATCH 04/16] fix bug in dropdown value adaption --- .../com_content/src/Model/ArticlesModel.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index e92545615e3..98184686dcb 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -39,7 +39,7 @@ class ArticlesModel extends ListModel */ public function __construct($config = array()) { - $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = Factory::getApplication()->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); if (empty($config['filter_fields'])) { @@ -238,8 +238,6 @@ protected function getListQuery() $query = $db->getQuery(true); $user = Factory::getUser(); - $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); - $params = ComponentHelper::getParams('com_content'); // Select the required fields from the table. @@ -312,13 +310,6 @@ protected function getListQuery() ->join('INNER', $db->quoteName('#__workflow_stages', 'ws'), $db->quoteName('ws.id') . ' = ' . $db->quoteName('wa.stage_id')) ->join('INNER', $db->quoteName('#__workflows', 'w'), $db->quoteName('w.id') . ' = ' . $db->quoteName('ws.workflow_id')); - if ($featured === '1'){ - $query->select($this->getDbo()->quoteName('fp.ordering')); - } - elseif ($featured === '0'){ - $query->where($db->quoteName('a.featured') . ' = 0'); - } - if (PluginHelper::isEnabled('content', 'vote')) { $query->select( @@ -364,7 +355,7 @@ protected function getListQuery() } // Filter by featured. - $featured = (string) $this->getState('filter.featured'); + $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); if (in_array($featured, ['0','1'])) { @@ -373,6 +364,11 @@ protected function getListQuery() ->bind(':featured', $featured, ParameterType::INTEGER); } + if ($featured === '1') + { + $query->select($this->getDbo()->quoteName('fp.ordering')); + } + // Filter by access level on categories. if (!$user->authorise('core.admin')) { From 547efc6a1326b3277dda5a89747daae0ee31c4bb Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 18:17:29 +0530 Subject: [PATCH 05/16] remove unneccesary ternary --- .../components/com_content/src/Model/ArticlesModel.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index 98184686dcb..0b47d4199d5 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -39,7 +39,7 @@ class ArticlesModel extends ListModel */ public function __construct($config = array()) { - $featured = Factory::getApplication()->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); if (empty($config['filter_fields'])) { @@ -150,8 +150,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc') $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Initialize featured to the get request value if it is set, else use the selector dropdown value. - $featured = $app->input->get('featured') ?? $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); $this->setState('filter.featured', $featured); $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); From 16fe4d24a495c25538650f025dc4dde23c3c8ab6 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 18:27:04 +0530 Subject: [PATCH 06/16] phpcs --- .../components/com_content/src/Model/ArticlesModel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index 0b47d4199d5..bdc98d34f6e 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -73,7 +73,8 @@ public function __construct($config = array()) 'ws.title' ); - if ($featured === '1'){ + if ($featured === '1') + { $config['filter_fields'][] = 'fp.ordering'; } From 297c164a498b33aa05b8bca9f76b91362d5f54c0 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 20:29:37 +0530 Subject: [PATCH 07/16] merge tmpl --- .../com_content/tmpl/articles/default.php | 49 +++++++++++++------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 35aa752669b..9b9e265423c 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -31,7 +31,9 @@ $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -$saveOrder = $listOrder == 'a.ordering'; +$featured = $this->state->get('filter.featured'); +$orderName = $featured === "1" ? 'fp.ordering' : 'a.ordering'; +$saveOrder = $listOrder == $orderName ; if (strpos($listOrder, 'publish_up') !== false) { @@ -108,7 +110,7 @@ @@ -118,15 +120,15 @@ - +
- , + , ,
- + - - + + - + @@ -174,6 +176,9 @@ class="js-draggable" data-url="" data-direction="" data-nested="true"> 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; @@ -388,19 +393,30 @@ pagination->getListFooter(); ?> - - authorise('core.create', 'com_content') - && $user->authorise('core.edit', 'com_content') - && $user->authorise('core.edit.state', 'com_content')) : ?> + Text::_('COM_CONTENT_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer'), + 'title' => Text::_('JTOOLBAR_CHANGE_STATUS'), + 'footer' => $this->loadTemplate('stage_footer'), ), - $this->loadTemplate('batch_body') + $this->loadTemplate('stage_body') ); ?> + + authorise('core.create', 'com_content') + && $user->authorise('core.edit', 'com_content') + && $user->authorise('core.edit.state', 'com_content')) : ?> + Text::_('COM_CONTENT_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer'), + ), + $this->loadTemplate('batch_body') + ); ?> + @@ -409,6 +425,9 @@ + + + From 52b5540184a9ca71d41ef6e55623e3ec705bff60 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Thu, 5 Aug 2021 20:29:56 +0530 Subject: [PATCH 08/16] add default stage templates --- .../tmpl/articles/default_stage_body.php | 23 +++++++++++++++++++ .../tmpl/articles/default_stage_footer.php | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 administrator/components/com_content/tmpl/articles/default_stage_body.php create mode 100644 administrator/components/com_content/tmpl/articles/default_stage_footer.php diff --git a/administrator/components/com_content/tmpl/articles/default_stage_body.php b/administrator/components/com_content/tmpl/articles/default_stage_body.php new file mode 100644 index 00000000000..3dadb99058e --- /dev/null +++ b/administrator/components/com_content/tmpl/articles/default_stage_body.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ +defined('_JEXEC') or die; + +use Joomla\CMS\Language\Text; + +?> + +
+
+
+

+
+
+
+
+
diff --git a/administrator/components/com_content/tmpl/articles/default_stage_footer.php b/administrator/components/com_content/tmpl/articles/default_stage_footer.php new file mode 100644 index 00000000000..886538176cf --- /dev/null +++ b/administrator/components/com_content/tmpl/articles/default_stage_footer.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ +defined('_JEXEC') or die; + +use Joomla\CMS\Language\Text; + +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('com_content.admin-articles-stage'); + +?> + + From cd9a0cb48d81689d83197b6d962a5e5e96c4b428 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Fri, 6 Aug 2021 23:14:56 +0530 Subject: [PATCH 09/16] phpcs --- administrator/components/com_content/tmpl/articles/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 9b9e265423c..ca15d27e59e 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -33,7 +33,7 @@ $listDirn = $this->escape($this->state->get('list.direction')); $featured = $this->state->get('filter.featured'); $orderName = $featured === "1" ? 'fp.ordering' : 'a.ordering'; -$saveOrder = $listOrder == $orderName ; +$saveOrder = $listOrder == $orderName; if (strpos($listOrder, 'publish_up') !== false) { From b2ba9602c94b586f78b7217bf2e19b0b69ab3bf2 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Sat, 7 Aug 2021 10:02:38 +0530 Subject: [PATCH 10/16] merge view --- .../src/View/Articles/HtmlView.php | 51 ++++++++++++++----- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/administrator/components/com_content/src/View/Articles/HtmlView.php b/administrator/components/com_content/src/View/Articles/HtmlView.php index 22071cc3c5e..1ccf72ff35e 100644 --- a/administrator/components/com_content/src/View/Articles/HtmlView.php +++ b/administrator/components/com_content/src/View/Articles/HtmlView.php @@ -96,6 +96,7 @@ public function display($tpl = null) $this->activeFilters = $this->get('ActiveFilters'); $this->vote = PluginHelper::isEnabled('content', 'vote'); $this->hits = ComponentHelper::getParams('com_content')->get('record_hits', 1); + $featured = $this->state->get('filter.featured'); if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) { @@ -110,7 +111,7 @@ public function display($tpl = null) } // Check for errors. - if (\count($errors = $this->get('Errors')) || $this->transitions === false) + if (\count($errors = $this->get('Errors')) || ($this->transitions === false && $featured === '1')) { throw new GenericDataException(implode("\n", $errors), 500); } @@ -157,13 +158,21 @@ public function display($tpl = null) */ protected function addToolbar() { - $canDo = ContentHelper::getActions('com_content', 'category', $this->state->get('filter.category_id')); - $user = Factory::getApplication()->getIdentity(); + $canDo = ContentHelper::getActions('com_content', 'category', $this->state->get('filter.category_id')); + $user = Factory::getApplication()->getIdentity(); + $featured = $this->state->get('filter.featured'); // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); - ToolbarHelper::title(Text::_('COM_CONTENT_ARTICLES_TITLE'), 'copy article'); + if ($featured === '1') + { + ToolbarHelper::title(Text::_('COM_CONTENT_FEATURED_TITLE'), 'star featured'); + } + else + { + ToolbarHelper::title(Text::_('COM_CONTENT_ARTICLES_TITLE'), 'copy article'); + } if ($canDo->get('core.create') || \count($user->getAuthorisedCategories('com_content', 'core.create')) > 0) { @@ -210,15 +219,21 @@ protected function addToolbar() $childBar->unpublish('articles.unpublish')->listCheck(true); - $childBar->standardButton('featured') - ->text('JFEATURE') - ->task('articles.featured') - ->listCheck(true); + if ($featured !== '1') + { + $childBar->standardButton('featured') + ->text('JFEATURE') + ->task('articles.featured') + ->listCheck(true); + } - $childBar->standardButton('circle') - ->text('JUNFEATURE') - ->task('articles.unfeatured') - ->listCheck(true); + if ($featured !== '0') + { + $childBar->standardButton('circle') + ->text('JUNFEATURE') + ->task('articles.unfeatured') + ->listCheck(true); + } $childBar->archive('articles.archive')->listCheck(true); @@ -233,7 +248,8 @@ protected function addToolbar() // Add a batch button if ($user->authorise('core.create', 'com_content') && $user->authorise('core.edit', 'com_content') - && $user->authorise('core.execute.transition', 'com_content')) + && $user->authorise('core.execute.transition', 'com_content') + && $featured !== '1') { $childBar->popupButton('batch') ->text('JTOOLBAR_BATCH') @@ -255,6 +271,13 @@ protected function addToolbar() $toolbar->preferences('com_content'); } - $toolbar->help('JHELP_CONTENT_ARTICLE_MANAGER'); + if ($featured === '1') + { + $toolbar->help('JHELP_CONTENT_ARTICLE_MANAGER'); + } + else + { + ToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES'); + } } } From 8bef9b3bf445798a7e5e1735ac6031d584b4d24d Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Sun, 8 Aug 2021 13:49:48 +0530 Subject: [PATCH 11/16] add isFeatured method to get featured selector --- .../com_content/src/Model/ArticlesModel.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index bdc98d34f6e..3f159c6be43 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -39,7 +39,7 @@ class ArticlesModel extends ListModel */ public function __construct($config = array()) { - $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = $this->isFeatured(); if (empty($config['filter_fields'])) { @@ -151,7 +151,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc') $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = $this->isFeatured(); $this->setState('filter.featured', $featured); $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); @@ -355,7 +355,7 @@ protected function getListQuery() } // Filter by featured. - $featured = $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + $featured = $this->isFeatured(); if (in_array($featured, ['0','1'])) { @@ -715,4 +715,16 @@ public function getItems() return $items; } + + /** + * Method to get the value of featured selector. + * + * @return string Returns the value of featured selector. + * + * @since __DEPLOY_VERSION__ + */ + public function isFeatured() + { + return $this->getUserStateFromRequest($this->context . '.featured', 'featured', ''); + } } From 4da41955d610d5c03e29ac391edcc3c7bf3ed84f Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Sun, 8 Aug 2021 13:50:15 +0530 Subject: [PATCH 12/16] merge featured controller --- .../src/Controller/ArticlesController.php | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/administrator/components/com_content/src/Controller/ArticlesController.php b/administrator/components/com_content/src/Controller/ArticlesController.php index a037239355c..cf34305773d 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -153,4 +153,60 @@ public function getQuickiconContent() echo new JsonResponse($result); } + + /** + * Removes an item. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function delete() + { + $articlesModel = $this->getModel('articles'); + $featured = $articlesModel->isFeatured(); + + if ($featured === "1") + { + // Check for request forgeries + $this->checkToken(); + + $user = $this->app->getIdentity(); + $ids = $this->input->get('cid', array(), 'array'); + + // Access checks. + foreach ($ids as $i => $id) + { + if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id)) + { + // Prune items that you can't delete. + unset($ids[$i]); + $this->app->enqueueMessage(Text::_('JERROR_CORE_DELETE_NOT_PERMITTED'), 'notice'); + } + } + + if (empty($ids)) + { + $this->app->enqueueMessage(Text::_('JERROR_NO_ITEMS_SELECTED'), 'error'); + } + else + { + /** @var \Joomla\Component\Content\Administrator\Model\FeatureModel $model */ + $featureModel = $this->getModel('Feature'); + + // Remove the items. + if (!$featureModel->featured($ids, 0)) + { + $this->app->enqueueMessage($featureModel->getError(), 'error'); + } + } + + $this->setMessage(Text::plural('COM_CONTENT_N_ITEMS_DELETED', \count($ids))); + $this->setRedirect('index.php?option=com_content&view=articles&featured=1'); + } + else + { + parent::delete(); + } + } } From 8ad7a66ded339723194f64bdaebdb9cbafeca842 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Mon, 9 Aug 2021 23:31:11 +0530 Subject: [PATCH 13/16] update incoming links to featured --- administrator/components/com_content/presets/content.xml | 2 +- administrator/components/com_menus/presets/alternate.xml | 2 +- administrator/components/com_menus/presets/default.xml | 2 +- plugins/sampledata/testing/testing.php | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/administrator/components/com_content/presets/content.xml b/administrator/components/com_content/presets/content.xml index 214cf4c8ce6..8e7a9cb6c64 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&featured=1" class="class:featured" /> diff --git a/administrator/components/com_menus/presets/alternate.xml b/administrator/components/com_menus/presets/alternate.xml index 761677398d0..c5dc9c16fef 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&featured=1" /> diff --git a/plugins/sampledata/testing/testing.php b/plugins/sampledata/testing/testing.php index 55dbca7c149..2572a32faec 100644 --- a/plugins/sampledata/testing/testing.php +++ b/plugins/sampledata/testing/testing.php @@ -1836,7 +1836,7 @@ public function onAjaxSampledataApplyStep7() array( 'menutype' => $menuTypes[6], 'title' => Text::_('PLG_SAMPLEDATA_TESTING_SAMPLEDATA_MENUS_ITEM_18_TITLE'), - 'link' => 'index.php?option=com_content&view=featured', + 'link' => 'index.php?option=com_content&view=articles&featured=1', 'component_id' => ComponentHelper::getComponent('com_content')->id, 'params' => array( 'num_leading_articles' => 1, @@ -3113,7 +3113,7 @@ public function onAjaxSampledataApplyStep7() array( 'menutype' => $menuTypes[2], 'title' => Text::_('PLG_SAMPLEDATA_TESTING_SAMPLEDATA_MENUS_ITEM_27_0_0_8_1_TITLE'), - 'link' => 'index.php?option=com_content&view=featured', + 'link' => 'index.php?option=com_content&view=articles&featured=1', 'parent_id' => $menuIdsLevel4[8], 'component_id' => ComponentHelper::getComponent('com_content')->id, 'template_style_id' => 3, @@ -3145,7 +3145,7 @@ public function onAjaxSampledataApplyStep7() array( 'menutype' => $menuTypes[2], 'title' => Text::_('PLG_SAMPLEDATA_TESTING_SAMPLEDATA_MENUS_ITEM_27_0_0_7_3_TITLE'), - 'link' => 'index.php?option=com_content&view=featured', + 'link' => 'index.php?option=com_content&view=articles&featured=1', 'parent_id' => $menuIdsLevel4[7], 'component_id' => ComponentHelper::getComponent('com_content')->id, 'template_style_id' => 4, @@ -3177,7 +3177,7 @@ public function onAjaxSampledataApplyStep7() array( 'menutype' => $menuTypes[2], 'title' => Text::_('PLG_SAMPLEDATA_TESTING_SAMPLEDATA_MENUS_ITEM_27_0_0_9_5_TITLE'), - 'link' => 'index.php?option=com_content&view=featured', + 'link' => 'index.php?option=com_content&view=articles&featured=1', 'parent_id' => $menuIdsLevel4[9], 'component_id' => ComponentHelper::getComponent('com_content')->id, 'params' => array( From 66aece22161e2a68606718921595bd4e3ae07046 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Mon, 9 Aug 2021 23:31:43 +0530 Subject: [PATCH 14/16] update menu item install link --- installation/sql/mysql/base.sql | 2 +- installation/sql/postgresql/base.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/sql/mysql/base.sql b/installation/sql/mysql/base.sql index 99199575edf..16d4696c272 100644 --- a/installation/sql/mysql/base.sql +++ b/installation/sql/mysql/base.sql @@ -512,7 +512,7 @@ SELECT 20, 'main', 'com_finder_filters', 'Smart-Search-Filters', '', 'Smart Sear INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 21, 'main', 'com_finder_searches', 'Smart-Search-Searches', '', 'Smart Search/Searches', 'index.php?option=com_finder&view=searches', 'component', 1, 13, 2, `extension_id`, 0, 0, 'class:finder-searches', 0, '', 36, 37, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_finder'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, `extension_id`, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","blog_class_leading":"","blog_class":"","num_leading_articles":"1","num_intro_articles":"3","num_links":"0","link_intro_image":"","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_associations":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_tags":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"page_title":"","show_page_heading":"1","page_heading":"","pageclass_sfx":"","menu-meta_description":"","robots":""}', 41, 42, 1, '*', 0, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_content'; +SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=articles&featured=1', 'component', 1, 1, 1, `extension_id`, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","blog_class_leading":"","blog_class":"","num_leading_articles":"1","num_intro_articles":"3","num_links":"0","link_intro_image":"","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_associations":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_tags":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"page_title":"","show_page_heading":"1","page_heading":"","pageclass_sfx":"","menu-meta_description":"","robots":""}', 41, 42, 1, '*', 0, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_content'; -- -------------------------------------------------------- diff --git a/installation/sql/postgresql/base.sql b/installation/sql/postgresql/base.sql index 8cda51c8fee..43a575fd039 100644 --- a/installation/sql/postgresql/base.sql +++ b/installation/sql/postgresql/base.sql @@ -537,7 +537,7 @@ SELECT 20, 'main', 'com_finder_filters', 'Smart-Search-Filters', '', 'Smart Sear INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 21, 'main', 'com_finder_searches', 'Smart-Search-Searches', '', 'Smart Search/Searches', 'index.php?option=com_finder&view=searches', 'component', 1, 13, 2, "extension_id", 0, 0, 'class:finder-searches', 0, '', 36, 37, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_finder'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, "extension_id", 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","blog_class_leading":"","blog_class":"","num_leading_articles":"1","num_intro_articles":"3","num_links":"0","link_intro_image":"","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_associations":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_tags":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"page_title":"","show_page_heading":"1","page_heading":"","pageclass_sfx":"","menu-meta_description":"","robots":""}', 41, 42, 1, '*', 0, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_content'; +SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=articles&featured=1', 'component', 1, 1, 1, "extension_id", 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","blog_class_leading":"","blog_class":"","num_leading_articles":"1","num_intro_articles":"3","num_links":"0","link_intro_image":"","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_associations":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_tags":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"page_title":"","show_page_heading":"1","page_heading":"","pageclass_sfx":"","menu-meta_description":"","robots":""}', 41, 42, 1, '*', 0, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_content'; SELECT setval('#__menu_id_seq', 102, false); -- From c59e867995cf3097c6a9674d1bf22a8b3405dfbf Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Mon, 9 Aug 2021 23:40:24 +0530 Subject: [PATCH 15/16] sql update link to featured --- .../com_admin/sql/updates/mysql/4.1.0-2021-08-09.sql | 4 ++++ .../com_admin/sql/updates/postgresql/4.1.0-2021-08-09.sql | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-08-09.sql create mode 100644 administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-08-09.sql diff --git a/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-08-09.sql b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-08-09.sql new file mode 100644 index 00000000000..4e39ce42304 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-08-09.sql @@ -0,0 +1,4 @@ +-- Update link to featured +UPDATE `#__menu` + SET `link` = 'index.php?option=com_content&view=articles&featured=1' + WHERE `link` = 'index.php?option=com_content&view=featured'; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-08-09.sql b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-08-09.sql new file mode 100644 index 00000000000..0e9b0c6ef6c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-08-09.sql @@ -0,0 +1,4 @@ +-- Update link to featured +UPDATE "#__menu" + SET "link" = 'index.php?option=com_content&view=articles&featured=1' + WHERE "link" = 'index.php?option=com_content&view=featured'; From b50d2540cb9397ff5c158d6fd32a0f974cf7f944 Mon Sep 17 00:00:00 2001 From: YatharthVyas Date: Sat, 14 Aug 2021 00:09:47 +0530 Subject: [PATCH 16/16] fixes https://github.com/joomla-projects/gsoc21_core-enhancements/issues/13 by removing hidden field --- administrator/components/com_content/tmpl/articles/default.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index ca15d27e59e..1f31b28f8e7 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -425,9 +425,6 @@ - - -