Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
275ca6b
Update signature
bembelimen Jun 23, 2021
0f07418
add selector field dropdown
YatharthVyas Aug 4, 2021
be41955
change featured from filter to selector
YatharthVyas Aug 5, 2021
bcb124f
update articles model to incorporate featurred
YatharthVyas Aug 5, 2021
73634bb
fix bug in dropdown value adaption
YatharthVyas Aug 5, 2021
f7f52a9
remove unneccesary ternary
YatharthVyas Aug 5, 2021
a5d723d
phpcs
YatharthVyas Aug 5, 2021
7074ae6
merge tmpl
YatharthVyas Aug 5, 2021
4a69c58
add default stage templates
YatharthVyas Aug 5, 2021
e732f6c
phpcs
YatharthVyas Aug 6, 2021
9cf22b8
merge view
YatharthVyas Aug 7, 2021
be42ff8
add isFeatured method to get featured selector
YatharthVyas Aug 8, 2021
d3d51a9
merge featured controller
YatharthVyas Aug 8, 2021
bfe7ac0
update incoming links to featured
YatharthVyas Aug 9, 2021
2ffc28d
update menu item install link
YatharthVyas Aug 9, 2021
d661187
sql update link to featured
YatharthVyas Aug 9, 2021
cbf71dd
fixes https://github.com/joomla-projects/gsoc21_core-enhancements/iss…
YatharthVyas Aug 13, 2021
8c7ee8f
set default ordering for featured and articles
YatharthVyas Aug 16, 2021
5481e3c
single help page
YatharthVyas Aug 20, 2021
babde74
delete the moved file
YatharthVyas Aug 20, 2021
24b6a0a
replace the files
YatharthVyas Aug 20, 2021
0e6cf7c
Change double quotes to single quotes
YatharthVyas Aug 20, 2021
cf8923c
correct typo
YatharthVyas Aug 20, 2021
dcd78a1
fix sorting by featured
YatharthVyas Oct 30, 2021
fcc9a50
delete featured template files
YatharthVyas Oct 30, 2021
751d5c6
delete featured controller
YatharthVyas Oct 30, 2021
d0c0f5c
delete featured model
YatharthVyas Oct 30, 2021
c61f30c
delete featured view
YatharthVyas Oct 30, 2021
1bac178
delete featurd filter form
YatharthVyas Oct 30, 2021
293c6b9
Update administrator/components/com_content/src/View/Articles/HtmlVie…
bembelimen Jan 7, 2022
bf59c4d
use short syntax array
YatharthVyas Mar 23, 2022
46e7778
revert changes to drone
YatharthVyas Mar 23, 2022
076e3d4
correctly filter user supplied input
YatharthVyas Mar 23, 2022
9974bfd
remove unused language constants
YatharthVyas Mar 23, 2022
caf27d4
revert removal of filtered_articles from script
YatharthVyas Mar 23, 2022
481321a
fix invalid var for filtering user state input
YatharthVyas Mar 23, 2022
fb97fd4
Update administrator/components/com_content/src/Controller/ArticlesCo…
YatharthVyas Mar 27, 2022
eae1700
Apply suggestions from code review
YatharthVyas Mar 27, 2022
d47fb0f
rename sql update script
YatharthVyas Mar 27, 2022
60fbda9
add client id filter in sql update script
YatharthVyas Mar 27, 2022
b0fea58
revert updation of links for client menu items
YatharthVyas Mar 27, 2022
ba8c231
remove feature from actions if workflow is enabled
YatharthVyas Mar 27, 2022
13f3d02
Update .drone.yml
obuisard Jul 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- 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'
AND `client_id` = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- 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'
AND "client_id" = 1;
26 changes: 13 additions & 13 deletions administrator/components/com_content/forms/filter_articles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be moved to the filter fields group, so it is within the "Search Tools" panel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented it this way primarily because:

  1. I wanted the value of this state to be a URL param of the current page so that we can have a 'Featured Articles' menu item and then I found the implementation of the context field in Contact->Field Groups. So I tried to replicate something similar (Ref: Context Field in Field Groups Form)
  2. The featured dropdown is now visible directly to the user instead of being hidden by default unless the user expands the 'Filter Options' button of Search Tools. I assumed that this dropdown would be used quite often and also because the search tools

name="featured"
type="list"
label="JFEATURED"
filtermode="selector"
onchange="Joomla.resetFilters(this)"
validate="options"
addfieldprefix="Joomla\Component\Content\Administrator\Field"
>
<option value="">JALL</option>
<option value="0">COM_CONTENT_FILTER_FEATURED_NO</option>
<option value="1">COM_CONTENT_FILTER_FEATURED_YES</option>
</field>
<fields name="filter">
<field
name="search"
Expand All @@ -10,19 +23,6 @@
hint="JSEARCH_FILTER"
/>

<field
name="featured"
type="list"
label="JFEATURED"
onchange="this.form.submit();"
default=""
validate="options"
>
<option value="">COM_CONTENT_SELECT_FEATURED</option>
<option value="0">COM_CONTENT_FILTER_FEATURED_NO</option>
<option value="1">COM_CONTENT_FILTER_FEATURED_YES</option>
</field>

<field
name="stage"
type="workflowstage"
Expand Down
150 changes: 0 additions & 150 deletions administrator/components/com_content/forms/filter_featured.xml

This file was deleted.

2 changes: 1 addition & 1 deletion administrator/components/com_content/presets/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
title="COM_CONTENT_MENUS_FEATURED"
type="component"
element="com_content"
link="index.php?option=com_content&amp;view=featured"
link="index.php?option=com_content&amp;view=articles&amp;featured=1"
class="class:featured"
/>
</menuitem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,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');

// 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();
}
}
}

This file was deleted.

Loading