mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 17:15:55 +00:00
rework controls to accept parameters as array
This commit is contained in:
@@ -644,8 +644,10 @@ class Pref_Feeds extends Handler_Protected {
|
||||
$local_purge_intervals = [ T_nsprintf('%d day', '%d days', $purge_interval, $purge_interval) ];
|
||||
}
|
||||
|
||||
print \Controls\select_hash("purge_interval", $purge_interval, $local_purge_intervals,
|
||||
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
|
||||
print \Controls\select_hash("purge_interval",
|
||||
$purge_interval,
|
||||
$local_purge_intervals,
|
||||
(FORCE_ARTICLE_PURGE == 0) ? [] : ["disabled" => 1]);
|
||||
|
||||
print "</fieldset>";
|
||||
|
||||
@@ -815,8 +817,6 @@ class Pref_Feeds extends Handler_Protected {
|
||||
|
||||
print_notice("Enable the options you wish to apply using checkboxes on the right:");
|
||||
|
||||
print "<p>";
|
||||
|
||||
print \Controls\hidden_tag("ids", "$feed_ids");
|
||||
print \Controls\hidden_tag("op", "pref-feeds");
|
||||
print \Controls\hidden_tag("method", "batchEditSave");
|
||||
@@ -846,8 +846,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
print "<fieldset>";
|
||||
|
||||
print "<label>" . __('Language:') . "</label> ";
|
||||
print \Controls\select_tag("feed_language", "", $this::get_ts_languages(),
|
||||
'disabled="1"');
|
||||
print \Controls\select_tag("feed_language", "", $this::get_ts_languages(), ["disabled"=> 1]);
|
||||
|
||||
$this->batch_edit_cbox("feed_language");
|
||||
|
||||
@@ -868,7 +867,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
$local_update_intervals = $update_intervals;
|
||||
$local_update_intervals[0] .= sprintf(" (%s)", $update_intervals[get_pref("DEFAULT_UPDATE_INTERVAL")]);
|
||||
|
||||
print \Controls\select_hash("update_interval", "", $local_update_intervals, 'disabled="1"');
|
||||
print \Controls\select_hash("update_interval", "", $local_update_intervals, ["disabled" => 1]);
|
||||
|
||||
$this->batch_edit_cbox("update_interval");
|
||||
|
||||
@@ -890,7 +889,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
else
|
||||
$local_purge_intervals[0] .= " " . sprintf("(%s)", __("Disabled"));
|
||||
|
||||
print \Controls\select_hash("purge_interval", "", $local_purge_intervals, 'disabled="1"');
|
||||
print \Controls\select_hash("purge_interval", "", $local_purge_intervals, ["disabled" => 1]);
|
||||
|
||||
$this->batch_edit_cbox("purge_interval");
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ class Pref_Filters extends Handler_Protected {
|
||||
dojoType='fox.form.Select'");*/
|
||||
|
||||
print \Controls\select_labels("action_param_label", $action_param,
|
||||
"style=\"$label_param_hidden\"",
|
||||
["style" => $label_param_hidden],
|
||||
"filterDlg_actionParamLabel");
|
||||
|
||||
$filter_actions = PluginHost::getInstance()->get_filter_actions();
|
||||
@@ -909,16 +909,16 @@ class Pref_Filters extends Handler_Protected {
|
||||
}
|
||||
|
||||
if (count($filter_action_hash) == 0) {
|
||||
$filter_plugin_disabled = "disabled";
|
||||
$filter_plugin_disabled = ["disabled" => "1"];
|
||||
|
||||
$filter_action_hash["no-data"] = __("No actions available");
|
||||
|
||||
} else {
|
||||
$filter_plugin_disabled = "";
|
||||
$filter_plugin_disabled = [];
|
||||
}
|
||||
|
||||
print \Controls\select_hash("action_param_plugin", $action_param, $filter_action_hash,
|
||||
"style=\"$plugin_param_hidden\" $filter_plugin_disabled",
|
||||
array_merge(["style" => $plugin_param_hidden], $filter_plugin_disabled),
|
||||
"filterDlg_actionParamPlugin");
|
||||
|
||||
print "</span>";
|
||||
|
||||
@@ -664,13 +664,13 @@ class Pref_Prefs extends Handler_Protected {
|
||||
|
||||
if ($pref_name == "USER_LANGUAGE") {
|
||||
print \Controls\select_hash($pref_name, $value, get_translations(),
|
||||
"style='width : 220px; margin : 0px'");
|
||||
["style" => 'width : 220px; margin : 0px']);
|
||||
|
||||
} else if ($pref_name == "USER_TIMEZONE") {
|
||||
|
||||
$timezones = explode("\n", file_get_contents("lib/timezones.txt"));
|
||||
|
||||
print \Controls\select_tag($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"');
|
||||
print \Controls\select_tag($pref_name, $value, $timezones, ["dojoType" => "dijit.form.FilteringSelect"]);
|
||||
|
||||
} else if ($pref_name == "BLACKLISTED_TAGS") { # TODO: other possible <textarea> prefs go here
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class Pref_System extends Handler_Administrative {
|
||||
E_USER_ERROR => __("Errors"),
|
||||
E_USER_WARNING => __("Warnings"),
|
||||
E_USER_NOTICE => __("Everything")
|
||||
], 'onchange="Helpers.EventLog.refresh()"', "severity") ?>
|
||||
], ["onchange"=> "Helpers.EventLog.refresh()"], "severity") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user