Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
198
Issues
198
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
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
8a304674
Commit
8a304674
authored
1 hour ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Footer settings
parent
3edad780
epic/minds-pro
1 merge request
!281
WIP: (feat): Minds Pro
Pipeline
#74206828
passed with stages
in 9 minutes and 58 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
7 deletions
+50
-7
Manager.php
Core/Pro/Manager.php
+21
-0
Repository.php
Core/Pro/Repository.php
+5
-1
Settings.php
Core/Pro/Settings.php
+24
-6
No files found.
Core/Pro/Manager.php
View file @
8a304674
...
...
@@ -196,6 +196,27 @@ class Manager
->
setPlainBackgroundColor
(
$values
[
'plain_background_color'
]);
}
if
(
isset
(
$values
[
'footer_text'
]))
{
// TODO: Validate!
$settings
->
setFooterText
(
$values
[
'footer_text'
]);
}
if
(
isset
(
$values
[
'footer_links'
])
&&
is_array
(
$values
[
'footer_links'
]))
{
$footerLinks
=
array_map
(
function
(
$item
)
{
$href
=
$item
[
'href'
];
$title
=
(
$item
[
'title'
]
??
null
)
?:
$item
[
'href'
];
return
compact
(
'title'
,
'href'
);
},
array_filter
(
$values
[
'footer_links'
],
function
(
$item
)
{
return
$item
&&
$item
[
'href'
]
&&
filter_var
(
$item
[
'href'
],
FILTER_VALIDATE_URL
);
}));
$settings
->
setFooterLinks
(
array_values
(
$footerLinks
));
}
return
$this
->
repository
->
update
(
$settings
);
}
}
This diff is collapsed.
Click to expand it.
Core/Pro/Repository.php
View file @
8a304674
...
...
@@ -92,7 +92,9 @@ class Repository
->
setHeadline
(
$data
[
'headline'
]
??
''
)
->
setTextColor
(
$data
[
'text_color'
]
??
''
)
->
setPrimaryColor
(
$data
[
'primary_color'
]
??
''
)
->
setPlainBackgroundColor
(
$data
[
'plain_background_color'
]
??
''
);
->
setPlainBackgroundColor
(
$data
[
'plain_background_color'
]
??
''
)
->
setFooterText
(
$data
[
'footer_text'
]
??
''
)
->
setFooterLinks
(
$data
[
'footer_links'
]
??
[]);
$response
[]
=
$settings
;
}
...
...
@@ -132,6 +134,8 @@ class Repository
'text_color'
=>
$settings
->
getTextColor
(),
'primary_color'
=>
$settings
->
getPrimaryColor
(),
'plain_background_color'
=>
$settings
->
getPlainBackgroundColor
(),
'footer_text'
=>
$settings
->
getFooterText
(),
'footer_links'
=>
$settings
->
getFooterLinks
(),
]),
];
...
...
This diff is collapsed.
Click to expand it.
Core/Pro/Settings.php
View file @
8a304674
...
...
@@ -26,6 +26,10 @@ use Minds\Traits\MagicAttributes;
* @method Settings setPrimaryColor(string $primaryColor)
* @method string getPlainBackgroundColor()
* @method Settings setPlainBackgroundColor(string $plainBackgroundColor)
* @method string getFooterText()
* @method Settings setFooterText(string $footerText)
* @method array getFooterLinks()
* @method Settings setFooterLinks(array $footerLinks)
* @method string getBackgroundImage()
* @method Settings setBackgroundImage(string $backgroundImage)
* @method string getLogoImage()
...
...
@@ -35,6 +39,12 @@ class Settings implements JsonSerializable
{
use
MagicAttributes
;
const
DEFAULT_TEXT_COLOR
=
'#000000'
;
const
DEFAULT_PRIMARY_COLOR
=
'#4690df'
;
const
DEFAULT_PLAIN_BACKGROUND_COLOR
=
'#ffffff'
;
/** @var int */
protected
$userGuid
;
...
...
@@ -62,6 +72,12 @@ class Settings implements JsonSerializable
/** @var string */
protected
$logoImage
;
/** @var string */
protected
$footerText
;
/** @var array */
protected
$footerLinks
=
[];
/**
* @return array
*/
...
...
@@ -72,15 +88,17 @@ class Settings implements JsonSerializable
'domain'
=>
$this
->
domain
,
'title'
=>
$this
->
title
,
'headline'
=>
$this
->
headline
,
'text_color'
=>
$this
->
textColor
,
'primary_color'
=>
$this
->
primaryColor
,
'plain_background_color'
=>
$this
->
plainBackgroundColor
,
'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
,
'footer_text'
=>
$this
->
footerText
,
'footer_links'
=>
$this
->
footerLinks
,
'background_image'
=>
$this
->
backgroundImage
,
'logo_image'
=>
$this
->
logoImage
,
'styles'
=>
[
'text_color'
=>
$this
->
textColor
?:
'#000000'
,
'primary_color'
=>
$this
->
primaryColor
?:
'#4690df'
,
'plain_background_color'
=>
$this
->
plainBackgroundColor
?:
'#ffffff'
,
'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
,
],
];
}
...
...
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