Generate a list of potential problems with the server.

@param Tree $tree

@return string[]
480357
private function tagsForPrivacy(Tree $tree): array
    {
        $tags = array_unique(array_merge(
            explode(',', $tree->getPreference('INDI_FACTS_ADD')),
            explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')),
            explode(',', $tree->getPreference('FAM_FACTS_ADD')),
            explode(',', $tree->getPreference('FAM_FACTS_UNIQUE')),
            explode(',', $tree->getPreference('NOTE_FACTS_ADD')),
            explode(',', $tree->getPreference('NOTE_FACTS_UNIQUE')),
            explode(',', $tree->getPreference('SOUR_FACTS_ADD')),
            explode(',', $tree->getPreference('SOUR_FACTS_UNIQUE')),
            explode(',', $tree->getPreference('REPO_FACTS_ADD')),
            explode(',', $tree->getPreference('REPO_FACTS_UNIQUE')),
            [
                'SOUR',
                'REPO',
                'OBJE',
                '_PRIM',
                'NOTE',
                'SUBM',
                'SUBN',
                '_UID',
                'CHAN',
            ]
        ));

        $all_tags = [];

        foreach ($tags as $tag) {
            if ($tag) {
                $all_tags[$tag] = GedcomTag::getLabel($tag);
            }
        }

        uasort($all_tags, '\Fisharebest\Webtrees\I18N::strcasecmp');

        return array_merge(
            ['' => I18N::translate('All facts and events')],
            $all_tags
        );
    }
792755
public function delete(Tree $tree): ResponseInterface
    {
        /* I18N: %s is the name of a family tree */
        FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', e($tree->title())), 'success');

        $tree->delete();

        $url = route('admin-trees');

        return redirect($url);
    }
1164295
public function renderTree( $tree = NULL ){														//  
		$list	= array();																			//  
		if( is_null( $tree ) )																		//  
			$tree	= $this->tree;																	//  
		foreach( $tree as $item ){
			$link	= UI_HTML_Tag::create( 'a', $item->label, array( 'href' => "#".$item->id ) );	//  
			$attributes		= array( 'class' => 'level-'.$item->level );							//  
			$subtree		= $this->renderTree( $item->children );									//  
			$list[]	= UI_HTML_Elements::ListItem( $link.$subtree, 0, $attributes );					//  
		}
		return UI_HTML_Tag::create( 'ul', $list, array( 'class' => 'index-tree' ) );				//  
	}
323879
public function getFooter(?Tree $tree): string
    {
        if ($tree === null) {
            return '';
        }

        $contact_user   = $this->user_service->find((int) $tree->getPreference('CONTACT_USER_ID'));
        $webmaster_user = $this->user_service->find((int) $tree->getPreference('WEBMASTER_USER_ID'));

        if ($contact_user instanceof User && $contact_user === $webmaster_user) {
            return view('modules/contact-links/footer', [
                'contact_links' => $this->contactLinkEverything($contact_user),
            ]);
        }

        if ($contact_user instanceof User && $webmaster_user instanceof User) {
            return view('modules/contact-links/footer', [
                'contact_links' => $this->contactLinkGenealogy($contact_user) . '<br>' . $this->contactLinkTechnical($webmaster_user),
            ]);
        }

        if ($contact_user instanceof User) {
            return view('modules/contact-links/footer', [
                'contact_links' => $this->contactLinkGenealogy($contact_user),
            ]);
        }

        if ($webmaster_user instanceof User) {
            return view('modules/contact-links/footer', [
                'contact_links' => $this->contactLinkTechnical($webmaster_user),
            ]);
        }

        return '';
    }
1012786
protected function _buildTree()
    {
        $returnTree = array();
        foreach ((array) $this->_return as $value) {
            $node = new Zend_Server_Reflection_Node($value);
            $this->_addTree($node);
            $returnTree[] = $node;
        }

        return $returnTree;
    }
16855
private static function splitFilters(array $tree): array
    {
        $n = \count($tree);

        $filters = $temp = [];
        $lastSplit = null;

        $first = \array_search('|', $tree, false);

        for ($i = $n - 1; $i >= $first; --$i) {
            $part = $tree[$n];

            if (\is_array($part)) {
                $temp[] = $part;
                continue;
            }

            /* @var Token $part */
            if ($part->is('|')) {
                if ($temp === []) {
                    throw new \InvalidArgumentException('Invalid filter syntax');
                }

                $count = \count($temp);

                $args = [];
                if ($count === 1) {
                    $name = $temp[0];
                } elseif ($count === 2) {
                    [$args, $name] = $temp;
                } else {
                    break;
                }

                if ($name instanceof Token && \is_array($args) && $name->is(T_STRING)) {
                    $lastSplit = $i;
                    $filters[] = [$name, $args];
                } else {
                    break;
                }
            } else {
                $temp[] = $part;
            }
        }

        $tree = \array_slice($tree, 0, $lastSplit);
        $filters = \array_reverse($filters);

        return [$tree, $filters];
    }
944217
public function render_tree(tree $tree) {
        $return = \html_writer::start_tag('div', array('class' => 'profile_tree'));
        $categories = $tree->categories;
        foreach ($categories as $category) {
            $return .= $this->render($category);
        }
        $return .= \html_writer::end_tag('div');
        return $return;
    }
103005
public function export(Tree $tree): ResponseInterface
    {
        $title = I18N::translate('Export a GEDCOM file') . ' — ' . e($tree->title());

        return $this->viewResponse('admin/trees-export', [
            'title' => $title,
            'tree'  => $tree,
        ]);
    }
1280648
public static function dendrogramToClusters($tree,$NC)
    {
        $clusters = $tree;
        while (count($clusters)<$NC) {
            $tmpc = array();
            foreach ($clusters as $subclust) {
                if (!is_array($subclust))
                    $tmpc[] = $subclust;
                else {
                    foreach ($subclust as $c)
                        $tmpc[] = $c;
                }
            }
            $clusters = $tmpc;
        }
        foreach ($clusters as &$c) {
            $c = iterator_to_array(
                new \RecursiveIteratorIterator(
                    new \RecursiveArrayIterator(
                        array($c)
                    )
                ),
                false // do not use keys
            );
        }

        return $clusters;
    }
525455
public function getShowAction(Tree $tree): ResponseInterface
    {
        return $this->viewResponse('modules/clippings/show', [
            'records' => $this->allRecordsInCart($tree),
            'title'   => I18N::translate('Family tree clippings cart'),
            'tree'    => $tree,
        ]);
    }
875128
public function generateTreePerimeter(array $tree)
    {
        $result = array();

        foreach ($tree as $leaf) {
            $result = array_merge($result, $this->formatPerimeter($leaf));
        }

        return $result;
    }
897293
private function privacyRestrictions(Tree $tree): array
    {
        return DB::table('default_resn')
            ->where('gedcom_id', '=', $tree->id())
            ->get()
            ->map(static function (stdClass $row) use ($tree): stdClass {
                $row->record = null;
                $row->label  = '';

                if ($row->xref !== null) {
                    $row->record = GedcomRecord::getInstance($row->xref, $tree);
                }

                if ($row->tag_type) {
                    $row->tag_label = GedcomTag::getLabel($row->tag_type);
                } else {
                    $row->tag_label = '';
                }

                return $row;
            })
            ->sort(static function (stdClass $x, stdClass $y): int {
                return I18N::strcasecmp($x->tag_label, $y->tag_label);
            })
            ->all();
    }
872575
private function allFolders(Tree $tree): array
    {
        $folders = DB::table('media_file')
            ->where('m_file', '=', $tree->id())
            ->where('multimedia_file_refn', 'NOT LIKE', 'http:%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https:%')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->pluck('multimedia_file_refn', 'multimedia_file_refn')
            ->map(static function (string $path): string {
                return dirname($path);
            })
            ->unique()
            ->sort()
            ->all();

        // Ensure we have an empty (top level) folder.
        array_unshift($folders, '');

        return array_combine($folders, $folders);
    }
1012939
public function getEmptyAction(Tree $tree): ResponseInterface
    {
        $cart                = Session::get('cart', []);
        $cart[$tree->name()] = [];
        Session::put('cart', $cart);

        $url = route('module', [
            'module' => $this->name(),
            'action' => 'Show',
            'ged'    => $tree->name(),
        ]);

        return redirect($url);
    }
1190956
public function reportList(Tree $tree, UserInterface $user): ResponseInterface
    {
        $title = I18N::translate('Choose a report to run');

        return $this->viewResponse('report-select-page', [
            'reports' => $this->module_service->findByComponent(ModuleReportInterface::class, $tree, $user),
            'title'   => $title,
        ]);
    }
286876
public function getMenu(Tree $tree): ?Menu
    {
        $submenu = [
            $this->menuSearchGeneral($tree),
            $this->menuSearchPhonetic($tree),
            $this->menuSearchAdvanced($tree),
            $this->menuSearchAndReplace($tree),
        ];

        $submenu = array_filter($submenu);

        return new Menu(I18N::translate('Search'), '#', 'menu-search', ['rel' => 'nofollow'], $submenu);
    }
62212
public function rejectAllChanges(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $url = $request->get('url', '');

        DB::table('change')
            ->where('gedcom_id', '=', $tree->id())
            ->where('status', '=', 'pending')
            ->update(['status' => 'rejected']);

        return redirect(route('show-pending', [
            'ged' => $tree->name(),
            'url' => $url,
        ]));
    }