Ticket #9613: mythweb_multikey_v2.patch

File mythweb_multikey_v2.patch, 4.2 KB (added by Jim Stichnoth <stichnot@…>, 9 years ago)
  • modules/mythtv/set_keys.php

    diff --git a/modules/mythtv/set_keys.php b/modules/mythtv/set_keys.php
    index c3da592..7aa4f8b 100644
    a b  
    4141                       $_POST['host']
    4242                      );
    4343        }
     44        foreach ($_POST['multijump'] as $dest => $key_list) {
     45            $db->query('UPDATE jumppoints
     46                           SET multikey=?
     47                         WHERE destination=? AND hostname=?',
     48                       $key_list,
     49                       $dest,
     50                       $_POST['host']
     51                      );
     52        }
    4453        foreach ($_POST['key'] as $context => $data) {
    4554            foreach ($data as $action => $key_list) {
    4655                $db->query('UPDATE keybindings
     
    5362                          );
    5463            }
    5564        }
     65        foreach ($_POST['multikey'] as $context => $data) {
     66            foreach ($data as $action => $key_list) {
     67                $db->query('UPDATE keybindings
     68                               SET multikey=?
     69                             WHERE context=? AND action=? AND hostname=?',
     70                           $key_list,
     71                           $context,
     72                           $action,
     73                           $_POST['host']
     74                          );
     75            }
     76        }
    5677    // Make sure the session host gets updated to the posted one.
    5778        $_SESSION['settings']['host'] = $_POST['host'];
    5879    }
  • modules/mythtv/tmpl/default/set_keys.php

    diff --git a/modules/mythtv/tmpl/default/set_keys.php b/modules/mythtv/tmpl/default/set_keys.php
    index 1b7ab7a..a3c3104 100644
    a b  
    1818
    1919<table border="0" cellpadding="4" cellspacing="2" class="list small" align="center">
    2020<tr class="menu large" align="center">
    21     <td colspan="3"><?php echo t('JumpPoints Editor') ?></td>
     21    <td colspan="4"><?php echo t('JumpPoints Editor') ?></td>
    2222</tr><tr class="menu" align="center">
    23     <td width="33%"><?php echo t('Destination') ?></td>
    24     <td width="33%"><?php echo t('Description') ?></td>
    25     <td width="33%"><?php echo t('Key bindings') ?></td>
     23    <td width="30%"><?php echo t('Destination') ?></td>
     24    <td width="30%"><?php echo t('Description') ?></td>
     25    <td width="20%"><?php echo t('Key bindings') ?></td>
     26    <td width="20%"><?php echo t('Multikey binding') ?></td>
    2627</tr><?php
    2728    foreach ($Jumps as $jumppoint) {
    2829?><tr class="settings" align="center">
     
    3132    <td><input type="text" size="35"
    3233               name="jump[<?php echo html_entities($jumppoint['destination']) ?>]"
    3334               value="<?php echo html_entities($jumppoint['keylist']) ?>"></td>
     35    <td><input type="text" size="35"
     36               name="multijump[<?php echo html_entities($jumppoint['destination']) ?>]"
     37               value="<?php echo html_entities($jumppoint['multikey']) ?>"></td>
    3438</tr><?php
    3539    }
    3640?>
     
    4044
    4145<table border="0" cellpadding="4" cellspacing="2" class="list small" align="center">
    4246<tr class="menu large" align="center">
    43         <td colspan="4"><?php echo t('Keybindings Editor') ?></td>
     47        <td colspan="5"><?php echo t('Keybindings Editor') ?></td>
    4448</tr><tr class="menu" align="center">
    4549        <td width="15%"><?php echo t('Context')      ?></td>
    4650        <td width="25%"><?php echo t('Action')       ?></td>
    4751        <td width="40%"><?php echo t('Description')  ?></td>
    48         <td width="20%"><?php echo t('Key bindings') ?></td>
     52        <td width="10%"><?php echo t('Key bindings') ?></td>
     53        <td width="10%"><?php echo t('Multikey binding') ?></td>
    4954</tr><?php
    5055    foreach ($Keys as $key) {
    5156?><tr class="settings" align="center">
     
    5560        <td><input type="text" size="25"
    5661                   name="key[<?php echo html_entities($key['context']), '][', html_entities($key['action']) ?>]"
    5762                   value="<?php echo html_entities($key['keylist']) ?>"></td>
     63        <td><input type="text" size="25"
     64                   name="multikey[<?php echo html_entities($key['context']), '][', html_entities($key['action']) ?>]"
     65                   value="<?php echo html_entities($key['multikey']) ?>"></td>
    5866</tr>
    5967<?php
    6068    }