public function childrenAction(Request $request, Tag $tag = null)
    {
        if (empty($request->request->get('Tags'))) {
            $this->addFlashMessage('errors', 'no_selected_tags');

            return $this->redirectToTag($tag);
        }

        $this->get('session')->set(
            'ngtags_tag_ids',
            $request->request->get('Tags')
        );

        if ($request->request->has('MoveTagsAction')) {
            return $this->redirectToRoute(
                'netgen_tags_admin_tag_move_tags',
                [
                    'parentId' => $tag !== null ? $tag->id : 0,
                ]
            );
        }

        if ($request->request->has('CopyTagsAction')) {
            return $this->redirectToRoute(
                'netgen_tags_admin_tag_copy_tags',
                [
                    'parentId' => $tag !== null ? $tag->id : 0,
                ]
            );
        }

        if ($request->request->has('DeleteTagsAction')) {
            return $this->redirectToRoute(
                'netgen_tags_admin_tag_delete_tags',
                [
                    'parentId' => $tag !== null ? $tag->id : 0,
                ]
            );
        }

        return $this->redirect($request->getPathInfo());
    }