public static function getAdminPrefix($withSlashes = false, $slashPos = 0)
    {
        $config = ConfigHelper::getWriter();
        $val = $config->get('admin_prefix');
        $prefix = is_null($val) ? self::ROUTE_DEFAULT_ADMIN_PREFIX : $val;

        // add slashes if requested
        if ($withSlashes && (! empty($prefix) && $prefix != '/')) {
            if ($slashPos == -1) {
                $prefix = "/{$prefix}";
            } elseif ($slashPos == 1) {
                $prefix = "{$prefix}/";
            } else {
                $prefix = "/{$prefix}/";
            }
        }

        // remove any duplicate slashes
        $prefix = str_replace('//', '/', $prefix);

        return $prefix;
    }