<?php
/**
 * Copyright 2008 Chris Abernethy
 *
 * This file is part of Member Access.
 *
 * Member Access is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Member Access is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Member Access.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
?>
<?php echo esc_html($this->get('visibility')) ?>
<script type="text/javascript">
    /*<![CDATA[*/
    // Register a click handler on the "Quick Edit" link for the current row.
    // The click handler registers a one-time focus handler on the inline
    // editor for the current row (which is created on the fly by WordPress as
    // a cloned HTML element after clicking the "Quick Edit" link.)
    jQuery(function($) {
        var post_id     = '<?echo esc_attr($this->get('post_id')); ?>';
        var radio_value = '<?echo esc_attr($this->get('radio_value')); ?>';
        $('#post-'+post_id+' a.editinline').click(function(){
            $('#the-list').one('focus', '#edit-'+post_id, function(){
                $('#edit-'+post_id+' input:radio[value="'+radio_value+'"]').attr('checked',true);
            })
        })
    });
    /*]]>*/
</script>
