mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 12:25:56 +00:00
add namespaced controls with unified naming; deprecated old-style control shortcuts
This commit is contained in:
@@ -583,7 +583,7 @@ class Feeds extends Handler_Protected {
|
||||
|
||||
function subscribeToFeed() {
|
||||
print json_encode([
|
||||
"cat_select" => format_feed_cat_select("cat", false, 'dojoType="fox.form.Select"')
|
||||
"cat_select" => \Controls\select_feeds_cats("cat")
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -607,8 +607,8 @@ class Feeds extends Handler_Protected {
|
||||
if (DB_TYPE == "pgsql") {
|
||||
print "<fieldset>";
|
||||
print "<label class='inline'>" . __("Language:") . "</label>";
|
||||
print_select("search_language", get_pref('DEFAULT_SEARCH_LANGUAGE'), Pref_Feeds::get_ts_languages(),
|
||||
"dojoType='fox.form.Select' title=\"".__('Used for word stemming')."\"");
|
||||
print \Controls\select_tag("search_language", get_pref('DEFAULT_SEARCH_LANGUAGE'), Pref_Feeds::get_ts_languages(),
|
||||
"title=\"".__('Used for word stemming')."\"");
|
||||
print "</fieldset>";
|
||||
}
|
||||
|
||||
@@ -668,6 +668,15 @@ class Feeds extends Handler_Protected {
|
||||
display : none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
dojoConfig = {
|
||||
async: true,
|
||||
cacheBust: "<?= get_scripts_timestamp(); ?>",
|
||||
packages: [
|
||||
{ name: "fox", location: "../../js" },
|
||||
]
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
echo javascript_tag("lib/prototype.js");
|
||||
echo javascript_tag("js/utility.js");
|
||||
@@ -677,7 +686,7 @@ class Feeds extends Handler_Protected {
|
||||
</head>
|
||||
<body class="flat ttrss_utility feed_debugger css_loading">
|
||||
<script type="text/javascript">
|
||||
require(['dojo/parser', "dojo/ready", 'dijit/form/Button','dijit/form/CheckBox', 'dijit/form/Select', 'dijit/form/Form',
|
||||
require(['dojo/parser', "dojo/ready", 'dijit/form/Button','dijit/form/CheckBox', 'fox/form/Select', 'dijit/form/Form',
|
||||
'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser, ready){
|
||||
ready(function() {
|
||||
parser.parse();
|
||||
@@ -697,9 +706,8 @@ class Feeds extends Handler_Protected {
|
||||
|
||||
<fieldset>
|
||||
<label>
|
||||
<?php print_select_hash("xdebug", $xdebug,
|
||||
[Debug::$LOG_VERBOSE => "LOG_VERBOSE", Debug::$LOG_EXTENDED => "LOG_EXTENDED"],
|
||||
'dojoType="dijit.form.Select"');
|
||||
<?= \Controls\select_hash("xdebug", $xdebug,
|
||||
[Debug::$LOG_VERBOSE => "LOG_VERBOSE", Debug::$LOG_EXTENDED => "LOG_EXTENDED"]);
|
||||
?></label>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -788,7 +788,7 @@ class Handler_Public extends Handler {
|
||||
?>
|
||||
<form method="post">
|
||||
<input type="hidden" name="op" value="subscribe">
|
||||
<?php print_hidden("csrf_token", $_SESSION["csrf_token"]) ?>
|
||||
<?= \Controls\hidden_tag("csrf_token", $_SESSION["csrf_token"]) ?>
|
||||
<fieldset>
|
||||
<label>Feed or site URL:</label>
|
||||
<input style="width: 300px" dojoType="dijit.form.ValidationTextBox" required="1" name="feed_url" value="<?= htmlspecialchars($feed_url) ?>">
|
||||
@@ -831,7 +831,7 @@ class Handler_Public extends Handler {
|
||||
|
||||
print "<form action='public.php'>";
|
||||
print "<input type='hidden' name='op' value='subscribe'>";
|
||||
print_hidden("csrf_token", $_SESSION["csrf_token"]);
|
||||
print \Controls\hidden_tag("csrf_token", $_SESSION["csrf_token"]);
|
||||
|
||||
print "<fieldset>";
|
||||
print "<label style='display : inline'>" . __("Multiple feed URLs found:") . "</label>";
|
||||
|
||||
@@ -563,15 +563,11 @@ class Pref_Feeds extends Handler_Protected {
|
||||
/* Category */
|
||||
|
||||
if (get_pref('ENABLE_FEED_CATS')) {
|
||||
|
||||
$cat_id = $row["cat_id"];
|
||||
|
||||
print "<fieldset>";
|
||||
|
||||
print "<label>" . __('Place in category:') . "</label> ";
|
||||
|
||||
print_feed_cat_select("cat_id", $cat_id,
|
||||
'dojoType="fox.form.Select"');
|
||||
print \Controls\select_feeds_cats("cat_id", $row["cat_id"]);
|
||||
|
||||
print "</fieldset>";
|
||||
}
|
||||
@@ -601,8 +597,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
print "<fieldset>";
|
||||
|
||||
print "<label>" . __('Language:') . "</label> ";
|
||||
print_select("feed_language", $feed_language, $this::get_ts_languages(),
|
||||
'dojoType="fox.form.Select"');
|
||||
print \Controls\select_tag("feed_language", $feed_language, $this::get_ts_languages());
|
||||
|
||||
print "</fieldset>";
|
||||
}
|
||||
@@ -623,8 +618,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_select_hash("update_interval", $update_interval, $local_update_intervals,
|
||||
'dojoType="fox.form.Select"');
|
||||
print \Controls\select_hash("update_interval", $update_interval, $local_update_intervals);
|
||||
|
||||
print "</fieldset>";
|
||||
|
||||
@@ -650,8 +644,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
$local_purge_intervals = [ T_nsprintf('%d day', '%d days', $purge_interval, $purge_interval) ];
|
||||
}
|
||||
|
||||
print_select_hash("purge_interval", $purge_interval, $local_purge_intervals,
|
||||
'dojoType="fox.form.Select" ' .
|
||||
print \Controls\select_hash("purge_interval", $purge_interval, $local_purge_intervals,
|
||||
((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
|
||||
|
||||
print "</fieldset>";
|
||||
@@ -857,8 +850,8 @@ class Pref_Feeds extends Handler_Protected {
|
||||
print "<fieldset>";
|
||||
|
||||
print "<label>" . __('Language:') . "</label> ";
|
||||
print_select("feed_language", "", $this::get_ts_languages(),
|
||||
'disabled="1" dojoType="fox.form.Select"');
|
||||
print \Controls\select_tag("feed_language", "", $this::get_ts_languages(),
|
||||
'disabled="1"');
|
||||
|
||||
$this->batch_edit_cbox("feed_language");
|
||||
|
||||
@@ -879,8 +872,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_select_hash("update_interval", "", $local_update_intervals,
|
||||
'disabled="1" dojoType="fox.form.Select"');
|
||||
print \Controls\select_hash("update_interval", "", $local_update_intervals, 'disabled="1"');
|
||||
|
||||
$this->batch_edit_cbox("update_interval");
|
||||
|
||||
@@ -902,8 +894,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
else
|
||||
$local_purge_intervals[0] .= " " . sprintf("(%s)", __("Disabled"));
|
||||
|
||||
print_select_hash("purge_interval", "", $local_purge_intervals,
|
||||
'disabled="1" dojoType="fox.form.Select"');
|
||||
print \Controls\select_hash("purge_interval", "", $local_purge_intervals, 'disabled="1"');
|
||||
|
||||
$this->batch_edit_cbox("purge_interval");
|
||||
|
||||
@@ -1550,7 +1541,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||
function batchSubscribe() {
|
||||
print json_encode([
|
||||
"enable_cats" => (int)get_pref('ENABLE_FEED_CATS'),
|
||||
"cat_select" => format_feed_cat_select("cat", false, 'dojoType="fox.form.Select"')
|
||||
"cat_select" => \Controls\select_feeds_cats("cat")
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ class Pref_Filters extends Handler_Protected {
|
||||
|
||||
print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='Lists.onRowChecked(this)'>
|
||||
<span onclick='App.dialogOf(this).editRule(this)'>".$this->_get_rule_name($line)."</span>".
|
||||
format_hidden("rule[]", $data)."</li>";
|
||||
\Controls\hidden_tag("rule[]", $data)."</li>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ class Pref_Filters extends Handler_Protected {
|
||||
|
||||
print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='Lists.onRowChecked(this)'>
|
||||
<span onclick='App.dialogOf(this).editAction(this)'>".$this->_get_action_name($line)."</span>".
|
||||
format_hidden("action[]", $data)."</li>";
|
||||
\Controls\hidden_tag("action[]", $data)."</li>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,8 +815,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="fox.form.Select"');
|
||||
print \Controls\select_hash("filter_type", $filter_type, $filter_types);
|
||||
print "<label style='padding-left : 10px; display : inline'>" . __("in") . "</label> ";
|
||||
|
||||
print "</fieldset>";
|
||||
@@ -894,9 +893,13 @@ class Pref_Filters extends Handler_Protected {
|
||||
id='filterDlg_actionParam' style=\"$param_hidden\"
|
||||
name='action_param' value=\"$action_param\">";
|
||||
|
||||
print_label_select("action_param_label", $action_param,
|
||||
/*print_label_select("action_param_label", $action_param,
|
||||
"id='filterDlg_actionParamLabel' style=\"$label_param_hidden\"
|
||||
dojoType='fox.form.Select'");
|
||||
dojoType='fox.form.Select'");*/
|
||||
|
||||
print \Controls\select_labels("action_param_label", $action_param,
|
||||
"style=\"$label_param_hidden\"",
|
||||
"filterDlg_actionParamLabel");
|
||||
|
||||
$filter_actions = PluginHost::getInstance()->get_filter_actions();
|
||||
$filter_action_hash = array();
|
||||
@@ -918,9 +921,9 @@ class Pref_Filters extends Handler_Protected {
|
||||
$filter_plugin_disabled = "";
|
||||
}
|
||||
|
||||
print_select_hash("filterDlg_actionParamPlugin", $action_param, $filter_action_hash,
|
||||
"style=\"$plugin_param_hidden\" dojoType='fox.form.Select' $filter_plugin_disabled",
|
||||
"action_param_plugin");
|
||||
print \Controls\select_hash("action_param_plugin", $action_param, $filter_action_hash,
|
||||
"style=\"$plugin_param_hidden\" $filter_plugin_disabled",
|
||||
"filterDlg_actionParamPlugin");
|
||||
|
||||
print "</span>";
|
||||
|
||||
|
||||
@@ -288,8 +288,8 @@ class Pref_Prefs extends Handler_Protected {
|
||||
?>
|
||||
<form dojoType='dijit.form.Form'>
|
||||
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "changeemail") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "changeemail") ?>
|
||||
|
||||
<script type='dojo/method' event='onSubmit' args='evt'>
|
||||
evt.preventDefault();
|
||||
@@ -347,8 +347,8 @@ class Pref_Prefs extends Handler_Protected {
|
||||
|
||||
<form dojoType='dijit.form.Form'>
|
||||
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "changepassword") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "changepassword") ?>
|
||||
|
||||
<script type='dojo/method' event='onSubmit' args='evt'>
|
||||
evt.preventDefault();
|
||||
@@ -456,8 +456,8 @@ class Pref_Prefs extends Handler_Protected {
|
||||
?>
|
||||
|
||||
<form dojoType='dijit.form.Form'>
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "otpdisable") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "otpdisable") ?>
|
||||
|
||||
<script type='dojo/method' event='onSubmit' args='evt'>
|
||||
evt.preventDefault();
|
||||
@@ -511,10 +511,10 @@ class Pref_Prefs extends Handler_Protected {
|
||||
$otp_secret = $this->otpsecret();
|
||||
?>
|
||||
|
||||
<form dojoType='dijit.form.Form' id='changeOtpForm'>
|
||||
<form dojoType='dijit.form.Form'>
|
||||
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "otpenable") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "otpenable") ?>
|
||||
|
||||
<fieldset>
|
||||
<label><?= __("OTP Key:") ?></label>
|
||||
@@ -663,14 +663,14 @@ class Pref_Prefs extends Handler_Protected {
|
||||
$type_name = $item['type_name'];
|
||||
|
||||
if ($pref_name == "USER_LANGUAGE") {
|
||||
print_select_hash($pref_name, $value, get_translations(),
|
||||
"style='width : 220px; margin : 0px' dojoType='fox.form.Select'");
|
||||
print \Controls\select_hash($pref_name, $value, get_translations(),
|
||||
"style='width : 220px; margin : 0px'");
|
||||
|
||||
} else if ($pref_name == "USER_TIMEZONE") {
|
||||
|
||||
$timezones = explode("\n", file_get_contents("lib/timezones.txt"));
|
||||
|
||||
print_select($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
|
||||
|
||||
@@ -715,12 +715,11 @@ class Pref_Prefs extends Handler_Protected {
|
||||
|
||||
global $update_intervals_nodefault;
|
||||
|
||||
print_select_hash($pref_name, $value, $update_intervals_nodefault,
|
||||
'dojoType="fox.form.Select"');
|
||||
print \Controls\select_hash($pref_name, $value, $update_intervals_nodefault);
|
||||
|
||||
} else if ($pref_name == "DEFAULT_SEARCH_LANGUAGE") {
|
||||
|
||||
print_select($pref_name, $value, Pref_Feeds::get_ts_languages(),
|
||||
'dojoType="fox.form.Select"');
|
||||
print \Controls\select_tag($pref_name, $value, Pref_Feeds::get_ts_languages());
|
||||
|
||||
} else if ($type_name == "bool") {
|
||||
|
||||
@@ -799,14 +798,14 @@ class Pref_Prefs extends Handler_Protected {
|
||||
}
|
||||
}
|
||||
}
|
||||
print_hidden("boolean_prefs", htmlspecialchars(join(",", $listed_boolean_prefs)));
|
||||
print \Controls\hidden_tag("boolean_prefs", htmlspecialchars(join(",", $listed_boolean_prefs)));
|
||||
}
|
||||
|
||||
private function index_prefs() {
|
||||
?>
|
||||
<form dojoType='dijit.form.Form' id='changeSettingsForm'>
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "saveconfig") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "saveconfig") ?>
|
||||
<script type='dojo/method' event='onSubmit' args='evt, quit'>
|
||||
if (evt) evt.preventDefault();
|
||||
if (this.validate()) {
|
||||
@@ -973,8 +972,8 @@ class Pref_Prefs extends Handler_Protected {
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php print_hidden("op", "pref-prefs") ?>
|
||||
<?php print_hidden("method", "setplugins") ?>
|
||||
<?= \Controls\hidden_tag("op", "pref-prefs") ?>
|
||||
<?= \Controls\hidden_tag("method", "setplugins") ?>
|
||||
|
||||
<div dojoType="dijit.layout.BorderContainer" gutters="false">
|
||||
<div dojoType="dijit.layout.ContentPane" region="center" style="overflow-y : auto">
|
||||
|
||||
@@ -90,12 +90,12 @@ class Pref_System extends Handler_Administrative {
|
||||
<div class='pull-right'>
|
||||
<?= __("Severity:") ?>
|
||||
|
||||
<?php print_select_hash("severity", $severity,
|
||||
<?= \Controls\select_hash("severity", $severity,
|
||||
[
|
||||
E_USER_ERROR => __("Errors"),
|
||||
E_USER_WARNING => __("Warnings"),
|
||||
E_USER_NOTICE => __("Everything")
|
||||
], 'dojoType="fox.form.Select" onchange="Helpers.EventLog.refresh()"') ?>
|
||||
], 'onchange="Helpers.EventLog.refresh()"', "severity") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user