system/modules/short_urls/dca/tl_short_urls.php
public function toggleVisibility($intId, $blnVisible, DataContainer $dc=null)
    {
        Input::setGet('id', $intId);
        Input::setGet('act', 'toggle');

        // Trigger the save_callback
        if (is_array($GLOBALS['TL_DCA']['tl_short_urls']['fields']['disable']['save_callback']))
        {
            foreach ($GLOBALS['TL_DCA']['tl_short_urls']['fields']['disable']['save_callback'] as $callback)
            {
                if (is_array($callback))
                {
                    $this->import($callback[0]);
                    $blnVisible = $this->$callback[0]->$callback[1]($blnVisible, ($dc ?: $this));
                }
                elseif (is_callable($callback))
                {
                    $blnVisible = $callback($blnVisible, ($dc ?: $this));
                }
            }
        }

        // Update the database
        $this->Database->prepare("UPDATE tl_short_urls SET tstamp=". time() .", disable='" . ($blnVisible ? '' : 1) . "' WHERE id=?")
                       ->execute($intId);
    }
public function toggleVisibility($intId, $blnVisible, DataContainer $dc=null)
    {
        Input::setGet('id', $intId);
        Input::setGet('act', 'toggle');

        // Trigger the save_callback
        if (is_array($GLOBALS['TL_DCA']['tl_short_urls']['fields']['disable']['save_callback']))
        {
            foreach ($GLOBALS['TL_DCA']['tl_short_urls']['fields']['disable']['save_callback'] as $callback)
            {
                if (is_array($callback))
                {
                    $this->import($callback[0]);
                    $blnVisible = $this->$callback[0]->$callback[1]($blnVisible, ($dc ?: $this));
                }
                elseif (is_callable($callback))
                {
                    $blnVisible = $callback($blnVisible, ($dc ?: $this));
                }
            }
        }

        // Update the database
        $this->Database->prepare("UPDATE tl_short_urls SET tstamp=". time() .", disable='" . ($blnVisible ? '' : 1) . "' WHERE id=?")
                       ->execute($intId);
    }
Disable/enable a short url

@param integer       $intId
@param boolean       $blnVisible
@param DataContainer $dc