src/Webtrees/Module/GeoDispersion/AdminConfigController.php
protected function renderEdit(GeoAnalysis $ga = null) {
        $wt_tree = Globals::getTree();
        Theme::theme(new AdministrationTheme)->init($wt_tree);
        $controller = new PageController();        
        $controller
            ->restrictAccess(Auth::isManager($wt_tree))
            ->addInlineJavascript('
                function toggleMapOptions() {
                    if($("input:radio[name=\'use_map\']:checked").val() == 1) {
                        $("#map_options").show();
                    }
                    else {
                        $("#map_options").hide();
                    }
                }
        
                $("[name=\'use_map\']").on("change", toggleMapOptions);
                toggleMapOptions();
            ');
        
        $data = new ViewBag();
        if($ga) {
            $controller->setPageTitle(I18N::translate('Edit the geographical dispersion analysis'));
            $data->set('geo_analysis', $ga);
        } else {
            $controller->setPageTitle(I18N::translate('Add a geographical dispersion analysis'));
        }
        
        $data->set('title', $controller->getPageTitle());
        $data->set('admin_config_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $wt_tree->getNameUrl());
        $data->set('module_title', $this->module->getTitle());
        $data->set('save_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@save&ged=' . $wt_tree->getNameUrl());
        $data->set('places_hierarchy', $this->provider->getPlacesHierarchy());
    
        $map_list = array_map(
            function(OutlineMap $map) {
                return $map->getDescription();
            },
            $this->provider->getOutlineMapsList()
            );
        asort($map_list);
        $data->set('map_list', $map_list);
    
        $gen_details = array(0 => I18N::translate('All'));
        for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i;
        $data->set('generation_details', $gen_details);
    
        ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render();
    }
protected function renderEdit(GeoAnalysis $ga = null) {
        $wt_tree = Globals::getTree();
        Theme::theme(new AdministrationTheme)->init($wt_tree);
        $controller = new PageController();        
        $controller
            ->restrictAccess(Auth::isManager($wt_tree))
            ->addInlineJavascript('
                function toggleMapOptions() {
                    if($("input:radio[name=\'use_map\']:checked").val() == 1) {
                        $("#map_options").show();
                    }
                    else {
                        $("#map_options").hide();
                    }
                }
        
                $("[name=\'use_map\']").on("change", toggleMapOptions);
                toggleMapOptions();
            ');
        
        $data = new ViewBag();
        if($ga) {
            $controller->setPageTitle(I18N::translate('Edit the geographical dispersion analysis'));
            $data->set('geo_analysis', $ga);
        } else {
            $controller->setPageTitle(I18N::translate('Add a geographical dispersion analysis'));
        }
        
        $data->set('title', $controller->getPageTitle());
        $data->set('admin_config_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $wt_tree->getNameUrl());
        $data->set('module_title', $this->module->getTitle());
        $data->set('save_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@save&ged=' . $wt_tree->getNameUrl());
        $data->set('places_hierarchy', $this->provider->getPlacesHierarchy());
    
        $map_list = array_map(
            function(OutlineMap $map) {
                return $map->getDescription();
            },
            $this->provider->getOutlineMapsList()
            );
        asort($map_list);
        $data->set('map_list', $map_list);
    
        $gen_details = array(0 => I18N::translate('All'));
        for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i;
        $data->set('generation_details', $gen_details);
    
        ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render();
    }
protected function renderEdit ( GeoAnalysis $ ga = null ) { $ wt_tree = Globals :: getTree ( ) ; Theme :: theme ( new AdministrationTheme ) -> init ( $ wt_tree ) ; $ controller = new PageController ( ) ; $ controller -> restrictAccess ( Auth :: isManager ( $ wt_tree ) ) -> addInlineJavascript ( '
                function toggleMapOptions() {
                    if($("input:radio[name=\'use_map\']:checked").val() == 1) {
                        $("#map_options").show();
                    }
                    else {
                        $("#map_options").hide();
                    }
                }
        
                $("[name=\'use_map\']").on("change", toggleMapOptions);
                toggleMapOptions();
            ' ) ; $ data = new ViewBag ( ) ; if ( $ ga ) { $ controller -> setPageTitle ( I18N :: translate ( 'Edit the geographical dispersion analysis' ) ) ; $ data -> set ( 'geo_analysis' , $ ga ) ; } else { $ controller -> setPageTitle ( I18N :: translate ( 'Add a geographical dispersion analysis' ) ) ; } $ data -> set ( 'title' , $ controller -> getPageTitle ( ) ) ; $ data -> set ( 'admin_config_url' , 'module.php?mod=' . $ this -> module -> getName ( ) . '&mod_action=AdminConfig&ged=' . $ wt_tree -> getNameUrl ( ) ) ; $ data -> set ( 'module_title' , $ this -> module -> getTitle ( ) ) ; $ data -> set ( 'save_url' , 'module.php?mod=' . $ this -> module -> getName ( ) . '&mod_action=AdminConfig@save&ged=' . $ wt_tree -> getNameUrl ( ) ) ; $ data -> set ( 'places_hierarchy' , $ this -> provider -> getPlacesHierarchy ( ) ) ; $ map_list = array_map ( function ( OutlineMap $ map ) { return $ map -> getDescription ( ) ; } , $ this -> provider -> getOutlineMapsList ( ) ) ; asort ( $ map_list ) ; $ data -> set ( 'map_list' , $ map_list ) ; $ gen_details = array ( 0 => I18N :: translate ( 'All' ) ) ; for ( $ i = 1 ; $ i <= 10 ; $ i ++ ) $ gen_details [ $ i ] = $ i ; $ data -> set ( 'generation_details' , $ gen_details ) ; ViewFactory :: make ( 'GeoAnalysisEdit' , $ this , $ controller , $ data ) -> render ( ) ; }
Renders the edit form, whether it is an edition of an existing GeoAnalysis, or the addition of a new one.

@param (GeoAnalysis!null) $ga GeoAnalysis to edit
Renders the edit form whether it is an edition of an existing GeoAnalysis or the addition of a new one .