Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
charts
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
charts
Commits
939168f8
Commit
939168f8
authored
7 years ago
by
andileco
Browse files
Options
Downloads
Patches
Plain Diff
add ChartsSettingsService and interface to make it easier to use Charts without Views
parent
037aa55e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
charts.services.yml
+4
-0
4 additions, 0 deletions
charts.services.yml
src/Services/ChartsSettingsService.php
+21
-0
21 additions, 0 deletions
src/Services/ChartsSettingsService.php
src/Services/ChartsSettingsServiceInterface.php
+10
-0
10 additions, 0 deletions
src/Services/ChartsSettingsServiceInterface.php
with
35 additions
and
0 deletions
charts.services.yml
+
4
−
0
View file @
939168f8
...
...
@@ -7,3 +7,7 @@ services:
charts.views_variable
:
class
:
Drupal\charts\Services\ViewsDataService
charts.settings
:
class
:
Drupal\charts\Services\ChartsSettingsService
arguments
:
[
'
@config.factory'
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Services/ChartsSettingsService.php
0 → 100644
+
21
−
0
View file @
939168f8
<?php
namespace
Drupal\charts\Services
;
use
Drupal\Core\Config\ConfigFactory
;
class
ChartsSettingsService
implements
ChartsSettingsServiceInterface
{
//private $editableConfigName = 'charts.settings';
private
$configFactory
;
public
function
__construct
(
ConfigFactory
$config_factory
){
$this
->
configFactory
=
$config_factory
;
}
public
function
getChartsSettings
(){
$config
=
$this
->
configFactory
->
getEditable
(
'charts.settings'
);
return
$config
->
get
(
'charts_default_settings'
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Services/ChartsSettingsServiceInterface.php
0 → 100644
+
10
−
0
View file @
939168f8
<?php
namespace
Drupal\charts\Services
;
interface
ChartsSettingsServiceInterface
{
public
function
getChartsSettings
();
}
\ No newline at end of file
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