From 30092ef3725bc57ced067e82ecb4f01ef4d77f7a Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 1 Feb 2017 08:54:28 -0800 Subject: [PATCH] GUI styling fixes. Theme thumbnail preview corrected on missing preview images. --- e107_admin/db.php | 4 +- e107_admin/mailout.php | 4 +- e107_core/templates/admin_icons_template.php | 10 +-- e107_handlers/form_handler.php | 21 +++++-- e107_handlers/theme_handler.php | 55 ++++++++-------- .../download/handlers/download_class.php | 2 +- e107_plugins/download/includes/admin.php | 62 +++++++++---------- e107_plugins/poll/poll_class.php | 4 +- e107_themes/bootstrap3/admin_dark.css | 4 +- e107_themes/bootstrap3/admin_style.css | 45 +++++++++++--- 10 files changed, 130 insertions(+), 81 deletions(-) diff --git a/e107_admin/db.php b/e107_admin/db.php index 3333ac0ca..1b1ae3be9 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -1428,7 +1428,7 @@ class system_tools
".DBLAN_20.""; - $text .= " \n \n"; @@ -1551,7 +1551,7 @@ class system_tools { $error_messages = array(0 => DBLAN_31, 1 => LAN_ERROR, 2 => DBLAN_33, 3 => DBLAN_34); // $error_image = array("integrity_pass.png", "integrity_fail.png", "warning.png", "blank.png"); - $error_glyph = array(ADMIN_TRUE_ICON,ADMIN_FALSE_ICON,""," "); + $error_glyph = array(ADMIN_TRUE_ICON,ADMIN_FALSE_ICON,ADMIN_WARNING_ICON," "); $error_type = array('warning'=>2, 'error'=>1); diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index ee6e51cf2..18419efb0 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -1059,7 +1059,7 @@ class mailout_main_ui extends e_admin_ui ".LAN_MAILOUT_110."
".$frm->admin_button('testemail', LAN_MAILOUT_112,'other')."  - + ".$this->mailAdmin->sendStyleSelect(varset($_POST['testtemplate'], 'textonly'), 'testtemplate')."
@@ -1198,7 +1198,7 @@ class mailout_main_ui extends e_admin_ui $autoDisp = ($pref['mail_bounce'] != 'auto') ? "style='display:none;'" : ''; $autoMail = ($pref['mail_bounce'] != 'mail') ? "style='display:none;'" : ''; $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234); - $text .= "\n\n"; foreach ($bounceOpts as $k => $v) { $selected = ($pref['mail_bounce'] == $k) ? " selected='selected'" : ''; diff --git a/e107_core/templates/admin_icons_template.php b/e107_core/templates/admin_icons_template.php index 3ccea6ad9..6f64570f0 100644 --- a/e107_core/templates/admin_icons_template.php +++ b/e107_core/templates/admin_icons_template.php @@ -440,20 +440,20 @@ if (!defined('E_16_FAILEDLOGIN')) { define("E_32_TRUE", ""); -/* + define("ADMIN_TRUE_ICON", ""); define("ADMIN_FALSE_ICON", ""); define("ADMIN_WARNING_ICON", ""); - +/* define("ADMIN_EDIT_ICON", ""); define("ADMIN_DELETE_ICON", ""); define("ADMIN_EXECUTE_ICON", ""); define("ADMIN_SORT_ICON", ""); */ - define("ADMIN_TRUE_ICON", ""); - define("ADMIN_FALSE_ICON", ""); - define("ADMIN_WARNING_ICON", ""); +// define("ADMIN_TRUE_ICON", ""); +// define("ADMIN_FALSE_ICON", ""); +// define("ADMIN_WARNING_ICON", ""); define("ADMIN_EDIT_ICON", ""); define("ADMIN_DELETE_ICON", ""); diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index cbf71da19..36596f876 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -794,10 +794,10 @@ class e_form function number($name, $value=0, $maxlength = 200, $options = array()) { if(is_string($options)) parse_str($options, $options); - if (vartrue($options['maxlength'])) $maxlength = $options['maxlength']; + if (empty($options['maxlength'])) $maxlength = $options['maxlength']; unset($options['maxlength']); - if(!vartrue($options['size'])) $options['size'] = 15; - if(!vartrue($options['class'])) $options['class'] = 'tbox number e-spinner input-small form-control'; + if(empty($options['size'])) $options['size'] = 15; + if(empty($options['class'])) $options['class'] = 'tbox number e-spinner input-small '; if(!empty($options['size'])) { @@ -805,6 +805,7 @@ class e_form unset($options['size']); } + $options['class'] .= " form-control"; $options['type'] ='number'; $mlength = vartrue($maxlength) ? "maxlength=".$maxlength : ""; @@ -817,7 +818,7 @@ class e_form //never allow id in format name-value for text fields - if(deftrue('BOOTSTRAP')) + if(THEME_LEGACY === false) { return "get_attributes($options, $name)." />"; } @@ -3350,7 +3351,7 @@ class e_form // 'multiple' => false, - see case 'select' ); - $form_control = (deftrue('BOOTSTRAP') === 3) ? ' form-control' : ''; + $form_control = (THEME_LEGACY !== true) ? ' form-control' : ''; switch ($type) { case 'hidden': @@ -3362,6 +3363,10 @@ class e_form unset($def_options['selected'], $def_options['checked']); break; + case 'number': + $def_options['class'] = 'tbox '.$form_control; + break; + case 'file': $def_options['class'] = 'tbox file'; unset($def_options['selected'], $def_options['checked']); @@ -5091,6 +5096,12 @@ class e_form // Appending needs is performed and customized using function: beforeUpdate($new_data, $old_data, $id) } + if(empty($parms['size'])) + { + $parms['size'] = 'xxlarge'; + } + + $text .= vartrue($parms['pre']).$this->textarea($key, $value, vartrue($parms['rows'], 5), vartrue($parms['cols'], 40), vartrue($parms['__options'],$parms), varset($parms['counter'], false)).vartrue($parms['post']); $ret = $text; break; diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 98bf20bb9..49d840ecf 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -370,7 +370,7 @@ class e_theme $vars['path'] = $path; $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; $vars['preview'] = varset($vars['screenshots']['image']); - $vars['thumbnail'] = isset($vars['preview'][0]) ? $vars['preview'][0] : ''; + $vars['thumbnail'] = isset($vars['preview'][0]) && file_exists(e_THEME.$path.'/'.$vars['preview'][0]) ? $vars['preview'][0] : ''; if(!empty($vars['themePrefs'])) @@ -568,6 +568,11 @@ class themeHandler * @var e_marketplace */ protected $mp; + + const RENDER_THUMBNAIL = 0; + const RENDER_SITEPREFS = 1; + const RENDER_ADMINPREFS = 2; + /* constructor */ @@ -1641,7 +1646,7 @@ class themeHandler mode = 1 :: selected site theme mode = 2 :: selected admin theme */ - function renderTheme($mode = FALSE, $theme) + function renderTheme($mode = 0, $theme) { $ns = e107::getRender(); $pref = e107::getPref(); @@ -1657,16 +1662,19 @@ class themeHandler // $preview_icon = "".E_32_SEARCH.""; $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "" : ""; $price = ''; - + + + e107::getDebug()->log($mode); + if(substr($theme['thumbnail'],0,4) == 'http') { $thumbPath = $theme['thumbnail']; $previewPath = $theme['preview'][0]; } - elseif(!empty($theme['preview'][0])) + elseif(!empty($theme['thumbnail'])) { - $thumbPath = e_THEME.$theme['path'] ."/".$theme['preview'][0]; - $previewPath = e_THEME.$theme['path'] ."/".$theme['preview'][0]; + $thumbPath = e_THEME.$theme['path'] ."/".$theme['thumbnail']; + $previewPath = e_THEME.$theme['path'] ."/".$theme['thumbnail']; } else { @@ -1762,10 +1770,10 @@ class themeHandler - if(!$mode) + if($mode == self::RENDER_THUMBNAIL) { // styles NEED to be put into style.css - + /* if($pref['sitetheme'] == $theme['path']) { $borderStyle = "admin-theme-cell-site"; @@ -1778,7 +1786,7 @@ class themeHandler { $borderStyle = "admin-theme-cell-default"; } - + */ $borderStyle = 'well'; @@ -1786,10 +1794,11 @@ class themeHandler
".$thumbnail."
".$main_icon.$admin_icon.$info_icon.$preview_icon."
-
".$theme['name']." ".$theme['version']." +
".strip_tags($theme['name'])." ".$theme['version']." ".$price."
"; + return $text; } @@ -1805,7 +1814,7 @@ class themeHandler
  • ".LAN_CONFIGURE."
  • "; - if($this->themeConfigObj && call_user_func(array(&$this->themeConfigObj, 'config')) && $mode == 1) + if($this->themeConfigObj && call_user_func(array(&$this->themeConfigObj, 'config')) && $mode == self::RENDER_SITEPREFS) { $text .= "
  • ".LAN_PREFS."
  • \n"; } @@ -1853,7 +1862,7 @@ class themeHandler // site theme.. - if($mode == 1) + if($mode == self::RENDER_SITEPREFS) { $text .= " @@ -1877,11 +1886,7 @@ class themeHandler ".TPVLAN_29." ";*/ - } - - // New in 0.8 ---- site theme. - if($mode == 1) - { + $itext = " ".TPVLAN_50.": @@ -1894,7 +1899,7 @@ class themeHandler "; - $itext .= ($mode == 1) ? "".TPVLAN_55."" : ""; + $itext .= ($mode == self::RENDER_SITEPREFS) ? "".TPVLAN_55."" : ""; $itext .= " ".TPVLAN_52." ".TPVLAN_56." @@ -1907,7 +1912,7 @@ class themeHandler { $itext .= " "; - if($mode == 1) + if($mode == self::RENDER_SITEPREFS) { if(!$pref['sitetheme_deflayout']) { @@ -1999,7 +2004,7 @@ class themeHandler // $itext .= !$mode ? "".TPVLAN_8.":".$previewbutton.$selectmainbutton.$selectadminbutton."" : ""; - if($mode == 2) + if($mode == self::RENDER_ADMINPREFS) { $astext = ""; @@ -2064,7 +2069,7 @@ class themeHandler switch($mode) { - case 2: // admin mode. + case self::RENDER_ADMINPREFS: // admin mode. $for = $frm->name2id("admincss-".$css['name']); $text2 = ""; $text2 .= $frm->radio('admincss', $css['name'], vartrue($pref['admincss'])== $css['name'], array('id'=>$for)); @@ -2073,7 +2078,7 @@ class themeHandler $text2 .= "".($css['info'] ? $css['info'] : ($css['name'] == "admin_style.css" ? TPVLAN_23 : TPVLAN_24))."\n"; break; - case 1: // front 'sitetheme' mode. + case self::RENDER_SITEPREFS: // front 'sitetheme' mode. $text2 = " @@ -2098,7 +2103,7 @@ class themeHandler
    "; - if($mode == 2) // admin + if($mode == self::RENDER_ADMINPREFS) // admin { $mainid = "selectmain[".$theme['id']."]"; $text .= $this->frm->admin_button('submit_adminstyle', TPVLAN_35, 'update'); @@ -2133,7 +2138,7 @@ class themeHandler
    "; - if($mode == 2) // admin + if($mode == self::RENDER_ADMINPREFS) // admin { $mainid = "selectmain[".$theme['id']."]"; $text .= $this->frm->admin_button('submit_adminstyle', TPVLAN_35, 'update'); @@ -2165,7 +2170,7 @@ class themeHandler $remove = array(); $detected = array(); - if($mode == 1) + if($mode == self::RENDER_SITEPREFS) { foreach($theme['css'] as $k=>$v) // check if wildcard is present. { diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index ba259c375..b1de0ae49 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -924,7 +924,7 @@ class download return "Error reading categories
    "; exit; } - $boxinfo .= " \n"; // Its a structured display option - need a 2-step process to create a tree $catlist = array(); diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index 3df003148..716e5d335 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -620,12 +620,12 @@ $columnInfo = array( ".$row['limit_id']." ".r_userclass_name($row['limit_classnum'])." - ".DOWLAN_109." - ".DOWLAN_110." + ".DOWLAN_109." + ".DOWLAN_110." - ".DOWLAN_111." ".DOWLAN_109." - ".DOWLAN_110." + ".DOWLAN_111." ".DOWLAN_109." + ".DOWLAN_110." "; @@ -644,12 +644,12 @@ $columnInfo = array( ".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")." - ".DOWLAN_109." - ".DOWLAN_110." + ".DOWLAN_109." + ".DOWLAN_110." - ".DOWLAN_111." ".DOWLAN_109." - ".DOWLAN_110." + ".DOWLAN_111." ".DOWLAN_109." + ".DOWLAN_110." @@ -1221,7 +1221,7 @@ $columnInfo = array(
    ".DOWLAN_131."  "; - // $text .= " // \n"; @@ -1272,14 +1272,14 @@ $columnInfo = array( ".DOWLAN_149." - + ".DOWLAN_66." - - + + - - "; + + "; if (DOWNLOAD_DEBUG) { if ($id) @@ -1331,7 +1331,7 @@ $columnInfo = array( } else { - $text .= ""; + $text .= ""; } } $text .= "
    "; @@ -1370,25 +1370,25 @@ $columnInfo = array( ".DOWLAN_12." - toForm($download_name)."\" maxlength='200'/> + toForm($download_name)."\" maxlength='200'/> ".DOWLAN_15." - + ".DOWLAN_16." - + ".DOWLAN_17." - + @@ -1404,7 +1404,7 @@ $columnInfo = array( ".DOWLAN_19." "; /* - $text = " "; foreach($image_array as $img) { @@ -1436,7 +1436,7 @@ $columnInfo = array( "; /* $text .= " - "; foreach($thumb_array as $thm){ $tpath = str_replace(e_FILE."downloadthumbs/","",$thm['path'].$thm['fname']); @@ -1493,7 +1493,7 @@ $columnInfo = array( ".DOWLAN_21." - "; foreach($download_status as $key => $val){ $sel = ($download_active == $key) ? " selected = 'selected' " : ""; $text .= "\n"; @@ -1526,7 +1526,7 @@ $columnInfo = array( ".DOWLAN_153." - "; $dl_dirlist = $fl->get_dirs(e_DOWNLOAD); if ($dl_dirlist){ @@ -1954,21 +1954,21 @@ $columnInfo = array( ".DOWLAN_12." - + ".DOWLAN_139." - + ".DOWLAN_136." - +
    @@ -1987,7 +1987,7 @@ $columnInfo = array( ".DOWLAN_141." - + @@ -2122,7 +2122,7 @@ $columnInfo = array( ".DOWLAN_160." - ". ($pref['mirror_order'] == "0" ? "" : ""). ($pref['mirror_order'] == "1" ? "" : ""). ($pref['mirror_order'] == "2" ? "" : "")." @@ -2131,7 +2131,7 @@ $columnInfo = array( ".DOWLAN_164." - + @@ -2320,7 +2320,7 @@ class download_main_admin_form_ui extends e_admin_form_ui } $types = array("theme","plugin"); - $text = ""; foreach($types as $val) { $selected = ($curVal == $val) ? "selected='selected'" : ""; diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 26b92ad52..3fc07d2d2 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -797,7 +797,7 @@ class poll
    ".POLLAN_3.":
    - "; + "; $option_count = (varset($_POST['poll_option']) && count($_POST['poll_option']) ? count($_POST['poll_option']) : 2); @@ -809,7 +809,7 @@ class poll for($count = 1; $count <= $option_count; $count++) { $opt = ($count==1) ? "id='pollopt'" : ""; - $text .="post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; + $text .="post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; $text .= "
    "; } diff --git a/e107_themes/bootstrap3/admin_dark.css b/e107_themes/bootstrap3/admin_dark.css index 51f73130e..6bb6ad8da 100644 --- a/e107_themes/bootstrap3/admin_dark.css +++ b/e107_themes/bootstrap3/admin_dark.css @@ -63,7 +63,9 @@ select:invalid:focus { box-shadow: 0px 1px 1px 0px rgba(255, 0, 0, 0.75) inset; } -.admin-icon-debug i { color: #f89406; margin-right:10px; cursor:help} + + +td.forumheader { background-image: linear-gradient(#303030,#212121 60%,#171717); filter: none; text-shadow: 1px 1px 1px rgba(0,0,0,.3); } diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css index 6339f56d7..594c2449d 100644 --- a/e107_themes/bootstrap3/admin_style.css +++ b/e107_themes/bootstrap3/admin_style.css @@ -1,9 +1,5 @@ -body { padding-top: 75px; -font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; -font-size: 14px; - - } +body { padding-top: 75px; font-size: 14px; } @media (max-width: 992px) { body { height: 100vh; overflow-y: auto!important; } @@ -1303,7 +1299,6 @@ ul.core-update-available li { color: white } /* BC for old plugins in admin */ input[type=checkbox].tbox { margin-right:5px } td.forumheader3 .form-control { display:inherit } -td.forumheader { background-image: linear-gradient(#303030,#212121 60%,#171717); filter: none; text-shadow: 1px 1px 1px rgba(0,0,0,.3); } @@ -1312,7 +1307,43 @@ td.forumheader { background-image: linear-gradient(#303030,#212121 60%,#171717); form#simplesef h4 { margin: 0 } .adminlist tr > td { min-height:50px; } -.navbar-fixed-top { height: 51px; } +.admin-icon-debug i { margin-right:10px; cursor:help} + +.navbar-fixed-top { height: 51px; +font-size: 14px; +left: 0px; +line-height: 20px; +margin-bottom: 20px; +min-height: 50px; +position: fixed; + } + + .navbar-nav { +font-size: 14px; +line-height: 20px; +list-style-image: none; +list-style-position: outside; +list-style-type: none; +margin-bottom: 0px; +margin-left: 0px; +margin-right: 0px; +margin-top: 0px; +padding-left: 0px; + } + + .navbar-nav > li > a { padding-bottom: 15px; +padding-left: 15px; +padding-right: 15px; +padding-top: 15px; +position: relative; + + } + + .navbar-right.navbar-text { padding-right: 5px; +padding-left: 5px; +margin-left: 0; +margin-right: 0; +padding-top: 6px; } /*