Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
iconify_icons
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
iconify_icons
Commits
ee534fd2
Commit
ee534fd2
authored
4 months ago
by
David Galeano
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3480854
by gxleano: Add clear cache method in form submit
parent
ccc40985
No related branches found
Branches containing commit
Tags
8.x-1.0
2 merge requests
!23
Issue #3480854 by gxleano: Add settings form to allow collections and create...
,
!22
Issue #3480854 by gxleano: Add settings form to allow collections and create...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/iconify_icons_provider/src/Form/Settings.php
+23
-2
23 additions, 2 deletions
modules/iconify_icons_provider/src/Form/Settings.php
with
23 additions
and
2 deletions
modules/iconify_icons_provider/src/Form/Settings.php
+
23
−
2
View file @
ee534fd2
...
...
@@ -117,11 +117,25 @@ class Settings extends ConfigFormBase {
->
set
(
'collections'
,
array_combine
(
$collections
,
$collections
))
->
save
();
// Clear caches after submit the form.
drupal_flush_all_caches
();
$this
->
messenger
()
->
addStatus
(
$this
->
t
(
'Cache has been cleared.'
));
parent
::
submitForm
(
$form
,
$form_state
);
}
/**
* TBD.
* Gets a formatted collection name for display purposes.
*
* @param array $collection
* An associative array containing information about the icon collection.
* @param string $collection_id
* The unique identifier of the collection, used to create the link.
*
* @return string
* A formatted string with the collection's name, category, total icons,
* and a link to view the collection on the Iconify website.
*/
protected
function
getCustomCollectionName
(
array
$collection
,
string
$collection_id
):
string
{
return
sprintf
(
...
...
@@ -134,7 +148,14 @@ class Settings extends ConfigFormBase {
}
/**
* TBD.
* Gets options for a select list of icon collections.
*
* @return array
* An associative array where the keys are collection IDs and the values are
* formatted collection names for display in a form select element.
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \JsonException
*/
protected
function
getOptions
():
array
{
// Fetch and sort collections by 'total' in descending order.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment