private function getLink()
    {
        // unset GET vars that we want to ignore
        $vars = $_GET;

        foreach ($vars as $name => $value) {
            if (in_array($name, $this->unset_get_vars)) {
                unset($vars[$name]);
            }
        }

        $key_orderby = $this->getLinkPrefix() . 'orderby';
        $key_orderbydir = $this->getLinkPrefix() . 'orderbydir';

        unset($vars[$key_orderby]);
        unset($vars[$key_orderbydir]);

        $next_dir = $this->getNextDirection();

        if ($next_dir != $this->default_direction) {
            $vars[$key_orderby] = $this->id;
            $vars[$key_orderbydir] = $this->getDirectionAsString(
                $next_dir,
                false
            );
        }

        // build the new link
        $link = $this->link . '?';
        $first = true;

        foreach ($vars as $name => $value) {
            if ($first) {
                $first = false;
            } else {
                $link .= '&amp;';
            }

            $link .= $name . '=' . $value;
        }

        return $link;
    }