Skip to content

Commit

Permalink
add private settings
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestaSafe committed Mar 28, 2024
1 parent 9041ecf commit 636c94a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions classes/PrettyBlocksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,12 @@ public static function getThemeSettings($with_tabs = true, $context = 'front', $
$settingsDB = PrettyBlocksSettingsModel::getSettings($context->shop->theme_name, $id_shop);
$res = [];
$no_tabs = [];

foreach ($theme_settings as $key => $settings) {
if (isset($settings['private']) && $settings['private'] === true && $context == 'front') {
continue;
}

$tab = $settings['tab'] ?? 'general';
$fieldCore = (new FieldCore($settings));
if (isset($settingsDB[$key]['value'])) {
Expand Down
2 changes: 1 addition & 1 deletion classes/TplSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function getSettings($key, $default = '')
return $result;
}

public static function getVars()
private static function getVars()
{
$cache_id = 'PrettyBlocks::getVars';
if (!Cache::isStored($cache_id)) {
Expand Down
1 change: 1 addition & 0 deletions prettyblocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ public function hookActionRegisterThemeSettings()
'description' => $this->l('Add your TinyMCE api key (free) https://www.tiny.cloud/pricing/'), // description to display
'tab' => 'Settings',
'default' => 'no-api-key', // default value (Boolean)
'private' => true
],
];
}
Expand Down

0 comments on commit 636c94a

Please sign in to comment.