Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
207
Issues
207
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
05d2acc9
Commit
05d2acc9
authored
21 minutes ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Scheme settings
parent
3c6712f0
epic/minds-pro
1 merge request
!281
WIP: (feat): Minds Pro (development branch)
Pipeline
#75233134
running with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
10 deletions
+39
-10
Manager.php
Core/Pro/Manager.php
+7
-0
Repository.php
Core/Pro/Repository.php
+4
-1
Settings.php
Core/Pro/Settings.php
+28
-9
No files found.
Core/Pro/Manager.php
View file @
05d2acc9
...
...
@@ -239,6 +239,13 @@ class Manager
->
setTagList
(
array_values
(
$tagList
));
}
if
(
isset
(
$values
[
'scheme'
]))
{
// TODO: Validate!
$settings
->
setScheme
(
$values
[
'scheme'
]);
}
return
$this
->
repository
->
update
(
$settings
);
}
}
This diff is collapsed.
Click to expand it.
Core/Pro/Repository.php
View file @
05d2acc9
...
...
@@ -96,7 +96,9 @@ class Repository
->
setLogoGuid
(
$data
[
'logo_guid'
]
??
''
)
->
setFooterText
(
$data
[
'footer_text'
]
??
''
)
->
setFooterLinks
(
$data
[
'footer_links'
]
??
[])
->
setTagList
(
$data
[
'tag_list'
]
??
[]);
->
setTagList
(
$data
[
'tag_list'
]
??
[])
->
setScheme
(
$data
[
'scheme'
]
??
''
)
;
$response
[]
=
$settings
;
}
...
...
@@ -140,6 +142,7 @@ class Repository
'footer_text'
=>
$settings
->
getFooterText
(),
'footer_links'
=>
$settings
->
getFooterLinks
(),
'tag_list'
=>
$settings
->
getTagList
(),
'scheme'
=>
$settings
->
getScheme
(),
]),
];
...
...
This diff is collapsed.
Click to expand it.
Core/Pro/Settings.php
View file @
05d2acc9
...
...
@@ -34,6 +34,8 @@ use Minds\Traits\MagicAttributes;
* @method Settings setFooterLinks(array $footerLinks)
* @method array getTagList()
* @method Settings setTagList(array $footerLinks)
* @method string getScheme()
* @method Settings setScheme(string $scheme)
* @method string getBackgroundImage()
* @method Settings setBackgroundImage(string $backgroundImage)
* @method string getLogoImage()
...
...
@@ -88,31 +90,48 @@ class Settings implements JsonSerializable
/** @var array */
protected
$tagList
=
[];
/** @var string */
protected
$scheme
;
/**
* @return array
*/
public
function
export
()
{
$textColor
=
$this
->
textColor
?:
static
::
DEFAULT_TEXT_COLOR
;
$primaryColor
=
$this
->
primaryColor
?:
static
::
DEFAULT_PRIMARY_COLOR
;
$plainBackgroundColor
=
$this
->
plainBackgroundColor
?:
static
::
DEFAULT_PLAIN_BACKGROUND_COLOR
;
return
[
'user_guid'
=>
(
string
)
$this
->
userGuid
,
'domain'
=>
$this
->
domain
,
'title'
=>
$this
->
title
,
'headline'
=>
$this
->
headline
,
'text_color'
=>
$t
his
->
textColor
?:
static
::
DEFAULT_TEXT_COLOR
,
'primary_color'
=>
$
this
->
primaryColor
?:
static
::
DEFAULT_PRIMARY_COLOR
,
'plain_background_color'
=>
$
this
->
plainBackgroundColor
?:
static
::
DEFAULT_PLAIN_BACKGROUND_COLOR
,
'text_color'
=>
$t
extColor
,
'primary_color'
=>
$
primaryColor
,
'plain_background_color'
=>
$
plainBackgroundColor
,
'footer_text'
=>
$this
->
footerText
,
'footer_links'
=>
$this
->
footerLinks
,
'tag_list'
=>
$this
->
tagList
,
'logo_guid'
=>
(
string
)
$this
->
logoGuid
,
'background_image'
=>
$this
->
backgroundImage
,
'logo_image'
=>
$this
->
logoImage
,
'styles'
=>
[
'text_color'
=>
$this
->
textColor
?:
static
::
DEFAULT_TEXT_COLOR
,
'primary_color'
=>
$this
->
primaryColor
?:
static
::
DEFAULT_PRIMARY_COLOR
,
'plain_background_color'
=>
$this
->
plainBackgroundColor
?:
static
::
DEFAULT_PLAIN_BACKGROUND_COLOR
,
'transparent_background_color'
=>
sprintf
(
"%sa0"
,
$this
->
plainBackgroundColor
?:
static
::
DEFAULT_PLAIN_BACKGROUND_COLOR
),
],
'scheme'
=>
$this
->
scheme
,
'styles'
=>
$this
->
buildStyles
(),
];
}
public
function
buildStyles
()
{
$textColor
=
$this
->
textColor
?:
static
::
DEFAULT_TEXT_COLOR
;
$primaryColor
=
$this
->
primaryColor
?:
static
::
DEFAULT_PRIMARY_COLOR
;
$plainBackgroundColor
=
$this
->
plainBackgroundColor
?:
static
::
DEFAULT_PLAIN_BACKGROUND_COLOR
;
return
[
'text_color'
=>
$textColor
,
'primary_color'
=>
$primaryColor
,
'plain_background_color'
=>
$plainBackgroundColor
,
'transparent_background_color'
=>
sprintf
(
"%sa0"
,
$plainBackgroundColor
),
];
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment