. */ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Module\CkeditorModule; /** @global Tree $WT_TREE */ global $WT_TREE; require 'includes/session.php'; $block_id = Filter::getInteger('block_id'); $block_info = Database::prepare( "SELECT SQL_CACHE * FROM `##block` WHERE block_id = :block_id" )->execute([ 'block_id' => $block_id, ])->fetchOneRow(); // A non-existant block? if ($block_info === null) { header('Location: ' . Html::url('index.php', [])); } $ctype = $block_info !== null && $block_info->user_id !== null ? 'user' : 'gedcom'; // Check access. (1) the block must exist and be enabled, (2) gedcom blocks require // managers, (3) user blocks require the user or an admin $blocks = Module::getActiveBlocks($WT_TREE); if ( !array_key_exists($block_info->module_name, $blocks) || $block_info->gedcom_id && !Auth::isManager(Tree::findById($block_info->gedcom_id)) || $block_info->user_id && $block_info->user_id != Auth::id() && !Auth::isAdmin() ) { header('Location: ' . Html::url('index.php', ['ctype' => $ctype, 'ged' => $WT_TREE->getName()])); return; } $block = $blocks[$block_info->module_name]; if (Filter::post('save')) { header('Location: ' . Html::url('index.php', ['ctype' => $ctype, 'ged' => $WT_TREE->getName()])); $block->configureBlock($block_id); return; } $controller = new PageController; $controller ->setPageTitle($block->getTitle() . ' — ' . I18N::translate('Preferences')) ->pageHeader(); if (Module::getModuleByName('ckeditor')) { CkeditorModule::enableEditor($controller); } ?>

getPageTitle() ?>

getDescription() ?>

configureBlock($block_id) ?>