protected function find_button(array &$params, $button) {
        foreach ($params as $key => $value) {
            if (preg_match('/^theme_advanced_buttons(\d+)$/', $key, $matches) &&
                    strpos(','. $value. ',', ','. $button. ',') !== false) {
                return (int)$matches[1];
            }
        }
        return false;
    }