Ticket #9613: mythweb_multikey_v1.patch

File mythweb_multikey_v1.patch, 2.3 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..4e181ea 100644
    a b  
    5353                          );
    5454            }
    5555        }
     56        foreach ($_POST['multikey'] as $context => $data) {
     57            foreach ($data as $action => $key_list) {
     58                $db->query('UPDATE keybindings
     59                               SET multikey=?
     60                             WHERE context=? AND action=? AND hostname=?',
     61                           $key_list,
     62                           $context,
     63                           $action,
     64                           $_POST['host']
     65                          );
     66            }
     67        }
    5668    // Make sure the session host gets updated to the posted one.
    5769        $_SESSION['settings']['host'] = $_POST['host'];
    5870    }
  • 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..74a365d 100644
    a b  
    4040
    4141<table border="0" cellpadding="4" cellspacing="2" class="list small" align="center">
    4242<tr class="menu large" align="center">
    43         <td colspan="4"><?php echo t('Keybindings Editor') ?></td>
     43        <td colspan="5"><?php echo t('Keybindings Editor') ?></td>
    4444</tr><tr class="menu" align="center">
    4545        <td width="15%"><?php echo t('Context')      ?></td>
    4646        <td width="25%"><?php echo t('Action')       ?></td>
    4747        <td width="40%"><?php echo t('Description')  ?></td>
    48         <td width="20%"><?php echo t('Key bindings') ?></td>
     48        <td width="10%"><?php echo t('Key bindings') ?></td>
     49        <td width="10%"><?php echo t('Multikey binding') ?></td>
    4950</tr><?php
    5051    foreach ($Keys as $key) {
    5152?><tr class="settings" align="center">
     
    5556        <td><input type="text" size="25"
    5657                   name="key[<?php echo html_entities($key['context']), '][', html_entities($key['action']) ?>]"
    5758                   value="<?php echo html_entities($key['keylist']) ?>"></td>
     59        <td><input type="text" size="25"
     60                   name="multikey[<?php echo html_entities($key['context']), '][', html_entities($key['action']) ?>]"
     61                   value="<?php echo html_entities($key['multikey']) ?>"></td>
    5862</tr>
    5963<?php
    6064    }