Magento - 隐藏残疾人类别

I've recently included Prattski's Hide Empty Categories module to Magento, however; The extension removes categories that have no products available, which is great. What it doesn't do is hide categories for products disabled. Therefore, the categories are still visible when all items in a particular category are disabled.

Below is the Observer.php code from the extension:

<?php
/**
 * Hide Empty Categories
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 * @copyright   Copyright (c) 2011 Prattski (http://prattski.com/)
 * @author      Josh Pratt (Prattski)
 */

/**
 * Event Observer
 *
 * @category    Prattski
 * @package     Prattski_HideEmptyCategories
 */
class Prattski_HideEmptyCategories_Model_Observer extends Mage_Core_Model_Abstract
{
    /**
     * Remove hidden caegories from the collection
     *
     * @param Varien_Event_Observer $observer
     */
    public function catalogCategoryCollectionLoadAfter($observer)
    {
        if ($this->_isApiRequest()) return;
        $collection = $observer->getEvent()->getCategoryCollection();
        $this->_removeHiddenCollectionItems($collection);
    }


/**
 * Remove hidden items from a product or category collection
 * 
 * @param Mage_Eav_Model_Entity_Collection_Abstract|Mage_Core_Model_Mysql4_Collection_Abstract $collection
 */
public function _removeHiddenCollectionItems($collection)
{
    // Loop through each category or product
    foreach ($collection as $key => $item)
    {
        // If it is a category
        if ($item->getEntityTypeId() == 3) {

            $products = Mage::getModel('catalog/category')->load($item->getId())
            ->getProductCollection()
            ->addAttributeToSelect('entity_id')
            ->addAttributeToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
            ->addAttributeToFilter('visibility',Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);

            $prodcount = $products->count();

            if ($item->prodcount) {
                $collection->removeItemByKey($key);
            }
        }
     }
  }

 /**
  * Return true if the reqest is made via the api
  *
  * @return boolean
  */
  protected function _isApiRequest()
  {
    return Mage::app()->getRequest()->getModuleName() === 'api';
  }
}

Any ideas on how to disable the categories with disabled products?