aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/configureController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-11-11 08:17:12 +0100
committerGravatar GitHub <noreply@github.com> 2025-11-11 08:17:12 +0100
commita18c35046daee15e7ac5f85db290d54541a03e3c (patch)
treeec638cf7c93537a4f81b27216097d8509252eb81 /app/Controllers/configureController.php
parent5e622c60fa5c40793138807280319f7e84d00cc6 (diff)
Housekeeping lib_rss.php (#8193)
* Housekeeping lib_rss.php `lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924 Moved most functions to other places. Mostly no change of code otherwise (see comments). * Extension: composer run-script phpstan-third-party
Diffstat (limited to 'app/Controllers/configureController.php')
-rw-r--r--app/Controllers/configureController.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index 17c6c20bd..451e98a8b 100644
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -236,6 +236,30 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
FreshRSS_View::prependTitle(_t('conf.sharing.title') . ' ยท ');
}
+ private const SHORTCUT_KEYS = [
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12',
+ 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'Backspace', 'Delete',
+ 'End', 'Enter', 'Escape', 'Home', 'Insert', 'PageDown', 'PageUp', 'Space', 'Tab',
+ ];
+
+ /**
+ * @param array<string> $shortcuts
+ * @return list<string>
+ */
+ public static function getNonStandardShortcuts(array $shortcuts): array {
+ $standard = strtolower(implode(' ', self::SHORTCUT_KEYS));
+
+ $nonStandard = array_filter($shortcuts, static function (string $shortcut) use ($standard) {
+ $shortcut = trim($shortcut);
+ return $shortcut !== '' && stripos($standard, $shortcut) === false;
+ });
+
+ return array_values($nonStandard);
+ }
+
/**
* This action handles the shortcut configuration page.
*
@@ -249,7 +273,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
* tab and up.
*/
public function shortcutAction(): void {
- $this->view->list_keys = SHORTCUT_KEYS;
+ $this->view->list_keys = self::SHORTCUT_KEYS;
if (Minz_Request::isPost()) {
$shortcuts = Minz_Request::paramArray('shortcuts', plaintext: true);