Merge branch 'develop' into rewrite/gravity-constants
This commit is contained in:
commit
26e0469de7
181 changed files with 2408 additions and 2405 deletions
|
@ -43,7 +43,8 @@ function theme_post(App $a)
|
|||
'background_image',
|
||||
'bg_image_option',
|
||||
'login_bg_image',
|
||||
'login_bg_color'
|
||||
'login_bg_color',
|
||||
'always_open_compose',
|
||||
] as $field) {
|
||||
if (isset($_POST['frio_' . $field])) {
|
||||
DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]);
|
||||
|
@ -73,7 +74,8 @@ function theme_admin_post(App $a)
|
|||
'background_image',
|
||||
'bg_image_option',
|
||||
'login_bg_image',
|
||||
'login_bg_color'
|
||||
'login_bg_color',
|
||||
'always_open_compose',
|
||||
] as $field) {
|
||||
if (isset($_POST['frio_' . $field])) {
|
||||
DI::config()->set('frio', $field, $_POST['frio_' . $field]);
|
||||
|
@ -84,48 +86,57 @@ function theme_admin_post(App $a)
|
|||
}
|
||||
}
|
||||
|
||||
function theme_content(App $a)
|
||||
function theme_content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
$arr = [];
|
||||
|
||||
$node_scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'scheme'));
|
||||
$arr = [
|
||||
'scheme' => DI::pConfig()->get(local_user(), 'frio', 'scheme',
|
||||
DI::pConfig()->get(local_user(), 'frio', 'schema',
|
||||
DI::config()->get('frio', 'scheme',
|
||||
DI::config()->get('frio', 'schema')
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
$arr['scheme'] = DI::pConfig()->get(local_user(), 'frio', 'scheme', DI::pConfig()->get(local_user(), 'frio', 'schema', $node_scheme));
|
||||
$arr['scheme_accent'] = DI::pConfig()->get(local_user(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent'));
|
||||
$arr['share_string'] = '';
|
||||
$arr['nav_bg'] = DI::pConfig()->get(local_user(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg'));
|
||||
$arr['nav_icon_color'] = DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color'));
|
||||
$arr['link_color'] = DI::pConfig()->get(local_user(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color'));
|
||||
$arr['background_color'] = DI::pConfig()->get(local_user(), 'frio', 'background_color', DI::config()->get('frio', 'background_color'));
|
||||
$arr['contentbg_transp'] = DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp', DI::config()->get('frio', 'contentbg_transp'));
|
||||
$arr['background_image'] = DI::pConfig()->get(local_user(), 'frio', 'background_image', DI::config()->get('frio', 'background_image'));
|
||||
$arr['bg_image_option'] = DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option'));
|
||||
'share_string' => '',
|
||||
'scheme_accent' => DI::pConfig()->get(local_user(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')),
|
||||
'nav_bg' => DI::pConfig()->get(local_user(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')),
|
||||
'nav_icon_color' => DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')),
|
||||
'link_color' => DI::pConfig()->get(local_user(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')),
|
||||
'background_color' => DI::pConfig()->get(local_user(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')),
|
||||
'contentbg_transp' => DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')),
|
||||
'background_image' => DI::pConfig()->get(local_user(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')),
|
||||
'bg_image_option' => DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')),
|
||||
'always_open_compose' => DI::pConfig()->get(local_user(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
|
||||
];
|
||||
|
||||
return frio_form($arr);
|
||||
}
|
||||
|
||||
function theme_admin(App $a)
|
||||
function theme_admin(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
$arr = [];
|
||||
|
||||
$arr['scheme'] = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema'));
|
||||
$arr['scheme_accent'] = DI::config()->get('frio', 'scheme_accent');
|
||||
$arr['share_string'] = '';
|
||||
$arr['nav_bg'] = DI::config()->get('frio', 'nav_bg');
|
||||
$arr['nav_icon_color'] = DI::config()->get('frio', 'nav_icon_color');
|
||||
$arr['link_color'] = DI::config()->get('frio', 'link_color');
|
||||
$arr['background_color'] = DI::config()->get('frio', 'background_color');
|
||||
$arr['contentbg_transp'] = DI::config()->get('frio', 'contentbg_transp');
|
||||
$arr['background_image'] = DI::config()->get('frio', 'background_image');
|
||||
$arr['bg_image_option'] = DI::config()->get('frio', 'bg_image_option');
|
||||
$arr['login_bg_image'] = DI::config()->get('frio', 'login_bg_image');
|
||||
$arr['login_bg_color'] = DI::config()->get('frio', 'login_bg_color');
|
||||
$arr = [
|
||||
'scheme' => DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')),
|
||||
'scheme_accent' => DI::config()->get('frio', 'scheme_accent'),
|
||||
'share_string' => '',
|
||||
'nav_bg' => DI::config()->get('frio', 'nav_bg'),
|
||||
'nav_icon_color' => DI::config()->get('frio', 'nav_icon_color'),
|
||||
'link_color' => DI::config()->get('frio', 'link_color'),
|
||||
'background_color' => DI::config()->get('frio', 'background_color'),
|
||||
'contentbg_transp' => DI::config()->get('frio', 'contentbg_transp'),
|
||||
'background_image' => DI::config()->get('frio', 'background_image'),
|
||||
'bg_image_option' => DI::config()->get('frio', 'bg_image_option'),
|
||||
'login_bg_image' => DI::config()->get('frio', 'login_bg_image'),
|
||||
'login_bg_color' => DI::config()->get('frio', 'login_bg_color'),
|
||||
'always_open_compose' => DI::config()->get('frio', 'always_open_compose', false),
|
||||
];
|
||||
|
||||
return frio_form($arr);
|
||||
}
|
||||
|
@ -173,6 +184,8 @@ function frio_form($arr)
|
|||
'$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', DI::l10n()->t('Set the background image'), $arr['background_image'], $background_image_help, false],
|
||||
'$bg_image_options_title' => DI::l10n()->t('Background image style'),
|
||||
'$bg_image_options' => Image::get_options($arr),
|
||||
|
||||
'$always_open_compose' => ['frio_always_open_compose', DI::l10n()->t('Always open Compose page'), $arr['always_open_compose'], DI::l10n()->t('The New Post button always open the <a href="/compose">Compose page</a> instead of the modal form. When this is disabled, the Compose page can be accessed with a middle click on the link or from the modal.')],
|
||||
];
|
||||
|
||||
if (array_key_exists('login_bg_image', $arr) && !array_key_exists('login_bg_image', $disable)) {
|
||||
|
@ -183,7 +196,5 @@ function frio_form($arr)
|
|||
$ctx['$login_bg_color'] = ['frio_login_bg_color', DI::l10n()->t('Login page background color'), $arr['login_bg_color'], DI::l10n()->t('Leave background image and color empty for theme defaults'), false];
|
||||
}
|
||||
|
||||
$o = Renderer::replaceMacros($t, $ctx);
|
||||
|
||||
return $o;
|
||||
return Renderer::replaceMacros($t, $ctx);
|
||||
}
|
||||
|
|
|
@ -87,10 +87,12 @@ $(document).ready(function () {
|
|||
if ($("#jot-popup").is(":hidden")) {
|
||||
$jotButton.hide();
|
||||
}
|
||||
$jotButton.on("click", function (e) {
|
||||
e.preventDefault();
|
||||
jotShow();
|
||||
});
|
||||
if ($jotButton.hasClass('modal-open')) {
|
||||
$jotButton.on("click", function (e) {
|
||||
e.preventDefault();
|
||||
jotShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let $body = $("body");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{* The button to open the jot - in This theme we move the button with js to the second nav bar *}}
|
||||
<a class="btn btn-sm btn-primary pull-right" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
|
||||
<a class="btn btn-sm btn-primary pull-right{{if !$always_open_compose}} modal-open{{/if}}" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
|
||||
|
||||
<div id="jot-content">
|
||||
<div id="jot-sections">
|
||||
|
|
|
@ -209,6 +209,8 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
{{include file="field_checkbox.tpl" field=$always_open_compose}}
|
||||
|
||||
<div class="settings-submit-wrapper pull-right">
|
||||
<button type="submit" value="{{$submit}}" class="settings-submit btn btn-primary" name="frio-settings-submit">{{$submit}}</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue