Show Sitemap as tree and save new order if necessary.

@Route("/reorganize", name="victoire_sitemap_reorganize", options={"expose"=true})

@return JsonResponse
11478
public function reorganizeAction(Request $request)
    {
        if ($request->isMethod('POST')) {
            $this->get('victoire_sitemap.sort.handler')->handle(
                $request->request->get('sorted')
            );
            $response['message'] = $this->get('translator')->trans('sitemap.changed.success', [], 'victoire');
        }

        $basePageRepo = $this->getDoctrine()->getManager()->getRepository('VictoirePageBundle:BasePage');
        $basePages = $basePageRepo
            ->getAll()
            ->joinSeo()
            ->joinSeoTranslations($request->getLocale())
            ->run();

        $forms = [];
        foreach ($basePages as $_page) {
            $_pageSeo = $_page->getSeo() ?: new PageSeo();
            $forms[$_page->getId()] = $this->createSitemapPriorityType($_page, $_pageSeo)->createView();
        }

        $response['success'] = true;
        $response['html'] = $this->container->get('templating')->render(
            'VictoireSitemapBundle:Sitemap:reorganize.html.twig',
            [
                'pages' => $basePageRepo->findByParent(null, ['position' => 'ASC']),
                'forms' => $forms,
            ]
        );

        return new JsonResponse($response);
    }
1228617
public function getRewriteMapsAsArray()
    {

        // initialize the array for the rewrite maps
        $rewriteMaps = array();

        // iterate over the rewriteMaps nodes and sort them into an array
        foreach ($this->getRewriteMaps() as $rewriteMapNode) {
            $rewriteMaps[$rewriteMapNode->getType()] = $rewriteMapNode->getParamsAsArray();
        }

        // return the array
        return $rewriteMaps;
    }
730618
public function getNestedController() {
		$request = $this->request;
		$segment = $request->param('URLSegment');
		$site    = Multisites::inst()->getCurrentSiteId();

		if(!$site) {
			return $this->httpError(404);
		}

		$page = SiteTree::get()->filter(array(
			'ParentID'   => $site,
			'URLSegment' => rawurlencode($segment)
		));
		$page = $page->first();

		if(!$page) {
			// Check to see if linkmapping module is installed and if so, if there a map for this request.
			if(class_exists('LinkMapping')){
				$queryString = '?';
				if ($request->requestVars()){
					foreach($request->requestVars() as  $key => $value) {
						if($key !='url'){$queryString .=$key.'='.$value.'&';}
					}
					$queryString =  rtrim($queryString,'&');
				}
				$link = ($queryString != '?' ? $request->getURL().$queryString : $request->getURL());
				$link = trim(Director::makeRelative($link));

				$map  = LinkMapping::get()->filter('MappedLink', $link)->first();

				if ($map) {
					$this->response = new HTTPResponse();
					$this->response->redirect($map->getLink(), 301);
					return $this->response;
				}	
			}
	
			// use OldPageRedirector if it exists, to find old page
			if(class_exists(OldPageRedirector::class)){
				if($redirect = OldPageRedirector::find_old_page(array($segment), Multisites::inst()->getCurrentSite())){
					$redirect = SiteTree::get_by_link($redirect);
				}
			}else{
				$redirect = self::find_old_page($segment, $site);			
			}			

			if($redirect) {
				$getVars = $request->getVars();
				//remove the url var as it confuses the routing
				unset($getVars['url']);
				
				$url = Controller::join_links(
						$redirect->Link(
							Controller::join_links(
								$request->param('Action'),
								$request->param('ID'),
								$request->param('OtherID')
							)
						)
					);
				
				if(!empty($getVars)){
					$url .= '?' . http_build_query($getVars);
				}
				
				$this->response->redirect($url, 301);

				return $this->response;
			}

			return $this->httpError(404);
		}


		return self::controller_for($page, $request->param('Action'));
	}
1160817
public function chart(ServerRequestInterface $request, Tree $tree, ChartService $chart_service): ResponseInterface
    {
        $this->layout = 'layouts/ajax';

        $xref       = $request->getQueryParams()['xref'];
        $individual = Individual::getInstance($xref, $tree);

        Auth::checkIndividualAccess($individual);

        $chart_style = $request->getQueryParams()['chart_style'];
        $generations = (int) $request->getQueryParams()['generations'];

        $generations = min($generations, self::MAXIMUM_GENERATIONS);
        $generations = max($generations, self::MINIMUM_GENERATIONS);

        switch ($chart_style) {
            case self::CHART_STYLE_TREE:
            default:
                return response(view('modules/descendancy_chart/tree', ['individual' => $individual, 'generations' => $generations, 'daboville' => '1']));

            case self::CHART_STYLE_INDIVIDUALS:
                $individuals = $chart_service->descendants($individual, $generations - 1);

                return $this->descendantsIndividuals($tree, $individuals);

            case self::CHART_STYLE_FAMILIES:
                $families = $chart_service->descendantFamilies($individual, $generations - 1);

                return $this->descendantsFamilies($tree, $families);
        }
    }
517675
public function renameAction()
    {
        $this->getResponse()->setTypeJson();
        if (null !== $cat = (new \Cms\Orm\CmsCategoryQuery)->findPk($this->getPost()->id)) {
            $name = trim($this->getPost()->name);
            if (mb_strlen($name) < 2 || mb_strlen($name) > 64) {
                return json_encode(['status' => false, 'error' => $this->view->_('controller.category.rename.validator')]);
            }
            $cat->name = $name;
            if ($cat->save()) {
                return json_encode(['status' => true, 'id' => $cat->id, 'name' => $name, 'message' => $this->view->_('controller.category.rename.message')]);
            }
        }
        return json_encode(['status' => false, 'error' => $this->view->_('controller.category.rename.error')]);
    }
1187501
public function clearAction()
    {
        if (!$this->checkLivePermissionForAllWebspaces()) {
            return new JsonResponse(null, 403);
        }

        $this->get('sulu_website.http_cache.clearer')->clear();

        return new JsonResponse(null, 204);
    }
680385
public function treePageDefaultEdit(): ResponseInterface
    {
        $this->checkDefaultTreeBlocksExist();

        $main_blocks = $this->treeBlocks(-1, 'main');
        $side_blocks = $this->treeBlocks(-1, 'side');

        $all_blocks = $this->availableTreeBlocks();
        $title      = I18N::translate('Set the default blocks for new family trees');
        $url_cancel = route('admin-control-panel');
        $url_save   = route('tree-page-default-update');

        return $this->viewResponse('edit-blocks-page', [
            'all_blocks'  => $all_blocks,
            'can_reset'   => false,
            'main_blocks' => $main_blocks,
            'side_blocks' => $side_blocks,
            'title'       => $title,
            'url_cancel'  => $url_cancel,
            'url_save'    => $url_save,
        ]);
    }
842193
public function jsonGeoAnalysisList() {
        $wt_tree = Globals::getTree();
        $controller = new JsonController();
        $controller
            ->restrictAccess(Auth::isManager($wt_tree));
        
        // Generate an AJAX/JSON response for datatables to load a block of rows
        $search = Filter::postArray('search');
        if($search) $search = $search['value'];
        $start  = Filter::postInteger('start');
        $length = Filter::postInteger('length');
        $order  = Filter::postArray('order');
        
        foreach($order as $key => &$value) {
            switch($value['column']) {
                case 3:
                    $value['column'] = 'majgd_descr';
                    break;
                case 5;
                    $value['column'] = 'majgd_sublevel';
                    break;
                default:
                    unset($order[$key]);
            }
        }
        
        /** @var GeoAnalysisProvider $provider */
        $provider = $this->module->getProvider();
        
        $list = $provider->getFilteredGeoAnalysisList($search, $order, $start, $length);
        $recordsFiltered = count($list);
        $recordsTotal = $this->provider->getGeoAnalysisCount();
        
        $data = array();
        $place_hierarchy = $this->provider->getPlacesHierarchy();
        foreach($list as $ga) {
            /** @var GeoAnalysis $ga */
            
            $datum = array();
            $options= $ga->getOptions();
            
            $datum[0] = '
                <div class="btn-group">
                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                        <i class="fa fa-pencil"></i><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                       <li>
                            <a href="#" onclick="return set_geoanalysis_status('. $ga->getId().', '.($ga->isEnabled() ? 'false' : 'true').', \''.Filter::escapeJs($wt_tree->getName()).'\');">
                                <i class="fa fa-fw '.($ga->isEnabled() ? 'fa-times' : 'fa-check').'"></i> ' . ($ga->isEnabled() ? I18N::translate('Disable') : I18N::translate('Enable')) . '
                            </a>
                       </li>
                        <li>
                            <a href="module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@edit&ga_id='.$ga->getId().'&ged='.$wt_tree->getName().'">
                                <i class="fa fa-fw fa-pencil"></i> ' . I18N::translate('Edit') . '
                            </a>
                       </li>
                       <li class="divider" />
                       <li>
                            <a href="#" onclick="return delete_geoanalysis('. $ga->getId().', \''.Filter::escapeJs($wt_tree->getName()).'\');">
                                <i class="fa fa-fw fa-trash-o"></i> ' . I18N::translate('Delete') . '
                            </a>
                       </li>
                    </ul>
                </div>';
		    $datum[1] = $ga->getId();
		    $datum[2] = $ga->isEnabled() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>';
		    $datum[3] = $ga->getTitle();
		    $analysis_level = $ga->getAnalysisLevel();
		    if($place_hierarchy['type'] == 'header') {
		        $datum[4] = $place_hierarchy['hierarchy'][$analysis_level - 1];
		    } else {
		        $datum[4] = $analysis_level . '(' . $place_hierarchy['hierarchy'][$analysis_level - 1] . ')';
		    }
		    $datum[5] = $ga->getAnalysisLevel();
		    $datum[6] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>';
		    $datum[7] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>';
		    if($ga->hasMap()) {
		        if($options->getMap()->isLoaded()) {
    		        $datum[6] = $options->getMap()->getDescription();
    		        $datum[7] = '<span data-toggle="tooltip" title="' . $options->getMap()->getTopLevelName() . '" />';
    		        $top_level = $options->getMapLevel();
    		        if($place_hierarchy['type'] == 'header') {
    		            $datum[7] .= $place_hierarchy['hierarchy'][$top_level - 1];
    		        } else {
    		            $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')';
    		        }
    		        $datum[7] .= '</span>';
		        }
		        else {
		            $datum[6] = I18N::translate('Error when loading map.');
		        }
		    }
		    $datum[8] = $options->isUsingFlags() ? 
				'<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : 
				'<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>';
		    $datum[9] = $options->getMaxDetailsInGen() > 0 ? $options->getMaxDetailsInGen() : I18N::translate('All');
		    
		    $data[] = $datum;
        }
        
        $controller->pageHeader();
        
        $controller->encode(array(
            'draw'            => Filter::getInteger('draw'),
            'recordsTotal'    => $recordsTotal,
            'recordsFiltered' => $recordsFiltered,
            'data'            => $data
        ));
        
    }
1008013
public function locationsAction() 
	{
		$main = $this->getServiceLocator()->get('neobazaar.service.main');
		$locations = $main->getGeonamesEntityRepository()
        	->getLocationMultioptions($this->getServiceLocator());
		
		return new JsonModel(array('data' => $locations));
	}
595809
public function jsonSerialize()
    {
        $response = [];
        $response['displayMenu'] = $this->collection->displayMenu();
        $response['entries'] = [];
        $response['entryGroups'] = [];
        foreach ($this->collection->getEntries() as $entry) {
            $formatter = new EntryJsonFormatter($entry);
            $response['entries'][] = $formatter->jsonSerialize();
        }
        foreach ($this->collection->getEntryGroups() as $group) {
            $formatter = new GroupJsonFormatter($group);
            $response['entryGroups'][] = $formatter->jsonSerialize();
        }

        return $response;
    }
711432
protected function createSitemapPage()
    {
        $ret = '<?xml version="1.0" encoding="UTF-8"?>';
        $ret .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"';
        $ret .= ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';
        $ret .= ' xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9';
        $ret .= ' http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';

        $pagePriorityDefaultValue     = (float)GeneralUtility::getRootSettingValue('sitemap_priority', 0);
        $pagePriorityDepthMultiplier  = (float)GeneralUtility::getRootSettingValue(
            'sitemap_priority_depth_multiplier',
            0
        );
        $pagePriorityDepthModificator = (float)GeneralUtility::getRootSettingValue(
            'sitemap_priority_depth_modificator',
            0
        );

        if ($pagePriorityDefaultValue == 0) {
            $pagePriorityDefaultValue = 1;
        }

        if ($pagePriorityDepthMultiplier == 0) {
            $pagePriorityDepthMultiplier = 1;
        }

        if ($pagePriorityDepthModificator == 0) {
            $pagePriorityDepthModificator = 1;
        }


        // #####################
        // SetupTS conf
        // #####################

        foreach ($this->sitemapPages as $sitemapPage) {
            if (empty($this->pages[$sitemapPage['page_uid']])) {
                // invalid page
                continue;
            }

            $page = $this->pages[$sitemapPage['page_uid']];

            // #####################################
            // Page priority
            // #####################################
            $pageDepth     = $sitemapPage['page_depth'];
            $pageDepthBase = 1;

            if (!empty($sitemapPage['page_hash'])) {
                // page has module-content - trade as subpage
                ++$pageDepth;
            }

            $pageDepth -= $pagePriorityDepthModificator;


            if ($pageDepth > 0.1) {
                $pageDepthBase = 1 / $pageDepth;
            }

            $pagePriority = $pagePriorityDefaultValue * ($pageDepthBase * $pagePriorityDepthMultiplier);
            if (!empty($page['tx_metaseo_priority'])) {
                $pagePriority = $page['tx_metaseo_priority'] / 100;
            }

            $pagePriority = number_format($pagePriority, 2);

            if ($pagePriority > 1) {
                $pagePriority = '1.00';
            } elseif ($pagePriority <= 0) {
                $pagePriority = '0.00';
            }

            // #####################################
            // Page information
            // #####################################

            // page Url
            $pageUrl = GeneralUtility::fullUrl($sitemapPage['page_url']);

            // Page modification date
            $pageModificationDate = date('c', $sitemapPage['tstamp']);

            // Page change frequency
            $pageChangeFrequency = null;
            if (!empty($page['tx_metaseo_change_frequency'])) {
                // from page
                $pageChangeFrequency = (int)$page['tx_metaseo_change_frequency'];
            } elseif (!empty($sitemapPage['page_change_frequency'])) {
                // from sitemap settings
                $pageChangeFrequency = (int)$sitemapPage['page_change_frequency'];
            } elseif (!empty($this->tsSetup['changeFrequency'])) {
                // default from SetupTS
                $pageChangeFrequency = (int)$this->tsSetup['changeFrequency'];
            }

            // translate change frequency
            if (!empty($pageChangeFrequency) && !empty($this->pageChangeFrequency[$pageChangeFrequency])) {
                $pageChangeFrequency = $this->pageChangeFrequency[$pageChangeFrequency];
            } else {
                $pageChangeFrequency = null;
            }

            // #####################################
            // Sitemal page output
            // #####################################
            $ret .= '<url>';
            $ret .= '<loc>' . htmlspecialchars($pageUrl) . '</loc>';

            if ($this->tsSetup['enableLastMod']) {
                $ret .= '<lastmod>' . $pageModificationDate . '</lastmod>';
            }

            if (!empty($pageChangeFrequency)) {
                $ret .= '<changefreq>' . htmlspecialchars($pageChangeFrequency) . '</changefreq>';
            }

            if ($this->tsSetup['enablePriority']) {
                $ret .= '<priority>' . $pagePriority . '</priority>';
            }

            $ret .= '</url>';
        }


        $ret .= '</urlset>';

        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'sitemapXmlPageOutput', $this, $ret);

        return $ret;
    }
786822
public function allSitePagesAction()
    {
        $entityMgr = $this->getServiceLocator()->get(
            'Doctrine\ORM\EntityManager'
        );
        $currentSite = $this->getServiceLocator()->get(
            \Rcm\Service\CurrentSite::class
        );
        $siteId = $currentSite->getSiteId();

        /** @var Site $site */
        $site = $entityMgr->getRepository(
            Site::class
        )->findOneBy(
            [
                'siteId' => $siteId
            ]
        );

        $pages = $site->getPages();

        $uriFormat = $this->params()->fromQuery('format', null);

        $return = [];

        /** @var Page $page */
        foreach ($pages as $page) {
            $pageName = $page->getName();
            $pageUrl = $this->urlToPage($pageName, $page->getPageType());

            if (!empty($uriFormat)
                && $uriFormat == 'tinyMceLinkList'
            ) {
                $return[] = [
                    'title' => $pageUrl,
                    'value' => $pageUrl
                ];
            } else {
                $return[$pageUrl] = $pageName;
            }
        }
        asort($return);

        return new JsonModel($return);
    }
1133909
public function index(): JsonResponse
    {
        $config = [
            'title' => trans('HCCore::roles.title.list'),
            'roles' => json_encode($this->service->getRolesWithPermissions()),
            'permissions' => json_encode($this->service->getAllPermissions()),
            'updateUrl' => route('v1.api.users.roles.update_permissions'),
        ];

        return $this->response->success('OK', $config);
    }
