diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 4e57ea846aabe297936119153ccfcb4bd7b1ed06..bce3c171bd522fcdc3fd83b127ae2d5d7bf2210e 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -66,9 +66,13 @@ class Pref_Prefs extends Handler_Protected { ] ]; + $this->pref_help_bottom = [ + "BLACKLISTED_TAGS" => __("Never apply these tags automatically (comma-separated list)."), + ]; + $this->pref_help = [ "ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate articles"), ""), - "BLACKLISTED_TAGS" => array(__("Blacklisted tags"), __("Never apply these tags automatically (comma-separated list).")), + "BLACKLISTED_TAGS" => array(__("Blacklisted tags"), ""), "DEFAULT_SEARCH_LANGUAGE" => array(__("Default language"), __("Used for full-text search")), "CDM_AUTO_CATCHUP" => array(__("Mark read on scroll"), __("Mark articles as read as you scroll past them")), "CDM_EXPANDED" => array(__("Always expand articles")), @@ -192,6 +196,12 @@ class Pref_Prefs extends Handler_Protected { case 'USER_CSS_THEME': if (!$need_reload) $need_reload = get_pref($pref_name) != $value; break; + + case 'BLACKLISTED_TAGS': + $cats = FeedItem_Common::normalize_categories(explode(",", $value)); + asort($cats); + $value = implode(", ", $cats); + break; } set_pref($pref_name, $value); @@ -671,6 +681,19 @@ class Pref_Prefs extends Handler_Protected { $timezones = explode("\n", file_get_contents("lib/timezones.txt")); print_select($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"'); + + } else if ($pref_name == "BLACKLISTED_TAGS") { # TODO: other possible <textarea> prefs go here + + print "<div>"; + + print "<textarea dojoType='dijit.form.SimpleTextarea' rows='4' + style='width: 500px; font-size : 12px;' + name='$pref_name'>$value</textarea><br/>"; + + print "<div class='help-text-bottom text-muted'>" . $this->pref_help_bottom[$pref_name] . "</div>"; + + print "</div>"; + } else if ($pref_name == "USER_CSS_THEME") { $themes = array_merge(glob("themes/*.php"), glob("themes/*.css"), glob("themes.local/*.css")); @@ -725,8 +748,8 @@ class Pref_Prefs extends Handler_Protected { print "<input type='checkbox' name='$pref_name' $checked $disabled dojoType='dijit.form.CheckBox' id='CB_$pref_name' value='1'>"; - } else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', - 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) { + } else if (in_array($pref_name, ['FRESH_ARTICLE_MAX_AGE', + 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT'])) { $regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : ''; diff --git a/themes/compact.css b/themes/compact.css index 2ce41eacced3ecac43bd706eca475c55cf140aae..c2828c5879b68293196141f401e0f2c8abcfe863 100644 --- a/themes/compact.css +++ b/themes/compact.css @@ -1472,6 +1472,9 @@ body.ttrss_prefs .user-css-editor { } body.ttrss_prefs fieldset.prefs { min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; } body.ttrss_prefs fieldset.prefs label:first-of-type { min-width: 300px; @@ -1480,6 +1483,9 @@ body.ttrss_prefs fieldset.prefs .help-text { display: inline-block; margin-left: 10px; } +body.ttrss_prefs fieldset.prefs .help-text-bottom { + margin-top: 10px; +} body.ttrss_prefs fieldset.plugin label.description { width: 600px; margin-right: 150px; diff --git a/themes/compact_night.css b/themes/compact_night.css index 4b939a00f1535a917077af3d53e3b5b05be04caf..6666787b0d35747b2ea4174b7bacd5b47329bf6c 100644 --- a/themes/compact_night.css +++ b/themes/compact_night.css @@ -1472,6 +1472,9 @@ body.ttrss_prefs .user-css-editor { } body.ttrss_prefs fieldset.prefs { min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; } body.ttrss_prefs fieldset.prefs label:first-of-type { min-width: 300px; @@ -1480,6 +1483,9 @@ body.ttrss_prefs fieldset.prefs .help-text { display: inline-block; margin-left: 10px; } +body.ttrss_prefs fieldset.prefs .help-text-bottom { + margin-top: 10px; +} body.ttrss_prefs fieldset.plugin label.description { width: 600px; margin-right: 150px; diff --git a/themes/light.css b/themes/light.css index facd16c05ac178267de9d3b7b5d6c8c23261df6d..d2f5aa4eeaabb5190daa4d5c5f9783d855979fa4 100644 --- a/themes/light.css +++ b/themes/light.css @@ -1472,6 +1472,9 @@ body.ttrss_prefs .user-css-editor { } body.ttrss_prefs fieldset.prefs { min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; } body.ttrss_prefs fieldset.prefs label:first-of-type { min-width: 300px; @@ -1480,6 +1483,9 @@ body.ttrss_prefs fieldset.prefs .help-text { display: inline-block; margin-left: 10px; } +body.ttrss_prefs fieldset.prefs .help-text-bottom { + margin-top: 10px; +} body.ttrss_prefs fieldset.plugin label.description { width: 600px; margin-right: 150px; diff --git a/themes/light/prefs.less b/themes/light/prefs.less index 92084a9c85d20a2af1888b487dbc8ac03a335cba..4d3e93688a7eb9dfc7b87d815c3bd7739b198cd4 100644 --- a/themes/light/prefs.less +++ b/themes/light/prefs.less @@ -82,6 +82,9 @@ body.ttrss_prefs { fieldset.prefs { min-height : 30px; + display : flex; + flex-direction : row; + align-items: center; label:first-of-type { min-width : 300px; @@ -91,6 +94,10 @@ body.ttrss_prefs { display : inline-block; margin-left : 10px; } + + .help-text-bottom { + margin-top : 10px; + } } fieldset.plugin { diff --git a/themes/night.css b/themes/night.css index 88ae685d29f2e61d2dfd3a78fdadaf789ca15193..face0193291209884d7b7bcb92ca1d04a29073a3 100644 --- a/themes/night.css +++ b/themes/night.css @@ -1473,6 +1473,9 @@ body.ttrss_prefs .user-css-editor { } body.ttrss_prefs fieldset.prefs { min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; } body.ttrss_prefs fieldset.prefs label:first-of-type { min-width: 300px; @@ -1481,6 +1484,9 @@ body.ttrss_prefs fieldset.prefs .help-text { display: inline-block; margin-left: 10px; } +body.ttrss_prefs fieldset.prefs .help-text-bottom { + margin-top: 10px; +} body.ttrss_prefs fieldset.plugin label.description { width: 600px; margin-right: 150px; diff --git a/themes/night_blue.css b/themes/night_blue.css index b80699747d9a0e7baffe1ec9d3dac88a99326077..d5cda927f6dcdad4abdaa1e1907f577ed9b6adcf 100644 --- a/themes/night_blue.css +++ b/themes/night_blue.css @@ -1473,6 +1473,9 @@ body.ttrss_prefs .user-css-editor { } body.ttrss_prefs fieldset.prefs { min-height: 30px; + display: flex; + flex-direction: row; + align-items: center; } body.ttrss_prefs fieldset.prefs label:first-of-type { min-width: 300px; @@ -1481,6 +1484,9 @@ body.ttrss_prefs fieldset.prefs .help-text { display: inline-block; margin-left: 10px; } +body.ttrss_prefs fieldset.prefs .help-text-bottom { + margin-top: 10px; +} body.ttrss_prefs fieldset.plugin label.description { width: 600px; margin-right: 150px;