/** * Get significant information from this page, to allow other pages such as * charts and reports to initialise with the same records * * @return Individual */ public function getSignificantIndividual() { if ($this->root) { return $this->root; } else { return parent::getSignificantIndividual(); } }
/** * WelcomeBlock@index * * @param PageController $parent_controller * @param Tree $tree * @param string $block_id * @param string $template * @return $string */ public function index(PageController $parent_controller, Tree $tree, $block_id, $template) { $view_bag = new ViewBag(); if ($parent_controller && $tree) { $view_bag->set('tree', $tree); $view_bag->set('indi', $parent_controller->getSignificantIndividual()); $id = $this->module->getName() . $block_id; $class = $this->module->getName() . '_block'; $parent_controller->addInlineJavascript(' jQuery("#maj-new_passwd").hide(); jQuery("#maj-passwd_click").click(function() { jQuery("#maj-new_passwd").slideToggle(100, function() { jQuery("#maj-new_passwd_username").focus(); }); return false; }); '); if (Auth::isAdmin()) { $title = '<a class="icon-admin" title="' . I18N::translate('Configure') . '" href="block_edit.php?block_id=' . $block_id . '&ged=' . $tree->getNameHtml() . '&ctype=gedcom"></a>'; } else { $title = ''; } $title .= '<span dir="auto">' . $tree->getTitleHtml() . '</span>'; $piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false); $view_bag->set('piwik_enabled', $piwik_enabled); if ($piwik_enabled) { $parent_controller->addInlineJavascript('$("#piwik_stats") .load("module.php?mod=' . $this->module->getName() . '&mod_action=Piwik&block_id=' . $block_id . '");'); } $content = ViewFactory::make('WelcomeBlock', $this, new BaseController(), $view_bag)->getHtmlPartial(); if ($template) { return Theme::theme()->formatBlock($id, $title, $class, $content); } else { return $content; } } }
/** * Get significant information from this page, to allow other pages such as * charts and reports to initialise with the same records * * @return Individual */ public function getSignificantIndividual() { global $WT_TREE; if ($this->people) { return $this->people[0]; } else { return parent::getSignificantIndividual(); } }
} if (!isset($input['default'])) { $input['default'] = ''; } if (!isset($input['lookup'])) { $input['lookup'] = ''; } if ($input['type'] == 'text') { echo '<input'; switch ($input['lookup']) { case 'INDI': echo ' data-autocomplete-type="INDI"'; if (!empty($pid)) { $input['default'] = $pid; } else { $input['default'] = $controller->getSignificantIndividual()->getXref(); } break; case 'FAM': echo ' data-autocomplete-type="FAM"'; if (!empty($famid)) { $input['default'] = $famid; } else { $input['default'] = $controller->getSignificantFamily()->getXref(); } break; case 'SOUR': echo ' data-autocomplete-type="SOUR"'; if (!empty($sid)) { $input['default'] = $sid; }
/** * Get significant information from this page, to allow other pages such as * charts and reports to initialise with the same records * * @return Individual */ public function getSignificantIndividual() { global $WT_TREE; if ($this->pids) { return Individual::getInstance($this->pids[0], $WT_TREE); } else { return parent::getSignificantIndividual(); } }