/**
     * This is a general purpose hook, allowing modules to respond to routes
     * of the form module.php?mod=FOO&mod_action=BAR
     *
     * @param string $mod_action
     */
    public function modAction($mod_action)
    {
        global $controller, $WT_TREE;
        switch ($mod_action) {
            case 'treeview':
                $controller = new ChartController();
                $tv = new TreeView('tv');
                ob_start();
                $person = $controller->getSignificantIndividual();
                list($html, $js) = $tv->drawViewport($person, 4);
                $controller->setPageTitle(I18N::translate('Interactive tree of %s', $person->getFullName()))->pageHeader()->addExternalJavascript($this->js())->addExternalJavascript(WT_JQUERYUI_TOUCH_PUNCH_URL)->addInlineJavascript($js)->addInlineJavascript('
					if (document.createStyleSheet) {
						document.createStyleSheet("' . $this->css() . '"); // For Internet Explorer
					} else {
						jQuery("head").append(\'<link rel="stylesheet" type="text/css" href="' . $this->css() . '">\');
					}
				');
                echo $html;
                break;
            case 'getDetails':
                header('Content-Type: text/html; charset=UTF-8');
                $pid = Filter::get('pid', WT_REGEX_XREF);
                $i = Filter::get('instance');
                $tv = new TreeView($i);
                $individual = Individual::getInstance($pid, $WT_TREE);
                if ($individual) {
                    echo $tv->getDetails($individual);
                }
                break;
            case 'getPersons':
                header('Content-Type: text/html; charset=UTF-8');
                $q = Filter::get('q');
                $i = Filter::get('instance');
                $tv = new TreeView($i);
                echo $tv->getPersons($q);
                break;
            default:
                http_response_code(404);
                break;
        }
    }