From 82fbeab43c4d8c31c31f34ccfdd54e9dd5d5f8dd Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 Feb 2021 20:38:31 -0800 Subject: [PATCH] Tool-tip placement options added to admin prefs. (Applies to Admin-ui areas only) Admin styling tweaks. --- e107_admin/db.php | 27 +++++++++++----------- e107_admin/prefs.php | 6 +++++ e107_core/xml/default_install.xml | 1 + e107_handlers/form_handler.php | 14 +++++++++-- e107_languages/English/admin/lan_prefs.php | 5 +++- e107_themes/bootstrap3/admin_style.css | 3 ++- e107_themes/bootstrap3/css/modern-dark.css | 8 +++---- e107_web/js/core/admin.jquery.js | 2 +- 8 files changed, 44 insertions(+), 22 deletions(-) diff --git a/e107_admin/db.php b/e107_admin/db.php index 0226473d1..03845f83f 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -166,24 +166,24 @@ class system_tools $this->_utf8_exclude = array(MPREFIX."core"); $this->_options = array( - "db_update" => array('diz'=>DBLAN_15, 'label'=>DBLAN_16), - "verify_sql" => array('diz'=>DBLAN_4, 'label'=>DBLAN_5), - 'optimize_sql' => array('diz'=>DBLAN_6, 'label'=> DBLAN_7), - 'plugin_scan' => array('diz'=>DBLAN_28, 'label'=> DBLAN_29), - 'pref_editor' => array('diz'=>DBLAN_19, 'label'=> DBLAN_20), + "db_update" => array('diz'=>DBLAN_15, 'label'=>DBLAN_16, 'icon'=>'fas-angle-double-up.glyph'), + "verify_sql" => array('diz'=>DBLAN_4, 'label'=>DBLAN_5, 'icon'=>'fas-database.glyph'), + 'optimize_sql' => array('diz'=>DBLAN_6, 'label'=> DBLAN_7, 'icon'=>'fas-wrench.glyph'), + 'plugin_scan' => array('diz'=>DBLAN_28, 'label'=> DBLAN_29, 'icon'=>'fas-plug.glyph'), + 'pref_editor' => array('diz'=>DBLAN_19, 'label'=> DBLAN_20, 'icon'=>'fas-edit.glyph'), // 'backup_core' => array('diz'=>DBLAN_8, 'label'=> DBLAN_9), // 'verify_sql_record' => array('diz'=>DBLAN_35, 'label'=> DBLAN_36), - 'importForm' => array('diz'=>DBLAN_59, 'label'=> DBLAN_59), - 'exportForm' => array('diz'=>DBLAN_58, 'label'=> DBLAN_58), - 'sc_override_scan' => array('diz'=>DBLAN_55, 'label'=> DBLAN_56), - 'convert_to_utf8' => array('diz'=>DBLAN_64,'label'=>DBLAN_65), - 'correct_perms' => array('diz'=>DBLAN_66,'label'=>DBLAN_67), + 'importForm' => array('diz'=>DBLAN_59, 'label'=> DBLAN_59, 'icon'=>'fas-file-import.glyph'), + 'exportForm' => array('diz'=>DBLAN_58, 'label'=> DBLAN_58, 'icon'=>'fas-file-export.glyph'), + 'sc_override_scan' => array('diz'=>DBLAN_55, 'label'=> DBLAN_56, 'icon'=>'fas-search.glyph'), + 'convert_to_utf8' => array('diz'=>DBLAN_64,'label'=>DBLAN_65, 'icon'=>'fas-language.glyph'), + 'correct_perms' => array('diz'=>DBLAN_66,'label'=>DBLAN_67, 'icon'=>'fas-folder.glyph'), 'backup' => array('diz'=>DBLAN_68,'label'=>DBLAN_69, 'icon'=>'fas-archive.glyph') ); if(deftrue('e_DEVELOPER')) { - $this->_options['multisite'] = array('diz'=>"".DBLAN_114."", 'label'=> 'Multi-Site' ); + $this->_options['multisite'] = array('diz'=>"".DBLAN_114."", 'label'=> 'Multi-Site' , 'icon'=>'fas-clone.glyph'); $this->_options['github'] = array('diz'=>"".DBLAN_114." ".DBLAN_115."", 'label'=> DBLAN_112, 'icon'=>'fab-github.glyph' ); } @@ -1032,7 +1032,8 @@ class system_tools private function render_options() { - $mes = e107::getMessage(); + $mes = e107::getMessage(); + $tp = e107::getParser(); $text = "
@@ -1052,7 +1053,7 @@ class system_tools { $text .= ""; diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index cbc7565d3..e28a4c95e 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -690,6 +690,12 @@ $text .= " ".$frm->radio_switch('admin_collapse_sidebar', varset($pref['admin_collapse_sidebar']))." + + + + ".$frm->radio('admin_helptip_location',['-1'=> LAN_DISABLED, '0' => PRFLAN_286, '1' => PRFLAN_287], varset($pref['admin_helptip_location']))." + + diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index 74fe1b348..ecdf89fc7 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -6,6 +6,7 @@ 0 0 0 + 1 0 css/modern-light.css diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index f42af7369..0c9f151e0 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -7326,6 +7326,11 @@ var_dump($select_options);*/ $required_help = false; $hidden_fields = array(); + + $helpTipLocation = (int) e107::getPref('admin_helptip_location'); + $help = ''; + + foreach($fdata['fields'] as $key => $att) { if($tab !== false && varset($att['tab'], 0) !== $tab) @@ -7350,8 +7355,11 @@ var_dump($select_options);*/ parse_str($parms, $parms); } $label = !empty($att['note']) ? '
'.deftrue($att['note'], $att['note']).'
' : ''; - $help = !empty($att['help']) ? '
'.deftrue($att['help'], $att['help']).'
' : ''; + if($helpTipLocation !== -1) // -1 = help disabled. + { + $help = !empty($att['help']) ? '
'.deftrue($att['help'], $att['help']).'
' : ''; + } $valPath = trim(vartrue($att['dataPath'], $key), '/'); $keyName = $key; @@ -7436,8 +7444,10 @@ var_dump($select_options);*/ } $leftCell = "".defset(vartrue($att['title']), vartrue($att['title'])). '' .$required.$label; - $rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId()). ' ' .$help; + $leftCell .= (!empty($help) && $helpTipLocation === 1) ? "".$help : ''; + $rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId()). ' '.$help; + $rightCell .= (!empty($help) && $helpTipLocation === 0) ? $help : ''; $att['writeParms'] = $writeParms; $text .= $this->renderCreateFieldRow($leftCell, $rightCell, $att); diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index f7525b730..1b18683e0 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -305,4 +305,7 @@ define("PRFLAN_281", "The 2 links above are used on various page on this site (e define("PRFLAN_282", "Session Save Method"); define("PRFLAN_283", "Display navigation-bar labels"); -define("PRFLAN_284", "Collapse navigation side-bar by default"); \ No newline at end of file +define("PRFLAN_284", "Collapse navigation side-bar by default"); +define("PRFLAN_285", "Display field help tips"); +define("PRFLAN_286", "When hovering over the field."); +define("PRFLAN_287", "When hovering on a help icon to the left of the field."); diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css index ed93dd450..4122bdc4d 100644 --- a/e107_themes/bootstrap3/admin_style.css +++ b/e107_themes/bootstrap3/admin_style.css @@ -88,7 +88,8 @@ a.core-mainpanel-link-icon:hover { text-decoration: none; filter: none; } #core-admin-log-list-form .fa-exclamation-circle { color: #FAA732 } #core-admin-log-list-form .fa-warning { color: #ee5f5b } - +.admin-ui-help-tip { padding-top: 5px; font-size: 18px; cursor: help; color: rgb(192, 192, 192,0.5); float: right; } +.admin-ui-help-tip:hover { color: #5bc0de; } /* #admin-ui-carousel .carousel-inner { min-height: 65vh; } diff --git a/e107_themes/bootstrap3/css/modern-dark.css b/e107_themes/bootstrap3/css/modern-dark.css index 337d8fcde..3e5151aa1 100644 --- a/e107_themes/bootstrap3/css/modern-dark.css +++ b/e107_themes/bootstrap3/css/modern-dark.css @@ -908,11 +908,11 @@ select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.i .nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#2f2f2f;border-color:#77acd9} .nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5} .nav>li>a>img{max-width:none} -.nav-tabs{border-bottom:1px solid #999} +.nav-tabs{border-bottom:1px solid rgba(255,255,255,0.2);} .nav-tabs>li{float:left;margin-bottom:-1px} .nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0} -.nav-tabs>li>a:hover{border-color:#999} -.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#fff;background-color:#373737;border:1px solid #999;border-bottom-color:transparent;cursor:default} +.nav-tabs>li>a:hover{border-color:rgba(255,255,255,0.2);border-bottom-color:rgba(255,255,255,0.15);} +.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#fff;background-color:#373737;border:1px solid rgba(255,255,255,0.15);border-bottom-color:transparent;cursor:default} .nav-tabs.nav-justified{width:100%;border-bottom:0} .nav-tabs.nav-justified>li{float:none} .nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px;margin-right:0;border-radius:4px} @@ -1523,7 +1523,7 @@ thead tr{background-color:#363636;background-image:linear-gradient(to bottom,#44 .bootstrap-select.btn-group .dropdown-menu .optgroup-div{color:#363636} .btn-primary>[class^=icon-],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-menu>.active>a>[class^=icon-],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^=icon-],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^=icon-],.icon-white,.nav-list>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^=icon-],.nav-pills>.active>a>[class*=" icon-"],.nav-pills>.active>a>[class^=icon-],.nav-tabs>li>a>[class^=icon-],.navbar-inverse .nav>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^=icon-],h1>[class^=icon-],h2>[class^=icon-],h3>[class^=icon-],h4>[class^=icon-],h5>[class^=icon-]{background-image:none} #admin-ui-nav-menu a.link-active{color:#fff} -.tab-content{background-color:#373737} +.tab-content{background-color:#373737; border-left:1px solid rgba(255,255,255,0.1); border-right:1px solid rgba(255,255,255,0.1);border-bottom:1px solid rgba(255,255,255,0.1); border-bottom-left-radius: 4px;border-bottom-right-radius: 4px;border-top-right-radius: 4px;} input:invalid:focus,select:invalid:focus,textarea:invalid:focus{border-color:red;box-shadow:0 1px 1px 0 rgba(255,0,0,.75) inset} td.forumheader{background-image:linear-gradient(#303030,#212121 60%,#171717);filter:none} diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 71ad94fbb..2d2cfadfc 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -87,7 +87,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; e107.behaviors.fieldHelpTooltip = { attach: function (context, settings) { - var selector = 'div.tbox,div.checkboxes,input,textarea,select,label,.e-tip,div.form-control'; + var selector = '.admin-ui-help-tip,div.tbox,div.checkboxes,input,textarea,select,label,.e-tip,div.form-control'; $(context).find(selector).once('field-help-tooltip').each(function () {