fix unset user prefs
This commit is contained in:
parent
f406831b7f
commit
5f6c8e80b9
1 changed files with 9 additions and 3 deletions
|
@ -46,7 +46,7 @@ class Config extends Process
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax')) {
|
if (self::useColorSynthax()) {
|
||||||
dcCore::app()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme')));
|
dcCore::app()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ class Config extends Process
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
(new Div())->items([
|
(new Div())->items([
|
||||||
(new Text('p', __('Settings are globals. Reports are by blog.')))->class('message'),
|
(new Text('p', __('Settings are globals. Reports are by blog.')))->class('message'),
|
||||||
|
@ -138,9 +139,14 @@ class Config extends Process
|
||||||
->class('maximal'),
|
->class('maximal'),
|
||||||
])->render() .
|
])->render() .
|
||||||
(
|
(
|
||||||
!dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax') ? '' :
|
self::useColorSynthax() ?
|
||||||
Page::jsRunCodeMirror(My::id() . 'editor', 'report_contents', 'json', dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme'))
|
Page::jsRunCodeMirror(My::id() . 'editor', 'report_contents', 'json', dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme')) : ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function useColorSynthax(): bool
|
||||||
|
{
|
||||||
|
return dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax') && '' != dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue