. */ namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsPrint; use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Menu; use Fisharebest\Webtrees\Module\ClippingsCart\ClippingsCartController; use Fisharebest\Webtrees\Session; /** * Class ClippingsCartModule */ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, ModuleSidebarInterface { /** {@inheritdoc} */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Clippings cart'); } /** {@inheritdoc} */ public function getDescription() { return /* I18N: Description of the “Clippings cart” module */ I18N::translate('Select records from your family tree and save them as a GEDCOM file.'); } /** * What is the default access level for this module? * * Some modules are aimed at admins or managers, and are not generally shown to users. * * @return int */ public function defaultAccessLevel() { return Auth::PRIV_USER; } /** * 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) { switch ($mod_action) { case 'ajax': $html = $this->getSidebarAjaxContent(); header('Content-Type: text/html; charset=UTF-8'); echo $html; break; case 'index': global $controller, $WT_TREE; $MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'); $clip_ctrl = new ClippingsCartController; $cart = Session::get('cart'); $controller = new PageController; $controller ->setPageTitle($this->getTitle()) ->PageHeader() ->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL) ->addInlineJavascript('autocomplete();'); echo ''; if (!$cart[$WT_TREE->getTreeId()]) { echo '