repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
fisharebest/webtrees
app/Services/HousekeepingService.php
HousekeepingService.deleteFileOrFolder
private function deleteFileOrFolder(Filesystem $filesystem, string $path): bool { if ($filesystem->has($path)) { try { $metadata = $filesystem->getMetadata($path); if ($metadata['type'] === 'dir') { $filesystem->deleteDir($path); ...
php
private function deleteFileOrFolder(Filesystem $filesystem, string $path): bool { if ($filesystem->has($path)) { try { $metadata = $filesystem->getMetadata($path); if ($metadata['type'] === 'dir') { $filesystem->deleteDir($path); ...
[ "private", "function", "deleteFileOrFolder", "(", "Filesystem", "$", "filesystem", ",", "string", "$", "path", ")", ":", "bool", "{", "if", "(", "$", "filesystem", "->", "has", "(", "$", "path", ")", ")", "{", "try", "{", "$", "metadata", "=", "$", "...
Delete a file or folder, if we can. @param Filesystem $filesystem @param string $path @return bool
[ "Delete", "a", "file", "or", "folder", "if", "we", "can", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/HousekeepingService.php#L454-L473
train
fisharebest/webtrees
app/Report/ReportBaseText.php
ReportBaseText.setWrapWidth
public function setWrapWidth(float $wrapwidth, float $cellwidth): float { $this->wrapWidthCell = $cellwidth; if (strpos($this->text, "\n") !== false) { $this->wrapWidthRemaining = $cellwidth; } else { $this->wrapWidthRemaining = $wrapwidth; } return $...
php
public function setWrapWidth(float $wrapwidth, float $cellwidth): float { $this->wrapWidthCell = $cellwidth; if (strpos($this->text, "\n") !== false) { $this->wrapWidthRemaining = $cellwidth; } else { $this->wrapWidthRemaining = $wrapwidth; } return $...
[ "public", "function", "setWrapWidth", "(", "float", "$", "wrapwidth", ",", "float", "$", "cellwidth", ")", ":", "float", "{", "$", "this", "->", "wrapWidthCell", "=", "$", "cellwidth", ";", "if", "(", "strpos", "(", "$", "this", "->", "text", ",", "\"\...
Set the width for word-wrapping. @param float $wrapwidth @param float $cellwidth @return float
[ "Set", "the", "width", "for", "word", "-", "wrapping", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportBaseText.php#L72-L82
train
fisharebest/webtrees
app/Statistics/Google/ChartMedia.php
ChartMedia.chartMedia
public function chartMedia( array $media, string $color_from = null, string $color_to = null ): string { $chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values'); $chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values'); ...
php
public function chartMedia( array $media, string $color_from = null, string $color_to = null ): string { $chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values'); $chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values'); ...
[ "public", "function", "chartMedia", "(", "array", "$", "media", ",", "string", "$", "color_from", "=", "null", ",", "string", "$", "color_to", "=", "null", ")", ":", "string", "{", "$", "chart_color1", "=", "(", "string", ")", "$", "this", "->", "theme...
Create a chart of media types. @param array $media The list of media types to display @param string|null $color_from @param string|null $color_to @return string
[ "Create", "a", "chart", "of", "media", "types", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Google/ChartMedia.php#L59-L93
train
fisharebest/webtrees
app/User.php
User.setEmail
public function setEmail($email): User { if ($this->email !== $email) { $this->email = $email; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'email' => $email, ]); } return $t...
php
public function setEmail($email): User { if ($this->email !== $email) { $this->email = $email; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'email' => $email, ]); } return $t...
[ "public", "function", "setEmail", "(", "$", "email", ")", ":", "User", "{", "if", "(", "$", "this", "->", "email", "!==", "$", "email", ")", "{", "$", "this", "->", "email", "=", "$", "email", ";", "DB", "::", "table", "(", "'user'", ")", "->", ...
Set the email address of this user. @param string $email @return User
[ "Set", "the", "email", "address", "of", "this", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L89-L102
train
fisharebest/webtrees
app/User.php
User.setRealName
public function setRealName($real_name): User { if ($this->real_name !== $real_name) { $this->real_name = $real_name; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'real_name' => $real_name, ]...
php
public function setRealName($real_name): User { if ($this->real_name !== $real_name) { $this->real_name = $real_name; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'real_name' => $real_name, ]...
[ "public", "function", "setRealName", "(", "$", "real_name", ")", ":", "User", "{", "if", "(", "$", "this", "->", "real_name", "!==", "$", "real_name", ")", "{", "$", "this", "->", "real_name", "=", "$", "real_name", ";", "DB", "::", "table", "(", "'u...
Set the real name of this user. @param string $real_name @return User
[ "Set", "the", "real", "name", "of", "this", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L121-L134
train
fisharebest/webtrees
app/User.php
User.setUserName
public function setUserName($user_name): self { if ($this->user_name !== $user_name) { $this->user_name = $user_name; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'user_name' => $user_name, ]...
php
public function setUserName($user_name): self { if ($this->user_name !== $user_name) { $this->user_name = $user_name; DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'user_name' => $user_name, ]...
[ "public", "function", "setUserName", "(", "$", "user_name", ")", ":", "self", "{", "if", "(", "$", "this", "->", "user_name", "!==", "$", "user_name", ")", "{", "$", "this", "->", "user_name", "=", "$", "user_name", ";", "DB", "::", "table", "(", "'u...
Set the login name for this user. @param string $user_name @return $this
[ "Set", "the", "login", "name", "for", "this", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L153-L166
train
fisharebest/webtrees
app/User.php
User.setPreference
public function setPreference(string $setting_name, string $setting_value): UserInterface { if ($this->user_id !== 0 && $this->getPreference($setting_name) !== $setting_value) { DB::table('user_setting')->updateOrInsert([ 'user_id' => $this->user_id, 'setting...
php
public function setPreference(string $setting_name, string $setting_value): UserInterface { if ($this->user_id !== 0 && $this->getPreference($setting_name) !== $setting_value) { DB::table('user_setting')->updateOrInsert([ 'user_id' => $this->user_id, 'setting...
[ "public", "function", "setPreference", "(", "string", "$", "setting_name", ",", "string", "$", "setting_value", ")", ":", "UserInterface", "{", "if", "(", "$", "this", "->", "user_id", "!==", "0", "&&", "$", "this", "->", "getPreference", "(", "$", "settin...
Update a setting for the user. @param string $setting_name @param string $setting_value @return UserInterface
[ "Update", "a", "setting", "for", "the", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L201-L217
train
fisharebest/webtrees
app/User.php
User.setPassword
public function setPassword(string $password): User { DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'password' => password_hash($password, PASSWORD_DEFAULT), ]); return $this; }
php
public function setPassword(string $password): User { DB::table('user') ->where('user_id', '=', $this->user_id) ->update([ 'password' => password_hash($password, PASSWORD_DEFAULT), ]); return $this; }
[ "public", "function", "setPassword", "(", "string", "$", "password", ")", ":", "User", "{", "DB", "::", "table", "(", "'user'", ")", "->", "where", "(", "'user_id'", ",", "'='", ",", "$", "this", "->", "user_id", ")", "->", "update", "(", "[", "'pass...
Set the password of this user. @param string $password @return User
[ "Set", "the", "password", "of", "this", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L226-L235
train
fisharebest/webtrees
app/User.php
User.checkPassword
public function checkPassword(string $password): bool { $password_hash = DB::table('user') ->where('user_id', '=', $this->id()) ->value('password'); if ($password_hash !== null && password_verify($password, $password_hash)) { if (password_needs_rehash($password_h...
php
public function checkPassword(string $password): bool { $password_hash = DB::table('user') ->where('user_id', '=', $this->id()) ->value('password'); if ($password_hash !== null && password_verify($password, $password_hash)) { if (password_needs_rehash($password_h...
[ "public", "function", "checkPassword", "(", "string", "$", "password", ")", ":", "bool", "{", "$", "password_hash", "=", "DB", "::", "table", "(", "'user'", ")", "->", "where", "(", "'user_id'", ",", "'='", ",", "$", "this", "->", "id", "(", ")", ")"...
Validate a supplied password @param string $password @return bool
[ "Validate", "a", "supplied", "password" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L245-L260
train
fisharebest/webtrees
app/User.php
User.rowMapper
public static function rowMapper(): Closure { return static function (stdClass $row): User { return new static((int) $row->user_id, $row->user_name, $row->real_name, $row->email); }; }
php
public static function rowMapper(): Closure { return static function (stdClass $row): User { return new static((int) $row->user_id, $row->user_name, $row->real_name, $row->email); }; }
[ "public", "static", "function", "rowMapper", "(", ")", ":", "Closure", "{", "return", "static", "function", "(", "stdClass", "$", "row", ")", ":", "User", "{", "return", "new", "static", "(", "(", "int", ")", "$", "row", "->", "user_id", ",", "$", "r...
A closure which will create an object from a database row. @return Closure
[ "A", "closure", "which", "will", "create", "an", "object", "from", "a", "database", "row", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/User.php#L267-L272
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.mediaList
public function mediaList(ServerRequestInterface $request, Tree $tree): ResponseInterface { //route is assumed to be 'module' $module = $request->get('module'); $action = $request->get('action'); $formats = GedcomTag::getFileFormTypes(); $action2 = $request->get('...
php
public function mediaList(ServerRequestInterface $request, Tree $tree): ResponseInterface { //route is assumed to be 'module' $module = $request->get('module'); $action = $request->get('action'); $formats = GedcomTag::getFileFormTypes(); $action2 = $request->get('...
[ "public", "function", "mediaList", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "//route is assumed to be 'module'", "$", "module", "=", "$", "request", "->", "get", "(", "'module'", ")", ";", "$", ...
Show a list of all media records. @param ServerRequestInterface $request @param Tree $tree @return ResponseInterface
[ "Show", "a", "list", "of", "all", "media", "records", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L403-L457
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.noteList
public function noteList(Tree $tree): ResponseInterface { $notes = $this->allNotes($tree); return $this->viewResponse('note-list-page', [ 'notes' => $notes, 'title' => I18N::translate('Shared notes'), ]); }
php
public function noteList(Tree $tree): ResponseInterface { $notes = $this->allNotes($tree); return $this->viewResponse('note-list-page', [ 'notes' => $notes, 'title' => I18N::translate('Shared notes'), ]); }
[ "public", "function", "noteList", "(", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "notes", "=", "$", "this", "->", "allNotes", "(", "$", "tree", ")", ";", "return", "$", "this", "->", "viewResponse", "(", "'note-list-page'", ",", "[", ...
Show a list of all note records. @param Tree $tree @return ResponseInterface
[ "Show", "a", "list", "of", "all", "note", "records", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L466-L474
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.repositoryList
public function repositoryList(Tree $tree): ResponseInterface { $repositories = $this->allRepositories($tree); return $this->viewResponse('repository-list-page', [ 'repositories' => $repositories, 'title' => I18N::translate('Repositories'), ]); }
php
public function repositoryList(Tree $tree): ResponseInterface { $repositories = $this->allRepositories($tree); return $this->viewResponse('repository-list-page', [ 'repositories' => $repositories, 'title' => I18N::translate('Repositories'), ]); }
[ "public", "function", "repositoryList", "(", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "repositories", "=", "$", "this", "->", "allRepositories", "(", "$", "tree", ")", ";", "return", "$", "this", "->", "viewResponse", "(", "'repository-l...
Show a list of all repository records. @param Tree $tree @return ResponseInterface
[ "Show", "a", "list", "of", "all", "repository", "records", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L483-L491
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.sourceList
public function sourceList(Tree $tree): ResponseInterface { $sources = $this->allSources($tree); return $this->viewResponse('source-list-page', [ 'sources' => $sources, 'title' => I18N::translate('Sources'), ]); }
php
public function sourceList(Tree $tree): ResponseInterface { $sources = $this->allSources($tree); return $this->viewResponse('source-list-page', [ 'sources' => $sources, 'title' => I18N::translate('Sources'), ]); }
[ "public", "function", "sourceList", "(", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "sources", "=", "$", "this", "->", "allSources", "(", "$", "tree", ")", ";", "return", "$", "this", "->", "viewResponse", "(", "'source-list-page'", ",",...
Show a list of all source records. @param Tree $tree @return ResponseInterface
[ "Show", "a", "list", "of", "all", "source", "records", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L500-L508
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.allFolders
private function allFolders(Tree $tree): array { $folders = DB::table('media_file') ->where('m_file', '=', $tree->id()) ->where('multimedia_file_refn', 'NOT LIKE', 'http:%') ->where('multimedia_file_refn', 'NOT LIKE', 'https:%') ->where('multimedia_file_refn',...
php
private function allFolders(Tree $tree): array { $folders = DB::table('media_file') ->where('m_file', '=', $tree->id()) ->where('multimedia_file_refn', 'NOT LIKE', 'http:%') ->where('multimedia_file_refn', 'NOT LIKE', 'https:%') ->where('multimedia_file_refn',...
[ "private", "function", "allFolders", "(", "Tree", "$", "tree", ")", ":", "array", "{", "$", "folders", "=", "DB", "::", "table", "(", "'media_file'", ")", "->", "where", "(", "'m_file'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", ")", "->"...
Generate a list of all the folders in a current tree. @param Tree $tree @return string[]
[ "Generate", "a", "list", "of", "all", "the", "folders", "in", "a", "current", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L517-L536
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.allMedia
private function allMedia(Tree $tree, string $folder, string $subfolders, string $sort, string $filter, string $form_type): array { $query = DB::table('media') ->join('media_file', static function (JoinClause $join): void { $join ->on('media_file.m_file', '=',...
php
private function allMedia(Tree $tree, string $folder, string $subfolders, string $sort, string $filter, string $form_type): array { $query = DB::table('media') ->join('media_file', static function (JoinClause $join): void { $join ->on('media_file.m_file', '=',...
[ "private", "function", "allMedia", "(", "Tree", "$", "tree", ",", "string", "$", "folder", ",", "string", "$", "subfolders", ",", "string", "$", "sort", ",", "string", "$", "filter", ",", "string", "$", "form_type", ")", ":", "array", "{", "$", "query"...
Generate a list of all the media objects matching the criteria in a current tree. @param Tree $tree find media in this tree @param string $folder folder to search @param string $subfolders either "include" or "exclude" @param string $sort either "file" or "title" @param string $filter optional se...
[ "Generate", "a", "list", "of", "all", "the", "media", "objects", "matching", "the", "criteria", "in", "a", "current", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L550-L601
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.allNotes
private function allNotes(Tree $tree): Collection { return DB::table('other') ->where('o_file', '=', $tree->id()) ->where('o_type', '=', 'NOTE') ->get() ->map(Note::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
php
private function allNotes(Tree $tree): Collection { return DB::table('other') ->where('o_file', '=', $tree->id()) ->where('o_type', '=', 'NOTE') ->get() ->map(Note::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
[ "private", "function", "allNotes", "(", "Tree", "$", "tree", ")", ":", "Collection", "{", "return", "DB", "::", "table", "(", "'other'", ")", "->", "where", "(", "'o_file'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", ")", "->", "where", "(...
Find all the note records in a tree. @param Tree $tree @return Collection @return Note[]
[ "Find", "all", "the", "note", "records", "in", "a", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L611-L619
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.allRepositories
private function allRepositories(Tree $tree): Collection { return DB::table('other') ->where('o_file', '=', $tree->id()) ->where('o_type', '=', 'REPO') ->get() ->map(Repository::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
php
private function allRepositories(Tree $tree): Collection { return DB::table('other') ->where('o_file', '=', $tree->id()) ->where('o_type', '=', 'REPO') ->get() ->map(Repository::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
[ "private", "function", "allRepositories", "(", "Tree", "$", "tree", ")", ":", "Collection", "{", "return", "DB", "::", "table", "(", "'other'", ")", "->", "where", "(", "'o_file'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", ")", "->", "where...
Find all the repository record in a tree. @param Tree $tree @return Collection @return Repository[]
[ "Find", "all", "the", "repository", "record", "in", "a", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L629-L637
train
fisharebest/webtrees
app/Http/Controllers/ListController.php
ListController.allSources
private function allSources(Tree $tree): Collection { return DB::table('sources') ->where('s_file', '=', $tree->id()) ->get() ->map(Source::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
php
private function allSources(Tree $tree): Collection { return DB::table('sources') ->where('s_file', '=', $tree->id()) ->get() ->map(Source::rowMapper()) ->filter(GedcomRecord::accessFilter()); }
[ "private", "function", "allSources", "(", "Tree", "$", "tree", ")", ":", "Collection", "{", "return", "DB", "::", "table", "(", "'sources'", ")", "->", "where", "(", "'s_file'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", ")", "->", "get", ...
Find all the source records in a tree. @param Tree $tree @return Collection @return Source[]
[ "Find", "all", "the", "source", "records", "in", "a", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/ListController.php#L647-L654
train
fisharebest/webtrees
app/Statistics/Repository/GedcomRepository.php
GedcomRepository.gedcomHead
private function gedcomHead(): array { $title = ''; $version = ''; $source = ''; $head = GedcomRecord::getInstance('HEAD', $this->tree); if ($head instanceof GedcomRecord) { $sour = $head->facts(['SOUR'])->first(); if ($sour instanceof Fact) { ...
php
private function gedcomHead(): array { $title = ''; $version = ''; $source = ''; $head = GedcomRecord::getInstance('HEAD', $this->tree); if ($head instanceof GedcomRecord) { $sour = $head->facts(['SOUR'])->first(); if ($sour instanceof Fact) { ...
[ "private", "function", "gedcomHead", "(", ")", ":", "array", "{", "$", "title", "=", "''", ";", "$", "version", "=", "''", ";", "$", "source", "=", "''", ";", "$", "head", "=", "GedcomRecord", "::", "getInstance", "(", "'HEAD'", ",", "$", "this", "...
Get information from the GEDCOM's HEAD record. @return string[]
[ "Get", "information", "from", "the", "GEDCOM", "s", "HEAD", "record", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/GedcomRepository.php#L53-L76
train
fisharebest/webtrees
app/Http/Controllers/Admin/ChangesLogController.php
ChangesLogController.changesQuery
private function changesQuery(ServerRequestInterface $request): Builder { $from = $request->getQueryParams()['from'] ?? ''; $to = $request->getQueryParams()['to'] ?? ''; $type = $request->getQueryParams()['type'] ?? ''; $oldged = $request->getQueryParams()['oldged'] ?...
php
private function changesQuery(ServerRequestInterface $request): Builder { $from = $request->getQueryParams()['from'] ?? ''; $to = $request->getQueryParams()['to'] ?? ''; $type = $request->getQueryParams()['type'] ?? ''; $oldged = $request->getQueryParams()['oldged'] ?...
[ "private", "function", "changesQuery", "(", "ServerRequestInterface", "$", "request", ")", ":", "Builder", "{", "$", "from", "=", "$", "request", "->", "getQueryParams", "(", ")", "[", "'from'", "]", "??", "''", ";", "$", "to", "=", "$", "request", "->",...
Generate a query for filtering the changes log. @param ServerRequestInterface $request @return Builder
[ "Generate", "a", "query", "for", "filtering", "the", "changes", "log", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/Admin/ChangesLogController.php#L228-L288
train
fisharebest/webtrees
app/Functions/FunctionsRtl.php
FunctionsRtl.getChar
public static function getChar(string $text, int $offset): array { if ($text == '') { return [ 'letter' => '', 'length' => 0, ]; } $char = substr($text, $offset, 1); $length = 1; if ((ord($char) & 0xE0) == 0xC0) { ...
php
public static function getChar(string $text, int $offset): array { if ($text == '') { return [ 'letter' => '', 'length' => 0, ]; } $char = substr($text, $offset, 1); $length = 1; if ((ord($char) & 0xE0) == 0xC0) { ...
[ "public", "static", "function", "getChar", "(", "string", "$", "text", ",", "int", "$", "offset", ")", ":", "array", "{", "if", "(", "$", "text", "==", "''", ")", "{", "return", "[", "'letter'", "=>", "''", ",", "'length'", "=>", "0", ",", "]", "...
Get the next character from an input string @param string $text @param int $offset @return array
[ "Get", "the", "next", "character", "from", "an", "input", "string" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Functions/FunctionsRtl.php#L560-L586
train
fisharebest/webtrees
app/Functions/FunctionsRtl.php
FunctionsRtl.beginCurrentSpan
public static function beginCurrentSpan(&$result): void { if (self::$currentState === 'LTR') { $result .= self::START_LTR; } if (self::$currentState === 'RTL') { $result .= self::START_RTL; } self::$posSpanStart = strlen($result); }
php
public static function beginCurrentSpan(&$result): void { if (self::$currentState === 'LTR') { $result .= self::START_LTR; } if (self::$currentState === 'RTL') { $result .= self::START_RTL; } self::$posSpanStart = strlen($result); }
[ "public", "static", "function", "beginCurrentSpan", "(", "&", "$", "result", ")", ":", "void", "{", "if", "(", "self", "::", "$", "currentState", "===", "'LTR'", ")", "{", "$", "result", ".=", "self", "::", "START_LTR", ";", "}", "if", "(", "self", "...
Begin current span @param string $result @return void
[ "Begin", "current", "span" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Functions/FunctionsRtl.php#L612-L622
train
fisharebest/webtrees
app/Http/Controllers/CalendarController.php
CalendarController.applyFilter
private function applyFilter(array $facts, string $filterof, string $filtersx): array { $filtered = []; $hundred_years = Carbon::now()->subYears(100)->julianDay(); foreach ($facts as $fact) { $record = $fact->record(); if ($filtersx) { // Filter o...
php
private function applyFilter(array $facts, string $filterof, string $filtersx): array { $filtered = []; $hundred_years = Carbon::now()->subYears(100)->julianDay(); foreach ($facts as $fact) { $record = $fact->record(); if ($filtersx) { // Filter o...
[ "private", "function", "applyFilter", "(", "array", "$", "facts", ",", "string", "$", "filterof", ",", "string", "$", "filtersx", ")", ":", "array", "{", "$", "filtered", "=", "[", "]", ";", "$", "hundred_years", "=", "Carbon", "::", "now", "(", ")", ...
Filter a list of anniversaries @param Fact[] $facts @param string $filterof @param string $filtersx @return Fact[]
[ "Filter", "a", "list", "of", "anniversaries" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/CalendarController.php#L477-L514
train
fisharebest/webtrees
app/Http/Controllers/CalendarController.php
CalendarController.calendarListText
private function calendarListText(array $list, string $tag1, string $tag2, Tree $tree): string { $html = ''; foreach ($list as $id => $facts) { $tmp = GedcomRecord::getInstance($id, $tree); $html .= $tag1 . '<a href="' . e($tmp->url()) . '">' . $tmp->fullName() . '</a> '; ...
php
private function calendarListText(array $list, string $tag1, string $tag2, Tree $tree): string { $html = ''; foreach ($list as $id => $facts) { $tmp = GedcomRecord::getInstance($id, $tree); $html .= $tag1 . '<a href="' . e($tmp->url()) . '">' . $tmp->fullName() . '</a> '; ...
[ "private", "function", "calendarListText", "(", "array", "$", "list", ",", "string", "$", "tag1", ",", "string", "$", "tag2", ",", "Tree", "$", "tree", ")", ":", "string", "{", "$", "html", "=", "''", ";", "foreach", "(", "$", "list", "as", "$", "i...
Format a list of facts for display @param Fact[] $list @param string $tag1 @param string $tag2 @param Tree $tree @return string
[ "Format", "a", "list", "of", "facts", "for", "display" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/CalendarController.php#L547-L558
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.icon
public function icon(Fact $fact): string { $asset = 'public/css/' . $this->name() . '/images/facts/' . $fact->getTag() . '.png'; if (file_exists(Webtrees::ROOT_DIR . 'public' . $asset)) { return '<img src="' . e(asset($asset)) . '" title="' . GedcomTag::getLabel($fact->getTag()) . '">'; ...
php
public function icon(Fact $fact): string { $asset = 'public/css/' . $this->name() . '/images/facts/' . $fact->getTag() . '.png'; if (file_exists(Webtrees::ROOT_DIR . 'public' . $asset)) { return '<img src="' . e(asset($asset)) . '" title="' . GedcomTag::getLabel($fact->getTag()) . '">'; ...
[ "public", "function", "icon", "(", "Fact", "$", "fact", ")", ":", "string", "{", "$", "asset", "=", "'public/css/'", ".", "$", "this", "->", "name", "(", ")", ".", "'/images/facts/'", ".", "$", "fact", "->", "getTag", "(", ")", ".", "'.png'", ";", ...
Display an icon for this fact. @TODO use CSS for this @param Fact $fact @return string
[ "Display", "an", "icon", "for", "this", "fact", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L47-L61
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.individualBoxFacts
public function individualBoxFacts(Individual $individual): string { $html = ''; $opt_tags = preg_split('/\W/', $individual->tree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT_NO_EMPTY); // Show BIRT or equivalent event foreach (Gedcom::BIRTH_EVENTS as $birttag) { if...
php
public function individualBoxFacts(Individual $individual): string { $html = ''; $opt_tags = preg_split('/\W/', $individual->tree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT_NO_EMPTY); // Show BIRT or equivalent event foreach (Gedcom::BIRTH_EVENTS as $birttag) { if...
[ "public", "function", "individualBoxFacts", "(", "Individual", "$", "individual", ")", ":", "string", "{", "$", "html", "=", "''", ";", "$", "opt_tags", "=", "preg_split", "(", "'/\\W/'", ",", "$", "individual", "->", "tree", "(", ")", "->", "getPreference...
Generate the facts, for display in charts. @param Individual $individual @return string
[ "Generate", "the", "facts", "for", "display", "in", "charts", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L70-L115
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.individualBoxMenu
public function individualBoxMenu(Individual $individual): array { $menus = array_merge( $this->individualBoxMenuCharts($individual), $this->individualBoxMenuFamilyLinks($individual) ); return $menus; }
php
public function individualBoxMenu(Individual $individual): array { $menus = array_merge( $this->individualBoxMenuCharts($individual), $this->individualBoxMenuFamilyLinks($individual) ); return $menus; }
[ "public", "function", "individualBoxMenu", "(", "Individual", "$", "individual", ")", ":", "array", "{", "$", "menus", "=", "array_merge", "(", "$", "this", "->", "individualBoxMenuCharts", "(", "$", "individual", ")", ",", "$", "this", "->", "individualBoxMen...
Links, to show in chart boxes; @param Individual $individual @return Menu[]
[ "Links", "to", "show", "in", "chart", "boxes", ";" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L124-L132
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.individualBoxMenuCharts
public function individualBoxMenuCharts(Individual $individual): array { $menus = []; foreach (app(ModuleService::class)->findByComponent(ModuleChartInterface::class, $individual->tree(), Auth::user()) as $chart) { $menu = $chart->chartBoxMenu($individual); if ($menu) { ...
php
public function individualBoxMenuCharts(Individual $individual): array { $menus = []; foreach (app(ModuleService::class)->findByComponent(ModuleChartInterface::class, $individual->tree(), Auth::user()) as $chart) { $menu = $chart->chartBoxMenu($individual); if ($menu) { ...
[ "public", "function", "individualBoxMenuCharts", "(", "Individual", "$", "individual", ")", ":", "array", "{", "$", "menus", "=", "[", "]", ";", "foreach", "(", "app", "(", "ModuleService", "::", "class", ")", "->", "findByComponent", "(", "ModuleChartInterfac...
Chart links, to show in chart boxes; @param Individual $individual @return Menu[]
[ "Chart", "links", "to", "show", "in", "chart", "boxes", ";" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L141-L156
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.individualBoxMenuFamilyLinks
public function individualBoxMenuFamilyLinks(Individual $individual): array { $menus = []; foreach ($individual->spouseFamilies() as $family) { $menus[] = new Menu('<strong>' . I18N::translate('Family with spouse') . '</strong>', $family->url()); $spouse = $family->spouse($...
php
public function individualBoxMenuFamilyLinks(Individual $individual): array { $menus = []; foreach ($individual->spouseFamilies() as $family) { $menus[] = new Menu('<strong>' . I18N::translate('Family with spouse') . '</strong>', $family->url()); $spouse = $family->spouse($...
[ "public", "function", "individualBoxMenuFamilyLinks", "(", "Individual", "$", "individual", ")", ":", "array", "{", "$", "menus", "=", "[", "]", ";", "foreach", "(", "$", "individual", "->", "spouseFamilies", "(", ")", "as", "$", "family", ")", "{", "$", ...
Family links, to show in chart boxes. @param Individual $individual @return Menu[]
[ "Family", "links", "to", "show", "in", "chart", "boxes", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L165-L183
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuControlPanel
public function menuControlPanel(Tree $tree): ?Menu { if (Auth::isAdmin()) { return new Menu(I18N::translate('Control panel'), route('admin-control-panel'), 'menu-admin'); } if (Auth::isManager($tree)) { return new Menu(I18N::translate('Control panel'), route('admin-...
php
public function menuControlPanel(Tree $tree): ?Menu { if (Auth::isAdmin()) { return new Menu(I18N::translate('Control panel'), route('admin-control-panel'), 'menu-admin'); } if (Auth::isManager($tree)) { return new Menu(I18N::translate('Control panel'), route('admin-...
[ "public", "function", "menuControlPanel", "(", "Tree", "$", "tree", ")", ":", "?", "Menu", "{", "if", "(", "Auth", "::", "isAdmin", "(", ")", ")", "{", "return", "new", "Menu", "(", "I18N", "::", "translate", "(", "'Control panel'", ")", ",", "route", ...
Generate a menu item for the control panel. @param Tree $tree @return Menu|null
[ "Generate", "a", "menu", "item", "for", "the", "control", "panel", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L214-L225
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuLanguages
public function menuLanguages(): ?Menu { $menu = new Menu(I18N::translate('Language'), '#', 'menu-language'); foreach (I18N::activeLocales() as $locale) { $language_tag = $locale->languageTag(); $class = 'menu-language-' . $language_tag . (WT_LOCALE === $language_tag ...
php
public function menuLanguages(): ?Menu { $menu = new Menu(I18N::translate('Language'), '#', 'menu-language'); foreach (I18N::activeLocales() as $locale) { $language_tag = $locale->languageTag(); $class = 'menu-language-' . $language_tag . (WT_LOCALE === $language_tag ...
[ "public", "function", "menuLanguages", "(", ")", ":", "?", "Menu", "{", "$", "menu", "=", "new", "Menu", "(", "I18N", "::", "translate", "(", "'Language'", ")", ",", "'#'", ",", "'menu-language'", ")", ";", "foreach", "(", "I18N", "::", "activeLocales", ...
A menu to show a list of available languages. @return Menu|null
[ "A", "menu", "to", "show", "a", "list", "of", "available", "languages", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L232-L250
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuMyPage
public function menuMyPage(Tree $tree): Menu { return new Menu(I18N::translate('My page'), route('user-page', ['ged' => $tree->name()]), 'menu-mypage'); }
php
public function menuMyPage(Tree $tree): Menu { return new Menu(I18N::translate('My page'), route('user-page', ['ged' => $tree->name()]), 'menu-mypage'); }
[ "public", "function", "menuMyPage", "(", "Tree", "$", "tree", ")", ":", "Menu", "{", "return", "new", "Menu", "(", "I18N", "::", "translate", "(", "'My page'", ")", ",", "route", "(", "'user-page'", ",", "[", "'ged'", "=>", "$", "tree", "->", "name", ...
A link to the user's personal home page. @param Tree $tree @return Menu
[ "A", "link", "to", "the", "user", "s", "personal", "home", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L325-L328
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuMyPages
public function menuMyPages(?Tree $tree): ?Menu { if ($tree instanceof Tree && Auth::id()) { return new Menu(I18N::translate('My pages'), '#', 'menu-mymenu', [], array_filter([ $this->menuMyPage($tree), $this->menuMyIndividualRecord($tree), $this->...
php
public function menuMyPages(?Tree $tree): ?Menu { if ($tree instanceof Tree && Auth::id()) { return new Menu(I18N::translate('My pages'), '#', 'menu-mymenu', [], array_filter([ $this->menuMyPage($tree), $this->menuMyIndividualRecord($tree), $this->...
[ "public", "function", "menuMyPages", "(", "?", "Tree", "$", "tree", ")", ":", "?", "Menu", "{", "if", "(", "$", "tree", "instanceof", "Tree", "&&", "Auth", "::", "id", "(", ")", ")", "{", "return", "new", "Menu", "(", "I18N", "::", "translate", "("...
A menu for the user's personal pages. @param Tree|null $tree @return Menu|null
[ "A", "menu", "for", "the", "user", "s", "personal", "pages", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L337-L351
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuMyPedigree
public function menuMyPedigree(Tree $tree): ?Menu { $gedcomid = $tree->getUserPreference(Auth::user(), 'gedcomid'); $pedigree_chart = app(ModuleService::class)->findByComponent(ModuleChartInterface::class, $tree, Auth::user()) ->filter(static function (ModuleInterface $module): bool { ...
php
public function menuMyPedigree(Tree $tree): ?Menu { $gedcomid = $tree->getUserPreference(Auth::user(), 'gedcomid'); $pedigree_chart = app(ModuleService::class)->findByComponent(ModuleChartInterface::class, $tree, Auth::user()) ->filter(static function (ModuleInterface $module): bool { ...
[ "public", "function", "menuMyPedigree", "(", "Tree", "$", "tree", ")", ":", "?", "Menu", "{", "$", "gedcomid", "=", "$", "tree", "->", "getUserPreference", "(", "Auth", "::", "user", "(", ")", ",", "'gedcomid'", ")", ";", "$", "pedigree_chart", "=", "a...
A link to the user's individual record. @param Tree $tree @return Menu|null
[ "A", "link", "to", "the", "user", "s", "individual", "record", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L360-L381
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuPendingChanges
public function menuPendingChanges(?Tree $tree): ?Menu { if ($tree instanceof Tree && $tree->hasPendingEdit() && Auth::isModerator($tree)) { $url = route('show-pending', [ 'ged' => $tree->name(), 'url' => app(ServerRequestInterface::class)->getUri(), ]...
php
public function menuPendingChanges(?Tree $tree): ?Menu { if ($tree instanceof Tree && $tree->hasPendingEdit() && Auth::isModerator($tree)) { $url = route('show-pending', [ 'ged' => $tree->name(), 'url' => app(ServerRequestInterface::class)->getUri(), ]...
[ "public", "function", "menuPendingChanges", "(", "?", "Tree", "$", "tree", ")", ":", "?", "Menu", "{", "if", "(", "$", "tree", "instanceof", "Tree", "&&", "$", "tree", "->", "hasPendingEdit", "(", ")", "&&", "Auth", "::", "isModerator", "(", "$", "tree...
Create a pending changes menu. @param Tree|null $tree @return Menu|null
[ "Create", "a", "pending", "changes", "menu", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L390-L402
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.menuThemes
public function menuThemes(): ?Menu { $themes = app(ModuleService::class)->findByInterface(ModuleThemeInterface::class, false, true); $current_theme = app(ModuleThemeInterface::class); if ($themes->count() > 1) { $submenus = $themes->map(static function (ModuleThemeInterface $t...
php
public function menuThemes(): ?Menu { $themes = app(ModuleService::class)->findByInterface(ModuleThemeInterface::class, false, true); $current_theme = app(ModuleThemeInterface::class); if ($themes->count() > 1) { $submenus = $themes->map(static function (ModuleThemeInterface $t...
[ "public", "function", "menuThemes", "(", ")", ":", "?", "Menu", "{", "$", "themes", "=", "app", "(", "ModuleService", "::", "class", ")", "->", "findByInterface", "(", "ModuleThemeInterface", "::", "class", ",", "false", ",", "true", ")", ";", "$", "curr...
Themes menu. @return Menu|null
[ "Themes", "menu", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L409-L430
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.genealogyMenuContent
public function genealogyMenuContent(array $menus): string { return implode('', array_map(static function (Menu $menu): string { return $menu->bootstrap4(); }, $menus)); }
php
public function genealogyMenuContent(array $menus): string { return implode('', array_map(static function (Menu $menu): string { return $menu->bootstrap4(); }, $menus)); }
[ "public", "function", "genealogyMenuContent", "(", "array", "$", "menus", ")", ":", "string", "{", "return", "implode", "(", "''", ",", "array_map", "(", "static", "function", "(", "Menu", "$", "menu", ")", ":", "string", "{", "return", "$", "menu", "->"...
Create the genealogy menu. @param Menu[] $menus @return string
[ "Create", "the", "genealogy", "menu", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L472-L477
train
fisharebest/webtrees
app/Module/ModuleThemeTrait.php
ModuleThemeTrait.userMenu
public function userMenu(?Tree $tree): array { return array_filter([ $this->menuPendingChanges($tree), $this->menuMyPages($tree), $this->menuThemes(), $this->menuLanguages(), $this->menuLogin(), $this->menuLogout(), ]); }
php
public function userMenu(?Tree $tree): array { return array_filter([ $this->menuPendingChanges($tree), $this->menuMyPages($tree), $this->menuThemes(), $this->menuLanguages(), $this->menuLogin(), $this->menuLogout(), ]); }
[ "public", "function", "userMenu", "(", "?", "Tree", "$", "tree", ")", ":", "array", "{", "return", "array_filter", "(", "[", "$", "this", "->", "menuPendingChanges", "(", "$", "tree", ")", ",", "$", "this", "->", "menuMyPages", "(", "$", "tree", ")", ...
Generate a list of items for the user menu. @param Tree|null $tree @return Menu[]
[ "Generate", "a", "list", "of", "items", "for", "the", "user", "menu", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleThemeTrait.php#L486-L496
train
fisharebest/webtrees
app/Filter.php
Filter.formatText
public static function formatText(string $text, Tree $tree): string { switch ($tree->getPreference('FORMAT_TEXT')) { case 'markdown': return '<div class="markdown" dir="auto">' . self::markdown($text, $tree) . '</div>'; default: return '<div class="mar...
php
public static function formatText(string $text, Tree $tree): string { switch ($tree->getPreference('FORMAT_TEXT')) { case 'markdown': return '<div class="markdown" dir="auto">' . self::markdown($text, $tree) . '</div>'; default: return '<div class="mar...
[ "public", "static", "function", "formatText", "(", "string", "$", "text", ",", "Tree", "$", "tree", ")", ":", "string", "{", "switch", "(", "$", "tree", "->", "getPreference", "(", "'FORMAT_TEXT'", ")", ")", "{", "case", "'markdown'", ":", "return", "'<d...
Format block-level text such as notes or transcripts, etc. @param string $text @param Tree $tree @return string
[ "Format", "block", "-", "level", "text", "such", "as", "notes", "or", "transcripts", "etc", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Filter.php#L58-L66
train
fisharebest/webtrees
app/Filter.php
Filter.expandUrls
public static function expandUrls(string $text, Tree $tree): string { // If it looks like a URL, turn it into a markdown autolink. $text = preg_replace('/' . addcslashes(self::URL_REGEX, '/') . '/', '<$0>', $text); // Create a minimal commonmark processor - just add support for autolinks. ...
php
public static function expandUrls(string $text, Tree $tree): string { // If it looks like a URL, turn it into a markdown autolink. $text = preg_replace('/' . addcslashes(self::URL_REGEX, '/') . '/', '<$0>', $text); // Create a minimal commonmark processor - just add support for autolinks. ...
[ "public", "static", "function", "expandUrls", "(", "string", "$", "text", ",", "Tree", "$", "tree", ")", ":", "string", "{", "// If it looks like a URL, turn it into a markdown autolink.", "$", "text", "=", "preg_replace", "(", "'/'", ".", "addcslashes", "(", "sel...
Format a block of text, expanding URLs and XREFs. @param string $text @param Tree $tree @return string
[ "Format", "a", "block", "of", "text", "expanding", "URLs", "and", "XREFs", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Filter.php#L76-L111
train
fisharebest/webtrees
app/Filter.php
Filter.markdown
public static function markdown(string $text, Tree $tree): string { $environment = Environment::createCommonMarkEnvironment(); $environment->mergeConfig(['html_input' => 'escape']); $environment->addExtension(new TableExtension()); $environment->addExtension(new CensusTableExtension(...
php
public static function markdown(string $text, Tree $tree): string { $environment = Environment::createCommonMarkEnvironment(); $environment->mergeConfig(['html_input' => 'escape']); $environment->addExtension(new TableExtension()); $environment->addExtension(new CensusTableExtension(...
[ "public", "static", "function", "markdown", "(", "string", "$", "text", ",", "Tree", "$", "tree", ")", ":", "string", "{", "$", "environment", "=", "Environment", "::", "createCommonMarkEnvironment", "(", ")", ";", "$", "environment", "->", "mergeConfig", "(...
Format a block of text, using "Markdown". @param string $text @param Tree $tree @return string
[ "Format", "a", "block", "of", "text", "using", "Markdown", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Filter.php#L121-L137
train
fisharebest/webtrees
app/Report/ReportBaseFootnote.php
ReportBaseFootnote.addText
public function addText(string $t) { $t = trim($t, "\r\n\t"); $t = str_replace([ '<br>', '&nbsp;', ], [ "\n", ' ', ], $t); $t = strip_tags($t); $t = htmlspecialchars_decode($t); ...
php
public function addText(string $t) { $t = trim($t, "\r\n\t"); $t = str_replace([ '<br>', '&nbsp;', ], [ "\n", ' ', ], $t); $t = strip_tags($t); $t = htmlspecialchars_decode($t); ...
[ "public", "function", "addText", "(", "string", "$", "t", ")", "{", "$", "t", "=", "trim", "(", "$", "t", ",", "\"\\r\\n\\t\"", ")", ";", "$", "t", "=", "str_replace", "(", "[", "'<br>'", ",", "'&nbsp;'", ",", "]", ",", "[", "\"\\n\"", ",", "' '"...
Add text. @param string $t @return void
[ "Add", "text", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportBaseFootnote.php#L85-L98
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.findByInterface
public function findByInterface(string $interface, $include_disabled = false, $sort = false): Collection { $modules = $this->all($include_disabled) ->filter($this->interfaceFilter($interface)); switch ($interface) { case ModuleFooterInterface::class: return $...
php
public function findByInterface(string $interface, $include_disabled = false, $sort = false): Collection { $modules = $this->all($include_disabled) ->filter($this->interfaceFilter($interface)); switch ($interface) { case ModuleFooterInterface::class: return $...
[ "public", "function", "findByInterface", "(", "string", "$", "interface", ",", "$", "include_disabled", "=", "false", ",", "$", "sort", "=", "false", ")", ":", "Collection", "{", "$", "modules", "=", "$", "this", "->", "all", "(", "$", "include_disabled", ...
All modules which provide a specific function. @param string $interface @param bool $include_disabled @param bool $sort @return Collection @return ModuleInterface[]
[ "All", "modules", "which", "provide", "a", "specific", "function", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L448-L473
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.all
public function all(bool $include_disabled = false): Collection { return app('cache.array')->rememberForever('all_modules', function (): Collection { // Modules have a default status, order etc. // We can override these from database settings. $module_info = DB::table('mo...
php
public function all(bool $include_disabled = false): Collection { return app('cache.array')->rememberForever('all_modules', function (): Collection { // Modules have a default status, order etc. // We can override these from database settings. $module_info = DB::table('mo...
[ "public", "function", "all", "(", "bool", "$", "include_disabled", "=", "false", ")", ":", "Collection", "{", "return", "app", "(", "'cache.array'", ")", "->", "rememberForever", "(", "'all_modules'", ",", "function", "(", ")", ":", "Collection", "{", "// Mo...
All modules. @param bool $include_disabled @return Collection @return ModuleInterface[]
[ "All", "modules", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L483-L529
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.coreModules
private function coreModules(): Collection { return Collection::make(self::CORE_MODULES) ->map(static function (string $class, string $name): ModuleInterface { $module = app($class); $module->setName($name); return $module; }); }
php
private function coreModules(): Collection { return Collection::make(self::CORE_MODULES) ->map(static function (string $class, string $name): ModuleInterface { $module = app($class); $module->setName($name); return $module; }); }
[ "private", "function", "coreModules", "(", ")", ":", "Collection", "{", "return", "Collection", "::", "make", "(", "self", "::", "CORE_MODULES", ")", "->", "map", "(", "static", "function", "(", "string", "$", "class", ",", "string", "$", "name", ")", ":...
All core modules in the system. @return Collection
[ "All", "core", "modules", "in", "the", "system", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L536-L546
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.setupLanguages
public function setupLanguages(): Collection { return $this->coreModules() ->filter(static function (ModuleInterface $module) { return $module instanceof ModuleLanguageInterface && $module->isEnabledByDefault(); }) ->sort(static function (ModuleLanguageInt...
php
public function setupLanguages(): Collection { return $this->coreModules() ->filter(static function (ModuleInterface $module) { return $module instanceof ModuleLanguageInterface && $module->isEnabledByDefault(); }) ->sort(static function (ModuleLanguageInt...
[ "public", "function", "setupLanguages", "(", ")", ":", "Collection", "{", "return", "$", "this", "->", "coreModules", "(", ")", "->", "filter", "(", "static", "function", "(", "ModuleInterface", "$", "module", ")", "{", "return", "$", "module", "instanceof",...
During setup, we'll need access to some languages. @return Collection
[ "During", "setup", "we", "ll", "need", "access", "to", "some", "languages", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L596-L605
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.footerSorter
private function footerSorter(): Closure { return static function (ModuleFooterInterface $x, ModuleFooterInterface $y): int { return $x->getFooterOrder() <=> $y->getFooterOrder(); }; }
php
private function footerSorter(): Closure { return static function (ModuleFooterInterface $x, ModuleFooterInterface $y): int { return $x->getFooterOrder() <=> $y->getFooterOrder(); }; }
[ "private", "function", "footerSorter", "(", ")", ":", "Closure", "{", "return", "static", "function", "(", "ModuleFooterInterface", "$", "x", ",", "ModuleFooterInterface", "$", "y", ")", ":", "int", "{", "return", "$", "x", "->", "getFooterOrder", "(", ")", ...
A function to sort footers @return Closure
[ "A", "function", "to", "sort", "footers" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L652-L657
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.moduleSorter
private function moduleSorter(): Closure { return static function (ModuleInterface $x, ModuleInterface $y): int { $title1 = $x instanceof ModuleLanguageInterface ? $x->locale()->endonymSortable() : $x->title(); $title2 = $y instanceof ModuleLanguageInterface ? $y->locale()->endonymSo...
php
private function moduleSorter(): Closure { return static function (ModuleInterface $x, ModuleInterface $y): int { $title1 = $x instanceof ModuleLanguageInterface ? $x->locale()->endonymSortable() : $x->title(); $title2 = $y instanceof ModuleLanguageInterface ? $y->locale()->endonymSo...
[ "private", "function", "moduleSorter", "(", ")", ":", "Closure", "{", "return", "static", "function", "(", "ModuleInterface", "$", "x", ",", "ModuleInterface", "$", "y", ")", ":", "int", "{", "$", "title1", "=", "$", "x", "instanceof", "ModuleLanguageInterfa...
A function to sort modules by name. Languages have a "sortable" name, so that "British English" sorts as "English, British". This provides a more natural order in the language menu. @return Closure
[ "A", "function", "to", "sort", "modules", "by", "name", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L703-L711
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.findByName
public function findByName(string $module_name, bool $include_disabled = false): ?ModuleInterface { return $this->all($include_disabled) ->first(static function (ModuleInterface $module) use ($module_name): bool { return $module->name() === $module_name; }); }
php
public function findByName(string $module_name, bool $include_disabled = false): ?ModuleInterface { return $this->all($include_disabled) ->first(static function (ModuleInterface $module) use ($module_name): bool { return $module->name() === $module_name; }); }
[ "public", "function", "findByName", "(", "string", "$", "module_name", ",", "bool", "$", "include_disabled", "=", "false", ")", ":", "?", "ModuleInterface", "{", "return", "$", "this", "->", "all", "(", "$", "include_disabled", ")", "->", "first", "(", "st...
Find a specified module, if it is currently active. @param string $module_name @param bool $include_disabled @return ModuleInterface|null
[ "Find", "a", "specified", "module", "if", "it", "is", "currently", "active", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L721-L727
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.otherModules
public function otherModules(bool $include_disabled = false): Collection { return $this->findByInterface(ModuleInterface::class, $include_disabled, true) ->filter(static function (ModuleInterface $module): bool { foreach (self::COMPONENTS as $interface) { if (...
php
public function otherModules(bool $include_disabled = false): Collection { return $this->findByInterface(ModuleInterface::class, $include_disabled, true) ->filter(static function (ModuleInterface $module): bool { foreach (self::COMPONENTS as $interface) { if (...
[ "public", "function", "otherModules", "(", "bool", "$", "include_disabled", "=", "false", ")", ":", "Collection", "{", "return", "$", "this", "->", "findByInterface", "(", "ModuleInterface", "::", "class", ",", "$", "include_disabled", ",", "true", ")", "->", ...
Configuration settings are available through the various "module component" pages. For modules that do not provide a component, we need to list them separately. @param bool $include_disabled @return Collection @return ModuleConfigInterface[]
[ "Configuration", "settings", "are", "available", "through", "the", "various", "module", "component", "pages", ".", "For", "modules", "that", "do", "not", "provide", "a", "component", "we", "need", "to", "list", "them", "separately", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L738-L750
train
fisharebest/webtrees
app/Services/ModuleService.php
ModuleService.deletedModules
public function deletedModules(): Collection { $database_modules = DB::table('module')->pluck('module_name'); $disk_modules = $this->all(true) ->map(static function (ModuleInterface $module): string { return $module->name(); }); return $database_modu...
php
public function deletedModules(): Collection { $database_modules = DB::table('module')->pluck('module_name'); $disk_modules = $this->all(true) ->map(static function (ModuleInterface $module): string { return $module->name(); }); return $database_modu...
[ "public", "function", "deletedModules", "(", ")", ":", "Collection", "{", "$", "database_modules", "=", "DB", "::", "table", "(", "'module'", ")", "->", "pluck", "(", "'module_name'", ")", ";", "$", "disk_modules", "=", "$", "this", "->", "all", "(", "tr...
Generate a list of module names which exist in the database but not on disk. @return Collection @return string[]
[ "Generate", "a", "list", "of", "module", "names", "which", "exist", "in", "the", "database", "but", "not", "on", "disk", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ModuleService.php#L758-L768
train
fisharebest/webtrees
app/Session.php
Session.regenerate
public static function regenerate(bool $destroy = false): void { if ($destroy) { self::clear(); } if (session_status() === PHP_SESSION_ACTIVE) { session_regenerate_id($destroy); } }
php
public static function regenerate(bool $destroy = false): void { if ($destroy) { self::clear(); } if (session_status() === PHP_SESSION_ACTIVE) { session_regenerate_id($destroy); } }
[ "public", "static", "function", "regenerate", "(", "bool", "$", "destroy", "=", "false", ")", ":", "void", "{", "if", "(", "$", "destroy", ")", "{", "self", "::", "clear", "(", ")", ";", "}", "if", "(", "session_status", "(", ")", "===", "PHP_SESSION...
After any change in authentication level, we should use a new session ID. @param bool $destroy @return void
[ "After", "any", "change", "in", "authentication", "level", "we", "should", "use", "a", "new", "session", "ID", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Session.php#L94-L103
train
fisharebest/webtrees
app/Session.php
Session.getCsrfToken
public static function getCsrfToken(): string { if (!self::has('CSRF_TOKEN')) { self::put('CSRF_TOKEN', Str::random(32)); } return self::get('CSRF_TOKEN'); }
php
public static function getCsrfToken(): string { if (!self::has('CSRF_TOKEN')) { self::put('CSRF_TOKEN', Str::random(32)); } return self::get('CSRF_TOKEN'); }
[ "public", "static", "function", "getCsrfToken", "(", ")", ":", "string", "{", "if", "(", "!", "self", "::", "has", "(", "'CSRF_TOKEN'", ")", ")", "{", "self", "::", "put", "(", "'CSRF_TOKEN'", ",", "Str", "::", "random", "(", "32", ")", ")", ";", "...
Cross-Site Request Forgery tokens - ensure that the user is submitting a form that was generated by the current session. @return string
[ "Cross", "-", "Site", "Request", "Forgery", "tokens", "-", "ensure", "that", "the", "user", "is", "submitting", "a", "form", "that", "was", "generated", "by", "the", "current", "session", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Session.php#L146-L153
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.checkLinkMessage
private function checkLinkMessage(Tree $tree, $type1, $xref1, $type2, $xref2): string { /* I18N: The placeholders are GEDCOM XREFs and tags. e.g. “INDI I123 contains a FAMC link to F234.” */ return I18N::translate( '%1$s %2$s has a %3$s link to %4$s.', $this->formatType($type...
php
private function checkLinkMessage(Tree $tree, $type1, $xref1, $type2, $xref2): string { /* I18N: The placeholders are GEDCOM XREFs and tags. e.g. “INDI I123 contains a FAMC link to F234.” */ return I18N::translate( '%1$s %2$s has a %3$s link to %4$s.', $this->formatType($type...
[ "private", "function", "checkLinkMessage", "(", "Tree", "$", "tree", ",", "$", "type1", ",", "$", "xref1", ",", "$", "type2", ",", "$", "xref2", ")", ":", "string", "{", "/* I18N: The placeholders are GEDCOM XREFs and tags. e.g. “INDI I123 contains a FAMC link to F234.”...
Create a message linking one record to another. @param Tree $tree @param string $type1 @param string $xref1 @param string $type2 @param string $xref2 @return string
[ "Create", "a", "message", "linking", "one", "record", "to", "another", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L315-L325
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.checkLink
private function checkLink(Tree $tree, string $xref): string { return '<b><a href="' . e(route('record', [ 'xref' => $xref, 'ged' => $tree->name(), ])) . '">' . $xref . '</a></b>'; }
php
private function checkLink(Tree $tree, string $xref): string { return '<b><a href="' . e(route('record', [ 'xref' => $xref, 'ged' => $tree->name(), ])) . '">' . $xref . '</a></b>'; }
[ "private", "function", "checkLink", "(", "Tree", "$", "tree", ",", "string", "$", "xref", ")", ":", "string", "{", "return", "'<b><a href=\"'", ".", "e", "(", "route", "(", "'record'", ",", "[", "'xref'", "=>", "$", "xref", ",", "'ged'", "=>", "$", "...
Format a link to a record. @param Tree $tree @param string $xref @return string
[ "Format", "a", "link", "to", "a", "record", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L335-L341
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.countCommonXrefs
private function countCommonXrefs(Tree $tree1, Tree $tree2): int { $subquery1 = DB::table('individuals') ->where('i_file', '=', $tree1->id()) ->select(['i_id AS xref']) ->union(DB::table('families') ->where('f_file', '=', $tree1->id()) ->se...
php
private function countCommonXrefs(Tree $tree1, Tree $tree2): int { $subquery1 = DB::table('individuals') ->where('i_file', '=', $tree1->id()) ->select(['i_id AS xref']) ->union(DB::table('families') ->where('f_file', '=', $tree1->id()) ->se...
[ "private", "function", "countCommonXrefs", "(", "Tree", "$", "tree1", ",", "Tree", "$", "tree2", ")", ":", "int", "{", "$", "subquery1", "=", "DB", "::", "table", "(", "'individuals'", ")", "->", "where", "(", "'i_file'", ",", "'='", ",", "$", "tree1",...
Count of XREFs used by two trees at the same time. @param Tree $tree1 @param Tree $tree2 @return int
[ "Count", "of", "XREFs", "used", "by", "two", "trees", "at", "the", "same", "time", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L1927-L1970
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.duplicateXrefs
private function duplicateXrefs(Tree $tree): array { $subquery1 = DB::table('individuals') ->where('i_file', '=', $tree->id()) ->select(['i_id AS xref', DB::raw("'INDI' AS type")]) ->union(DB::table('families') ->where('f_file', '=', $tree->id()) ...
php
private function duplicateXrefs(Tree $tree): array { $subquery1 = DB::table('individuals') ->where('i_file', '=', $tree->id()) ->select(['i_id AS xref', DB::raw("'INDI' AS type")]) ->union(DB::table('families') ->where('f_file', '=', $tree->id()) ...
[ "private", "function", "duplicateXrefs", "(", "Tree", "$", "tree", ")", ":", "array", "{", "$", "subquery1", "=", "DB", "::", "table", "(", "'individuals'", ")", "->", "where", "(", "'i_file'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", ")",...
Every XREF used by this tree and also used by some other tree @param Tree $tree @return string[]
[ "Every", "XREF", "used", "by", "this", "tree", "and", "also", "used", "by", "some", "other", "tree" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L2065-L2109
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.gedcomFiles
private function gedcomFiles(string $folder): array { $d = opendir($folder); $files = []; while (($f = readdir($d)) !== false) { if (!is_dir(WT_DATA_DIR . $f) && is_readable(WT_DATA_DIR . $f)) { $fp = fopen(WT_DATA_DIR . $f, 'rb'); $header ...
php
private function gedcomFiles(string $folder): array { $d = opendir($folder); $files = []; while (($f = readdir($d)) !== false) { if (!is_dir(WT_DATA_DIR . $f) && is_readable(WT_DATA_DIR . $f)) { $fp = fopen(WT_DATA_DIR . $f, 'rb'); $header ...
[ "private", "function", "gedcomFiles", "(", "string", "$", "folder", ")", ":", "array", "{", "$", "d", "=", "opendir", "(", "$", "folder", ")", ";", "$", "files", "=", "[", "]", ";", "while", "(", "(", "$", "f", "=", "readdir", "(", "$", "d", ")...
Find a list of GEDCOM files in a folder @param string $folder @return array
[ "Find", "a", "list", "of", "GEDCOM", "files", "in", "a", "folder" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L2118-L2135
train
fisharebest/webtrees
app/Http/Controllers/AdminTreesController.php
AdminTreesController.generateNewTreeName
private function generateNewTreeName(): string { $tree_name = 'tree'; $tree_number = 1; $existing_trees = Tree::getNameList(); while (array_key_exists($tree_name . $tree_number, $existing_trees)) { $tree_number++; } return $tree_name . $tree_numb...
php
private function generateNewTreeName(): string { $tree_name = 'tree'; $tree_number = 1; $existing_trees = Tree::getNameList(); while (array_key_exists($tree_name . $tree_number, $existing_trees)) { $tree_number++; } return $tree_name . $tree_numb...
[ "private", "function", "generateNewTreeName", "(", ")", ":", "string", "{", "$", "tree_name", "=", "'tree'", ";", "$", "tree_number", "=", "1", ";", "$", "existing_trees", "=", "Tree", "::", "getNameList", "(", ")", ";", "while", "(", "array_key_exists", "...
Generate a unqiue name for new trees @return string
[ "Generate", "a", "unqiue", "name", "for", "new", "trees" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminTreesController.php#L2142-L2153
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePageBlockUpdate
public function treePageBlockUpdate(ServerRequestInterface $request, Tree $tree, UserInterface $user): ResponseInterface { $block = $this->treeBlock($request, $tree, $user); $block_id = (int) $request->get('block_id'); $block->saveBlockConfiguration($request, $block_id); return ...
php
public function treePageBlockUpdate(ServerRequestInterface $request, Tree $tree, UserInterface $user): ResponseInterface { $block = $this->treeBlock($request, $tree, $user); $block_id = (int) $request->get('block_id'); $block->saveBlockConfiguration($request, $block_id); return ...
[ "public", "function", "treePageBlockUpdate", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ",", "UserInterface", "$", "user", ")", ":", "ResponseInterface", "{", "$", "block", "=", "$", "this", "->", "treeBlock", "(", "$", "request",...
Update block config options. @param ServerRequestInterface $request @param Tree $tree @param UserInterface $user @return ResponseInterface
[ "Update", "block", "config", "options", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L137-L145
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treeBlock
private function treeBlock(ServerRequestInterface $request, Tree $tree, UserInterface $user): ModuleBlockInterface { $block_id = (int) $request->get('block_id'); $block = DB::table('block') ->where('block_id', '=', $block_id) ->where('gedcom_id', '=', $tree->id()) ...
php
private function treeBlock(ServerRequestInterface $request, Tree $tree, UserInterface $user): ModuleBlockInterface { $block_id = (int) $request->get('block_id'); $block = DB::table('block') ->where('block_id', '=', $block_id) ->where('gedcom_id', '=', $tree->id()) ...
[ "private", "function", "treeBlock", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ",", "UserInterface", "$", "user", ")", ":", "ModuleBlockInterface", "{", "$", "block_id", "=", "(", "int", ")", "$", "request", "->", "get", "(", ...
Load a block and check we have permission to edit it. @param ServerRequestInterface $request @param Tree $tree @param UserInterface $user @return ModuleBlockInterface
[ "Load", "a", "block", "and", "check", "we", "have", "permission", "to", "edit", "it", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L156-L181
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePage
public function treePage(Tree $tree): ResponseInterface { $has_blocks = DB::table('block') ->where('gedcom_id', '=', $tree->id()) ->exists(); if (!$has_blocks) { $this->checkDefaultTreeBlocksExist(); // Copy the defaults (new Builder(DB::...
php
public function treePage(Tree $tree): ResponseInterface { $has_blocks = DB::table('block') ->where('gedcom_id', '=', $tree->id()) ->exists(); if (!$has_blocks) { $this->checkDefaultTreeBlocksExist(); // Copy the defaults (new Builder(DB::...
[ "public", "function", "treePage", "(", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "has_blocks", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", "'gedcom_id'", ",", "'='", ",", "$", "tree", "->", "id", "(", ")", "...
Show a tree's page. @param Tree $tree @return ResponseInterface
[ "Show", "a", "tree", "s", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L270-L297
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePageBlock
public function treePageBlock(ServerRequestInterface $request, Tree $tree): ResponseInterface { $block_id = $request->get('block_id'); $block_id = (int) DB::table('block') ->where('block_id', '=', $block_id) ->where('gedcom_id', '=', $tree->id()) ->value('block_i...
php
public function treePageBlock(ServerRequestInterface $request, Tree $tree): ResponseInterface { $block_id = $request->get('block_id'); $block_id = (int) DB::table('block') ->where('block_id', '=', $block_id) ->where('gedcom_id', '=', $tree->id()) ->value('block_i...
[ "public", "function", "treePageBlock", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "block_id", "=", "$", "request", "->", "get", "(", "'block_id'", ")", ";", "$", "block_id", "=", "(", "...
Load block asynchronously. @param ServerRequestInterface $request @param Tree $tree @return ResponseInterface
[ "Load", "block", "asynchronously", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L307-L323
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePageDefaultEdit
public function treePageDefaultEdit(): ResponseInterface { $this->checkDefaultTreeBlocksExist(); $main_blocks = $this->treeBlocks(-1, 'main'); $side_blocks = $this->treeBlocks(-1, 'side'); $all_blocks = $this->availableTreeBlocks(); $title = I18N::translate('Set the de...
php
public function treePageDefaultEdit(): ResponseInterface { $this->checkDefaultTreeBlocksExist(); $main_blocks = $this->treeBlocks(-1, 'main'); $side_blocks = $this->treeBlocks(-1, 'side'); $all_blocks = $this->availableTreeBlocks(); $title = I18N::translate('Set the de...
[ "public", "function", "treePageDefaultEdit", "(", ")", ":", "ResponseInterface", "{", "$", "this", "->", "checkDefaultTreeBlocksExist", "(", ")", ";", "$", "main_blocks", "=", "$", "this", "->", "treeBlocks", "(", "-", "1", ",", "'main'", ")", ";", "$", "s...
Show a form to edit the default blocks for new trees. @return ResponseInterface
[ "Show", "a", "form", "to", "edit", "the", "default", "blocks", "for", "new", "trees", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L330-L351
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePageDefaultUpdate
public function treePageDefaultUpdate(ServerRequestInterface $request): ResponseInterface { $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateTreeBlocks(-1, $main_blocks, $side_blocks); return redirect(route('admin-control-pane...
php
public function treePageDefaultUpdate(ServerRequestInterface $request): ResponseInterface { $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateTreeBlocks(-1, $main_blocks, $side_blocks); return redirect(route('admin-control-pane...
[ "public", "function", "treePageDefaultUpdate", "(", "ServerRequestInterface", "$", "request", ")", ":", "ResponseInterface", "{", "$", "main_blocks", "=", "(", "array", ")", "$", "request", "->", "get", "(", "'main'", ")", ";", "$", "side_blocks", "=", "(", ...
Save updated default blocks for new trees. @param ServerRequestInterface $request @return ResponseInterface
[ "Save", "updated", "default", "blocks", "for", "new", "trees", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L360-L368
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treePageUpdate
public function treePageUpdate(ServerRequestInterface $request, Tree $tree): ResponseInterface { $defaults = (bool) $request->get('defaults'); if ($defaults) { $main_blocks = $this->treeBlocks(-1, 'main')->all(); $side_blocks = $this->treeBlocks(-1, 'side')->all(); }...
php
public function treePageUpdate(ServerRequestInterface $request, Tree $tree): ResponseInterface { $defaults = (bool) $request->get('defaults'); if ($defaults) { $main_blocks = $this->treeBlocks(-1, 'main')->all(); $side_blocks = $this->treeBlocks(-1, 'side')->all(); }...
[ "public", "function", "treePageUpdate", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ")", ":", "ResponseInterface", "{", "$", "defaults", "=", "(", "bool", ")", "$", "request", "->", "get", "(", "'defaults'", ")", ";", "if", "("...
Save updated blocks on a tree's page. @param ServerRequestInterface $request @param Tree $tree @return ResponseInterface
[ "Save", "updated", "blocks", "on", "a", "tree", "s", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L406-L421
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userPage
public function userPage(UserInterface $user): ResponseInterface { $has_blocks = DB::table('block') ->where('user_id', '=', $user->id()) ->exists(); if (!$has_blocks) { $this->checkDefaultUserBlocksExist(); // Copy the defaults (new Build...
php
public function userPage(UserInterface $user): ResponseInterface { $has_blocks = DB::table('block') ->where('user_id', '=', $user->id()) ->exists(); if (!$has_blocks) { $this->checkDefaultUserBlocksExist(); // Copy the defaults (new Build...
[ "public", "function", "userPage", "(", "UserInterface", "$", "user", ")", ":", "ResponseInterface", "{", "$", "has_blocks", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", "'user_id'", ",", "'='", ",", "$", "user", "->", "id", "(", "...
Show a users's page. @param UserInterface $user @return ResponseInterface
[ "Show", "a", "users", "s", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L430-L456
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userPageDefaultEdit
public function userPageDefaultEdit(): ResponseInterface { $this->checkDefaultUserBlocksExist(); $main_blocks = $this->userBlocks(-1, 'main'); $side_blocks = $this->userBlocks(-1, 'side'); $all_blocks = $this->availableUserBlocks(); $title = I18N::translate('Set the d...
php
public function userPageDefaultEdit(): ResponseInterface { $this->checkDefaultUserBlocksExist(); $main_blocks = $this->userBlocks(-1, 'main'); $side_blocks = $this->userBlocks(-1, 'side'); $all_blocks = $this->availableUserBlocks(); $title = I18N::translate('Set the d...
[ "public", "function", "userPageDefaultEdit", "(", ")", ":", "ResponseInterface", "{", "$", "this", "->", "checkDefaultUserBlocksExist", "(", ")", ";", "$", "main_blocks", "=", "$", "this", "->", "userBlocks", "(", "-", "1", ",", "'main'", ")", ";", "$", "s...
Show a form to edit the default blocks for new uesrs. @return ResponseInterface
[ "Show", "a", "form", "to", "edit", "the", "default", "blocks", "for", "new", "uesrs", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L490-L510
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userPageDefaultUpdate
public function userPageDefaultUpdate(ServerRequestInterface $request): ResponseInterface { $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateUserBlocks(-1, $main_blocks, $side_blocks); return redirect(route('admin-control-pane...
php
public function userPageDefaultUpdate(ServerRequestInterface $request): ResponseInterface { $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateUserBlocks(-1, $main_blocks, $side_blocks); return redirect(route('admin-control-pane...
[ "public", "function", "userPageDefaultUpdate", "(", "ServerRequestInterface", "$", "request", ")", ":", "ResponseInterface", "{", "$", "main_blocks", "=", "(", "array", ")", "$", "request", "->", "get", "(", "'main'", ")", ";", "$", "side_blocks", "=", "(", ...
Save the updated default blocks for new users. @param ServerRequestInterface $request @return ResponseInterface
[ "Save", "the", "updated", "default", "blocks", "for", "new", "users", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L519-L527
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userPageUpdate
public function userPageUpdate(ServerRequestInterface $request, Tree $tree, UserInterface $user): ResponseInterface { $defaults = (bool) $request->get('defaults'); if ($defaults) { $main_blocks = $this->userBlocks(-1, 'main')->all(); $side_blocks = $this->userBlocks(-1, 'sid...
php
public function userPageUpdate(ServerRequestInterface $request, Tree $tree, UserInterface $user): ResponseInterface { $defaults = (bool) $request->get('defaults'); if ($defaults) { $main_blocks = $this->userBlocks(-1, 'main')->all(); $side_blocks = $this->userBlocks(-1, 'sid...
[ "public", "function", "userPageUpdate", "(", "ServerRequestInterface", "$", "request", ",", "Tree", "$", "tree", ",", "UserInterface", "$", "user", ")", ":", "ResponseInterface", "{", "$", "defaults", "=", "(", "bool", ")", "$", "request", "->", "get", "(", ...
Save the updted blocks on a user's page. @param ServerRequestInterface $request @param Tree $tree @param UserInterface $user @return ResponseInterface
[ "Save", "the", "updted", "blocks", "on", "a", "user", "s", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L566-L581
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userPageUserUpdate
public function userPageUserUpdate(ServerRequestInterface $request): ResponseInterface { $user_id = (int) $request->get('user_id'); $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateUserBlocks($user_id, $main_blocks, $side_b...
php
public function userPageUserUpdate(ServerRequestInterface $request): ResponseInterface { $user_id = (int) $request->get('user_id'); $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateUserBlocks($user_id, $main_blocks, $side_b...
[ "public", "function", "userPageUserUpdate", "(", "ServerRequestInterface", "$", "request", ")", ":", "ResponseInterface", "{", "$", "user_id", "=", "(", "int", ")", "$", "request", "->", "get", "(", "'user_id'", ")", ";", "$", "main_blocks", "=", "(", "array...
Save the updated blocks for another user's page. @param ServerRequestInterface $request @return ResponseInterface
[ "Save", "the", "updated", "blocks", "for", "another", "user", "s", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L619-L628
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.getBlockModule
private function getBlockModule(Tree $tree, int $block_id): ModuleBlockInterface { $active_blocks = $this->module_service->findByComponent(ModuleBlockInterface::class, $tree, Auth::user()); $module_name = DB::table('block') ->where('block_id', '=', $block_id) ->value('module...
php
private function getBlockModule(Tree $tree, int $block_id): ModuleBlockInterface { $active_blocks = $this->module_service->findByComponent(ModuleBlockInterface::class, $tree, Auth::user()); $module_name = DB::table('block') ->where('block_id', '=', $block_id) ->value('module...
[ "private", "function", "getBlockModule", "(", "Tree", "$", "tree", ",", "int", "$", "block_id", ")", ":", "ModuleBlockInterface", "{", "$", "active_blocks", "=", "$", "this", "->", "module_service", "->", "findByComponent", "(", "ModuleBlockInterface", "::", "cl...
Get a specific block. @param Tree $tree @param int $block_id @return ModuleBlockInterface @throws NotFoundHttpException
[ "Get", "a", "specific", "block", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L639-L656
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.availableTreeBlocks
private function availableTreeBlocks(): Collection { return $this->module_service->findByInterface(ModuleBlockInterface::class, false, true) ->filter(static function (ModuleBlockInterface $block): bool { return $block->isTreeBlock(); }) ->mapWithKeys(stati...
php
private function availableTreeBlocks(): Collection { return $this->module_service->findByInterface(ModuleBlockInterface::class, false, true) ->filter(static function (ModuleBlockInterface $block): bool { return $block->isTreeBlock(); }) ->mapWithKeys(stati...
[ "private", "function", "availableTreeBlocks", "(", ")", ":", "Collection", "{", "return", "$", "this", "->", "module_service", "->", "findByInterface", "(", "ModuleBlockInterface", "::", "class", ",", "false", ",", "true", ")", "->", "filter", "(", "static", "...
Get all the available blocks for a tree page. @return Collection @return ModuleBlockInterface[]
[ "Get", "all", "the", "available", "blocks", "for", "a", "tree", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L664-L673
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.availableUserBlocks
private function availableUserBlocks(): Collection { return $this->module_service->findByInterface(ModuleBlockInterface::class, false, true) ->filter(static function (ModuleBlockInterface $block): bool { return $block->isUserBlock(); }) ->mapWithKeys(stati...
php
private function availableUserBlocks(): Collection { return $this->module_service->findByInterface(ModuleBlockInterface::class, false, true) ->filter(static function (ModuleBlockInterface $block): bool { return $block->isUserBlock(); }) ->mapWithKeys(stati...
[ "private", "function", "availableUserBlocks", "(", ")", ":", "Collection", "{", "return", "$", "this", "->", "module_service", "->", "findByInterface", "(", "ModuleBlockInterface", "::", "class", ",", "false", ",", "true", ")", "->", "filter", "(", "static", "...
Get all the available blocks for a user page. @return Collection @return ModuleBlockInterface[]
[ "Get", "all", "the", "available", "blocks", "for", "a", "user", "page", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L681-L690
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.treeBlocks
private function treeBlocks(int $tree_id, string $location): Collection { $rows = DB::table('block') ->where('gedcom_id', '=', $tree_id) ->where('location', '=', $location) ->orderBy('block_order') ->pluck('module_name', 'block_id'); return $this->fil...
php
private function treeBlocks(int $tree_id, string $location): Collection { $rows = DB::table('block') ->where('gedcom_id', '=', $tree_id) ->where('location', '=', $location) ->orderBy('block_order') ->pluck('module_name', 'block_id'); return $this->fil...
[ "private", "function", "treeBlocks", "(", "int", "$", "tree_id", ",", "string", "$", "location", ")", ":", "Collection", "{", "$", "rows", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", "'gedcom_id'", ",", "'='", ",", "$", "tree_id"...
Get the blocks for a specified tree. @param int $tree_id @param string $location "main" or "side" @return Collection @return ModuleBlockInterface[]
[ "Get", "the", "blocks", "for", "a", "specified", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L701-L710
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.checkDefaultTreeBlocksExist
private function checkDefaultTreeBlocksExist(): void { $has_blocks = DB::table('block') ->where('gedcom_id', '=', -1) ->exists(); // No default settings? Create them. if (!$has_blocks) { foreach (['main', 'side'] as $location) { foreach (...
php
private function checkDefaultTreeBlocksExist(): void { $has_blocks = DB::table('block') ->where('gedcom_id', '=', -1) ->exists(); // No default settings? Create them. if (!$has_blocks) { foreach (['main', 'side'] as $location) { foreach (...
[ "private", "function", "checkDefaultTreeBlocksExist", "(", ")", ":", "void", "{", "$", "has_blocks", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", "'gedcom_id'", ",", "'='", ",", "-", "1", ")", "->", "exists", "(", ")", ";", "// No...
Make sure that default blocks exist for a tree. @return void
[ "Make", "sure", "that", "default", "blocks", "exist", "for", "a", "tree", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L717-L738
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.userBlocks
private function userBlocks(int $user_id, string $location): Collection { $rows = DB::table('block') ->where('user_id', '=', $user_id) ->where('location', '=', $location) ->orderBy('block_order') ->pluck('module_name', 'block_id'); return $this->filte...
php
private function userBlocks(int $user_id, string $location): Collection { $rows = DB::table('block') ->where('user_id', '=', $user_id) ->where('location', '=', $location) ->orderBy('block_order') ->pluck('module_name', 'block_id'); return $this->filte...
[ "private", "function", "userBlocks", "(", "int", "$", "user_id", ",", "string", "$", "location", ")", ":", "Collection", "{", "$", "rows", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", "'user_id'", ",", "'='", ",", "$", "user_id", ...
Get the blocks for a specified user. @param int $user_id @param string $location "main" or "side" @return Collection @return ModuleBlockInterface[]
[ "Get", "the", "blocks", "for", "a", "specified", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L749-L758
train
fisharebest/webtrees
app/Http/Controllers/HomePageController.php
HomePageController.updateUserBlocks
private function updateUserBlocks(int $user_id, array $main_blocks, array $side_blocks): void { $existing_block_ids = DB::table('block') ->where('user_id', '=', $user_id) ->pluck('block_id'); // Deleted blocks foreach ($existing_block_ids as $existing_block_id) { ...
php
private function updateUserBlocks(int $user_id, array $main_blocks, array $side_blocks): void { $existing_block_ids = DB::table('block') ->where('user_id', '=', $user_id) ->pluck('block_id'); // Deleted blocks foreach ($existing_block_ids as $existing_block_id) { ...
[ "private", "function", "updateUserBlocks", "(", "int", "$", "user_id", ",", "array", "$", "main_blocks", ",", "array", "$", "side_blocks", ")", ":", "void", "{", "$", "existing_block_ids", "=", "DB", "::", "table", "(", "'block'", ")", "->", "where", "(", ...
Save the updated blocks for a user. @param int $user_id @param array $main_blocks @param array $side_blocks @return void
[ "Save", "the", "updated", "blocks", "for", "a", "user", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/HomePageController.php#L797-L842
train
fisharebest/webtrees
app/Report/ReportPdfHtml.php
ReportPdfHtml.render
public function render($renderer, $sub = false) { if (!empty($this->attrs['style'])) { $renderer->setCurrentStyle($this->attrs['style']); } if (!empty($this->attrs['width'])) { $this->attrs['width'] *= 3.9; } $this->text = $this->getStart() . $this->t...
php
public function render($renderer, $sub = false) { if (!empty($this->attrs['style'])) { $renderer->setCurrentStyle($this->attrs['style']); } if (!empty($this->attrs['width'])) { $this->attrs['width'] *= 3.9; } $this->text = $this->getStart() . $this->t...
[ "public", "function", "render", "(", "$", "renderer", ",", "$", "sub", "=", "false", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "attrs", "[", "'style'", "]", ")", ")", "{", "$", "renderer", "->", "setCurrentStyle", "(", "$", "this",...
Render the output. @param $renderer @param bool $sub @return string|void
[ "Render", "the", "output", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportPdfHtml.php#L33-L59
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.familyQuery
private function familyQuery(string $type): string { $row = DB::table('families') ->where('f_file', '=', $this->tree->id()) ->orderBy('f_numchil', 'desc') ->first(); if ($row === null) { return ''; } /** @var Family $family */ ...
php
private function familyQuery(string $type): string { $row = DB::table('families') ->where('f_file', '=', $this->tree->id()) ->orderBy('f_numchil', 'desc') ->first(); if ($row === null) { return ''; } /** @var Family $family */ ...
[ "private", "function", "familyQuery", "(", "string", "$", "type", ")", ":", "string", "{", "$", "row", "=", "DB", "::", "table", "(", "'families'", ")", "->", "where", "(", "'f_file'", ",", "'='", ",", "$", "this", "->", "tree", "->", "id", "(", ")...
General query on family. @param string $type @return string
[ "General", "query", "on", "family", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L66-L95
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topTenGrandFamilyQuery
private function topTenGrandFamilyQuery(int $total): array { return DB::table('families') ->join('link AS children', static function (JoinClause $join): void { $join ->on('children.l_from', '=', 'f_id') ->on('children.l_file', '=', 'f_file'...
php
private function topTenGrandFamilyQuery(int $total): array { return DB::table('families') ->join('link AS children', static function (JoinClause $join): void { $join ->on('children.l_from', '=', 'f_id') ->on('children.l_file', '=', 'f_file'...
[ "private", "function", "topTenGrandFamilyQuery", "(", "int", "$", "total", ")", ":", "array", "{", "return", "DB", "::", "table", "(", "'families'", ")", "->", "join", "(", "'link AS children'", ",", "static", "function", "(", "JoinClause", "$", "join", ")",...
Find the couple with the most grandchildren. @param int $total @return array
[ "Find", "the", "couple", "with", "the", "most", "grandchildren", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L134-L175
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.ageBetweenSiblingsQuery
private function ageBetweenSiblingsQuery(int $total): array { $prefix = DB::connection()->getTablePrefix(); return DB::table('link AS link1') ->join('link AS link2', static function (JoinClause $join): void { $join ->on('link2.l_from', '=', 'link1.l_f...
php
private function ageBetweenSiblingsQuery(int $total): array { $prefix = DB::connection()->getTablePrefix(); return DB::table('link AS link1') ->join('link AS link2', static function (JoinClause $join): void { $join ->on('link2.l_from', '=', 'link1.l_f...
[ "private", "function", "ageBetweenSiblingsQuery", "(", "int", "$", "total", ")", ":", "array", "{", "$", "prefix", "=", "DB", "::", "connection", "(", ")", "->", "getTablePrefix", "(", ")", ";", "return", "DB", "::", "table", "(", "'link AS link1'", ")", ...
Returns the ages between siblings. @param int $total The total number of records to query @return array
[ "Returns", "the", "ages", "between", "siblings", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L292-L325
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.calculateAge
private function calculateAge(int $age): string { if ((int) ($age / 365.25) > 0) { $result = (int) ($age / 365.25) . 'y'; } elseif ((int) ($age / 30.4375) > 0) { $result = (int) ($age / 30.4375) . 'm'; } else { $result = $age . 'd'; } retu...
php
private function calculateAge(int $age): string { if ((int) ($age / 365.25) > 0) { $result = (int) ($age / 365.25) . 'y'; } elseif ((int) ($age / 30.4375) > 0) { $result = (int) ($age / 30.4375) . 'm'; } else { $result = $age . 'd'; } retu...
[ "private", "function", "calculateAge", "(", "int", "$", "age", ")", ":", "string", "{", "if", "(", "(", "int", ")", "(", "$", "age", "/", "365.25", ")", ">", "0", ")", "{", "$", "result", "=", "(", "int", ")", "(", "$", "age", "/", "365.25", ...
Returns the calculated age the time of event. @param int $age The age from the database record @return string
[ "Returns", "the", "calculated", "age", "the", "time", "of", "event", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L334-L345
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topAgeBetweenSiblingsFullName
public function topAgeBetweenSiblingsFullName(int $total = 10): string { $record = $this->ageBetweenSiblingsNoList($total); if (empty($record)) { return I18N::translate('This information is not available.'); } return view('statistics/families/top10-nolist-age', [ ...
php
public function topAgeBetweenSiblingsFullName(int $total = 10): string { $record = $this->ageBetweenSiblingsNoList($total); if (empty($record)) { return I18N::translate('This information is not available.'); } return view('statistics/families/top10-nolist-age', [ ...
[ "public", "function", "topAgeBetweenSiblingsFullName", "(", "int", "$", "total", "=", "10", ")", ":", "string", "{", "$", "record", "=", "$", "this", "->", "ageBetweenSiblingsNoList", "(", "$", "total", ")", ";", "if", "(", "empty", "(", "$", "record", "...
Find the name of siblings with the widest age gap. @param int $total @return string
[ "Find", "the", "name", "of", "siblings", "with", "the", "widest", "age", "gap", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L505-L516
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topAgeBetweenSiblingsList
public function topAgeBetweenSiblingsList(int $total = 10, string $one = ''): string { $records = $this->ageBetweenSiblingsList($total, (bool) $one); return view('statistics/families/top10-list-age', [ 'records' => $records, ]); }
php
public function topAgeBetweenSiblingsList(int $total = 10, string $one = ''): string { $records = $this->ageBetweenSiblingsList($total, (bool) $one); return view('statistics/families/top10-list-age', [ 'records' => $records, ]); }
[ "public", "function", "topAgeBetweenSiblingsList", "(", "int", "$", "total", "=", "10", ",", "string", "$", "one", "=", "''", ")", ":", "string", "{", "$", "records", "=", "$", "this", "->", "ageBetweenSiblingsList", "(", "$", "total", ",", "(", "bool", ...
Find the siblings with the widest age gaps. @param int $total @param string $one @return string
[ "Find", "the", "siblings", "with", "the", "widest", "age", "gaps", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L526-L533
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.totalChildren
public function totalChildren(): string { $total = (int) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->sum('f_numchil'); return I18N::number($total); }
php
public function totalChildren(): string { $total = (int) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->sum('f_numchil'); return I18N::number($total); }
[ "public", "function", "totalChildren", "(", ")", ":", "string", "{", "$", "total", "=", "(", "int", ")", "DB", "::", "table", "(", "'families'", ")", "->", "where", "(", "'f_file'", ",", "'='", ",", "$", "this", "->", "tree", "->", "id", "(", ")", ...
Count the total children. @return string
[ "Count", "the", "total", "children", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L581-L588
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.averageChildren
public function averageChildren(): string { $average = (float) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->avg('f_numchil'); return I18N::number($average, 2); }
php
public function averageChildren(): string { $average = (float) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->avg('f_numchil'); return I18N::number($average, 2); }
[ "public", "function", "averageChildren", "(", ")", ":", "string", "{", "$", "average", "=", "(", "float", ")", "DB", "::", "table", "(", "'families'", ")", "->", "where", "(", "'f_file'", ",", "'='", ",", "$", "this", "->", "tree", "->", "id", "(", ...
Find the average number of children in families. @return string
[ "Find", "the", "average", "number", "of", "children", "in", "families", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L595-L602
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topTenFamilyQuery
private function topTenFamilyQuery(int $total): array { return DB::table('families') ->where('f_file', '=', $this->tree->id()) ->orderBy('f_numchil', 'DESC') ->limit($total) ->get() ->map(Family::rowMapper()) ->filter(GedcomRecord::acce...
php
private function topTenFamilyQuery(int $total): array { return DB::table('families') ->where('f_file', '=', $this->tree->id()) ->orderBy('f_numchil', 'DESC') ->limit($total) ->get() ->map(Family::rowMapper()) ->filter(GedcomRecord::acce...
[ "private", "function", "topTenFamilyQuery", "(", "int", "$", "total", ")", ":", "array", "{", "return", "DB", "::", "table", "(", "'families'", ")", "->", "where", "(", "'f_file'", ",", "'='", ",", "$", "this", "->", "tree", "->", "id", "(", ")", ")"...
General query on families. @param int $total @return array
[ "General", "query", "on", "families", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L611-L627
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topTenLargestFamily
public function topTenLargestFamily(int $total = 10): string { $records = $this->topTenFamilyQuery($total); return view('statistics/families/top10-nolist', [ 'records' => $records, ]); }
php
public function topTenLargestFamily(int $total = 10): string { $records = $this->topTenFamilyQuery($total); return view('statistics/families/top10-nolist', [ 'records' => $records, ]); }
[ "public", "function", "topTenLargestFamily", "(", "int", "$", "total", "=", "10", ")", ":", "string", "{", "$", "records", "=", "$", "this", "->", "topTenFamilyQuery", "(", "$", "total", ")", ";", "return", "view", "(", "'statistics/families/top10-nolist'", ...
The the families with the most children. @param int $total @return string
[ "The", "the", "families", "with", "the", "most", "children", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L636-L643
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.topTenLargestFamilyList
public function topTenLargestFamilyList(int $total = 10): string { $records = $this->topTenFamilyQuery($total); return view('statistics/families/top10-list', [ 'records' => $records, ]); }
php
public function topTenLargestFamilyList(int $total = 10): string { $records = $this->topTenFamilyQuery($total); return view('statistics/families/top10-list', [ 'records' => $records, ]); }
[ "public", "function", "topTenLargestFamilyList", "(", "int", "$", "total", "=", "10", ")", ":", "string", "{", "$", "records", "=", "$", "this", "->", "topTenFamilyQuery", "(", "$", "total", ")", ";", "return", "view", "(", "'statistics/families/top10-list'", ...
Find the families with the most children. @param int $total @return string
[ "Find", "the", "families", "with", "the", "most", "children", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L652-L659
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.totalMarriedMales
public function totalMarriedMales(): string { $n = (int) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->where('f_gedcom', 'LIKE', "%\n1 MARR%") ->distinct() ->count('f_husb'); return I18N::number($n); }
php
public function totalMarriedMales(): string { $n = (int) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->where('f_gedcom', 'LIKE', "%\n1 MARR%") ->distinct() ->count('f_husb'); return I18N::number($n); }
[ "public", "function", "totalMarriedMales", "(", ")", ":", "string", "{", "$", "n", "=", "(", "int", ")", "DB", "::", "table", "(", "'families'", ")", "->", "where", "(", "'f_file'", ",", "'='", ",", "$", "this", "->", "tree", "->", "id", "(", ")", ...
Number of husbands. @return string
[ "Number", "of", "husbands", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L750-L759
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.ageBetweenSpousesQuery
private function ageBetweenSpousesQuery(string $age_dir, int $total): array { $prefix = DB::connection()->getTablePrefix(); $query = DB::table('families') ->where('f_file', '=', $this->tree->id()) ->join('dates AS wife', static function (JoinClause $join): void { ...
php
private function ageBetweenSpousesQuery(string $age_dir, int $total): array { $prefix = DB::connection()->getTablePrefix(); $query = DB::table('families') ->where('f_file', '=', $this->tree->id()) ->join('dates AS wife', static function (JoinClause $join): void { ...
[ "private", "function", "ageBetweenSpousesQuery", "(", "string", "$", "age_dir", ",", "int", "$", "total", ")", ":", "array", "{", "$", "prefix", "=", "DB", "::", "connection", "(", ")", "->", "getTablePrefix", "(", ")", ";", "$", "query", "=", "DB", ":...
Find the ages between spouses. @param string $age_dir @param int $total @return array
[ "Find", "the", "ages", "between", "spouses", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L1252-L1306
train
fisharebest/webtrees
app/Statistics/Repository/FamilyRepository.php
FamilyRepository.statsDiv
public function statsDiv(string $color_from = null, string $color_to = null): string { return (new ChartDivorce($this->tree)) ->chartDivorce($color_from, $color_to); }
php
public function statsDiv(string $color_from = null, string $color_to = null): string { return (new ChartDivorce($this->tree)) ->chartDivorce($color_from, $color_to); }
[ "public", "function", "statsDiv", "(", "string", "$", "color_from", "=", "null", ",", "string", "$", "color_to", "=", "null", ")", ":", "string", "{", "return", "(", "new", "ChartDivorce", "(", "$", "this", "->", "tree", ")", ")", "->", "chartDivorce", ...
General divorce query. @param string|null $color_from @param string|null $color_to @return string
[ "General", "divorce", "query", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/FamilyRepository.php#L1731-L1735
train
fisharebest/webtrees
app/Menu.php
Menu.bootstrap4
public function bootstrap4(): string { if (!empty($this->submenus)) { $submenus = ''; foreach ($this->submenus as $submenu) { $attrs = ''; foreach ($submenu->attrs as $key => $value) { $attrs .= ' ' . $key . '="' . e($value) . '"'; ...
php
public function bootstrap4(): string { if (!empty($this->submenus)) { $submenus = ''; foreach ($this->submenus as $submenu) { $attrs = ''; foreach ($submenu->attrs as $key => $value) { $attrs .= ' ' . $key . '="' . e($value) . '"'; ...
[ "public", "function", "bootstrap4", "(", ")", ":", "string", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "submenus", ")", ")", "{", "$", "submenus", "=", "''", ";", "foreach", "(", "$", "this", "->", "submenus", "as", "$", "submenu", ")",...
Render this menu using Bootstrap4 markup @return string
[ "Render", "this", "menu", "using", "Bootstrap4", "markup" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Menu.php#L64-L99
train
fisharebest/webtrees
app/Module/LifespansChartModule.php
LifespansChartModule.chartUrl
public function chartUrl(Individual $individual, array $parameters = []): string { return route('module', [ 'module' => $this->name(), 'action' => 'Chart', 'xrefs[]' => $individual->xref(), 'ged' => $individual->tree()->name(), ...
php
public function chartUrl(Individual $individual, array $parameters = []): string { return route('module', [ 'module' => $this->name(), 'action' => 'Chart', 'xrefs[]' => $individual->xref(), 'ged' => $individual->tree()->name(), ...
[ "public", "function", "chartUrl", "(", "Individual", "$", "individual", ",", "array", "$", "parameters", "=", "[", "]", ")", ":", "string", "{", "return", "route", "(", "'module'", ",", "[", "'module'", "=>", "$", "this", "->", "name", "(", ")", ",", ...
The URL for this chart. @param Individual $individual @param string[] $parameters @return string
[ "The", "URL", "for", "this", "chart", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/LifespansChartModule.php#L88-L96
train
fisharebest/webtrees
app/Module/LifespansChartModule.php
LifespansChartModule.maxYear
protected function maxYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual $item) { return max($carry, $item->getEstimatedDeathDate()->maximumJulianDay()); }, 0); $year = $this->jdToYear($jd); // Don't show future dates ...
php
protected function maxYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual $item) { return max($carry, $item->getEstimatedDeathDate()->maximumJulianDay()); }, 0); $year = $this->jdToYear($jd); // Don't show future dates ...
[ "protected", "function", "maxYear", "(", "array", "$", "individuals", ")", ":", "int", "{", "$", "jd", "=", "array_reduce", "(", "$", "individuals", ",", "static", "function", "(", "$", "carry", ",", "Individual", "$", "item", ")", "{", "return", "max", ...
Find the latest event year for individuals @param array $individuals @return int
[ "Find", "the", "latest", "event", "year", "for", "individuals" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/LifespansChartModule.php#L292-L302
train
fisharebest/webtrees
app/Module/LifespansChartModule.php
LifespansChartModule.minYear
protected function minYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual $item) { return min($carry, $item->getEstimatedBirthDate()->minimumJulianDay()); }, PHP_INT_MAX); return $this->jdToYear($jd); }
php
protected function minYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual $item) { return min($carry, $item->getEstimatedBirthDate()->minimumJulianDay()); }, PHP_INT_MAX); return $this->jdToYear($jd); }
[ "protected", "function", "minYear", "(", "array", "$", "individuals", ")", ":", "int", "{", "$", "jd", "=", "array_reduce", "(", "$", "individuals", ",", "static", "function", "(", "$", "carry", ",", "Individual", "$", "item", ")", "{", "return", "min", ...
Find the earliest event year for individuals @param array $individuals @return int
[ "Find", "the", "earliest", "event", "year", "for", "individuals" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/LifespansChartModule.php#L311-L318
train
fisharebest/webtrees
app/Module/LifespansChartModule.php
LifespansChartModule.jdToYear
protected function jdToYear(int $jd): int { if ($jd === 0) { return 0; } $gregorian = new GregorianCalendar(); [$y] = $gregorian->jdToYmd($jd); return $y; }
php
protected function jdToYear(int $jd): int { if ($jd === 0) { return 0; } $gregorian = new GregorianCalendar(); [$y] = $gregorian->jdToYmd($jd); return $y; }
[ "protected", "function", "jdToYear", "(", "int", "$", "jd", ")", ":", "int", "{", "if", "(", "$", "jd", "===", "0", ")", "{", "return", "0", ";", "}", "$", "gregorian", "=", "new", "GregorianCalendar", "(", ")", ";", "[", "$", "y", "]", "=", "$...
Convert a julian day to a gregorian year @param int $jd @return int
[ "Convert", "a", "julian", "day", "to", "a", "gregorian", "year" ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/LifespansChartModule.php#L327-L337
train
fisharebest/webtrees
app/Module/LifespansChartModule.php
LifespansChartModule.closeFamily
protected function closeFamily(Individual $individual): array { $xrefs = []; foreach ($individual->spouseFamilies() as $family) { foreach ($family->children() as $child) { $xrefs[] = $child->xref(); } foreach ($family->spouses() as $spouse) { ...
php
protected function closeFamily(Individual $individual): array { $xrefs = []; foreach ($individual->spouseFamilies() as $family) { foreach ($family->children() as $child) { $xrefs[] = $child->xref(); } foreach ($family->spouses() as $spouse) { ...
[ "protected", "function", "closeFamily", "(", "Individual", "$", "individual", ")", ":", "array", "{", "$", "xrefs", "=", "[", "]", ";", "foreach", "(", "$", "individual", "->", "spouseFamilies", "(", ")", "as", "$", "family", ")", "{", "foreach", "(", ...
Find the close family members of an individual. @param Individual $individual @return string[]
[ "Find", "the", "close", "family", "members", "of", "an", "individual", "." ]
840bd0d721dc479520ec24a065996bc6becb8348
https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/LifespansChartModule.php#L389-L414
train