Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
browser_development
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
browser_development
Commits
c9377fdd
Commit
c9377fdd
authored
1 year ago
by
purencool
Browse files
Options
Downloads
Patches
Plain Diff
Modernised editor controller
parent
6e6a6db9
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
src/Controller/Editor.php
+7
-7
7 additions, 7 deletions
src/Controller/Editor.php
src/Processing/FileSystemStructure.php
+2
-3
2 additions, 3 deletions
src/Processing/FileSystemStructure.php
src/Processing/FormsStorage.php
+1
-1
1 addition, 1 deletion
src/Processing/FormsStorage.php
with
10 additions
and
11 deletions
src/Controller/Editor.php
+
7
−
7
View file @
c9377fdd
...
...
@@ -23,16 +23,16 @@ class Editor extends ControllerBase implements ContainerInjectionInterface {
/**
* Twig object.
*
* @var
mixed
* @var
TwigEnvironment
*/
protected
$twig
;
/**
* Data sent to controller.
*
* @var
mixed
* @var
array
*/
protected
$dataArray
;
protected
array
$dataArray
;
/**
* Constructor.
...
...
@@ -65,7 +65,7 @@ class Editor extends ControllerBase implements ContainerInjectionInterface {
* @return string
* Domain that is assigned to the front page.
*/
protected
function
domainPath
()
{
protected
function
domainPath
()
:
string
{
$url_options
=
[
'absolute'
=>
TRUE
,
'language'
=>
\Drupal
::
languageManager
()
->
getCurrentLanguage
(),
...
...
@@ -79,7 +79,7 @@ class Editor extends ControllerBase implements ContainerInjectionInterface {
* @return array
* Array of paths for template rendering variables.
*/
protected
function
templateVariables
()
{
protected
function
templateVariables
()
:
array
{
$url
=
""
;
if
(
!
empty
(
FormsStorage
::
getStorage
(
'browser_development_settings'
)[
'browser_development_settings'
][
'uri'
]))
{
...
...
@@ -112,7 +112,7 @@ class Editor extends ControllerBase implements ContainerInjectionInterface {
* @return string
* Returns data structure for troubleshooting
*/
protected
function
templateVariablesDebug
()
{
protected
function
templateVariablesDebug
()
:
string
{
return
var_export
(
$this
->
dataArray
,
TRUE
);
}
...
...
@@ -123,7 +123,7 @@ class Editor extends ControllerBase implements ContainerInjectionInterface {
* Template that needs to be returned.
* @throws \Throwable
*/
public
function
getContent
()
{
public
function
getContent
()
:
Response
{
$drupalModulePath
=
\Drupal
::
service
(
'extension.list.module'
)
->
getPath
(
'browser_development'
);
$response
=
new
Response
();
...
...
This diff is collapsed.
Click to expand it.
src/Processing/FileSystemStructure.php
+
2
−
3
View file @
c9377fdd
...
...
@@ -78,17 +78,16 @@ class FileSystemStructure {
/**
*
* @param array $path
*
* @return array
*/
public
function
setPathArray
(
$path
=
[])
{
public
function
setPathArray
(
array
$path
=
[])
:
array
{
if
(
!
empty
(
$path
))
{
$this
->
globalFilePathArray
[
'base_path'
]
=
$path
;
$arr
[
'base_path'
]
=
$this
->
globalFilePathArray
[
'base_path'
];
FormsStorage
::
setStorage
(
'browser_development_settings'
,
$arr
);
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/Processing/FormsStorage.php
+
1
−
1
View file @
c9377fdd
...
...
@@ -17,7 +17,7 @@ class FormsStorage {
* @param string $input
* String creator.
*/
protected
static
function
storage
(
$formName
,
$input
)
{
protected
static
function
storage
(
$formName
,
$input
)
{
$config
=
\Drupal
::
service
(
'config.factory'
)
->
getEditable
(
'browser_development.settings'
);
...
...
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