1292869
public function index() {
        $wt_tree = Globals::getTree();
        Theme::theme(new AdministrationTheme)->init($wt_tree);
        $controller = new PageController();
        $controller
            ->restrictAccess(Auth::isManager($wt_tree))
            ->setPageTitle($this->module->getTitle());
        
        $data = new ViewBag();
        $data->set('title', $controller->getPageTitle());
        $data->set('tree', $wt_tree);
        
        $data->set('root_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig');
                
        $table_id = 'table-geoanalysis-' . Uuid::uuid4();
        $data->set('table_id', $table_id);
        
        $other_trees = array();
        foreach (Tree::getAll() as $tree) {
            if($tree->getTreeId() != $wt_tree->getTreeId()) $other_trees[] = $tree;
        }      
        $data->set('other_trees', $other_trees);
        
        $data->set('places_hierarchy', $this->provider->getPlacesHierarchy());
        
        $controller
            ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)
            ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)
            ->addInlineJavascript('
				jQuery.fn.dataTableExt.oSort["text-asc"] = textCompareAsc;
				jQuery.fn.dataTableExt.oSort["text-desc"] = textCompareDesc;
                
				var geoAnalysisTable = jQuery("#'.$table_id.'")
                .on("draw.dt", function ( e, settings, json, xhr ) {
                    jQuery("[data-toggle=\'tooltip\']").tooltip();
                }).DataTable({
					'.I18N::datatablesI18N().',			
					sorting: [[3, "asc"], [4, "asc"]],
					pageLength: 10,
                    processing: true,
                    serverSide : true,
					ajax : {
						url : "module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@jsonGeoAnalysisList&ged='. $wt_tree->getNameUrl().'",
                        type : "POST"
					},
                    columns: [
						/* 0 Edit		 	*/ { sortable: false, className: "text-center"},
                        /* 1 ID             */ { sortable: false, visible: false},
						/* 2 Enabled 		*/ { sortable: false, className: "text-center"  },
						/* 3 Description	*/ { type: "text" },
						/* 4 Analysis Level	*/ { type: "text", dataSort: 5, className: "text-center" },
						/* 5 ANAL_LEVEL_SORT*/ { type: "num", visible: false },
						/* 6 Map 	        */ { type: "text", sortable: false, className: "text-center" },
						/* 7 Map Top Level 	*/ { type: "text", sortable: false, className: "text-center" },
						/* 8 Use Flags     	*/ { type: "text", sortable: false, className: "text-center" },					
						/* 9 Place Details	*/ { type: "text", sortable: false, className: "text-center" }
					],
				});
                
                ')
                ->addInlineJavascript('				
                    function set_geoanalysis_status(ga_id, status, gedcom) {
                		jQuery.ajax({
                            url: "module.php", 
                            type: "GET",
                            data: {
                			    mod: "' . $this->module->getName() .'",
                                mod_action:  "GeoAnalysis@setStatus",
                			    ga_id: ga_id,
                			    ged: typeof gedcom === "undefined" ? WT_GEDCOM : gedcom,
                                status: status
                            },
                            error: function(result, stat, error) {
                                var err = typeof result.responseJSON === "undefined" ? error : result.responseJSON.error;
                                alert("' . I18N::translate('An error occured while editing this analysis:') . '" + err);
                            },
                            complete: function(result, stat) {
                                geoAnalysisTable.ajax.reload(null, false);
                            }                            
                		});
                    }
                    
                    function delete_geoanalysis(ga_id, status, gedcom) {
                		jQuery.ajax({
                            url: "module.php", 
                            type: "GET",
                            data: {
                			    mod: "' . $this->module->getName() .'",
                                mod_action:  "GeoAnalysis@delete",
                			    ga_id: ga_id,
                			    ged: typeof gedcom === "undefined" ? WT_GEDCOM : gedcom
                            },
                            error: function(result, stat, error) {
                                var err = typeof result.responseJSON === "undefined" ? error : result.responseJSON.error;
                                alert("' . I18N::translate('An error occured while deleting this analysis:') . '" + err);
                            },
                            complete: function(result, stat) {
                                geoAnalysisTable.ajax.reload(null, false);
                            }                            
                		});
                    }
                ');
        
        
        ViewFactory::make('AdminConfig', $this, $controller, $data)->render();
    }
1186867
public function listAction()
    {
        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSet = $metaSetManager->findAll();

        $data = [];
        foreach ($metaSet as $set) {
            /* @var $set MetaSetInterface */

            $data[] = [
                'id' => $set->getId(),
                'name' => $set->getName(),
                'createdAt' => $set->getCreatedAt() ? $set->getCreatedAt()->format('Y-m-d H:i:s') : null,
                'createUser' => $set->getCreateUser(),
                'modifiedAt' => $set->getModifiedAt() ? $set->getModifiedAt()->format('Y-m-d H:i:s') : null,
                'modifyUser' => $set->getModifyUser(),
                'revision' => $set->getRevision(),
            ];
        }

        return new JsonResponse(['sets' => $data]);
    }
357248
public function index()
    {
        $urls = [];
        foreach ($this->actions as $action => $description) {
            $fired = \Illuminate\Support\Facades\Event::fire('analyzer:before.' . $action);
            if (!empty($fired)) {
                array_push($urls, current($fired));
            }
            array_push($urls, [
                'url'         => handles('antares::logger/analyze/' . $action, ['csrf' => true]),
                'description' => $description,
            ]);
        }
        return new JsonResponse($urls);
    }
742656
public function sortAction(Request $request)
    {
        $tid = $request->get('tid');
        $mode = $request->get('mode');
        $dir = strtolower($request->get('dir'));
        $sortTids = $request->get('sort_ids');
        $sortTids = json_decode($sortTids, true);

        $treeManager = $this->get('phlexible_tree.tree_manager');
        $nodeSorter = $this->get('phlexible_tree.node_sorter');

        $tree = $treeManager->getByNodeId($tid);
        $node = $tree->get($tid);

        $node->setSortMode($mode);
        $node->setSortDir($dir);

        if ($mode !== TreeInterface::SORT_MODE_FREE) {
            $sortTids = $nodeSorter->sort($node);
        }

        if (count($sortTids)) {
            $tree->reorderChildren($node, $sortTids);
        }

        return new ResultResponse(true, 'Tree sort published.');
    }