public function addAliasButton(array $buttons, DataContainer $dc)
    {
        $request = $this->requestStack->getCurrentRequest();

        // Generate the aliases
        if ('tl_select' === $request->request->get('FORM_SUBMIT') && $request->request->has('alias')) {
            $ids = $this->session->all()['CURRENT']['IDS'];

            /**
             * @var Controller
             * @var System     $systemAdapter
             * @var TagModel   $tagAdapter
             */
            $controllerAdapter = $this->framework->getAdapter(Controller::class);
            $systemAdapter = $this->framework->getAdapter(System::class);
            $tagAdapter = $this->framework->getAdapter(TagModel::class);

            // Handle each model individually
            if (null !== ($tagModels = $tagAdapter->findMultipleByIds($ids))) {
                /** @var TagModel $tagModel */
                foreach ($tagModels as $tagModel) {
                    $dc->id = $tagModel->id;
                    $dc->activeRecord = $tagModel;

                    $alias = '';

                    // Generate new alias through save callbacks
                    foreach ($GLOBALS['TL_DCA'][$dc->table]['fields']['alias']['save_callback'] as $callback) {
                        if (\is_array($callback)) {
                            $alias = $systemAdapter->importStatic($callback[0])->{$callback[1]}($alias, $dc);
                        } elseif (\is_callable($callback)) {
                            $alias = $callback($alias, $dc);
                        }
                    }

                    // The alias has not changed
                    if ($alias === $tagModel->alias) {
                        continue;
                    }

                    // Initialize the version manager
                    /** @var Versions $versions */
                    $versions = $this->framework->createInstance(Versions::class, [$dc->table, $tagModel->id]);
                    $versions->initialize();

                    // Store the new alias
                    $this->db->update($dc->table, ['alias' => $alias], ['id' => $tagModel->id]);

                    // Create a new version
                    $versions->create();
                }
            }

            $controllerAdapter->redirect($systemAdapter->getReferer());
        }

        // Add the button
        $buttons['alias'] = \sprintf('<button type="submit" name="alias" id="alias" class="tl_submit" accesskey="a">%s</button> ', $GLOBALS['TL_LANG']['MSC']['aliasSelected']);

        return $buttons;
    }