summaryrefslogtreecommitdiff
path: root/classes/rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-16 14:51:42 +0300
committerAndrew Dolgov <[email protected]>2021-02-16 14:51:42 +0300
commit22fc6871e8eca507578381bda6d6683d2082810b (patch)
tree6496bbfcd04f0e6717b0cb2b5246f6cdf52785e6 /classes/rpc.php
parentd7127cead362ba00b0defd93b2091ce15aeae2f3 (diff)
remove backend helper and move its only function to rpc for the time being
Diffstat (limited to 'classes/rpc.php')
-rwxr-xr-xclasses/rpc.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/classes/rpc.php b/classes/rpc.php
index 1bfea621b..d6284033a 100755
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -706,4 +706,76 @@ class RPC extends Handler_Protected {
return array($prefixes, $hotkeys);
}
+ function hotkeyHelp() {
+ $info = self::get_hotkeys_info();
+ $imap = self::get_hotkeys_map();
+ $omap = array();
+
+ foreach ($imap[1] as $sequence => $action) {
+ if (!isset($omap[$action])) $omap[$action] = array();
+
+ array_push($omap[$action], $sequence);
+ }
+
+ ?>
+ <ul class='panel panel-scrollable hotkeys-help' style='height : 300px'>
+ <?php
+
+ $cur_section = "";
+ foreach ($info as $section => $hotkeys) {
+
+ if ($cur_section) print "<li>&nbsp;</li>";
+ print "<li><h3>" . $section . "</h3></li>";
+ $cur_section = $section;
+
+ foreach ($hotkeys as $action => $description) {
+
+ if (!empty($omap[$action])) {
+ foreach ($omap[$action] as $sequence) {
+ if (strpos($sequence, "|") !== false) {
+ $sequence = substr($sequence,
+ strpos($sequence, "|")+1,
+ strlen($sequence));
+ } else {
+ $keys = explode(" ", $sequence);
+
+ for ($i = 0; $i < count($keys); $i++) {
+ if (strlen($keys[$i]) > 1) {
+ $tmp = '';
+ foreach (str_split($keys[$i]) as $c) {
+ switch ($c) {
+ case '*':
+ $tmp .= __('Shift') . '+';
+ break;
+ case '^':
+ $tmp .= __('Ctrl') . '+';
+ break;
+ default:
+ $tmp .= $c;
+ }
+ }
+ $keys[$i] = $tmp;
+ }
+ }
+ $sequence = join(" ", $keys);
+ }
+
+ ?>
+ <li>
+ <div class='hk'><code><?= $sequence ?></code></div>
+ <div class='desc'><?= $description ?></div>
+ </li>
+ <?php
+ }
+ }
+ }
+ }
+ print "</ul>";
+
+ ?>
+ <footer class='text-center'>
+ <?= \Controls\submit_tag(__('Close this window')) ?>
+ </footer>
+ <?php
+ }
}