summaryrefslogtreecommitdiff
path: root/classes/pref
diff options
context:
space:
mode:
Diffstat (limited to 'classes/pref')
-rwxr-xr-xclasses/pref/feeds.php71
-rwxr-xr-xclasses/pref/filters.php28
-rw-r--r--classes/pref/labels.php4
-rw-r--r--classes/pref/prefs.php22
-rw-r--r--classes/pref/users.php8
5 files changed, 73 insertions, 60 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index 40bbc7ef3..6cbf15a58 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -66,9 +66,9 @@ class Pref_Feeds extends Handler_Protected {
$cat['items'] = array();
$cat['checkbox'] = false;
$cat['type'] = 'category';
- $cat['unread'] = 0;
- $cat['child_unread'] = 0;
- $cat['auxcounter'] = 0;
+ $cat['unread'] = -1;
+ $cat['child_unread'] = -1;
+ $cat['auxcounter'] = -1;
$cat['parent_id'] = $cat_id;
$cat['items'] = $this->get_category_items($line['id']);
@@ -95,10 +95,10 @@ class Pref_Feeds extends Handler_Protected {
$feed = array();
$feed['id'] = 'FEED:' . $feed_line['id'];
$feed['bare_id'] = (int)$feed_line['id'];
- $feed['auxcounter'] = 0;
+ $feed['auxcounter'] = -1;
$feed['name'] = $feed_line['title'];
$feed['checkbox'] = false;
- $feed['unread'] = 0;
+ $feed['unread'] = -1;
$feed['error'] = $feed_line['last_error'];
$feed['icon'] = Feeds::getFeedIcon($feed_line['id']);
$feed['param'] = make_local_datetime(
@@ -153,14 +153,14 @@ class Pref_Feeds extends Handler_Protected {
$item = array();
$item['id'] = 'FEED:' . $feed_id;
$item['bare_id'] = (int)$feed_id;
- $item['auxcounter'] = 0;
+ $item['auxcounter'] = -1;
$item['name'] = $feed['title'];
$item['checkbox'] = false;
$item['error'] = '';
$item['icon'] = $feed['icon'];
$item['param'] = '';
- $item['unread'] = 0; //$feed['sender']->get_unread($feed['id']);
+ $item['unread'] = -1;
$item['type'] = 'feed';
array_push($cat['items'], $item);
@@ -218,13 +218,13 @@ class Pref_Feeds extends Handler_Protected {
$cat = array();
$cat['id'] = 'CAT:' . $line['id'];
$cat['bare_id'] = (int)$line['id'];
- $cat['auxcounter'] = 0;
+ $cat['auxcounter'] = -1;
$cat['name'] = $line['title'];
$cat['items'] = array();
$cat['checkbox'] = false;
$cat['type'] = 'category';
- $cat['unread'] = 0;
- $cat['child_unread'] = 0;
+ $cat['unread'] = -1;
+ $cat['child_unread'] = -1;
$cat['items'] = $this->get_category_items($line['id']);
@@ -242,13 +242,13 @@ class Pref_Feeds extends Handler_Protected {
$cat = array();
$cat['id'] = 'CAT:0';
$cat['bare_id'] = 0;
- $cat['auxcounter'] = 0;
+ $cat['auxcounter'] = -1;
$cat['name'] = __("Uncategorized");
$cat['items'] = array();
$cat['type'] = 'category';
$cat['checkbox'] = false;
- $cat['unread'] = 0;
- $cat['child_unread'] = 0;
+ $cat['unread'] = -1;
+ $cat['child_unread'] = -1;
$fsth = $this->pdo->prepare("SELECT id, title,last_error,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
@@ -263,14 +263,14 @@ class Pref_Feeds extends Handler_Protected {
$feed = array();
$feed['id'] = 'FEED:' . $feed_line['id'];
$feed['bare_id'] = (int)$feed_line['id'];
- $feed['auxcounter'] = 0;
+ $feed['auxcounter'] = -1;
$feed['name'] = $feed_line['title'];
$feed['checkbox'] = false;
$feed['error'] = $feed_line['last_error'];
$feed['icon'] = Feeds::getFeedIcon($feed_line['id']);
$feed['param'] = make_local_datetime(
$feed_line['last_updated'], true);
- $feed['unread'] = 0;
+ $feed['unread'] = -1;
$feed['type'] = 'feed';
$feed['updates_disabled'] = (int)($feed_line['update_interval'] < 0);
@@ -298,14 +298,14 @@ class Pref_Feeds extends Handler_Protected {
$feed = array();
$feed['id'] = 'FEED:' . $feed_line['id'];
$feed['bare_id'] = (int)$feed_line['id'];
- $feed['auxcounter'] = 0;
+ $feed['auxcounter'] = -1;
$feed['name'] = $feed_line['title'];
$feed['checkbox'] = false;
$feed['error'] = $feed_line['last_error'];
$feed['icon'] = Feeds::getFeedIcon($feed_line['id']);
$feed['param'] = make_local_datetime(
$feed_line['last_updated'], true);
- $feed['unread'] = 0;
+ $feed['unread'] = -1;
$feed['type'] = 'feed';
$feed['updates_disabled'] = (int)($feed_line['update_interval'] < 0);
@@ -571,7 +571,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>" . __('Place in category:') . "</label> ";
print_feed_cat_select("cat_id", $cat_id,
- 'dojoType="dijit.form.Select"');
+ 'dojoType="fox.form.Select"');
print "</fieldset>";
}
@@ -595,11 +595,14 @@ class Pref_Feeds extends Handler_Protected {
if (DB_TYPE == "pgsql") {
$feed_language = $row["feed_language"];
+ if (!$feed_language)
+ $feed_language = get_pref('DEFAULT_SEARCH_LANGUAGE');
+
print "<fieldset>";
print "<label>" . __('Language:') . "</label> ";
print_select("feed_language", $feed_language, $this::get_ts_languages(),
- 'dojoType="dijit.form.Select"');
+ 'dojoType="fox.form.Select"');
print "</fieldset>";
}
@@ -618,7 +621,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>".__("Interval:")."</label> ";
print_select_hash("update_interval", $update_interval, $update_intervals,
- 'dojoType="dijit.form.Select"');
+ 'dojoType="fox.form.Select"');
print "</fieldset>";
@@ -631,7 +634,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>" . __('Article purging:') . "</label> ";
print_select_hash("purge_interval", $purge_interval, $purge_intervals,
- 'dojoType="dijit.form.Select" ' .
+ 'dojoType="fox.form.Select" ' .
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
print "</fieldset>";
@@ -823,7 +826,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>" . __('Place in category:') . "</label> ";
print_feed_cat_select("cat_id", false,
- 'disabled="1" dojoType="dijit.form.Select"');
+ 'disabled="1" dojoType="fox.form.Select"');
$this->batch_edit_cbox("cat_id");
@@ -837,7 +840,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>" . __('Language:') . "</label> ";
print_select("feed_language", "", $this::get_ts_languages(),
- 'disabled="1" dojoType="dijit.form.Select"');
+ 'disabled="1" dojoType="fox.form.Select"');
$this->batch_edit_cbox("feed_language");
@@ -856,7 +859,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>".__("Interval:")."</label> ";
print_select_hash("update_interval", "", $update_intervals,
- 'disabled="1" dojoType="dijit.form.Select"');
+ 'disabled="1" dojoType="fox.form.Select"');
$this->batch_edit_cbox("update_interval");
@@ -871,7 +874,7 @@ class Pref_Feeds extends Handler_Protected {
print "<label>" . __('Article purging:') . "</label> ";
print_select_hash("purge_interval", "", $purge_intervals,
- 'disabled="1" dojoType="dijit.form.Select"');
+ 'disabled="1" dojoType="fox.form.Select"');
$this->batch_edit_cbox("purge_interval");
@@ -1205,7 +1208,7 @@ class Pref_Feeds extends Handler_Protected {
print '<div dojoType="dijit.layout.BorderContainer" gutters="false">';
- print "<div region='top' dojoType=\"dijit.Toolbar\">"; #toolbar
+ print "<div region='top' dojoType=\"fox.Toolbar\">"; #toolbar
print "<div style='float : right; padding-right : 4px;'>
<input dojoType=\"dijit.form.TextBox\" id=\"feed_search\" size=\"20\" type=\"search\"
@@ -1214,7 +1217,7 @@ class Pref_Feeds extends Handler_Protected {
__('Search')."</button>
</div>";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('feedTree').model.setAllChecked(true)\"
@@ -1223,7 +1226,7 @@ class Pref_Feeds extends Handler_Protected {
dojoType=\"dijit.MenuItem\">".__('None')."</div>";
print "</div></div>";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Feeds')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"CommonDialogs.quickAddFeed()\"
@@ -1239,7 +1242,7 @@ class Pref_Feeds extends Handler_Protected {
print "</div></div>";
if (get_pref('ENABLE_FEED_CATS')) {
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Categories')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('feedTree').createCategory()\"
@@ -1446,8 +1449,8 @@ class Pref_Feeds extends Handler_Protected {
ORDER BY last_article");
$sth->execute([$_SESSION['uid']]);
- print "<div dojoType='dijit.Toolbar'>";
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.Toolbar'>";
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType='dijit.Menu' style='display: none'>";
print "<div onclick=\"Tables.select('inactive-feeds-list', true)\"
@@ -1503,8 +1506,8 @@ class Pref_Feeds extends Handler_Protected {
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?");
$sth->execute([$_SESSION['uid']]);
- print "<div dojoType=\"dijit.Toolbar\">";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.Toolbar\">";
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"Tables.select('error-feeds-list', true)\"
@@ -1659,7 +1662,7 @@ class Pref_Feeds extends Handler_Protected {
if (get_pref('ENABLE_FEED_CATS')) {
print "<fieldset>";
print "<label>" . __('Place in category:') . "</label> ";
- print_feed_cat_select("cat", false, 'dojoType="dijit.form.Select"');
+ print_feed_cat_select("cat", false, 'dojoType="fox.form.Select"');
print "</fieldset>";
}
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index 37a7236ee..041951b35 100755
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -354,9 +354,9 @@ class Pref_Filters extends Handler_Protected {
print "<header class='horizontal'>".__("Match")."</header>";
print "<section>";
- print "<div dojoType=\"dijit.Toolbar\">";
+ print "<div dojoType=\"fox.Toolbar\">";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('filterEditDlg').selectRules(true)\"
@@ -414,9 +414,9 @@ class Pref_Filters extends Handler_Protected {
print "<section>";
- print "<div dojoType=\"dijit.Toolbar\">";
+ print "<div dojoType=\"fox.Toolbar\">";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('filterEditDlg').selectActions(true)\"
@@ -757,7 +757,7 @@ class Pref_Filters extends Handler_Protected {
print "<div dojoType='dijit.layout.BorderContainer' gutters='false'>";
print "<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='top'>";
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
if (array_key_exists("search", $_REQUEST)) {
$_SESSION["prefs_filter_search"] = $filter_search;
@@ -772,7 +772,7 @@ class Pref_Filters extends Handler_Protected {
__('Search')."</button>
</div>";
- print "<div dojoType=\"dijit.form.DropDownButton\">".
+ print "<div dojoType=\"fox.form.DropDownButton\">".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('filterTree').model.setAllChecked(true)\"
@@ -856,9 +856,9 @@ class Pref_Filters extends Handler_Protected {
print "<header class='horizontal'>".__("Match")."</header >";
print "<section>";
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType='dijit.Menu' style='display: none'>";
print "<div onclick=\"dijit.byId('filterEditDlg').selectRules(true)\"
@@ -885,9 +885,9 @@ class Pref_Filters extends Handler_Protected {
print "<section>";
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType='dijit.Menu' style='display: none'>";
print "<div onclick=\"dijit.byId('filterEditDlg').selectActions(true)\"
@@ -993,7 +993,7 @@ class Pref_Filters extends Handler_Protected {
print "<fieldset>";
print "<label style='display : inline'>". __("on field") . "</label> ";
print_select_hash("filter_type", $filter_type, $filter_types,
- 'dojoType="dijit.form.Select"');
+ 'dojoType="fox.form.Select"');
print "<label style='padding-left : 10px; display : inline'>" . __("in") . "</label> ";
print "</fieldset>";
@@ -1042,7 +1042,7 @@ class Pref_Filters extends Handler_Protected {
print "<section>";
- print "<select name='action_id' dojoType='dijit.form.Select'
+ print "<select name='action_id' dojoType='fox.form.Select'
onchange='Filters.filterDlgCheckAction(this)'>";
$res = $this->pdo->query("SELECT id,description FROM ttrss_filter_actions
@@ -1073,7 +1073,7 @@ class Pref_Filters extends Handler_Protected {
print_label_select("action_param_label", $action_param,
"id='filterDlg_actionParamLabel' style=\"$label_param_hidden\"
- dojoType='dijit.form.Select'");
+ dojoType='fox.form.Select'");
$filter_actions = PluginHost::getInstance()->get_filter_actions();
$filter_action_hash = array();
@@ -1096,7 +1096,7 @@ class Pref_Filters extends Handler_Protected {
}
print_select_hash("filterDlg_actionParamPlugin", $action_param, $filter_action_hash,
- "style=\"$plugin_param_hidden\" dojoType='dijit.form.Select' $filter_plugin_disabled",
+ "style=\"$plugin_param_hidden\" dojoType='fox.form.Select' $filter_plugin_disabled",
"action_param_plugin");
print "</span>";
diff --git a/classes/pref/labels.php b/classes/pref/labels.php
index 5dadddab4..ec9667441 100644
--- a/classes/pref/labels.php
+++ b/classes/pref/labels.php
@@ -251,9 +251,9 @@ class Pref_Labels extends Handler_Protected {
print "<div dojoType='dijit.layout.BorderContainer' gutters='false'>";
print "<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='top'>";
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"dijit.byId('labelTree').model.setAllChecked(true)\"
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index cb10e2322..cb19998ce 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -28,6 +28,7 @@ class Pref_Prefs extends Handler_Protected {
__('Feeds') => [
'DEFAULT_UPDATE_INTERVAL',
'FRESH_ARTICLE_MAX_AGE',
+ 'DEFAULT_SEARCH_LANGUAGE',
'BLOCK_SEPARATOR',
'ENABLE_FEED_CATS',
'BLOCK_SEPARATOR',
@@ -68,6 +69,7 @@ class Pref_Prefs extends Handler_Protected {
$this->pref_help = [
"ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate articles"), ""),
"BLACKLISTED_TAGS" => array(__("Blacklisted tags"), __("Never apply these tags automatically (comma-separated list).")),
+ "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")),
"COMBINED_DISPLAY_MODE" => array(__("Combined mode"), __("Show flat list of articles instead of separate panels")),
@@ -560,6 +562,10 @@ class Pref_Prefs extends Handler_Protected {
continue;
}
+ if ($pref_name == "DEFAULT_SEARCH_LANGUAGE" && DB_TYPE != "pgsql") {
+ continue;
+ }
+
if ($item = $prefs_available[$pref_name]) {
print "<fieldset class='prefs'>";
@@ -573,7 +579,7 @@ class Pref_Prefs extends Handler_Protected {
if ($pref_name == "USER_LANGUAGE") {
print_select_hash($pref_name, $value, get_translations(),
- "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
+ "style='width : 220px; margin : 0px' dojoType='fox.form.Select'");
} else if ($pref_name == "USER_TIMEZONE") {
@@ -589,7 +595,7 @@ class Pref_Prefs extends Handler_Protected {
if (!theme_exists($value)) $value = "default.php";
- print "<select name='$pref_name' id='$pref_name' dojoType='dijit.form.Select'>";
+ print "<select name='$pref_name' id='$pref_name' dojoType='fox.form.Select'>";
$issel = $value == "default.php" ? "selected='selected'" : "";
print "<option $issel value='default.php'>".__("default")."</option>";
@@ -612,7 +618,11 @@ class Pref_Prefs extends Handler_Protected {
global $update_intervals_nodefault;
print_select_hash($pref_name, $value, $update_intervals_nodefault,
- 'dojoType="dijit.form.Select"');
+ 'dojoType="fox.form.Select"');
+ } else if ($pref_name == "DEFAULT_SEARCH_LANGUAGE") {
+
+ print_select($pref_name, $value, Pref_Feeds::get_ts_languages(),
+ 'dojoType="fox.form.Select"');
} else if ($type_name == "bool") {
@@ -705,7 +715,7 @@ class Pref_Prefs extends Handler_Protected {
print_hidden("op", "pref-prefs");
print_hidden("method", "saveconfig");
- print "<div dojoType=\"dijit.form.ComboButton\" type=\"submit\" class=\"alt-primary\">
+ print "<div dojoType=\"fox.form.ComboButton\" type=\"submit\" class=\"alt-primary\">
<span>".__('Save configuration')."</span>
<div dojoType=\"dijit.DropDownMenu\">
<div dojoType=\"dijit.MenuItem\"
@@ -1011,9 +1021,9 @@ class Pref_Prefs extends Handler_Protected {
}
function editPrefProfiles() {
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType='dijit.Menu' style='display: none'>";
print "<div onclick=\"Tables.select('pref-profiles-list', true)\"
diff --git a/classes/pref/users.php b/classes/pref/users.php
index 7b75bb872..680290b74 100644
--- a/classes/pref/users.php
+++ b/classes/pref/users.php
@@ -69,10 +69,10 @@ class Pref_Users extends Handler_Protected {
if (!$sel_disabled) {
print_select_hash("access_level", $access_level, $access_level_names,
- "dojoType=\"dijit.form.Select\" $sel_disabled");
+ "dojoType=\"fox.form.Select\" $sel_disabled");
} else {
print_select_hash("", $access_level, $access_level_names,
- "dojoType=\"dijit.form.Select\" $sel_disabled");
+ "dojoType=\"fox.form.Select\" $sel_disabled");
print_hidden("access_level", "$access_level");
}
@@ -313,7 +313,7 @@ class Pref_Users extends Handler_Protected {
print "<div dojoType='dijit.layout.BorderContainer' gutters='false'>";
print "<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='top'>";
- print "<div dojoType='dijit.Toolbar'>";
+ print "<div dojoType='fox.Toolbar'>";
$user_search = trim(clean($_REQUEST["search"]));
@@ -336,7 +336,7 @@ class Pref_Users extends Handler_Protected {
$sort = "login";
}
- print "<div dojoType='dijit.form.DropDownButton'>".
+ print "<div dojoType='fox.form.DropDownButton'>".
"<span>" . __('Select')."</span>";
print "<div dojoType='dijit.Menu' style='display: none'>";
print "<div onclick=\"Tables.select('prefUserList', true)\"