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
208
Issues
208
List
Boards
Labels
Service Desk
Milestones
Merge Requests
28
Merge Requests
28
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
Compare Revisions
245d49e65c9de0295d871e4066cfc438ec969aa5...05d2acc98a8d07d1a21feacc0fe39e4892d98000
Source
05d2acc98a8d07d1a21feacc0fe39e4892d98000
Select Git revision
...
Target
245d49e65c9de0295d871e4066cfc438ec969aa5
Select Git revision
Compare
Commits (2)
(feat): Tag list for Pro
· 3c6712f0
Emiliano Balbuena
authored
16 hours ago
3c6712f0
(feat): Scheme settings
· 05d2acc9
Emiliano Balbuena
authored
1 hour ago
05d2acc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
10 deletions
+62
-10
Manager.php
Core/Pro/Manager.php
+22
-0
Repository.php
Core/Pro/Repository.php
+6
-1
Settings.php
Core/Pro/Settings.php
+34
-9
No files found.
Core/Pro/Manager.php
View file @
05d2acc9
...
...
@@ -224,6 +224,28 @@ class Manager
->
setFooterLinks
(
array_values
(
$footerLinks
));
}
if
(
isset
(
$values
[
'tag_list'
])
&&
is_array
(
$values
[
'tag_list'
]))
{
$tagList
=
array_map
(
function
(
$item
)
{
$tag
=
trim
(
$item
[
'tag'
],
"#
\t\n\r
"
);
$label
=
(
$item
[
'label'
]
??
null
)
?:
"#
{
$item
[
'tag'
]
}
"
;
return
compact
(
'label'
,
'tag'
);
},
array_filter
(
$values
[
'tag_list'
],
function
(
$item
)
{
return
$item
&&
$item
[
'tag'
];
}));
$settings
->
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
...
...
@@ -95,7 +95,10 @@ class Repository
->
setPlainBackgroundColor
(
$data
[
'plain_background_color'
]
??
''
)
->
setLogoGuid
(
$data
[
'logo_guid'
]
??
''
)
->
setFooterText
(
$data
[
'footer_text'
]
??
''
)
->
setFooterLinks
(
$data
[
'footer_links'
]
??
[]);
->
setFooterLinks
(
$data
[
'footer_links'
]
??
[])
->
setTagList
(
$data
[
'tag_list'
]
??
[])
->
setScheme
(
$data
[
'scheme'
]
??
''
)
;
$response
[]
=
$settings
;
}
...
...
@@ -138,6 +141,8 @@ class Repository
'logo_guid'
=>
$settings
->
getLogoGuid
(),
'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
...
...
@@ -32,6 +32,10 @@ use Minds\Traits\MagicAttributes;
* @method Settings setFooterText(string $footerText)
* @method array getFooterLinks()
* @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()
...
...
@@ -83,30 +87,51 @@ class Settings implements JsonSerializable
/** @var array */
protected
$footerLinks
=
[];
/** @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.