From 431d885e4e2de899168a237c3d7a683a030dc856 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sat, 9 Jan 2021 19:43:21 +0000 Subject: [PATCH] see: //github.com/postfixadmin/postfixadmin/issues/410 - ignore theme_css if it points to css/default.css; drop css/default.css --- model/PFASmarty.php | 10 +- public/css/default.css | 385 ----------------------------------------- 2 files changed, 7 insertions(+), 388 deletions(-) delete mode 100644 public/css/default.css diff --git a/model/PFASmarty.php b/model/PFASmarty.php index 0a80d666..6b347fa4 100644 --- a/model/PFASmarty.php +++ b/model/PFASmarty.php @@ -20,7 +20,6 @@ class PFASmarty { } - private function __construct() { $CONF = Config::getInstance()->getAll(); @@ -60,6 +59,13 @@ class PFASmarty { public function configureTheme(string $rel_path = '') { $CONF = Config::getInstance()->getAll(); + // see: https://github.com/postfixadmin/postfixadmin/issues/410 + // ignore $CONF['theme_css'] if it points to css/default.css and we have css/bootstrap.css. + if ($CONF['theme_css'] == 'css/default.css' && is_file(__DIR__ . '/../public/css/bootstrap.css')) { + // silently upgrade to bootstrap, css/default.css does not exist. + $CONF['theme_css'] = 'css/bootstrap.css'; + } + $CONF['theme_css'] = $rel_path . htmlentities($CONF['theme_css']); if (!empty($CONF['theme_custom_css'])) { $CONF['theme_custom_css'] = $rel_path . htmlentities($CONF['theme_custom_css']); @@ -72,8 +78,6 @@ class PFASmarty { } - - /** * @param string $key * @param mixed $value diff --git a/public/css/default.css b/public/css/default.css deleted file mode 100644 index 525b0797..00000000 --- a/public/css/default.css +++ /dev/null @@ -1,385 +0,0 @@ -body { - background: #ffffff; - color: #000000; - font-family: "BitStream Vera Sans", Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - text-align: left; -} - -#container { - width:970px; - margin:auto; -} -a { - text-decoration: none; - color: #888888; -} - -a:hover { - text-decoration: underline; - color: #888888; -} - -a:visited, a:active { - color: #888888; -} - -table { - /* border-spacing: 0; */ - /* padding: 0; */ - border-collapse: collapse; /* for IE */ - text-align: left; -} - -input, .button, textarea { - padding: 6px; -} - -input, .button, textarea, select { - font-family: "BitStream Vera Sans", Verdana, Arial, Helvetica, sans-serif; - font-size: 13px; -} - -.readonly { - background:#eee; -} - -.button { - border: 1px solid #aaaaaa; - color: #777777; - background: #dddddd; - padding: 3px 3px 3px 3px; -} - -.button:hover, .button:focus { - background: #eee; - color: #666; - text-decoration:none; -} - -.flat { - border: 1px solid #888888; -} - -ul.flash-info { - border:2px solid #AFE1A6; /* medium green */ - padding:1em; - max-width:970px; - margin-left:auto; - margin-right:auto; - list-style:none; -} - -ul.flash-error { - border:2px solid #FF6347; /* tomato */ - padding:1em; - max-width:970px; - margin-left:auto; - margin-right:auto; - list-style:none; -} - -.error_msg { - color: #d01313; -} - -#motd { - color: maroon; - padding-top:2em; -} - -.standout { - color: maroon; - padding: 3px 3px 3px 3px; - text-align: center; -} - -#login_header, #login, #main_menu, #overview, -#admin_domains, #admin_virtual, .nav_bar, #alias_domain_table, -#alias_table, #mailbox_table, #overview_table, #log_table, -#admin_table, #footer, .subnav { - width: 990px; - margin: 0 auto; -} - -#login_header { - padding-bottom: 10px; - text-align: left; -} - -#login { - width: 990px; - margin: 0 auto; - background: url(../images/mail_bg.gif) right 50% no-repeat; -} - -#login_table { - border-left: none; - border-right: 1px solid #999; - width: 400px; - margin: 0 0 0 200px; - border-collapse: separate; - border-spacing: 10px; -} - -#login_table h4 { - font-size: 13px; -} - -#menu, #tabbar { - text-align:center; - float:left; - width:100%; - margin: 0 auto; - padding-top: 10px; - white-space: nowrap; -} - -#menu ul, #tabbar ul { - padding: 0; - margin: 0; - margin-left:auto; - margin-right:auto; - list-style: none; - text-align: center; - position:relative; - width:990px; - float:left; -} - -#menu li, #tabbar li { - float: left; - background: #efefef; - margin-right: 3px; - border-top: 4px solid #aaaaaa; - position:relative; -} - -#menu li:hover, #menu li.sfhover, #tabbar li:hover, #tabbar li.sfhover { - background: #ccc; -} - -#menu li ul, #tabbar li ul { - position: absolute; - width: auto; - left: -999em; - right:auto; - background: #FFFFFF; - color: #999999; - border:2px solid white; - border-top:none; - z-index:101; -} - -#menu li:hover ul, #menu li.sfhover ul, #tabbar li:hover ul, #tabbar li.sfhover ul { - left: auto; -} - -#menu li ul li, #tabbar li ul li { - float: none; - margin-right: 0px; - border-top:2px solid white; - text-align:left; - right:auto; -} - -#menu a, #tabbar a { - display: block; - width: auto; - padding: 20px 5px 5px 5px; -} - -#menu a, #tabbar a, #menu a:hover, #tabbar a:hover { - color: #888888; -} - -#menu li ul li a, #tabbar li ul li a { - padding: 5px 5px 5px 5px; -} - -.subnav p { - padding-left:10px; - margin-top:2em; - margin-bottom:0; - font-size:12px; -} - -#edit_form table { - margin: 0 50px; - padding-top: 10px; - text-align: left; -} - -#edit_form th { - text-align: left; - font-size: 12px; - margin: 0; - line-height: 25px; -} - -.hlp_center { - text-align: center; -} - -.help_text { - text-align: center; - padding-top: 5px; - padding-bottom: 5px; -} - -#main_menu table { - margin: 0 0; - text-align: left; - padding-top: 20px; - padding-bottom: 20px; -} - -#main_menu table td { - padding-left: 30px; - padding-bottom: 5px; -} - -#main_menu a { - padding-left: 8px; -} - -#main_menu a:hover { - color: #333; - text-decoration: none; - padding-left: 4px; - border-bottom: none; - border-left: 4px solid #333; -} - -#overview h4, #overview P, #overview FORM, #admin_virtual h4, #admin_virtual P, #admin_virtual FORM { - display: inline; - padding-right: 10px; - line-height: 30px; -} - -#alias_domain_table .header, #alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header { - line-height: 20px; - background: #efefef; - color: black; -} - -#alias_domain_table h3, #alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 { - text-align: left; - font-size: 12px; - font-weight: bold; - padding-left: 20px; - line-height: 25px; - margin: 0; -} - -#alias_domain_table .hilightoff, #alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff { - background: white; -} - -#alias_domain_table .hilighton, #alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton { - background: #eee; /*#D6FF85;*/ /*#ffdddd;*/ -} - -#alias_domain_table tr:hover, #alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover { - background: #eee; /*#D6FF85;*/ /*#ffdddd;*/ -} - -th { - text-align: center; - padding:7px 0; - margin: 0 0 14px 0; - border-bottom: 1px solid #bbb; - color: #555555; -} - -td { - padding:7px 7px; -} - -td.label { - text-align:right; - margin-right:0px; -} - -label { - padding-right:0; - font-weight:bold; - vertical-align:middle; -} - -#alias_domain_table td, #alias_table td, #mailbox_table td, #overview_table td, #log_table td, #admin_table td { - text-align: left; -} - -#footer { - width:975px; - margin: 20px auto; - border-top: 1px solid #bbbbbb; - background: #efefef; - color: #999999; - line-height: 20px; - text-align: left; - padding-left: 15px; - font-size: 9px; -} - -#footer a { - text-decoration: none; - color: #999999; -} - -#footer a:hover { - text-decoration: underline; - color: #777777; -} - -div.setup { - width:700px; - margin-left:auto; - margin-right:auto; - text-align: left; -} - -div.setup li { - padding-bottom:1em; -} - -.searchresult { - background:lightgreen; -} - -span.active { - font-weight:bold; -} - -div.nav_bar { - text-align: left; -} - - -.quota { -z-index:99; -height:14px; -position: absolute; -} -.quota_text { -z-index:100; - text-align: center; - font-size: 10px; - color: #666; - - cursor: default; - position: absolute; - width:120px; - height:14px; - margin-top:-14px; -} -.quota_bg { background-color: white; z-index:98; width:120px; height:14px;margin-top:-1px;margin-left:-1px; border: 1px solid #999;} -.quota_no_border { border:none; margin:0; } -.quota_high { background: url(../images/quota-colors.png) repeat-x 0 -28px #f90509; } -.quota_mid { background: url(../images/quota-colors.png) repeat-x 0 -14px #e3e909; } -.quota_low { background: url(../images/quota-colors.png) repeat-x 0 0px #05f905; } -.quota_text_high { color: white; } -.quota_text_mid { color: #666; } -.quota_text_low { color: #666; }