public static function admin()
    {
        $DW =& $GLOBALS['DW'];
        parent::admin();
        self::$opt = $DW->getDWOpt($_GET['id'], 'single');
        $authors = DW_Author::getAuthors();
        if (count($authors) > DW_LIST_LIMIT) {
            $author_condition_select_style = DW_LIST_STYLE;
        }
        $js_count = 0;
        $opt_single_author = $DW->getDWOpt($_GET['id'], 'single-author');
        $js_author_array = array();
        if ($opt_single_author->count > 0) {
            $js_count = $js_count + $opt_single_author->count - 1;
        }
        // -- Category
        $category = get_categories(array('hide_empty' => FALSE));
        if (count($category) > DW_LIST_LIMIT) {
            $category_condition_select_style = DW_LIST_STYLE;
        }
        // For JS
        $js_category_array = array();
        foreach ($category as $cat) {
            $js_category_array[] = '\'single_category_act_' . $cat->cat_ID . '\'';
            $js_category_array[] = '\'single_category_childs_act_' . $cat->cat_ID . '\'';
        }
        $catmap = DW_Category::getCatChilds(array(), 0, array());
        $opt_single_category = $DW->getDWOpt($_GET['id'], 'single-category');
        if ($opt_single_category->count > 0) {
            $js_count = $js_count + $opt_single_category->count - 1;
        }
        // -- Individual / Posts / Tags
        $opt_individual = $DW->getDWOpt($_GET['id'], 'individual');
        $opt_single_post = $DW->getDWOpt($_GET['id'], 'single-post');
        $opt_single_tag = $DW->getDWOpt($_GET['id'], 'single-tag');
        if ($opt_individual->count > 0) {
            $individual = TRUE;
            $count_individual = '(' . __('Posts: ', DW_L10N_DOMAIN) . $opt_single_post->count . ', ' . __('Tags: ', DW_L10N_DOMAIN) . $opt_single_tag->count . ')';
        }
        self::GUIHeader(self::$option[self::$name], self::$question, self::$info);
        self::GUIOption();
        // Individual
        $DW->dumpOpt($opt_individual);
        echo '<br />';
        echo '<input type="checkbox" id="individual" name="individual" value="1" ' . (isset($individual) && $individual ? 'checked="checked"' : '') . ' onclick="chkInPosts()" />';
        echo '<label for="individual">' . __('Make exception rule available to individual posts and tags.', DW_L10N_DOMAIN) . ' ' . ($opt_individual->count > 0 ? $count_individual : '') . '</label>';
        echo '<img src="' . $DW->plugin_url . 'img/info.gif" alt="info" title="' . __('Click to toggle info', DW_L10N_DOMAIN) . '" onclick="divToggle(\'individual_post_tag\')" />';
        echo '<div>';
        echo '<div id="individual_post_tag" class="infotext">';
        _e('When you enable this option, you have the ability to apply the exception rule for <em>Single Posts</em> to tags and individual posts.
								You can set the exception rule for tags in the single Edit Tag Panel (go to <a href="edit-tags.php?taxonomy=post_tag">Post Tags</a>,
								click a tag), For individual posts in the <a href="post-new.php">New</a> or <a href="edit.php">Edit</a> Posts panel.
								Exception rules for tags and individual posts in any combination work independantly, but will always be counted as one exception.<br />
		  					Please note when exception rules are set for Author and/or Category, these will be removed.
		  				', DW_L10N_DOMAIN);
        echo '</div></div>';
        // Individual posts and tags
        foreach ($opt_single_post->act as $singlepost) {
            echo '<input type="hidden" name="single_post_act[]" value="' . $singlepost . '" />';
        }
        foreach ($opt_single_tag->act as $tag) {
            echo '<input type="hidden" name="single_tag_act[]" value="' . $tag . '" />';
        }
        // JS array authors
        foreach (array_keys($authors) as $id) {
            $js_author_array[] = '\'single_author_act_' . $id . '\'';
        }
        ?>

<table border="0" cellspacing="0" cellpadding="0">
<tr>
  <td valign="top">
  	<?php 
        DW_Author::mkGUI(TRUE);
        ?>
  </td>
  <td style="width:10px"></td>
  <td valign="top">
  	<?php 
        $opt = $DW->getDWOpt($_GET['id'], 'single-category');
        ?>
  	<?php 
        $DW->dumpOpt($opt);
        ?>
		<?php 
        DW_Category::GUIComplex(TRUE, $opt);
        ?>
    </div>
  </td>
</tr>
</table>
<?php 
        self::GUIFooter();
        ?>
<script type="text/javascript">
/* <![CDATA[ */
  function chkInPosts() {
    var posts = <?php 
        echo $opt_single_post->count;
        ?>
;
    var tags = <?php 
        echo $opt_single_tag->count;
        ?>
;

    if ( (posts > 0 || tags > 0) && jQuery('#individual').is(':checked') == false ) {
      if ( confirm('Are you sure you want to disable the exception rule for individual posts and tags?\nThis will remove the options set to individual posts and/or tags for this widget.\nOk = Yes; No = Cancel') ) {
        swChb(cAuthors, false);
        swChb(cCat, false);
      } else {
        jQuery('#individual').attr('checked', true);
      }
    } else if ( icount > 0 && jQuery('#individual').is(':checked') ) {
      if ( confirm('Are you sure you want to enable the exception rule for individual posts and tags?\nThis will remove the exceptions set for Author and/or Category on single posts for this widget.\nOk = Yes; No = Cancel') ) {
        swChb(cAuthors, true);
        swChb(cCat, true);
        icount = 0;
      } else {
        jQuery('#individual').attr('checked', false);
      }
    } else if ( jQuery('#individual').is(':checked') ) {
        swChb(cAuthors, true);
        swChb(cCat, true);
    } else {
        swChb(cAuthors, false);
        swChb(cCat, false);
    }
  }

 	function ci(id) {
    if ( jQuery('#'+id).is(':checked') ) {
      icount++;
    } else {
      icount--;
    }
  }

  var icount = <?php 
        echo $js_count;
        ?>
;
  var cAuthors = new Array(<?php 
        echo implode(', ', $js_author_array);
        ?>
);
  var cCat = new Array(<?php 
        echo implode(', ', $js_category_array);
        ?>
);

  if ( jQuery('#individual').is(':checked') ) {
    swChb(cAuthors, true);
    swChb(cCat, true);
  }
/* ]]> */
</script>
<?php 
    }
    public static function admin()
    {
        $DW =& $GLOBALS['DW'];
        $widget_id = $GLOBALS['widget_id'];
        parent::admin();
        self::$opt = $DW->getDWOpt($widget_id, 'single');
        $authors = DW_Author::getAuthors();
        if (count($authors) > DW_LIST_LIMIT) {
            $author_condition_select_style = DW_LIST_STYLE;
        }
        $js_count = 0;
        $opt_single_author = $DW->getDWOpt($widget_id, 'single-author');
        $js_author_array = array();
        if ($opt_single_author->count > 0) {
            $js_count = $js_count + $opt_single_author->count - 1;
        }
        // -- Category
        $category = get_categories(array('hide_empty' => FALSE));
        if (count($category) > DW_LIST_LIMIT) {
            $category_condition_select_style = DW_LIST_STYLE;
        }
        // For JS
        $js_category_array = array();
        foreach ($category as $cat) {
            $js_category_array[] = '\'single_category_act_' . $cat->cat_ID . '\'';
            $js_category_array[] = '\'single_category_childs_act_' . $cat->cat_ID . '\'';
        }
        $catmap = DW_Category::getCatChilds(array(), 0, array());
        $opt_single_category = $DW->getDWOpt($widget_id, 'single-category');
        if ($opt_single_category->count > 0) {
            $js_count = $js_count + $opt_single_category->count - 1;
        }
        $opt_single_post = $DW->getDWOpt($widget_id, 'single-post');
        $opt_single_tag = $DW->getDWOpt($widget_id, 'single-tag');
        self::GUIHeader(self::$option[self::$name], self::$question, self::$info);
        self::GUIOption();
        // Individual posts and tags
        foreach ($opt_single_post->act as $singlepost) {
            echo '<input type="hidden" name="single_post_act[]" value="' . $singlepost . '" />';
        }
        foreach ($opt_single_tag->act as $tag) {
            echo '<input type="hidden" name="single_tag_act[]" value="' . $tag . '" />';
        }
        // JS array authors
        foreach (array_keys($authors) as $id) {
            $js_author_array[] = '\'single_author_act_' . $id . '\'';
        }
        ?>

<table border="0" cellspacing="0" cellpadding="0">
<tr>
  <td valign="top">
  	<?php 
        DW_Author::mkGUI(self::$type, self::$option[self::$name], self::$question, TRUE);
        ?>
  </td>
  <td style="width:10px"></td>
  <td valign="top">
  	<?php 
        $opt = $DW->getDWOpt($widget_id, 'single-category');
        ?>
  	<?php 
        $DW->dumpOpt($opt);
        ?>
		<?php 
        DW_Category::GUIComplex(NULL, NULL, TRUE, $opt);
        ?>
    </div>
  </td>
</tr>
</table>
<?php 
        $type = 'post';
        $tax_list = get_object_taxonomies($type, 'objects');
        $tax_list = apply_filters('dynwid_taxonomies', $tax_list);
        foreach ($tax_list as $tax_type) {
            if ($tax_type->name != 'post_tag' && $tax_type->name != 'category') {
                // Prepare
                $opt_tax = $DW->getDWOpt($widget_id, 'single-tax_' . $tax_type->name);
                if ($tax_type->hierarchical) {
                    $opt_tax_childs = $DW->getDWOpt($widget_id, 'single-tax_' . $tax_type->name . '-childs');
                } else {
                    unset($opt_tax_childs);
                }
                $tax = get_terms($tax_type->name, array('get' => 'all'));
                if (count($tax) > 0) {
                    if (count($tax) > DW_LIST_LIMIT) {
                        $tax_condition_select_style = DW_LIST_STYLE;
                    }
                    $tree = DW_CustomPost::getTaxChilds($tax_type->name, array(), 0, array());
                    echo '<br />';
                    $DW->dumpOpt($opt_tax);
                    if (isset($opt_tax_childs)) {
                        $DW->dumpOpt($opt_tax_childs);
                    }
                    echo '<input type="hidden" name="single_tax_list[]" value="single-tax_' . $tax_type->name . '" />';
                    echo __('Except for', DW_L10N_DOMAIN) . ' ' . $tax_type->label . ':<br />';
                    echo '<div id="single-tax_' . $tax_type->name . '-select" class="condition-select" ' . (isset($tax_condition_select_style) ? $tax_condition_select_style : '') . '>';
                    echo '<div style="position:relative;left:-15px">';
                    if (!isset($opt_tax_childs)) {
                        $childs = FALSE;
                    } else {
                        $childs = $opt_tax_childs->act;
                    }
                    echo '<input type="hidden" id="single-tax_' . $tax_type->name . '_act" name="single-tax_' . $tax_type->name . '_act" value="' . implode(',', $opt_tax->act) . '" />';
                    if (isset($opt_tax_childs)) {
                        echo '<input type="hidden" id="single-tax_' . $tax_type->name . '_childs_act" name="single-tax_' . $tax_type->name . '_childs_act" value="' . implode(',', $opt_tax_childs->act) . '" />';
                    }
                    DW_CustomPost::prtTax($widget_id, $tax_type->name, $tree, $opt_tax->act, $childs, 'single-tax_' . $tax_type->name);
                    echo '</div>';
                    echo '</div>';
                }
            }
        }
        // foreach
        self::GUIFooter();
        ?>
<script type="text/javascript">
/* <![CDATA[ */
  function chkInPosts() {
    var posts = <?php 
        echo $opt_single_post->count;
        ?>
;
    var tags = <?php 
        echo $opt_single_tag->count;
        ?>
;

    if ( (posts > 0 || tags > 0) && jQuery('#individual').is(':checked') == false ) {
      if ( confirm('Are you sure you want to disable the exception rule for individual posts and tags?\nThis will remove the options set to individual posts and/or tags for this widget.\nOk = Yes; No = Cancel') ) {
        swChb(cAuthors, false);
        swChb(cCat, false);
      } else {
        jQuery('#individual').attr('checked', true);
      }
    } else if ( icount > 0 && jQuery('#individual').is(':checked') ) {
      if ( confirm('Are you sure you want to enable the exception rule for individual posts and tags?\nThis will remove the exceptions set for Author and/or Category on single posts for this widget.\nOk = Yes; No = Cancel') ) {
        swChb(cAuthors, true);
        swChb(cCat, true);
        icount = 0;
      } else {
        jQuery('#individual').attr('checked', false);
      }
    } else if ( jQuery('#individual').is(':checked') ) {
        swChb(cAuthors, true);
        swChb(cCat, true);
    } else {
        swChb(cAuthors, false);
        swChb(cCat, false);
    }
  }

 	function ci(id) {
    if ( jQuery('#'+id).is(':checked') ) {
      icount++;
    } else {
      icount--;
    }
  }

  var icount = <?php 
        echo $js_count;
        ?>
;
  var cAuthors = new Array(<?php 
        echo implode(', ', $js_author_array);
        ?>
);
  var cCat = new Array(<?php 
        echo implode(', ', $js_category_array);
        ?>
);

  if ( jQuery('#individual').is(':checked') ) {
    swChb(cAuthors, true);
    swChb(cCat, true);
  }

  if ( jQuery('#single-yes').is(':checked') && jQuery('#single_conf :checkbox').is(':checked')  ) {
  	jQuery('#single').append( ' <img src="<?php 
        echo $DW->plugin_url;
        ?>
img/checkmark.gif" alt="Checkmark" />' );
  }
/* ]]> */
</script>
<?php 
    }