function tdomf_widget_subscribe_to_comments_comment_status($form_id)
 {
     $comment_status = true;
     if (get_option('default_comment_status') == 'closed') {
         $comment_status = false;
     }
     $widgets_in_use = tdomf_get_widget_order($form_id);
     if (in_array("comments", $widgets_in_use)) {
         $options = tdomf_widget_comments_get_options($form_id);
         if ($options['user-comments']) {
             $comment_status = true;
         } else {
             if ($options['overwrite']) {
                 $comment_status = $options['comments'];
             }
         }
     }
     return $comment_status;
 }
function tdomf_widget_comments_control($form_id)
{
    $options = tdomf_widget_comments_get_options($form_id);
    // Store settings for this widget
    if ($_POST['excerpt-submit']) {
        $newoptions['title'] = strip_tags(stripslashes($_POST['comments-title']));
        $newoptions['overwrite'] = isset($_POST['comments-overwrite']);
        $newoptions['comments'] = isset($_POST['comments-comments']);
        $newoptions['pings'] = isset($_POST['comments-pings']);
        $newoptions['user-comments'] = isset($_POST['comments-user-comments']);
        $newoptions['user-pings'] = isset($_POST['comments-user-pings']);
        if ($options != $newoptions) {
            $options = $newoptions;
            tdomf_set_option_widget('tdomf_comment_widget', $options, $form_id);
        }
    }
    // Display control panel for this widget
    extract($options);
    ?>
<div>
<label for="comments-title" style="line-height:35px;display:block;"><?php 
    _e("Title: ", "tdomf");
    ?>
<input type="textfield" id="comments-title" name="comments-title" value="<?php 
    echo htmlentities($options['title'], ENT_QUOTES, get_bloginfo('charset'));
    ?>
" /></label>

<br/>

<label for="overwrite" style="line-height:35px;"><b><?php 
    _e("Overwrite Default Settings", "tdomf");
    ?>
</b></label> 
<input type="checkbox" name="comments-overwrite" id="comments-overwrite" <?php 
    if ($options['overwrite']) {
        echo "checked";
    }
    ?>
 >
<br/>
<small><?php 
    _e("You can overwrite the default settings for comments pings for any submission from this form by enabling this option and setting defaults below", "tdomf");
    ?>
</small>
<br/>
<input type="checkbox" name="comments-comments" id="comments-comments" <?php 
    if ($options['comments']) {
        echo "checked";
    }
    ?>
 >
<label for="overwrite" style="line-height:35px;"><?php 
    _e("Allow Comments on Submission", "tdomf");
    ?>
</label> 
<br/>
<input type="checkbox" name="comments-pings" id="comments-pings" <?php 
    if ($options['pings']) {
        echo "checked";
    }
    ?>
 >
<label for="overwrite" style="line-height:35px;"><?php 
    _e("Allow Pings and Trackbacks on Submission", "tdomf");
    ?>
</label> 

<br/><br/>
<small><?php 
    _e("Use these options to allow submitters to set if they want comments or pings on their submission. This will overwrite any other configuration.", "tdomf");
    ?>
</small>
<br/>
<input type="checkbox" name="comments-user-comments" id="comments-user-comments" <?php 
    if ($options['user-comments']) {
        echo "checked";
    }
    ?>
 >
<label for="overwrite" style="line-height:35px;"><?php 
    _e("Submitter can choose to allow Comments", "tdomf");
    ?>
</label> 
<br/>
<input type="checkbox" name="comments-user-pings" id="comments-user-pings" <?php 
    if ($options['user-pings']) {
        echo "checked";
    }
    ?>
 >
<label for="overwrite" style="line-height:35px;"><?php 
    _e("Submitter can choose to allow Pings and Trackbacks", "tdomf");
    ?>
</label>

</div>
        <?php 
}