$customhome = False;
$defaultheader = '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
- $homefilepath = $a->basepath . '/home.html';
- $cssfilepath = $a->basepath . '/home.css';
+ $homefilepath = $a->basepath . "/home.html";
+ $cssfilepath = $a->basepath . "/home.css";
if (file_exists($homefilepath)) {
$customhome = $homefilepath;
if (file_exists($cssfilepath)) {
Config::set('frio', 'background_image', $_POST["frio_background_image"]);
Config::set('frio', 'bg_image_option', $_POST["frio_bg_image_option"]);
Config::set('frio', 'login_bg_image', $_POST["frio_login_bg_image"]);
+ Config::set('frio', 'login_bg_color', $_POST["frio_login_bg_color"]);
Config::set('frio', 'css_modified', time());
}
}
$arr["background_image"] = Config::get('frio', 'background_image');
$arr["bg_image_option"] = Config::get('frio', 'bg_image_option');
$arr["login_bg_image"] = Config::get('frio', 'login_bg_image');
+ $arr["login_bg_color"] = Config::get('frio', 'login_bg_color');
return frio_form($arr);
}
if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
$ctx['$login_bg_image'] = ['frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help];
}
+ if ( array_key_exists("login_bg_color", $arr ) && !array_key_exists("login_bg_color", $disable ) ) {
+ $ctx['$login_bg_color'] = ['frio_login_bg_color', t('Login page background color'), $arr['login_bg_color'], t('Leave background image and color empty for theme defaults')];
+ }
+
$o .= replace_macros($t, $ctx);
.mod-home.is-not-singleuser,
.mod-login {
+ background-color: $login_bg_color;
background-image: linear-gradient(to right, rgba(0,0,0, 0.7) , rgba(0,0,0, 0.4)), url($login_bg_image);
background-size: cover;
background-attachment: fixed;
}
.mod-home.is-not-singleuser .login-content,
.mod-login .login-content {
- color: #eee;
- margin-top: 2.5%;
+ color: #eee;
+ margin-top: 2.5%;
}
.mod-home.is-not-singleuser .login-form > #login-form label,
.mod-login #content #login-form label {
- color: #eee;
+ color: #eee;
}
.mod-home.is-not-singleuser .login-panel-content,
.mod-login .login-panel-content {
- background-color: rgba(255,255,255,.85);
+ background-color: rgba(255,255,255,.85);
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
- .mod-home.is-not-singleuser #content,
+ .mod-home.is-not-singleuser #content,
.mod-login #content {
- margin-top: 100px!important;
- }
+ margin-top: 100px!important;
+ }
- .mod-home.is-not-singleuser .login-form > #login-form,
+ .mod-home.is-not-singleuser .login-form > #login-form,
.mod-login #content #login-form {
background-color: #fff;
padding: 1em;
margin-top: 4em;
}
- .mod-home.is-not-singleuser .login-form > #login-form label,
- .mod-login #content #login-form label {
- color: #444;
- }
+ .mod-home.is-not-singleuser .login-form > #login-form label,
+ .mod-login #content #login-form label {
+ color: #444;
+ }
.mod-home.is-not-singleuser .login-form > #login-form::before,
.mod-login #content #login-form::before {
top: -10%;
left: 10%;
z-index: -1;
- }
+ }
}
$background_image = Config::get("frio", "background_image");
$bg_image_option = Config::get("frio", "bg_image_option");
$login_bg_image = Config::get("frio", "login_bg_image");
+ $login_bg_color = Config::get("frio", "login_bg_color");
$modified = Config::get("frio", "css_modified");
// There is maybe the case that the user did never modify the theme settings.
$bgcolor = (empty($bgcolor) ? "#ededed" : $bgcolor);
// The background image can not be empty. So we use a dummy jpg if no image was set.
$background_image = (empty($background_image) ? 'img/none.jpg' : $background_image);
-$login_bg_image = (empty($login_bg_image) ? 'img/login_bg.jpg' : $login_bg_image);
$modified = (empty($modified) ? time() :$modified);
+
+// set a default login bg image if no custom image and no custom bg color are set.
+if (empty($login_bg_image) && empty($login_bg_color)) {
+ $login_bg_image = (empty($login_bg_image) ? 'img/login_bg.jpg' : $login_bg_image);
+}
+$login_bg_color = (empty($login_bg_color) ? "#ededed" : $login_bg_color);
+
+
$contentbg_transp = ((isset($contentbg_transp) && $contentbg_transp != "") ? $contentbg_transp : 100);
// Calculate some colors in dependance of existing colors.
'$background_image' => $background_image,
'$background_size_img' => $background_size_img,
'$login_bg_image' => $login_bg_image,
+ '$login_bg_color' => $login_bg_color
];
$css_tpl = file_get_contents('view/theme/frio/css/style.css');
</div>
{{if $login_bg_image}}{{include file="field_fileinput.tpl" field=$login_bg_image}}{{/if}}
+{{if $login_bg_color}}{{include file="field_colorinput.tpl" field=$login_bg_color}}{{/if}}
<script type="text/javascript">
$(document).ready(function() {
- $("#frio_nav_bg, #frio_nav_icon_color, #frio_background_color, #frio_link_color").colorpicker({format: 'hex', align: 'left'});
+ $("#frio_nav_bg, #frio_nav_icon_color, #frio_background_color, #frio_link_color, #frio_login_bg_color").colorpicker({format: 'hex', align: 'left'});
// show image options when user user starts to type the address of the image
$("#id_frio_background_image").keyup(function(){