Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jstimer
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
jstimer
Merge requests
!25
Something went wrong fetching the scanner findings. Please try again.
Resolve
#3511225
"Fix phpcs issues"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve
#3511225
"Fix phpcs issues"
issue/jstimer-3511225:3511225-fix-phpcs-issues
into
2.0.x
Overview
0
Commits
5
Pipelines
3
Changes
5
Merged
Charllie Quadros
requested to merge
issue/jstimer-3511225:3511225-fix-phpcs-issues
into
2.0.x
1 month ago
Overview
0
Commits
5
Pipelines
3
Changes
5
Expand
Closes
#3511225
0
0
Merge request reports
Compare
2.0.x
version 1
1b5c31f0
1 month ago
2.0.x (base)
and
latest version
latest version
c432f4bb
5 commits,
1 month ago
version 1
1b5c31f0
5 commits,
1 month ago
5 files
+
179
−
134
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
modules/jst_clock/jst_clock.module
+
42
−
25
Options
@@ -8,45 +8,62 @@
use
Drupal\Core\Form\FormStateInterface
;
/**
* Implementation of hook_form_alter().
* Implements hook_form_alter().
*
* Add the clock widget specific settings to admin screen.
*/
function
jst_clock_form_jstimer_admin_settings_alter
(
&
$form
,
FormStateInterface
$form_state
,
$form_id
)
{
$config
=
\Drupal
::
config
(
'jstimer.settings'
);
$config
=
\Drupal
::
config
(
'jstimer.settings'
);
$form
[
'jst_clock'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Clock widget'
),
'#weight'
=>
5
,
)
;
$form
[
'jst_clock'
]
=
[
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Clock widget'
),
'#weight'
=>
5
,
]
;
$form
[
'jst_clock'
][
'jstimer_jst_clock_demo'
]
=
array
(
'#theme'
=>
'jst_clock'
,
)
;
$form
[
'jst_clock'
][
'jstimer_jst_clock_demo'
]
=
[
'#theme'
=>
'jst_clock'
,
]
;
$form
[
'jst_clock'
][
'jstimer_jst_clock_type'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Clock type'
),
'#default_value'
=>
$config
->
get
(
'jstimer_jst_clock_type'
),
'#options'
=>
array
(
0
=>
t
(
'12-hour plain text'
),
1
=>
t
(
'24-hour plain text'
),
2
=>
t
(
'Analog canvas'
),
3
=>
t
(
'Analog SVG'
)),
'#description'
=>
t
(
"The analog clocks are experimental and only works on Firefox, Opera, and Safari and IE9."
)
);
$form
[
'jst_clock'
][
'jstimer_jst_clock_type'
]
=
[
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Clock type'
),
'#default_value'
=>
$config
->
get
(
'jstimer_jst_clock_type'
),
'#options'
=>
[
0
=>
t
(
'12-hour plain text'
),
1
=>
t
(
'24-hour plain text'
),
2
=>
t
(
'Analog canvas'
),
3
=>
t
(
'Analog SVG'
),
],
'#description'
=>
t
(
"The analog clocks are experimental and only works on Firefox, Opera, and Safari and IE9."
),
];
$form
[
'jst_clock'
][
'jst_clock_sva_file'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Clock svg file'
),
'#default_value'
=>
$config
->
get
(
'jst_clock_sva_file'
),
'#description'
=>
t
(
'The name of the svg file to use for the SVG clock. They are stored in the clocks sub directory.'
),
)
;
$form
[
'jst_clock'
][
'jst_clock_sva_file'
]
=
[
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Clock svg file'
),
'#default_value'
=>
$config
->
get
(
'jst_clock_sva_file'
),
'#description'
=>
t
(
'The name of the svg file to use for the SVG clock. They are stored in the clocks sub directory.'
),
]
;
$form
[
'buttons'
][
'#weight'
]
=
10
;
$form
[
'buttons'
][
'#weight'
]
=
10
;
// Put this module's submit handler first so it can save before javascript file is built.
// Put this module's submit handler first so it can save
// before the JavaScript file is built.
array_unshift
(
$form
[
'#submit'
],
'jst_clock_admin_settings_submit'
);
}
/**
* Form submission handler for the JST Clock admin settings form.
*
* Saves the selected clock type and SVG file configuration.
*
* @param array $form
* The form structure.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
function
jst_clock_admin_settings_submit
(
$form
,
FormStateInterface
$form_state
)
{
$config
=
\Drupal
::
configFactory
()
->
getEditable
(
'jstimer.settings'
);
Loading