repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
reactphp/filesystem | src/ChildProcess/Adapter.php | Adapter.appendContents | public function appendContents($path, $content)
{
return $this->invoker->invokeCall('putContents', [
'path' => $path,
'chunk' => base64_encode($content),
'flags' => FILE_APPEND,
])->then(function ($payload) {
return \React\Promise\resolve($payload['wri... | php | public function appendContents($path, $content)
{
return $this->invoker->invokeCall('putContents', [
'path' => $path,
'chunk' => base64_encode($content),
'flags' => FILE_APPEND,
])->then(function ($payload) {
return \React\Promise\resolve($payload['wri... | [
"public",
"function",
"appendContents",
"(",
"$",
"path",
",",
"$",
"content",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'putContents'",
",",
"[",
"'path'",
"=>",
"$",
"path",
",",
"'chunk'",
"=>",
"base64_encode",
"(",
... | Appends the given content to the specified file.
If the file does not exist, the file will be created.
This is an optimization for adapters which can optimize
the open -> write -> close sequence into one call.
@param string $path
@param string $content
@return PromiseInterface
@see AdapterInterface::putContents() | [
"Appends",
"the",
"given",
"content",
"to",
"the",
"specified",
"file",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"the",
"file",
"will",
"be",
"created",
"."
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/ChildProcess/Adapter.php#L347-L356 |
reactphp/filesystem | src/Node/File.php | File.time | public function time()
{
return $this->adapter->stat($this->path)->then(function ($result) {
return [
'atime' => $result['atime'],
'ctime' => $result['ctime'],
'mtime' => $result['mtime'],
];
});
} | php | public function time()
{
return $this->adapter->stat($this->path)->then(function ($result) {
return [
'atime' => $result['atime'],
'ctime' => $result['ctime'],
'mtime' => $result['mtime'],
];
});
} | [
"public",
"function",
"time",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"stat",
"(",
"$",
"this",
"->",
"path",
")",
"->",
"then",
"(",
"function",
"(",
"$",
"result",
")",
"{",
"return",
"[",
"'atime'",
"=>",
"$",
"result",
"[",... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L71-L80 |
reactphp/filesystem | src/Node/File.php | File.rename | public function rename($toFilename)
{
return $this->adapter->rename($this->path, $toFilename)->then(function () use ($toFilename) {
return $this->filesystem->file($toFilename);
});
} | php | public function rename($toFilename)
{
return $this->adapter->rename($this->path, $toFilename)->then(function () use ($toFilename) {
return $this->filesystem->file($toFilename);
});
} | [
"public",
"function",
"rename",
"(",
"$",
"toFilename",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"rename",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"toFilename",
")",
"->",
"then",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"toFilena... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L85-L90 |
reactphp/filesystem | src/Node/File.php | File.create | public function create($mode = AdapterInterface::CREATION_MODE, $time = null)
{
return $this->stat()->then(function () {
throw new \Exception('File exists already');
}, function () use ($mode, $time) {
return $this->adapter->touch($this->path, $mode, $time);
});
} | php | public function create($mode = AdapterInterface::CREATION_MODE, $time = null)
{
return $this->stat()->then(function () {
throw new \Exception('File exists already');
}, function () use ($mode, $time) {
return $this->adapter->touch($this->path, $mode, $time);
});
} | [
"public",
"function",
"create",
"(",
"$",
"mode",
"=",
"AdapterInterface",
"::",
"CREATION_MODE",
",",
"$",
"time",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"stat",
"(",
")",
"->",
"then",
"(",
"function",
"(",
")",
"{",
"throw",
"new",
"\... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L95-L102 |
reactphp/filesystem | src/Node/File.php | File.touch | public function touch($mode = AdapterInterface::CREATION_MODE, $time = null)
{
return $this->adapter->touch($this->path, $mode, $time);
} | php | public function touch($mode = AdapterInterface::CREATION_MODE, $time = null)
{
return $this->adapter->touch($this->path, $mode, $time);
} | [
"public",
"function",
"touch",
"(",
"$",
"mode",
"=",
"AdapterInterface",
"::",
"CREATION_MODE",
",",
"$",
"time",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"touch",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"mode",
",",
"$... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L107-L110 |
reactphp/filesystem | src/Node/File.php | File.open | public function open($flags, $mode = AdapterInterface::CREATION_MODE)
{
if ($this->open === true) {
return \React\Promise\reject(new Exception('File is already open'));
}
return $this->adapter->open($this->path, $flags, $mode)->then(function ($fd) use ($flags) {
$thi... | php | public function open($flags, $mode = AdapterInterface::CREATION_MODE)
{
if ($this->open === true) {
return \React\Promise\reject(new Exception('File is already open'));
}
return $this->adapter->open($this->path, $flags, $mode)->then(function ($fd) use ($flags) {
$thi... | [
"public",
"function",
"open",
"(",
"$",
"flags",
",",
"$",
"mode",
"=",
"AdapterInterface",
"::",
"CREATION_MODE",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"open",
"===",
"true",
")",
"{",
"return",
"\\",
"React",
"\\",
"Promise",
"\\",
"reject",
"(",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L115-L126 |
reactphp/filesystem | src/Node/File.php | File.close | public function close()
{
if ($this->open === false) {
return \React\Promise\reject(new Exception('File is already closed'));
}
return $this->adapter->close($this->fileDescriptor)->then(function () {
$this->open = false;
$this->fileDescriptor = null;
... | php | public function close()
{
if ($this->open === false) {
return \React\Promise\reject(new Exception('File is already closed'));
}
return $this->adapter->close($this->fileDescriptor)->then(function () {
$this->open = false;
$this->fileDescriptor = null;
... | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"open",
"===",
"false",
")",
"{",
"return",
"\\",
"React",
"\\",
"Promise",
"\\",
"reject",
"(",
"new",
"Exception",
"(",
"'File is already closed'",
")",
")",
";",
"}",
"retur... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L131-L141 |
reactphp/filesystem | src/Node/File.php | File.putContents | public function putContents($contents)
{
return $this->open('cw')->then(function (WritableStreamInterface $stream) use ($contents) {
$stream->write($contents);
return $this->close();
});
} | php | public function putContents($contents)
{
return $this->open('cw')->then(function (WritableStreamInterface $stream) use ($contents) {
$stream->write($contents);
return $this->close();
});
} | [
"public",
"function",
"putContents",
"(",
"$",
"contents",
")",
"{",
"return",
"$",
"this",
"->",
"open",
"(",
"'cw'",
")",
"->",
"then",
"(",
"function",
"(",
"WritableStreamInterface",
"$",
"stream",
")",
"use",
"(",
"$",
"contents",
")",
"{",
"$",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/File.php#L156-L162 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.setFilesystem | public function setFilesystem(FilesystemInterface $filesystem)
{
$this->filesystem = $filesystem;
$this->typeDetectors = [
new ConstTypeDetector($this->filesystem),
new ModeTypeDetector($this->filesystem),
];
} | php | public function setFilesystem(FilesystemInterface $filesystem)
{
$this->filesystem = $filesystem;
$this->typeDetectors = [
new ConstTypeDetector($this->filesystem),
new ModeTypeDetector($this->filesystem),
];
} | [
"public",
"function",
"setFilesystem",
"(",
"FilesystemInterface",
"$",
"filesystem",
")",
"{",
"$",
"this",
"->",
"filesystem",
"=",
"$",
"filesystem",
";",
"$",
"this",
"->",
"typeDetectors",
"=",
"[",
"new",
"ConstTypeDetector",
"(",
"$",
"this",
"->",
"f... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L148-L156 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.lsStream | public function lsStream($path)
{
$stream = new ObjectStream();
$this->readDirInvoker->invokeCall('eio_readdir', [$path, $this->options['lsFlags']], false)->then(function ($result) use ($path, $stream) {
$this->processLsContents($path, $result, $stream);
});
return $str... | php | public function lsStream($path)
{
$stream = new ObjectStream();
$this->readDirInvoker->invokeCall('eio_readdir', [$path, $this->options['lsFlags']], false)->then(function ($result) use ($path, $stream) {
$this->processLsContents($path, $result, $stream);
});
return $str... | [
"public",
"function",
"lsStream",
"(",
"$",
"path",
")",
"{",
"$",
"stream",
"=",
"new",
"ObjectStream",
"(",
")",
";",
"$",
"this",
"->",
"readDirInvoker",
"->",
"invokeCall",
"(",
"'eio_readdir'",
",",
"[",
"$",
"path",
",",
"$",
"this",
"->",
"optio... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L223-L232 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.open | public function open($path, $flags, $mode = self::CREATION_MODE)
{
$eioFlags = $this->openFlagResolver->resolve($flags);
$mode = $this->permissionFlagResolver->resolve($mode);
return $this->openFileLimiter->open()->then(function () use ($path, $eioFlags, $mode) {
return $this->in... | php | public function open($path, $flags, $mode = self::CREATION_MODE)
{
$eioFlags = $this->openFlagResolver->resolve($flags);
$mode = $this->permissionFlagResolver->resolve($mode);
return $this->openFileLimiter->open()->then(function () use ($path, $eioFlags, $mode) {
return $this->in... | [
"public",
"function",
"open",
"(",
"$",
"path",
",",
"$",
"flags",
",",
"$",
"mode",
"=",
"self",
"::",
"CREATION_MODE",
")",
"{",
"$",
"eioFlags",
"=",
"$",
"this",
"->",
"openFlagResolver",
"->",
"resolve",
"(",
"$",
"flags",
")",
";",
"$",
"mode",... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L286-L300 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.close | public function close($fd)
{
return $this->invoker->invokeCall('eio_close', [$fd])->always(function () {
$this->openFileLimiter->close();
});
} | php | public function close($fd)
{
return $this->invoker->invokeCall('eio_close', [$fd])->always(function () {
$this->openFileLimiter->close();
});
} | [
"public",
"function",
"close",
"(",
"$",
"fd",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'eio_close'",
",",
"[",
"$",
"fd",
"]",
")",
"->",
"always",
"(",
"function",
"(",
")",
"{",
"$",
"this",
"->",
"openFileLimite... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L305-L310 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.getContents | public function getContents($path, $offset = 0, $length = null)
{
if ($length === null) {
return $this->stat($path)->then(function ($stat) use ($path, $offset) {
return $this->getContents($path, $offset, $stat['size']);
});
}
return $this->open($path,... | php | public function getContents($path, $offset = 0, $length = null)
{
if ($length === null) {
return $this->stat($path)->then(function ($stat) use ($path, $offset) {
return $this->getContents($path, $offset, $stat['size']);
});
}
return $this->open($path,... | [
"public",
"function",
"getContents",
"(",
"$",
"path",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"length",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"stat",
"(",
"$",
"path",
")",
"->",
... | Reads the entire file.
This is an optimization for adapters which can optimize
the open -> (seek ->) read -> close sequence into one call.
@param string $path
@param int $offset
@param int|null $length
@return PromiseInterface | [
"Reads",
"the",
"entire",
"file",
"."
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L323-L336 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.putContents | public function putContents($path, $content)
{
return $this->open($path, 'cw')->then(function ($fd) use ($content) {
return $this->write($fd, $content, strlen($content), 0)->always(function () use ($fd) {
return $this->close($fd);
});
});
} | php | public function putContents($path, $content)
{
return $this->open($path, 'cw')->then(function ($fd) use ($content) {
return $this->write($fd, $content, strlen($content), 0)->always(function () use ($fd) {
return $this->close($fd);
});
});
} | [
"public",
"function",
"putContents",
"(",
"$",
"path",
",",
"$",
"content",
")",
"{",
"return",
"$",
"this",
"->",
"open",
"(",
"$",
"path",
",",
"'cw'",
")",
"->",
"then",
"(",
"function",
"(",
"$",
"fd",
")",
"use",
"(",
"$",
"content",
")",
"{... | Writes the given content to the specified file.
If the file exists, the file is truncated.
If the file does not exist, the file will be created.
This is an optimization for adapters which can optimize
the open -> write -> close sequence into one call.
@param string $path
@param string $content
@return PromiseInterfac... | [
"Writes",
"the",
"given",
"content",
"to",
"the",
"specified",
"file",
".",
"If",
"the",
"file",
"exists",
"the",
"file",
"is",
"truncated",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"the",
"file",
"will",
"be",
"created",
"."
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L351-L358 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.touch | public function touch($path, $mode = self::CREATION_MODE, $time = null)
{
return $this->stat($path)->then(function () use ($path, $time) {
if ($time === null) {
$time = microtime(true);
}
return $this->invoker->invokeCall('eio_utime', [
$pa... | php | public function touch($path, $mode = self::CREATION_MODE, $time = null)
{
return $this->stat($path)->then(function () use ($path, $time) {
if ($time === null) {
$time = microtime(true);
}
return $this->invoker->invokeCall('eio_utime', [
$pa... | [
"public",
"function",
"touch",
"(",
"$",
"path",
",",
"$",
"mode",
"=",
"self",
"::",
"CREATION_MODE",
",",
"$",
"time",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"stat",
"(",
"$",
"path",
")",
"->",
"then",
"(",
"function",
"(",
")",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L384-L406 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.read | public function read($fileDescriptor, $length, $offset)
{
return $this->invoker->invokeCall('eio_read', [
$fileDescriptor,
$length,
$offset,
]);
} | php | public function read($fileDescriptor, $length, $offset)
{
return $this->invoker->invokeCall('eio_read', [
$fileDescriptor,
$length,
$offset,
]);
} | [
"public",
"function",
"read",
"(",
"$",
"fileDescriptor",
",",
"$",
"length",
",",
"$",
"offset",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'eio_read'",
",",
"[",
"$",
"fileDescriptor",
",",
"$",
"length",
",",
"$",
"o... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L411-L418 |
reactphp/filesystem | src/Eio/Adapter.php | Adapter.write | public function write($fileDescriptor, $data, $length, $offset)
{
return $this->invoker->invokeCall('eio_write', [
$fileDescriptor,
$data,
$length,
$offset,
]);
} | php | public function write($fileDescriptor, $data, $length, $offset)
{
return $this->invoker->invokeCall('eio_write', [
$fileDescriptor,
$data,
$length,
$offset,
]);
} | [
"public",
"function",
"write",
"(",
"$",
"fileDescriptor",
",",
"$",
"data",
",",
"$",
"length",
",",
"$",
"offset",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'eio_write'",
",",
"[",
"$",
"fileDescriptor",
",",
"$",
"d... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Eio/Adapter.php#L423-L431 |
reactphp/filesystem | src/Node/Directory.php | Directory.size | public function size($recursive = false)
{
return $this->ls()->then(function ($result) use ($recursive) {
return $this->processSizeContents($result, $recursive);
});
} | php | public function size($recursive = false)
{
return $this->ls()->then(function ($result) use ($recursive) {
return $this->processSizeContents($result, $recursive);
});
} | [
"public",
"function",
"size",
"(",
"$",
"recursive",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"ls",
"(",
")",
"->",
"then",
"(",
"function",
"(",
"$",
"result",
")",
"use",
"(",
"$",
"recursive",
")",
"{",
"return",
"$",
"this",
"->",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/Directory.php#L86-L91 |
reactphp/filesystem | src/Node/Directory.php | Directory.create | public function create($mode = AdapterInterface::CREATION_MODE)
{
return $this->adapter->mkdir($this->path, $mode)->then(function () {
$deferred = new Deferred();
$check = function () use (&$check, $deferred) {
$this->stat()->then(function () use ($deferred) {
... | php | public function create($mode = AdapterInterface::CREATION_MODE)
{
return $this->adapter->mkdir($this->path, $mode)->then(function () {
$deferred = new Deferred();
$check = function () use (&$check, $deferred) {
$this->stat()->then(function () use ($deferred) {
... | [
"public",
"function",
"create",
"(",
"$",
"mode",
"=",
"AdapterInterface",
"::",
"CREATION_MODE",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"mkdir",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"mode",
")",
"->",
"then",
"(",
"function",
"("... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/Directory.php#L136-L153 |
reactphp/filesystem | src/Node/Directory.php | Directory.rename | public function rename($toDirectoryName)
{
return $this->adapter->rename($this->path, $toDirectoryName)->then(function () use ($toDirectoryName) {
return $this->filesystem->dir($toDirectoryName);
});
} | php | public function rename($toDirectoryName)
{
return $this->adapter->rename($this->path, $toDirectoryName)->then(function () use ($toDirectoryName) {
return $this->filesystem->dir($toDirectoryName);
});
} | [
"public",
"function",
"rename",
"(",
"$",
"toDirectoryName",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"rename",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"toDirectoryName",
")",
"->",
"then",
"(",
"function",
"(",
")",
"use",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/Directory.php#L167-L172 |
reactphp/filesystem | src/Node/Directory.php | Directory.createRecursive | public function createRecursive($mode = AdapterInterface::CREATION_MODE)
{
$parentPath = explode(DIRECTORY_SEPARATOR, $this->path);
array_pop($parentPath);
$parentPath = implode(DIRECTORY_SEPARATOR, $parentPath);
$parentDirectory = $this->filesystem->dir($parentPath);
return... | php | public function createRecursive($mode = AdapterInterface::CREATION_MODE)
{
$parentPath = explode(DIRECTORY_SEPARATOR, $this->path);
array_pop($parentPath);
$parentPath = implode(DIRECTORY_SEPARATOR, $parentPath);
$parentDirectory = $this->filesystem->dir($parentPath);
return... | [
"public",
"function",
"createRecursive",
"(",
"$",
"mode",
"=",
"AdapterInterface",
"::",
"CREATION_MODE",
")",
"{",
"$",
"parentPath",
"=",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"this",
"->",
"path",
")",
";",
"array_pop",
"(",
"$",
"parentPath",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/Directory.php#L177-L191 |
reactphp/filesystem | src/Node/GenericOperationTrait.php | GenericOperationTrait.chown | public function chown($uid = -1, $gid = -1)
{
return $this->adapter->chown($this->getPath(), $uid, $gid);
} | php | public function chown($uid = -1, $gid = -1)
{
return $this->adapter->chown($this->getPath(), $uid, $gid);
} | [
"public",
"function",
"chown",
"(",
"$",
"uid",
"=",
"-",
"1",
",",
"$",
"gid",
"=",
"-",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"adapter",
"->",
"chown",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
",",
"$",
"uid",
",",
"$",
"gid",
")"... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Node/GenericOperationTrait.php#L99-L102 |
theiconic/name-parser | src/Mapper/SuffixMapper.php | SuffixMapper.map | public function map(array $parts): array
{
if ($this->isMatchingSinglePart($parts)) {
$parts[0] = new Suffix($parts[0], $this->suffixes[$this->getKey($parts[0])]);
return $parts;
}
$start = count($parts) - 1;
for ($k = $start; $k > 1; $k--) {
$pa... | php | public function map(array $parts): array
{
if ($this->isMatchingSinglePart($parts)) {
$parts[0] = new Suffix($parts[0], $this->suffixes[$this->getKey($parts[0])]);
return $parts;
}
$start = count($parts) - 1;
for ($k = $start; $k > 1; $k--) {
$pa... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"isMatchingSinglePart",
"(",
"$",
"parts",
")",
")",
"{",
"$",
"parts",
"[",
"0",
"]",
"=",
"new",
"Suffix",
"(",
"$",
"parts",
"[",
"0... | map suffixes in the parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"suffixes",
"in",
"the",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/SuffixMapper.php#L26-L46 |
theiconic/name-parser | src/Parser.php | Parser.parse | public function parse($name): Name
{
$name = $this->normalize($name);
$segments = explode(',', $name);
if (1 < count($segments)) {
return $this->parseSplitName($segments[0], $segments[1], $segments[2] ?? '');
}
$parts = explode(' ', $name);
foreach ($t... | php | public function parse($name): Name
{
$name = $this->normalize($name);
$segments = explode(',', $name);
if (1 < count($segments)) {
return $this->parseSplitName($segments[0], $segments[1], $segments[2] ?? '');
}
$parts = explode(' ', $name);
foreach ($t... | [
"public",
"function",
"parse",
"(",
"$",
"name",
")",
":",
"Name",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"normalize",
"(",
"$",
"name",
")",
";",
"$",
"segments",
"=",
"explode",
"(",
"','",
",",
"$",
"name",
")",
";",
"if",
"(",
"1",
"<",
... | split full names into the following parts:
- prefix / salutation (Mr., Mrs., etc)
- given name / first name
- middle initials
- surname / last name
- suffix (II, Phd, Jr, etc)
@param string $name
@return Name | [
"split",
"full",
"names",
"into",
"the",
"following",
"parts",
":",
"-",
"prefix",
"/",
"salutation",
"(",
"Mr",
".",
"Mrs",
".",
"etc",
")",
"-",
"given",
"name",
"/",
"first",
"name",
"-",
"middle",
"initials",
"-",
"surname",
"/",
"last",
"name",
... | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Parser.php#L61-L78 |
theiconic/name-parser | src/Parser.php | Parser.parseSplitName | protected function parseSplitName($first, $second, $third): Name
{
$parts = array_merge(
$this->getFirstSegmentParser()->parse($first)->getParts(),
$this->getSecondSegmentParser()->parse($second)->getParts(),
$this->getThirdSegmentParser()->parse($third)->getParts()
... | php | protected function parseSplitName($first, $second, $third): Name
{
$parts = array_merge(
$this->getFirstSegmentParser()->parse($first)->getParts(),
$this->getSecondSegmentParser()->parse($second)->getParts(),
$this->getThirdSegmentParser()->parse($third)->getParts()
... | [
"protected",
"function",
"parseSplitName",
"(",
"$",
"first",
",",
"$",
"second",
",",
"$",
"third",
")",
":",
"Name",
"{",
"$",
"parts",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getFirstSegmentParser",
"(",
")",
"->",
"parse",
"(",
"$",
"first",
"... | handles split-parsing of comma-separated name parts
@param $left - the name part left of the comma
@param $right - the name part right of the comma
@return Name | [
"handles",
"split",
"-",
"parsing",
"of",
"comma",
"-",
"separated",
"name",
"parts"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Parser.php#L88-L97 |
theiconic/name-parser | src/Parser.php | Parser.getMappers | public function getMappers(): array
{
if (empty($this->mappers)) {
$this->setMappers([
new NicknameMapper($this->getNicknameDelimiters()),
new SalutationMapper($this->getSalutations(), $this->getMaxSalutationIndex()),
new SuffixMapper($this->getSuf... | php | public function getMappers(): array
{
if (empty($this->mappers)) {
$this->setMappers([
new NicknameMapper($this->getNicknameDelimiters()),
new SalutationMapper($this->getSalutations(), $this->getMaxSalutationIndex()),
new SuffixMapper($this->getSuf... | [
"public",
"function",
"getMappers",
"(",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mappers",
")",
")",
"{",
"$",
"this",
"->",
"setMappers",
"(",
"[",
"new",
"NicknameMapper",
"(",
"$",
"this",
"->",
"getNicknameDelimiters",
... | get the mappers for this parser
@return array | [
"get",
"the",
"mappers",
"for",
"this",
"parser"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Parser.php#L152-L167 |
theiconic/name-parser | src/Parser.php | Parser.normalize | protected function normalize(string $name): string
{
$whitespace = $this->getWhitespace();
$name = trim($name);
return preg_replace('/[' . preg_quote($whitespace) . ']+/', ' ', $name);
} | php | protected function normalize(string $name): string
{
$whitespace = $this->getWhitespace();
$name = trim($name);
return preg_replace('/[' . preg_quote($whitespace) . ']+/', ' ', $name);
} | [
"protected",
"function",
"normalize",
"(",
"string",
"$",
"name",
")",
":",
"string",
"{",
"$",
"whitespace",
"=",
"$",
"this",
"->",
"getWhitespace",
"(",
")",
";",
"$",
"name",
"=",
"trim",
"(",
"$",
"name",
")",
";",
"return",
"preg_replace",
"(",
... | normalize the name
@param string $name
@return string | [
"normalize",
"the",
"name"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Parser.php#L188-L195 |
theiconic/name-parser | src/Mapper/FirstnameMapper.php | FirstnameMapper.map | public function map(array $parts): array
{
if (count($parts) < 2) {
return [$this->handleSinglePart($parts[0])];
}
$pos = $this->findFirstnamePosition($parts);
if (null !== $pos) {
$parts[$pos] = new Firstname($parts[$pos]);
}
return $parts;... | php | public function map(array $parts): array
{
if (count($parts) < 2) {
return [$this->handleSinglePart($parts[0])];
}
$pos = $this->findFirstnamePosition($parts);
if (null !== $pos) {
$parts[$pos] = new Firstname($parts[$pos]);
}
return $parts;... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
"<",
"2",
")",
"{",
"return",
"[",
"$",
"this",
"->",
"handleSinglePart",
"(",
"$",
"parts",
"[",
"0",
"]",
")",
"]",
"... | map firstnames in parts array
@param array $parts the parts
@return array the mapped parts | [
"map",
"firstnames",
"in",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/FirstnameMapper.php#L19-L32 |
theiconic/name-parser | src/Mapper/SalutationMapper.php | SalutationMapper.map | public function map(array $parts): array
{
$max = ($this->maxIndex > 0) ? $this->maxIndex : floor(count($parts) / 2);
for ($k = 0; $k < $max; $k++) {
$part = $parts[$k];
if ($part instanceof AbstractPart) {
break;
}
if ($this->isSalu... | php | public function map(array $parts): array
{
$max = ($this->maxIndex > 0) ? $this->maxIndex : floor(count($parts) / 2);
for ($k = 0; $k < $max; $k++) {
$part = $parts[$k];
if ($part instanceof AbstractPart) {
break;
}
if ($this->isSalu... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"max",
"=",
"(",
"$",
"this",
"->",
"maxIndex",
">",
"0",
")",
"?",
"$",
"this",
"->",
"maxIndex",
":",
"floor",
"(",
"count",
"(",
"$",
"parts",
")",
"/",
"2... | map salutations in the parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"salutations",
"in",
"the",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/SalutationMapper.php#L26-L43 |
theiconic/name-parser | src/Mapper/NicknameMapper.php | NicknameMapper.map | public function map(array $parts): array
{
$isEncapsulated = false;
$regexp = $this->buildRegexp();
$closingDelimiter = '';
foreach ($parts as $k => $part) {
if ($part instanceof AbstractPart) {
continue;
}
if (preg_match($regex... | php | public function map(array $parts): array
{
$isEncapsulated = false;
$regexp = $this->buildRegexp();
$closingDelimiter = '';
foreach ($parts as $k => $part) {
if ($part instanceof AbstractPart) {
continue;
}
if (preg_match($regex... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"isEncapsulated",
"=",
"false",
";",
"$",
"regexp",
"=",
"$",
"this",
"->",
"buildRegexp",
"(",
")",
";",
"$",
"closingDelimiter",
"=",
"''",
";",
"foreach",
"(",
"... | map nicknames in the parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"nicknames",
"in",
"the",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/NicknameMapper.php#L35-L67 |
theiconic/name-parser | src/Mapper/InitialMapper.php | InitialMapper.map | public function map(array $parts): array
{
$last = count($parts) - 1;
foreach ($parts as $k => $part) {
if ($part instanceof AbstractPart) {
continue;
}
if (!$this->matchLastPart && $k === $last) {
continue;
}
... | php | public function map(array $parts): array
{
$last = count($parts) - 1;
foreach ($parts as $k => $part) {
if ($part instanceof AbstractPart) {
continue;
}
if (!$this->matchLastPart && $k === $last) {
continue;
}
... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"last",
"=",
"count",
"(",
"$",
"parts",
")",
"-",
"1",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"k",
"=>",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"par... | map intials in parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"intials",
"in",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/InitialMapper.php#L26-L45 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.map | public function map(array $parts): array
{
if (!$this->matchSinglePart && count($parts) < 2) {
return $parts;
}
return $this->mapParts($parts);
} | php | public function map(array $parts): array
{
if (!$this->matchSinglePart && count($parts) < 2) {
return $parts;
}
return $this->mapParts($parts);
} | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"matchSinglePart",
"&&",
"count",
"(",
"$",
"parts",
")",
"<",
"2",
")",
"{",
"return",
"$",
"parts",
";",
"}",
"return",
"$",
"th... | map lastnames in the parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"lastnames",
"in",
"the",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L31-L38 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.mapParts | protected function mapParts(array $parts): array
{
$k = $this->skipIgnoredParts($parts) + 1;
$remapIgnored = true;
while (--$k >= 0) {
$part = $parts[$k];
if ($part instanceof AbstractPart) {
break;
}
if ($this->isFollowedByL... | php | protected function mapParts(array $parts): array
{
$k = $this->skipIgnoredParts($parts) + 1;
$remapIgnored = true;
while (--$k >= 0) {
$part = $parts[$k];
if ($part instanceof AbstractPart) {
break;
}
if ($this->isFollowedByL... | [
"protected",
"function",
"mapParts",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"k",
"=",
"$",
"this",
"->",
"skipIgnoredParts",
"(",
"$",
"parts",
")",
"+",
"1",
";",
"$",
"remapIgnored",
"=",
"true",
";",
"while",
"(",
"--",
"$",
"k... | we map the parts in reverse order because it makes more
sense to parse for the lastname starting from the end
@param array $parts
@return array | [
"we",
"map",
"the",
"parts",
"in",
"reverse",
"order",
"because",
"it",
"makes",
"more",
"sense",
"to",
"parse",
"for",
"the",
"lastname",
"starting",
"from",
"the",
"end"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L47-L79 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.skipIgnoredParts | protected function skipIgnoredParts(array $parts): int
{
$k = count($parts);
while (--$k >= 0) {
if (!$this->isIgnoredPart($parts[$k])) {
break;
}
}
return $k;
} | php | protected function skipIgnoredParts(array $parts): int
{
$k = count($parts);
while (--$k >= 0) {
if (!$this->isIgnoredPart($parts[$k])) {
break;
}
}
return $k;
} | [
"protected",
"function",
"skipIgnoredParts",
"(",
"array",
"$",
"parts",
")",
":",
"int",
"{",
"$",
"k",
"=",
"count",
"(",
"$",
"parts",
")",
";",
"while",
"(",
"--",
"$",
"k",
">=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isIgnoredPa... | skip through the parts we want to ignore and return the start index
@param array $parts
@return int | [
"skip",
"through",
"the",
"parts",
"we",
"want",
"to",
"ignore",
"and",
"return",
"the",
"start",
"index"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L87-L98 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.shouldStopMapping | protected function shouldStopMapping(array $parts, int $k): bool
{
if ($k < 1) {
return true;
}
if ($parts[$k + 1] instanceof LastnamePrefix) {
return true;
}
return strlen($parts[$k + 1]->getValue()) >= 3;
} | php | protected function shouldStopMapping(array $parts, int $k): bool
{
if ($k < 1) {
return true;
}
if ($parts[$k + 1] instanceof LastnamePrefix) {
return true;
}
return strlen($parts[$k + 1]->getValue()) >= 3;
} | [
"protected",
"function",
"shouldStopMapping",
"(",
"array",
"$",
"parts",
",",
"int",
"$",
"k",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"k",
"<",
"1",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"parts",
"[",
"$",
"k",
"+",
"1",
"]",
... | indicates if we should stop mapping at the give index $k
the assumption is that lastname parts have already been found
but we want to see if we should add more parts
@param array $parts
@param int $k
@return bool | [
"indicates",
"if",
"we",
"should",
"stop",
"mapping",
"at",
"the",
"give",
"index",
"$k"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L110-L121 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.remapIgnored | protected function remapIgnored(array $parts): array
{
$k = count($parts);
while (--$k >= 0) {
$part = $parts[$k];
if (!$this->isIgnoredPart($part)) {
break;
}
$parts[$k] = new Lastname($part);
}
return $parts;
} | php | protected function remapIgnored(array $parts): array
{
$k = count($parts);
while (--$k >= 0) {
$part = $parts[$k];
if (!$this->isIgnoredPart($part)) {
break;
}
$parts[$k] = new Lastname($part);
}
return $parts;
} | [
"protected",
"function",
"remapIgnored",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"k",
"=",
"count",
"(",
"$",
"parts",
")",
";",
"while",
"(",
"--",
"$",
"k",
">=",
"0",
")",
"{",
"$",
"part",
"=",
"$",
"parts",
"[",
"$",
"k",
... | remap ignored parts as lastname
if the mapping did not derive any lastname this is called to transform
any previously ignored parts into lastname parts
the parts array is still reversed at this point
@param array $parts
@return array | [
"remap",
"ignored",
"parts",
"as",
"lastname"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L143-L158 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.isApplicablePrefix | protected function isApplicablePrefix(array $parts, int $index): bool
{
if (!$this->isPrefix($parts[$index])) {
return false;
}
return $this->hasUnmappedPartsBefore($parts, $index);
} | php | protected function isApplicablePrefix(array $parts, int $index): bool
{
if (!$this->isPrefix($parts[$index])) {
return false;
}
return $this->hasUnmappedPartsBefore($parts, $index);
} | [
"protected",
"function",
"isApplicablePrefix",
"(",
"array",
"$",
"parts",
",",
"int",
"$",
"index",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPrefix",
"(",
"$",
"parts",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"false",
... | Assuming that the part at the given index is matched as a prefix,
determines if the prefix should be applied to the lastname.
We only apply it to the lastname if we already have at least one
lastname part and there are other parts left in
the name (this effectively prioritises firstname over prefix matching).
This ex... | [
"Assuming",
"that",
"the",
"part",
"at",
"the",
"given",
"index",
"is",
"matched",
"as",
"a",
"prefix",
"determines",
"if",
"the",
"prefix",
"should",
"be",
"applied",
"to",
"the",
"lastname",
"."
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L186-L193 |
theiconic/name-parser | src/Mapper/LastnameMapper.php | LastnameMapper.skipNicknameParts | protected function skipNicknameParts($parts, $startIndex)
{
$total = count($parts);
for ($i = $startIndex; $i < $total; $i++) {
if (!($parts[$i] instanceof Nickname)) {
return $i;
}
}
return $total - 1;
} | php | protected function skipNicknameParts($parts, $startIndex)
{
$total = count($parts);
for ($i = $startIndex; $i < $total; $i++) {
if (!($parts[$i] instanceof Nickname)) {
return $i;
}
}
return $total - 1;
} | [
"protected",
"function",
"skipNicknameParts",
"(",
"$",
"parts",
",",
"$",
"startIndex",
")",
"{",
"$",
"total",
"=",
"count",
"(",
"$",
"parts",
")",
";",
"for",
"(",
"$",
"i",
"=",
"$",
"startIndex",
";",
"$",
"i",
"<",
"$",
"total",
";",
"$",
... | find the next non-nickname index in parts
@param $parts
@param $startIndex
@return int|void | [
"find",
"the",
"next",
"non",
"-",
"nickname",
"index",
"in",
"parts"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/LastnameMapper.php#L213-L224 |
theiconic/name-parser | src/Part/AbstractPart.php | AbstractPart.setValue | public function setValue($value): AbstractPart
{
if ($value instanceof AbstractPart) {
$value = $value->getValue();
}
$this->value = $value;
return $this;
} | php | public function setValue($value): AbstractPart
{
if ($value instanceof AbstractPart) {
$value = $value->getValue();
}
$this->value = $value;
return $this;
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
":",
"AbstractPart",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"AbstractPart",
")",
"{",
"$",
"value",
"=",
"$",
"value",
"->",
"getValue",
"(",
")",
";",
"}",
"$",
"this",
"->",
"value",
"=... | set the value to wrap
(can take string or part instance)
@param string|AbstractPart $value
@return $this | [
"set",
"the",
"value",
"to",
"wrap",
"(",
"can",
"take",
"string",
"or",
"part",
"instance",
")"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Part/AbstractPart.php#L29-L38 |
theiconic/name-parser | src/Part/AbstractPart.php | AbstractPart.camelcaseReplace | protected function camelcaseReplace($matches): string
{
if (function_exists('mb_convert_case')) {
return mb_convert_case($matches[0], MB_CASE_TITLE, "UTF-8");
}
return ucfirst(strtolower($matches[0]));
} | php | protected function camelcaseReplace($matches): string
{
if (function_exists('mb_convert_case')) {
return mb_convert_case($matches[0], MB_CASE_TITLE, "UTF-8");
}
return ucfirst(strtolower($matches[0]));
} | [
"protected",
"function",
"camelcaseReplace",
"(",
"$",
"matches",
")",
":",
"string",
"{",
"if",
"(",
"function_exists",
"(",
"'mb_convert_case'",
")",
")",
"{",
"return",
"mb_convert_case",
"(",
"$",
"matches",
"[",
"0",
"]",
",",
"MB_CASE_TITLE",
",",
"\"U... | camelcasing callback
@param $matches
@return string | [
"camelcasing",
"callback"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Part/AbstractPart.php#L82-L89 |
theiconic/name-parser | src/Mapper/AbstractMapper.php | AbstractMapper.hasUnmappedPartsBefore | protected function hasUnmappedPartsBefore(array $parts, $index): bool
{
foreach ($parts as $k => $part) {
if ($k === $index) {
break;
}
if (!($part instanceof AbstractPart)) {
return true;
}
}
return false;
... | php | protected function hasUnmappedPartsBefore(array $parts, $index): bool
{
foreach ($parts as $k => $part) {
if ($k === $index) {
break;
}
if (!($part instanceof AbstractPart)) {
return true;
}
}
return false;
... | [
"protected",
"function",
"hasUnmappedPartsBefore",
"(",
"array",
"$",
"parts",
",",
"$",
"index",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"k",
"=>",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"k",
"===",
"$",
"index",
")",
"{",
... | checks if there are still unmapped parts left before the given position
@param array $parts
@param $index
@return bool | [
"checks",
"if",
"there",
"are",
"still",
"unmapped",
"parts",
"left",
"before",
"the",
"given",
"position"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/AbstractMapper.php#L25-L38 |
theiconic/name-parser | src/Name.php | Name.getNickname | public function getNickname(bool $wrap = false): string
{
if ($wrap) {
return sprintf('(%s)', $this->export('Nickname'));
}
return $this->export('Nickname');
} | php | public function getNickname(bool $wrap = false): string
{
if ($wrap) {
return sprintf('(%s)', $this->export('Nickname'));
}
return $this->export('Nickname');
} | [
"public",
"function",
"getNickname",
"(",
"bool",
"$",
"wrap",
"=",
"false",
")",
":",
"string",
"{",
"if",
"(",
"$",
"wrap",
")",
"{",
"return",
"sprintf",
"(",
"'(%s)'",
",",
"$",
"this",
"->",
"export",
"(",
"'Nickname'",
")",
")",
";",
"}",
"re... | get the nick name(s)
@param bool $wrap
@return string | [
"get",
"the",
"nick",
"name",
"(",
"s",
")"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Name.php#L153-L160 |
theiconic/name-parser | src/Name.php | Name.export | protected function export(string $type, bool $strict = false): string
{
$matched = [];
foreach ($this->parts as $part) {
if ($part instanceof AbstractPart && $this->isType($part, $type, $strict)) {
$matched[] = $part->normalize();
}
}
return ... | php | protected function export(string $type, bool $strict = false): string
{
$matched = [];
foreach ($this->parts as $part) {
if ($part instanceof AbstractPart && $this->isType($part, $type, $strict)) {
$matched[] = $part->normalize();
}
}
return ... | [
"protected",
"function",
"export",
"(",
"string",
"$",
"type",
",",
"bool",
"$",
"strict",
"=",
"false",
")",
":",
"string",
"{",
"$",
"matched",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"if",
"... | helper method used by getters to extract and format relevant name parts
@param string $type
@param bool $pure
@return string | [
"helper",
"method",
"used",
"by",
"getters",
"to",
"extract",
"and",
"format",
"relevant",
"name",
"parts"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Name.php#L179-L190 |
theiconic/name-parser | src/Name.php | Name.isType | protected function isType(AbstractPart $part, string $type, bool $strict = false): bool
{
$className = sprintf('%s\\%s', self::PARTS_NAMESPACE, $type);
if ($strict) {
return get_class($part) === $className;
}
return is_a($part, $className);
} | php | protected function isType(AbstractPart $part, string $type, bool $strict = false): bool
{
$className = sprintf('%s\\%s', self::PARTS_NAMESPACE, $type);
if ($strict) {
return get_class($part) === $className;
}
return is_a($part, $className);
} | [
"protected",
"function",
"isType",
"(",
"AbstractPart",
"$",
"part",
",",
"string",
"$",
"type",
",",
"bool",
"$",
"strict",
"=",
"false",
")",
":",
"bool",
"{",
"$",
"className",
"=",
"sprintf",
"(",
"'%s\\\\%s'",
",",
"self",
"::",
"PARTS_NAMESPACE",
"... | helper method to check if a part is of the given type
@param AbstractPart $part
@param string $type
@param bool $strict
@return bool | [
"helper",
"method",
"to",
"check",
"if",
"a",
"part",
"is",
"of",
"the",
"given",
"type"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Name.php#L200-L209 |
theiconic/name-parser | src/Mapper/MiddlenameMapper.php | MiddlenameMapper.map | public function map(array $parts): array
{
// If we don't expect a lastname, match a mimimum of 2 parts
$minumumParts = ($this->mapWithoutLastname ? 2 : 3);
if (count($parts) < $minumumParts) {
return $parts;
}
$start = $this->findFirstMapped(Firstname::class, $... | php | public function map(array $parts): array
{
// If we don't expect a lastname, match a mimimum of 2 parts
$minumumParts = ($this->mapWithoutLastname ? 2 : 3);
if (count($parts) < $minumumParts) {
return $parts;
}
$start = $this->findFirstMapped(Firstname::class, $... | [
"public",
"function",
"map",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"// If we don't expect a lastname, match a mimimum of 2 parts",
"$",
"minumumParts",
"=",
"(",
"$",
"this",
"->",
"mapWithoutLastname",
"?",
"2",
":",
"3",
")",
";",
"if",
"(",
"c... | map middlenames in the parts array
@param array $parts the name parts
@return array the mapped parts | [
"map",
"middlenames",
"in",
"the",
"parts",
"array"
] | train | https://github.com/theiconic/name-parser/blob/9a2599397d1cd0a9f69bec81286bb0c6b2782c6f/src/Mapper/MiddlenameMapper.php#L25-L41 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.cleanupCollapsedStatesInUC | public function cleanupCollapsedStatesInUC()
{
$backendUser = $this->getBackendUser();
if (is_array($backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'])) {
$collapsedGridelementColumns = $backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'];
... | php | public function cleanupCollapsedStatesInUC()
{
$backendUser = $this->getBackendUser();
if (is_array($backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'])) {
$collapsedGridelementColumns = $backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'];
... | [
"public",
"function",
"cleanupCollapsedStatesInUC",
"(",
")",
"{",
"$",
"backendUser",
"=",
"$",
"this",
"->",
"getBackendUser",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"backendUser",
"->",
"uc",
"[",
"'moduleData'",
"]",
"[",
"'page'",
"]",
"[",
... | Processes the collapsed states of Gridelements columns and removes columns with 0 values | [
"Processes",
"the",
"collapsed",
"states",
"of",
"Gridelements",
"columns",
"and",
"removes",
"columns",
"with",
"0",
"values"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L116-L129 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.preProcess | public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
{
if ($row['CType']) {
$this->showHidden = $parentObject->tt_contentConfig['showHidden'] ? true : false;
if ($this->helper->getBackendUser()->uc['hideContentPreview']) ... | php | public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
{
if ($row['CType']) {
$this->showHidden = $parentObject->tt_contentConfig['showHidden'] ? true : false;
if ($this->helper->getBackendUser()->uc['hideContentPreview']) ... | [
"public",
"function",
"preProcess",
"(",
"PageLayoutView",
"&",
"$",
"parentObject",
",",
"&",
"$",
"drawItem",
",",
"&",
"$",
"headerContent",
",",
"&",
"$",
"itemContent",
",",
"array",
"&",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"row",
"[",
"'CType'"... | Processes the item to be rendered before the actual example content gets rendered
Deactivates the original example content output
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param bool $drawItem : A switch to tell the parent object, if the item still must be drawn
@param string $h... | [
"Processes",
"the",
"item",
"to",
"be",
"rendered",
"before",
"the",
"actual",
"example",
"content",
"gets",
"rendered",
"Deactivates",
"the",
"original",
"example",
"content",
"output"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L151-L178 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderCTypeGridelements | protected function renderCTypeGridelements(PageLayoutView $parentObject, &$row)
{
$head = [];
$gridContent = [];
$editUidList = [];
$colPosValues = [];
$singleColumn = false;
// get the layout record for the selected backend layout if any
$gridContainerId = $... | php | protected function renderCTypeGridelements(PageLayoutView $parentObject, &$row)
{
$head = [];
$gridContent = [];
$editUidList = [];
$colPosValues = [];
$singleColumn = false;
// get the layout record for the selected backend layout if any
$gridContainerId = $... | [
"protected",
"function",
"renderCTypeGridelements",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"row",
")",
"{",
"$",
"head",
"=",
"[",
"]",
";",
"$",
"gridContent",
"=",
"[",
"]",
";",
"$",
"editUidList",
"=",
"[",
"]",
";",
"$",
"colPo... | renders the HTML output for elements of the CType gridelements_pi1
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $row : The current data row for this item
@return string $itemContent: The HTML output for elements of the CType gridelements_pi1 | [
"renders",
"the",
"HTML",
"output",
"for",
"elements",
"of",
"the",
"CType",
"gridelements_pi1"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L188-L246 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.setMultipleColPosValues | protected function setMultipleColPosValues($parserRows, &$colPosValues, $layout)
{
if (is_array($parserRows)) {
foreach ($parserRows as $parserRow) {
if (is_array($parserRow['columns.']) && !empty($parserRow['columns.'])) {
foreach ($parserRow['columns.'] as $... | php | protected function setMultipleColPosValues($parserRows, &$colPosValues, $layout)
{
if (is_array($parserRows)) {
foreach ($parserRows as $parserRow) {
if (is_array($parserRow['columns.']) && !empty($parserRow['columns.'])) {
foreach ($parserRow['columns.'] as $... | [
"protected",
"function",
"setMultipleColPosValues",
"(",
"$",
"parserRows",
",",
"&",
"$",
"colPosValues",
",",
"$",
"layout",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"parserRows",
")",
")",
"{",
"foreach",
"(",
"$",
"parserRows",
"as",
"$",
"parserRow"... | Sets column positions based on a selected gridelement layout
@param array $parserRows : The parsed rows of the gridelement layout
@param array $colPosValues : The column positions that have been found for that layout
@param array $layout
@return void | [
"Sets",
"column",
"positions",
"based",
"on",
"a",
"selected",
"gridelement",
"layout"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L256-L283 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.setSingleColPosItems | protected function setSingleColPosItems(PageLayoutView $parentObject, &$colPosValues, &$row)
{
$specificIds = $this->helper->getSpecificIds($row);
/** @var $expressionBuilder ExpressionBuilder */
$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQuery... | php | protected function setSingleColPosItems(PageLayoutView $parentObject, &$colPosValues, &$row)
{
$specificIds = $this->helper->getSpecificIds($row);
/** @var $expressionBuilder ExpressionBuilder */
$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQuery... | [
"protected",
"function",
"setSingleColPosItems",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"colPosValues",
",",
"&",
"$",
"row",
")",
"{",
"$",
"specificIds",
"=",
"$",
"this",
"->",
"helper",
"->",
"getSpecificIds",
"(",
"$",
"row",
")",
... | Directly returns the items for a single column if the rendering mode is set to single columns only
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $colPosValues : The column positions that have been found for that layout
@param array $row : The current data row for the con... | [
"Directly",
"returns",
"the",
"items",
"for",
"a",
"single",
"column",
"if",
"the",
"rendering",
"mode",
"is",
"set",
"to",
"single",
"columns",
"only"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L294-L321 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderGridColumns | protected function renderGridColumns(
PageLayoutView $parentObject,
&$colPosValues,
&$gridContent,
&$row,
&$editUidList,
&$singleColumn,
&$head
) {
$collectedItems = $this->collectItemsForColumns($parentObject, $colPosValues, $row);
$workspace ... | php | protected function renderGridColumns(
PageLayoutView $parentObject,
&$colPosValues,
&$gridContent,
&$row,
&$editUidList,
&$singleColumn,
&$head
) {
$collectedItems = $this->collectItemsForColumns($parentObject, $colPosValues, $row);
$workspace ... | [
"protected",
"function",
"renderGridColumns",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"colPosValues",
",",
"&",
"$",
"gridContent",
",",
"&",
"$",
"row",
",",
"&",
"$",
"editUidList",
",",
"&",
"$",
"singleColumn",
",",
"&",
"$",
"head",... | renders the columns of a grid layout
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $colPosValues : The column positions we want to get the content for
@param array $gridContent : The rendered content data of the grid columns
@param array $row : The current data row for t... | [
"renders",
"the",
"columns",
"of",
"a",
"grid",
"layout"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L336-L432 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.collectItemsForColumns | protected function collectItemsForColumns(PageLayoutView $parentObject, &$colPosValues, &$row)
{
$colPosList = array_keys($colPosValues);
$specificIds = $this->helper->getSpecificIds($row);
$queryBuilder = $this->getQueryBuilder();
$constraints = [
$queryBuilder->expr()-... | php | protected function collectItemsForColumns(PageLayoutView $parentObject, &$colPosValues, &$row)
{
$colPosList = array_keys($colPosValues);
$specificIds = $this->helper->getSpecificIds($row);
$queryBuilder = $this->getQueryBuilder();
$constraints = [
$queryBuilder->expr()-... | [
"protected",
"function",
"collectItemsForColumns",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"colPosValues",
",",
"&",
"$",
"row",
")",
"{",
"$",
"colPosList",
"=",
"array_keys",
"(",
"$",
"colPosValues",
")",
";",
"$",
"specificIds",
"=",
"... | Collects tt_content data from a single tt_content element
@param PageLayoutView $parentObject : The paren object that triggered this hook
@param array $colPosValues : The column position to collect the items for
@param array $row : The current data row for the container item
@return mixed collected items for the give... | [
"Collects",
"tt_content",
"data",
"from",
"a",
"single",
"tt_content",
"element"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L443-L527 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderSingleGridColumn | protected function renderSingleGridColumn(
PageLayoutView $parentObject,
&$items,
&$colPos,
$values,
&$gridContent,
$row,
&$editUidList
) {
$specificIds = $this->helper->getSpecificIds($row);
$allowed = base64_encode(json_encode($values['allowe... | php | protected function renderSingleGridColumn(
PageLayoutView $parentObject,
&$items,
&$colPos,
$values,
&$gridContent,
$row,
&$editUidList
) {
$specificIds = $this->helper->getSpecificIds($row);
$allowed = base64_encode(json_encode($values['allowe... | [
"protected",
"function",
"renderSingleGridColumn",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"items",
",",
"&",
"$",
"colPos",
",",
"$",
"values",
",",
"&",
"$",
"gridContent",
",",
"$",
"row",
",",
"&",
"$",
"editUidList",
")",
"{",
"$"... | renders a single column of a grid layout and sets the edit uid list
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $items : The content data of the column to be rendered
@param int $colPos : The column position we want to get the content for
@param array $values : The lay... | [
"renders",
"a",
"single",
"column",
"of",
"a",
"grid",
"layout",
"and",
"sets",
"the",
"edit",
"uid",
"list"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L555-L760 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.checkIfTranslationsExistInLanguage | protected function checkIfTranslationsExistInLanguage(
array $contentElements,
$language,
PageLayoutView $parentObject
) {
// If in default language, you may always create new entries
// Also, you may override this strict behavior via user TS Config
// If you do so, y... | php | protected function checkIfTranslationsExistInLanguage(
array $contentElements,
$language,
PageLayoutView $parentObject
) {
// If in default language, you may always create new entries
// Also, you may override this strict behavior via user TS Config
// If you do so, y... | [
"protected",
"function",
"checkIfTranslationsExistInLanguage",
"(",
"array",
"$",
"contentElements",
",",
"$",
"language",
",",
"PageLayoutView",
"$",
"parentObject",
")",
"{",
"// If in default language, you may always create new entries",
"// Also, you may override this strict be... | Checks whether translated Content Elements exist in the desired language
If so, deny creating new ones via the UI
@param array $contentElements
@param int $language
@param PageLayoutView $parentObject
@return bool
@throws \TYPO3\CMS\Core\Exception | [
"Checks",
"whether",
"translated",
"Content",
"Elements",
"exist",
"in",
"the",
"desired",
"language",
"If",
"so",
"deny",
"creating",
"new",
"ones",
"via",
"the",
"UI"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L781-L833 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderSingleElementHTML | protected function renderSingleElementHTML(PageLayoutView $parentObject, $item)
{
$singleElementHTML = '';
$unset = false;
if (!isset($parentObject->tt_contentData['nextThree'][$item['uid']])) {
$unset = true;
$parentObject->tt_contentData['nextThree'][$item['uid']] =... | php | protected function renderSingleElementHTML(PageLayoutView $parentObject, $item)
{
$singleElementHTML = '';
$unset = false;
if (!isset($parentObject->tt_contentData['nextThree'][$item['uid']])) {
$unset = true;
$parentObject->tt_contentData['nextThree'][$item['uid']] =... | [
"protected",
"function",
"renderSingleElementHTML",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"$",
"item",
")",
"{",
"$",
"singleElementHTML",
"=",
"''",
";",
"$",
"unset",
"=",
"false",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"parentObject",
"->",
... | Renders the HTML code for a single tt_content element
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $item : The data row to be rendered as HTML
@return string | [
"Renders",
"the",
"HTML",
"code",
"for",
"a",
"single",
"tt_content",
"element"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L865-L897 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.tt_content_drawFooter | protected function tt_content_drawFooter(PageLayoutView $parentObject, array $row)
{
$content = '';
// Get processed values:
$info = [];
$parentObject->getProcessedValue('tt_content', 'starttime,endtime,fe_group,space_before_class,space_after_class', $row, $info);
// Content... | php | protected function tt_content_drawFooter(PageLayoutView $parentObject, array $row)
{
$content = '';
// Get processed values:
$info = [];
$parentObject->getProcessedValue('tt_content', 'starttime,endtime,fe_group,space_before_class,space_after_class', $row, $info);
// Content... | [
"protected",
"function",
"tt_content_drawFooter",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"array",
"$",
"row",
")",
"{",
"$",
"content",
"=",
"''",
";",
"// Get processed values:",
"$",
"info",
"=",
"[",
"]",
";",
"$",
"parentObject",
"->",
"getProces... | Draw the footer for a single tt_content element
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $row Record array
@return string HTML of the footer
@throws \UnexpectedValueException | [
"Draw",
"the",
"footer",
"for",
"a",
"single",
"tt_content",
"element"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L907-L939 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.setColumnHeader | protected function setColumnHeader(
PageLayoutView $parentObject,
&$head,
&$colPos,
&$name,
&$editUidList,
$expanded = true
) {
$head[$colPos] = $this->tt_content_drawColHeader(
$name,
($parentObject->doEdit && $editUidList[$colPos]) ? ... | php | protected function setColumnHeader(
PageLayoutView $parentObject,
&$head,
&$colPos,
&$name,
&$editUidList,
$expanded = true
) {
$head[$colPos] = $this->tt_content_drawColHeader(
$name,
($parentObject->doEdit && $editUidList[$colPos]) ? ... | [
"protected",
"function",
"setColumnHeader",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"head",
",",
"&",
"$",
"colPos",
",",
"&",
"$",
"name",
",",
"&",
"$",
"editUidList",
",",
"$",
"expanded",
"=",
"true",
")",
"{",
"$",
"head",
"[",
... | Sets the headers for a grid before content and headers are put together
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $head : The collected item data rows
@param int $colPos : The column position we want to get a header for
@param string $name : The name of the header
@p... | [
"Sets",
"the",
"headers",
"for",
"a",
"grid",
"before",
"content",
"and",
"headers",
"are",
"put",
"together"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L953-L967 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.tt_content_drawColHeader | protected function tt_content_drawColHeader($colName, $editParams, PageLayoutView $parentObject, $expanded = true)
{
$iconsArr = [];
// Create command links:
if ($parentObject->tt_contentConfig['showCommands']) {
// Edit whole of column:
if ($editParams) {
... | php | protected function tt_content_drawColHeader($colName, $editParams, PageLayoutView $parentObject, $expanded = true)
{
$iconsArr = [];
// Create command links:
if ($parentObject->tt_contentConfig['showCommands']) {
// Edit whole of column:
if ($editParams) {
... | [
"protected",
"function",
"tt_content_drawColHeader",
"(",
"$",
"colName",
",",
"$",
"editParams",
",",
"PageLayoutView",
"$",
"parentObject",
",",
"$",
"expanded",
"=",
"true",
")",
"{",
"$",
"iconsArr",
"=",
"[",
"]",
";",
"// Create command links:",
"if",
"(... | Draw header for a content element column:
@param string $colName Column name
@param string $editParams Edit params (Syntax: &edit[...] for FormEngine)
@param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject
@param bool $expanded
@return string HTML table | [
"Draw",
"header",
"for",
"a",
"content",
"element",
"column",
":"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L979-L1024 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderGridLayoutTable | protected function renderGridLayoutTable($layout, $row, $head, $gridContent, PageLayoutView $parentObject)
{
$specificIds = $this->helper->getSpecificIds($row);
$grid = '<div class="t3-grid-container t3-grid-element-container' . ($layout['frame'] ? ' t3-grid-container-framed t3-grid-container-' . ht... | php | protected function renderGridLayoutTable($layout, $row, $head, $gridContent, PageLayoutView $parentObject)
{
$specificIds = $this->helper->getSpecificIds($row);
$grid = '<div class="t3-grid-container t3-grid-element-container' . ($layout['frame'] ? ' t3-grid-container-framed t3-grid-container-' . ht... | [
"protected",
"function",
"renderGridLayoutTable",
"(",
"$",
"layout",
",",
"$",
"row",
",",
"$",
"head",
",",
"$",
"gridContent",
",",
"PageLayoutView",
"$",
"parentObject",
")",
"{",
"$",
"specificIds",
"=",
"$",
"this",
"->",
"helper",
"->",
"getSpecificId... | Renders the grid layout table after the HTML content for the single elements has been rendered
@param array $layout : The setup of the layout that is selected for the grid we are going to render
@param array $row : The current data row for the container item
@param array $head : The data for the column headers of the ... | [
"Renders",
"the",
"grid",
"layout",
"table",
"after",
"the",
"HTML",
"content",
"for",
"the",
"single",
"elements",
"has",
"been",
"rendered"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L1037-L1257 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.renderCTypeShortcut | protected function renderCTypeShortcut(PageLayoutView $parentObject, &$row)
{
$shortcutContent = '';
if ($row['records']) {
$shortcutItems = explode(',', $row['records']);
$collectedItems = [];
foreach ($shortcutItems as $shortcutItem) {
$shortcutI... | php | protected function renderCTypeShortcut(PageLayoutView $parentObject, &$row)
{
$shortcutContent = '';
if ($row['records']) {
$shortcutItems = explode(',', $row['records']);
$collectedItems = [];
foreach ($shortcutItems as $shortcutItem) {
$shortcutI... | [
"protected",
"function",
"renderCTypeShortcut",
"(",
"PageLayoutView",
"$",
"parentObject",
",",
"&",
"$",
"row",
")",
"{",
"$",
"shortcutContent",
"=",
"''",
";",
"if",
"(",
"$",
"row",
"[",
"'records'",
"]",
")",
"{",
"$",
"shortcutItems",
"=",
"explode"... | renders the HTML output for elements of the CType shortcut
@param PageLayoutView $parentObject : The parent object that triggered this hook
@param array $row : The current data row for this item
@return string $shortcutContent: The HTML output for elements of the CType shortcut | [
"renders",
"the",
"HTML",
"output",
"for",
"elements",
"of",
"the",
"CType",
"shortcut"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L1267-L1309 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.collectContentDataFromPages | protected function collectContentDataFromPages(
$shortcutItem,
&$collectedItems,
$recursive = 0,
$parentUid = 0,
$language = 0
) {
$itemList = str_replace('pages_', '', $shortcutItem);
if ($recursive) {
if (!$this->tree instanceof QueryGenerator) {... | php | protected function collectContentDataFromPages(
$shortcutItem,
&$collectedItems,
$recursive = 0,
$parentUid = 0,
$language = 0
) {
$itemList = str_replace('pages_', '', $shortcutItem);
if ($recursive) {
if (!$this->tree instanceof QueryGenerator) {... | [
"protected",
"function",
"collectContentDataFromPages",
"(",
"$",
"shortcutItem",
",",
"&",
"$",
"collectedItems",
",",
"$",
"recursive",
"=",
"0",
",",
"$",
"parentUid",
"=",
"0",
",",
"$",
"language",
"=",
"0",
")",
"{",
"$",
"itemList",
"=",
"str_replac... | Collects tt_content data from a single page or a page tree starting at a given page
@param string $shortcutItem : The single page to be used as the tree root
@param array $collectedItems : The collected item data rows ordered by parent position, column position and sorting
@param int $recursive : The number of levels ... | [
"Collects",
"tt_content",
"data",
"from",
"a",
"single",
"page",
"or",
"a",
"page",
"tree",
"starting",
"at",
"a",
"given",
"page"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L1322-L1381 |
TYPO3-extensions/gridelements | Classes/Hooks/DrawItem.php | DrawItem.collectContentData | protected function collectContentData($shortcutItem, &$collectedItems, $parentUid, $language)
{
$shortcutItem = str_replace('tt_content_', '', $shortcutItem);
if ((int)$shortcutItem !== (int)$parentUid) {
$queryBuilder = $this->getQueryBuilder();
if ($this->showHidden) {
... | php | protected function collectContentData($shortcutItem, &$collectedItems, $parentUid, $language)
{
$shortcutItem = str_replace('tt_content_', '', $shortcutItem);
if ((int)$shortcutItem !== (int)$parentUid) {
$queryBuilder = $this->getQueryBuilder();
if ($this->showHidden) {
... | [
"protected",
"function",
"collectContentData",
"(",
"$",
"shortcutItem",
",",
"&",
"$",
"collectedItems",
",",
"$",
"parentUid",
",",
"$",
"language",
")",
"{",
"$",
"shortcutItem",
"=",
"str_replace",
"(",
"'tt_content_'",
",",
"''",
",",
"$",
"shortcutItem",... | Collects tt_content data from a single tt_content element
@param string $shortcutItem : The tt_content element to fetch the data from
@param array $collectedItems : The collected item data row
@param int $parentUid : uid of the referencing tt_content record
@param int $language : sys_language_uid of the referencing tt... | [
"Collects",
"tt_content",
"data",
"from",
"a",
"single",
"tt_content",
"element"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DrawItem.php#L1393-L1430 |
TYPO3-extensions/gridelements | Classes/Hooks/DatabaseRecordList.php | DatabaseRecordList.checkChildren | public function checkChildren($table, array $row, $level, array &$theData, DatabaseRecordListXclass $parentObj)
{
if ($table === 'tt_content' && $row['CType'] === 'gridelements_pi1') {
$elementChildren = Helper::getInstance()->getChildren(
$table,
$row['uid'],
... | php | public function checkChildren($table, array $row, $level, array &$theData, DatabaseRecordListXclass $parentObj)
{
if ($table === 'tt_content' && $row['CType'] === 'gridelements_pi1') {
$elementChildren = Helper::getInstance()->getChildren(
$table,
$row['uid'],
... | [
"public",
"function",
"checkChildren",
"(",
"$",
"table",
",",
"array",
"$",
"row",
",",
"$",
"level",
",",
"array",
"&",
"$",
"theData",
",",
"DatabaseRecordListXclass",
"$",
"parentObj",
")",
"{",
"if",
"(",
"$",
"table",
"===",
"'tt_content'",
"&&",
"... | check if current row has child elements and add info to $theData array
@param string $table
@param array $row
@param int $level
@param array $theData
@param DatabaseRecordListXclass $parentObj | [
"check",
"if",
"current",
"row",
"has",
"child",
"elements",
"and",
"add",
"info",
"to",
"$theData",
"array"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DatabaseRecordList.php#L131-L150 |
TYPO3-extensions/gridelements | Classes/Hooks/DatabaseRecordList.php | DatabaseRecordList.contentCollapseIcon | public function contentCollapseIcon(
array &$data,
$sortField,
$level,
&$contentCollapseIcon,
DatabaseRecordListXclass $parentObj
) {
if ($data['_EXPAND_TABLE_'] === 'tt_content') {
$expandTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/... | php | public function contentCollapseIcon(
array &$data,
$sortField,
$level,
&$contentCollapseIcon,
DatabaseRecordListXclass $parentObj
) {
if ($data['_EXPAND_TABLE_'] === 'tt_content') {
$expandTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/... | [
"public",
"function",
"contentCollapseIcon",
"(",
"array",
"&",
"$",
"data",
",",
"$",
"sortField",
",",
"$",
"level",
",",
"&",
"$",
"contentCollapseIcon",
",",
"DatabaseRecordListXclass",
"$",
"parentObj",
")",
"{",
"if",
"(",
"$",
"data",
"[",
"'_EXPAND_T... | return content collapse icon
@param array $data
@param string $sortField
@param int $level
@param string $contentCollapseIcon
@param DatabaseRecordListXclass $parentObj | [
"return",
"content",
"collapse",
"icon"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DatabaseRecordList.php#L161-L188 |
TYPO3-extensions/gridelements | Classes/Backend/ItemsProcFuncs/SysLanguageUidList.php | SysLanguageUidList.itemsProcFunc | public function itemsProcFunc(array &$params)
{
if ((int)$params['row']['pid'] > 0 && (int)$params['row']['tx_gridelements_container'] > 0 && isset($params['items'])) {
$this->checkForAllowedLanguages($params['items'], $params['row']['tx_gridelements_container']);
}
} | php | public function itemsProcFunc(array &$params)
{
if ((int)$params['row']['pid'] > 0 && (int)$params['row']['tx_gridelements_container'] > 0 && isset($params['items'])) {
$this->checkForAllowedLanguages($params['items'], $params['row']['tx_gridelements_container']);
}
} | [
"public",
"function",
"itemsProcFunc",
"(",
"array",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"(",
"int",
")",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'pid'",
"]",
">",
"0",
"&&",
"(",
"int",
")",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'tx_gride... | ItemProcFunc for CType items
@param array $params The array of parameters that is used to render the item list | [
"ItemProcFunc",
"for",
"CType",
"items"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/ItemsProcFuncs/SysLanguageUidList.php#L37-L42 |
TYPO3-extensions/gridelements | Classes/Backend/ItemsProcFuncs/SysLanguageUidList.php | SysLanguageUidList.checkForAllowedLanguages | public function checkForAllowedLanguages(array &$items, $gridContainerId)
{
if (!$gridContainerId) {
return;
}
$parentContainer = BackendUtility::getRecordWSOL('tt_content', $gridContainerId);
if (!empty($items) && (int)$parentContainer['uid'] > 0) {
foreach (... | php | public function checkForAllowedLanguages(array &$items, $gridContainerId)
{
if (!$gridContainerId) {
return;
}
$parentContainer = BackendUtility::getRecordWSOL('tt_content', $gridContainerId);
if (!empty($items) && (int)$parentContainer['uid'] > 0) {
foreach (... | [
"public",
"function",
"checkForAllowedLanguages",
"(",
"array",
"&",
"$",
"items",
",",
"$",
"gridContainerId",
")",
"{",
"if",
"(",
"!",
"$",
"gridContainerId",
")",
"{",
"return",
";",
"}",
"$",
"parentContainer",
"=",
"BackendUtility",
"::",
"getRecordWSOL"... | Checks if a language is allowed in this particular container - only this one container defines the allowed languages regardless of any parent
@param array $items The items of the current language list
@param int $gridContainerId The ID of the current container | [
"Checks",
"if",
"a",
"language",
"is",
"allowed",
"in",
"this",
"particular",
"container",
"-",
"only",
"this",
"one",
"container",
"defines",
"the",
"allowed",
"languages",
"regardless",
"of",
"any",
"parent"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/ItemsProcFuncs/SysLanguageUidList.php#L50-L63 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.columnsItemsProcFunc | public function columnsItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$gridContainerId = is_array($params['row']['tx_gridelements_container'])
? (int)$params['row']['tx_gridelements_container'][0]
: (int)$params['row']['tx_gridelements_container'];
... | php | public function columnsItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$gridContainerId = is_array($params['row']['tx_gridelements_container'])
? (int)$params['row']['tx_gridelements_container'][0]
: (int)$params['row']['tx_gridelements_container'];
... | [
"public",
"function",
"columnsItemsProcFunc",
"(",
"array",
"&",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'pid'",
"]",
")",
";",
"$",
"gridContainerId",
"=",
"is_array",
"(",
"$",
"params",
"[",
... | ItemProcFunc for columns items
@param array $params An array containing the items and parameters for the list of items | [
"ItemProcFunc",
"for",
"columns",
"items"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L48-L70 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.init | public function init($pageId)
{
if (!$this->layoutSetup instanceof LayoutSetup) {
$this->injectLayoutSetup(GeneralUtility::makeInstance(LayoutSetup::class)->init($pageId));
}
} | php | public function init($pageId)
{
if (!$this->layoutSetup instanceof LayoutSetup) {
$this->injectLayoutSetup(GeneralUtility::makeInstance(LayoutSetup::class)->init($pageId));
}
} | [
"public",
"function",
"init",
"(",
"$",
"pageId",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"layoutSetup",
"instanceof",
"LayoutSetup",
")",
"{",
"$",
"this",
"->",
"injectLayoutSetup",
"(",
"GeneralUtility",
"::",
"makeInstance",
"(",
"LayoutSetup",
"::"... | initializes this class
@param int $pageId | [
"initializes",
"this",
"class"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L77-L82 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.containerItemsProcFunc | public function containerItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$possibleContainers = [];
$this->removeItemsFromListOfSelectableContainers($params, $possibleContainers);
if (!empty($possibleContainers)) {
$params['items'] = array_merge($param... | php | public function containerItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$possibleContainers = [];
$this->removeItemsFromListOfSelectableContainers($params, $possibleContainers);
if (!empty($possibleContainers)) {
$params['items'] = array_merge($param... | [
"public",
"function",
"containerItemsProcFunc",
"(",
"array",
"&",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'pid'",
"]",
")",
";",
"$",
"possibleContainers",
"=",
"[",
"]",
";",
"$",
"this",
"->... | ItemProcFunc for container items
removes items of the children chain from the list of selectable containers
if the element itself already is a container
@param array $params An array containing the items and parameters for the list of items | [
"ItemProcFunc",
"for",
"container",
"items",
"removes",
"items",
"of",
"the",
"children",
"chain",
"from",
"the",
"list",
"of",
"selectable",
"containers",
"if",
"the",
"element",
"itself",
"already",
"is",
"a",
"container"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L101-L122 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.removeItemsFromListOfSelectableContainers | public function removeItemsFromListOfSelectableContainers(array &$params, array &$possibleContainers)
{
$contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
if ($contentType === 'gridelements_pi1' && count($params['items']) > 1) {
$item... | php | public function removeItemsFromListOfSelectableContainers(array &$params, array &$possibleContainers)
{
$contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
if ($contentType === 'gridelements_pi1' && count($params['items']) > 1) {
$item... | [
"public",
"function",
"removeItemsFromListOfSelectableContainers",
"(",
"array",
"&",
"$",
"params",
",",
"array",
"&",
"$",
"possibleContainers",
")",
"{",
"$",
"contentType",
"=",
"is_array",
"(",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'CType'",
"]",
")",
... | removes items of the children chain from the list of selectable containers
@param array $params
@param array $possibleContainers | [
"removes",
"items",
"of",
"the",
"children",
"chain",
"from",
"the",
"list",
"of",
"selectable",
"containers"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L130-L145 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.lookForChildContainersRecursively | public function lookForChildContainersRecursively($containerIds, array &$possibleContainers)
{
if (!$containerIds) {
return;
}
$containerIds = GeneralUtility::intExplode(',', $containerIds);
$queryBuilder = $this->getQueryBuilder();
$childrenOnNextLevel = $queryBu... | php | public function lookForChildContainersRecursively($containerIds, array &$possibleContainers)
{
if (!$containerIds) {
return;
}
$containerIds = GeneralUtility::intExplode(',', $containerIds);
$queryBuilder = $this->getQueryBuilder();
$childrenOnNextLevel = $queryBu... | [
"public",
"function",
"lookForChildContainersRecursively",
"(",
"$",
"containerIds",
",",
"array",
"&",
"$",
"possibleContainers",
")",
"{",
"if",
"(",
"!",
"$",
"containerIds",
")",
"{",
"return",
";",
"}",
"$",
"containerIds",
"=",
"GeneralUtility",
"::",
"i... | Recursive function to remove any container from the list of possible containers
that is already a subcontainer on any level of the current container
@param string $containerIds : A list determining containers that should be checked
@param array $possibleContainers : The result list containing the remaining containers ... | [
"Recursive",
"function",
"to",
"remove",
"any",
"container",
"from",
"the",
"list",
"of",
"possible",
"containers",
"that",
"is",
"already",
"a",
"subcontainer",
"on",
"any",
"level",
"of",
"the",
"current",
"container"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L154-L191 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.deleteDisallowedContainers | public function deleteDisallowedContainers(array &$params, $itemUidList = '')
{
$contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
$listType = '';
if ($contentType === 'list') {
$listType = is_array($params['row']['list_type']... | php | public function deleteDisallowedContainers(array &$params, $itemUidList = '')
{
$contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
$listType = '';
if ($contentType === 'list') {
$listType = is_array($params['row']['list_type']... | [
"public",
"function",
"deleteDisallowedContainers",
"(",
"array",
"&",
"$",
"params",
",",
"$",
"itemUidList",
"=",
"''",
")",
"{",
"$",
"contentType",
"=",
"is_array",
"(",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'CType'",
"]",
")",
"?",
"$",
"params",
... | delete containers from params which are not allowed
@param array $params
@param string $itemUidList comma separated list of uids | [
"delete",
"containers",
"from",
"params",
"which",
"are",
"not",
"allowed"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L215-L283 |
TYPO3-extensions/gridelements | Classes/Backend/TtContent.php | TtContent.layoutItemsProcFunc | public function layoutItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$layoutSelectItems = $this->layoutSetup->getLayoutSelectItems(
isset($params['row']['colPos'][0]) ? $params['row']['colPos'][0] : $params['row']['colPos'],
$params['row']['tx_gridelement... | php | public function layoutItemsProcFunc(array &$params)
{
$this->init($params['row']['pid']);
$layoutSelectItems = $this->layoutSetup->getLayoutSelectItems(
isset($params['row']['colPos'][0]) ? $params['row']['colPos'][0] : $params['row']['colPos'],
$params['row']['tx_gridelement... | [
"public",
"function",
"layoutItemsProcFunc",
"(",
"array",
"&",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"params",
"[",
"'row'",
"]",
"[",
"'pid'",
"]",
")",
";",
"$",
"layoutSelectItems",
"=",
"$",
"this",
"->",
"layoutSetup",
"->... | ItemProcFunc for layout items
removes items that are available for grid boxes on the first level only
and items that are excluded for a certain branch or user
@param array $params An array containing the items and parameters for the list of items | [
"ItemProcFunc",
"for",
"layout",
"items",
"removes",
"items",
"that",
"are",
"available",
"for",
"grid",
"boxes",
"on",
"the",
"first",
"level",
"only",
"and",
"items",
"that",
"are",
"excluded",
"for",
"a",
"certain",
"branch",
"or",
"user"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/TtContent.php#L292-L302 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.init | public function init($pageId, array $typoScriptSetup = [])
{
$this->setLanguageService($GLOBALS['LANG']);
$pageId = (strpos($pageId, 'NEW') === 0) ? 0 : (int)$pageId;
if ((int)$pageId < 0) {
$pageId = Helper::getInstance()->getPidFromUid($pageId);
}
$this->realPid... | php | public function init($pageId, array $typoScriptSetup = [])
{
$this->setLanguageService($GLOBALS['LANG']);
$pageId = (strpos($pageId, 'NEW') === 0) ? 0 : (int)$pageId;
if ((int)$pageId < 0) {
$pageId = Helper::getInstance()->getPidFromUid($pageId);
}
$this->realPid... | [
"public",
"function",
"init",
"(",
"$",
"pageId",
",",
"array",
"$",
"typoScriptSetup",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setLanguageService",
"(",
"$",
"GLOBALS",
"[",
"'LANG'",
"]",
")",
";",
"$",
"pageId",
"=",
"(",
"strpos",
"(",
"$",
... | Load page TSconfig
@param int $pageId The current page ID
@param array $typoScriptSetup The PlugIn configuration
@return LayoutSetup | [
"Load",
"page",
"TSconfig"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L82-L103 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.loadLayoutSetup | protected function loadLayoutSetup($pageId)
{
// Load page TSconfig.
if (\TYPO3_MODE === 'FE') {
$pageTSconfig = $GLOBALS['TSFE']->getPagesTSconfig();
} else {
$pageTSconfig = BackendUtility::getPagesTSconfig($pageId);
}
$excludeLayoutIds = !empty($pag... | php | protected function loadLayoutSetup($pageId)
{
// Load page TSconfig.
if (\TYPO3_MODE === 'FE') {
$pageTSconfig = $GLOBALS['TSFE']->getPagesTSconfig();
} else {
$pageTSconfig = BackendUtility::getPagesTSconfig($pageId);
}
$excludeLayoutIds = !empty($pag... | [
"protected",
"function",
"loadLayoutSetup",
"(",
"$",
"pageId",
")",
"{",
"// Load page TSconfig.",
"if",
"(",
"\\",
"TYPO3_MODE",
"===",
"'FE'",
")",
"{",
"$",
"pageTSconfig",
"=",
"$",
"GLOBALS",
"[",
"'TSFE'",
"]",
"->",
"getPagesTSconfig",
"(",
")",
";",... | Returns the page TSconfig merged with the grid layout records
@param int $pageId The uid of the page we are currently working on | [
"Returns",
"the",
"page",
"TSconfig",
"merged",
"with",
"the",
"grid",
"layout",
"records"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L110-L255 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getQueryBuilder | public function getQueryBuilder()
{
/** @var $queryBuilder QueryBuilder */
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_gridelements_backend_layout');
$queryBuilder->getRestrictions()
->removeAll()
->add... | php | public function getQueryBuilder()
{
/** @var $queryBuilder QueryBuilder */
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_gridelements_backend_layout');
$queryBuilder->getRestrictions()
->removeAll()
->add... | [
"public",
"function",
"getQueryBuilder",
"(",
")",
"{",
"/** @var $queryBuilder QueryBuilder */",
"$",
"queryBuilder",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"ConnectionPool",
"::",
"class",
")",
"->",
"getQueryBuilderForTable",
"(",
"'tx_gridelements_backend_lay... | getter for queryBuilder
@return QueryBuilder queryBuilder | [
"getter",
"for",
"queryBuilder"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L262-L272 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getLayoutColumns | public function getLayoutColumns($layoutId)
{
if (!isset($this->layoutSetup[$layoutId])) {
return [];
}
if (empty($GLOBALS['tx_gridelements']['ceBackendLayoutData'][$layoutId])) {
if (!empty($this->layoutSetup[$layoutId]['config']['rows.'])) {
$GLOBAL... | php | public function getLayoutColumns($layoutId)
{
if (!isset($this->layoutSetup[$layoutId])) {
return [];
}
if (empty($GLOBALS['tx_gridelements']['ceBackendLayoutData'][$layoutId])) {
if (!empty($this->layoutSetup[$layoutId]['config']['rows.'])) {
$GLOBAL... | [
"public",
"function",
"getLayoutColumns",
"(",
"$",
"layoutId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"layoutSetup",
"[",
"$",
"layoutId",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"GLOBALS... | fetches all available columns for a certain grid container
@param string $layoutId The selected backend layout of the grid container
@return array first key is 'CSV' The columns available for the selected layout as CSV list and the allowed elements for each of the columns | [
"fetches",
"all",
"available",
"columns",
"for",
"a",
"certain",
"grid",
"container"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L281-L294 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getTypoScriptSetup | public function getTypoScriptSetup($layoutId)
{
$typoScriptSetup = [];
if ($layoutId == '0' && isset($this->typoScriptSetup['setup.']['default.'])) {
$typoScriptSetup = $this->typoScriptSetup['setup.']['default.'];
} elseif ($layoutId && isset($this->typoScriptSetup['setup.'][$l... | php | public function getTypoScriptSetup($layoutId)
{
$typoScriptSetup = [];
if ($layoutId == '0' && isset($this->typoScriptSetup['setup.']['default.'])) {
$typoScriptSetup = $this->typoScriptSetup['setup.']['default.'];
} elseif ($layoutId && isset($this->typoScriptSetup['setup.'][$l... | [
"public",
"function",
"getTypoScriptSetup",
"(",
"$",
"layoutId",
")",
"{",
"$",
"typoScriptSetup",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"layoutId",
"==",
"'0'",
"&&",
"isset",
"(",
"$",
"this",
"->",
"typoScriptSetup",
"[",
"'setup.'",
"]",
"[",
"'defaul... | fetches the setup for each of the columns
assigns a default setup if there is none available
@param string $layoutId The selected backend layout of the grid container
@return array The adjusted TypoScript setup for the container or a default setup | [
"fetches",
"the",
"setup",
"for",
"each",
"of",
"the",
"columns",
"assigns",
"a",
"default",
"setup",
"if",
"there",
"is",
"none",
"available"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L361-L380 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getLayoutSelectItems | public function getLayoutSelectItems($colPos, $gridColPos = 0, $containerId = 0, $pageId = 0)
{
$allowed = ['*' => '*'];
$disallowed = [];
$selectItems = [];
if ($containerId > 0) {
$container = $this->cacheCurrentParent((int)$containerId, true);
if (!empty($c... | php | public function getLayoutSelectItems($colPos, $gridColPos = 0, $containerId = 0, $pageId = 0)
{
$allowed = ['*' => '*'];
$disallowed = [];
$selectItems = [];
if ($containerId > 0) {
$container = $this->cacheCurrentParent((int)$containerId, true);
if (!empty($c... | [
"public",
"function",
"getLayoutSelectItems",
"(",
"$",
"colPos",
",",
"$",
"gridColPos",
"=",
"0",
",",
"$",
"containerId",
"=",
"0",
",",
"$",
"pageId",
"=",
"0",
")",
"{",
"$",
"allowed",
"=",
"[",
"'*'",
"=>",
"'*'",
"]",
";",
"$",
"disallowed",
... | Returns the item array for form field selection.
@param int $colPos The selected content column position.
@param int $gridColPos
@param int $containerId
@param int $pageId
@return array | [
"Returns",
"the",
"item",
"array",
"for",
"form",
"field",
"selection",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L423-L478 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.cacheCurrentParent | public function cacheCurrentParent($gridContainerId = 0, $doReturn = false)
{
if ($gridContainerId > 0) {
if (empty($GLOBALS['tx_gridelements']['parentElement'][$gridContainerId])) {
$GLOBALS['tx_gridelements']['parentElement'][$gridContainerId] = BackendUtility::getRecordWSOL(
... | php | public function cacheCurrentParent($gridContainerId = 0, $doReturn = false)
{
if ($gridContainerId > 0) {
if (empty($GLOBALS['tx_gridelements']['parentElement'][$gridContainerId])) {
$GLOBALS['tx_gridelements']['parentElement'][$gridContainerId] = BackendUtility::getRecordWSOL(
... | [
"public",
"function",
"cacheCurrentParent",
"(",
"$",
"gridContainerId",
"=",
"0",
",",
"$",
"doReturn",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"gridContainerId",
">",
"0",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"GLOBALS",
"[",
"'tx_gridelements'",
"]"... | Caches Container-Records and their setup to avoid multiple selects of the same record during a single request
@param int $gridContainerId The ID of the current grid container
@param bool $doReturn
@return array|null | [
"Caches",
"Container",
"-",
"Records",
"and",
"their",
"setup",
"to",
"avoid",
"multiple",
"selects",
"of",
"the",
"same",
"record",
"during",
"a",
"single",
"request"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L488-L503 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getLayoutColumnsSelectItems | public function getLayoutColumnsSelectItems($layoutId)
{
$setup = $this->getLayoutSetup($layoutId);
if (empty($setup['config']['rows.'])) {
return [];
}
$selectItems = [];
foreach ($setup['config']['rows.'] as $row) {
if (empty($row['columns.'])) {
... | php | public function getLayoutColumnsSelectItems($layoutId)
{
$setup = $this->getLayoutSetup($layoutId);
if (empty($setup['config']['rows.'])) {
return [];
}
$selectItems = [];
foreach ($setup['config']['rows.'] as $row) {
if (empty($row['columns.'])) {
... | [
"public",
"function",
"getLayoutColumnsSelectItems",
"(",
"$",
"layoutId",
")",
"{",
"$",
"setup",
"=",
"$",
"this",
"->",
"getLayoutSetup",
"(",
"$",
"layoutId",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"setup",
"[",
"'config'",
"]",
"[",
"'rows.'",
"]",... | Returns the item array for form field selection
@param string $layoutId : The selected layout ID of the grid container
@return array | [
"Returns",
"the",
"item",
"array",
"for",
"form",
"field",
"selection"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L512-L535 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getLayoutSetup | public function getLayoutSetup($layoutId = '')
{
// Continue only if setup for given layout ID found.
if (isset($this->layoutSetup[$layoutId])) {
return $this->layoutSetup[$layoutId];
}
return $this->layoutSetup;
} | php | public function getLayoutSetup($layoutId = '')
{
// Continue only if setup for given layout ID found.
if (isset($this->layoutSetup[$layoutId])) {
return $this->layoutSetup[$layoutId];
}
return $this->layoutSetup;
} | [
"public",
"function",
"getLayoutSetup",
"(",
"$",
"layoutId",
"=",
"''",
")",
"{",
"// Continue only if setup for given layout ID found.",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"layoutSetup",
"[",
"$",
"layoutId",
"]",
")",
")",
"{",
"return",
"$",
"this... | Returns the grid layout setup
@param string $layoutId If set only requested layout setup, else all layout setups will be returned.
@return array | [
"Returns",
"the",
"grid",
"layout",
"setup"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L544-L552 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getLayoutWizardItems | public function getLayoutWizardItems(
$colPos,
$excludeLayouts = '',
array $allowedGridTypes = [],
array $disallowedGridTypes = []
) {
$wizardItems = [];
$excludeLayouts = array_flip(explode(',', $excludeLayouts));
foreach ($this->layoutSetup as $layoutId => $... | php | public function getLayoutWizardItems(
$colPos,
$excludeLayouts = '',
array $allowedGridTypes = [],
array $disallowedGridTypes = []
) {
$wizardItems = [];
$excludeLayouts = array_flip(explode(',', $excludeLayouts));
foreach ($this->layoutSetup as $layoutId => $... | [
"public",
"function",
"getLayoutWizardItems",
"(",
"$",
"colPos",
",",
"$",
"excludeLayouts",
"=",
"''",
",",
"array",
"$",
"allowedGridTypes",
"=",
"[",
"]",
",",
"array",
"$",
"disallowedGridTypes",
"=",
"[",
"]",
")",
"{",
"$",
"wizardItems",
"=",
"[",
... | Returns the item array for form field selection
@param int $colPos
@param string $excludeLayouts
@param array $allowedGridTypes
@param array $disallowedGridTypes
@return array | [
"Returns",
"the",
"item",
"array",
"for",
"form",
"field",
"selection"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L585-L617 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.getFlexformConfiguration | public function getFlexformConfiguration($layoutId)
{
$layoutSetup = $this->getLayoutSetup($layoutId);
// Get flexform file from pi_flexform_ds if pi_flexform_ds_file not set and "FILE:" found in pi_flexform_ds for backward compatibility.
if ($layoutSetup['pi_flexform_ds_file']) {
... | php | public function getFlexformConfiguration($layoutId)
{
$layoutSetup = $this->getLayoutSetup($layoutId);
// Get flexform file from pi_flexform_ds if pi_flexform_ds_file not set and "FILE:" found in pi_flexform_ds for backward compatibility.
if ($layoutSetup['pi_flexform_ds_file']) {
... | [
"public",
"function",
"getFlexformConfiguration",
"(",
"$",
"layoutId",
")",
"{",
"$",
"layoutSetup",
"=",
"$",
"this",
"->",
"getLayoutSetup",
"(",
"$",
"layoutId",
")",
";",
"// Get flexform file from pi_flexform_ds if pi_flexform_ds_file not set and \"FILE:\" found in pi_f... | Returns the FlexForm configuration of a grid layout
@param string $layoutId The current layout ID of the grid container
@return string | [
"Returns",
"the",
"FlexForm",
"configuration",
"of",
"a",
"grid",
"layout"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L626-L644 |
TYPO3-extensions/gridelements | Classes/Backend/LayoutSetup.php | LayoutSetup.setLanguageService | public function setLanguageService(LanguageService $languageService = null)
{
$this->languageService = $languageService instanceof LanguageService ? $languageService : GeneralUtility::makeInstance(LanguageService::class);
if ($this->getBackendUser()) {
$this->languageService->init($this-... | php | public function setLanguageService(LanguageService $languageService = null)
{
$this->languageService = $languageService instanceof LanguageService ? $languageService : GeneralUtility::makeInstance(LanguageService::class);
if ($this->getBackendUser()) {
$this->languageService->init($this-... | [
"public",
"function",
"setLanguageService",
"(",
"LanguageService",
"$",
"languageService",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"languageService",
"=",
"$",
"languageService",
"instanceof",
"LanguageService",
"?",
"$",
"languageService",
":",
"GeneralUtility",
... | setter for languageService object
@param LanguageService $languageService | [
"setter",
"for",
"languageService",
"object"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Backend/LayoutSetup.php#L671-L677 |
TYPO3-extensions/gridelements | Classes/Hooks/DataHandler.php | DataHandler.processDatamap_preProcessFieldArray | public function processDatamap_preProcessFieldArray(
&$fieldArray,
$table,
$id,
\TYPO3\CMS\Core\DataHandling\DataHandler $parentObj
) {
if (($table === 'tt_content' || $table === 'pages') && !$parentObj->isImporting) {
/** @var $hook PreProcessFieldArray */
... | php | public function processDatamap_preProcessFieldArray(
&$fieldArray,
$table,
$id,
\TYPO3\CMS\Core\DataHandling\DataHandler $parentObj
) {
if (($table === 'tt_content' || $table === 'pages') && !$parentObj->isImporting) {
/** @var $hook PreProcessFieldArray */
... | [
"public",
"function",
"processDatamap_preProcessFieldArray",
"(",
"&",
"$",
"fieldArray",
",",
"$",
"table",
",",
"$",
"id",
",",
"\\",
"TYPO3",
"\\",
"CMS",
"\\",
"Core",
"\\",
"DataHandling",
"\\",
"DataHandler",
"$",
"parentObj",
")",
"{",
"if",
"(",
"(... | Function to set the colPos of an element depending on
whether it is a child of a parent container or not
will set colPos according to availability of the current grid column of an element
0 = no column at all
-1 = grid element column
-2 = non used elements column
changes are applied to the field array of the parent obj... | [
"Function",
"to",
"set",
"the",
"colPos",
"of",
"an",
"element",
"depending",
"on",
"whether",
"it",
"is",
"a",
"child",
"of",
"a",
"parent",
"container",
"or",
"not",
"will",
"set",
"colPos",
"according",
"to",
"availability",
"of",
"the",
"current",
"gri... | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DataHandler.php#L56-L67 |
TYPO3-extensions/gridelements | Classes/Hooks/DataHandler.php | DataHandler.processDatamap_afterDatabaseOperations | public function processDatamap_afterDatabaseOperations(
&$status,
&$table,
&$id,
&$fieldArray,
\TYPO3\CMS\Core\DataHandling\DataHandler $parentObj
) {
if (($table === 'tt_content' || $table === 'pages') && !$parentObj->isImporting) {
/** @var AfterDatabase... | php | public function processDatamap_afterDatabaseOperations(
&$status,
&$table,
&$id,
&$fieldArray,
\TYPO3\CMS\Core\DataHandling\DataHandler $parentObj
) {
if (($table === 'tt_content' || $table === 'pages') && !$parentObj->isImporting) {
/** @var AfterDatabase... | [
"public",
"function",
"processDatamap_afterDatabaseOperations",
"(",
"&",
"$",
"status",
",",
"&",
"$",
"table",
",",
"&",
"$",
"id",
",",
"&",
"$",
"fieldArray",
",",
"\\",
"TYPO3",
"\\",
"CMS",
"\\",
"Core",
"\\",
"DataHandling",
"\\",
"DataHandler",
"$"... | @param string $status
@param string $table : The name of the table the data should be saved to
@param int $id : The uid of the page we are currently working on
@param array $fieldArray : The array of fields and values that have been saved to the datamap
@param \TYPO3\CMS\Core\DataHandling\DataHandler $parentObj : The p... | [
"@param",
"string",
"$status",
"@param",
"string",
"$table",
":",
"The",
"name",
"of",
"the",
"table",
"the",
"data",
"should",
"be",
"saved",
"to",
"@param",
"int",
"$id",
":",
"The",
"uid",
"of",
"the",
"page",
"we",
"are",
"currently",
"working",
"on"... | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DataHandler.php#L78-L97 |
TYPO3-extensions/gridelements | Classes/Hooks/DataHandler.php | DataHandler.processCmdmap | public function processCmdmap(
$command,
$table,
$id,
$value,
&$commandIsProcessed,
\TYPO3\CMS\Core\DataHandling\DataHandler &$parentObj,
$pasteUpdate
) {
if (!$parentObj->isImporting) {
/** @var ProcessCmdmap $hook */
$hook = G... | php | public function processCmdmap(
$command,
$table,
$id,
$value,
&$commandIsProcessed,
\TYPO3\CMS\Core\DataHandling\DataHandler &$parentObj,
$pasteUpdate
) {
if (!$parentObj->isImporting) {
/** @var ProcessCmdmap $hook */
$hook = G... | [
"public",
"function",
"processCmdmap",
"(",
"$",
"command",
",",
"$",
"table",
",",
"$",
"id",
",",
"$",
"value",
",",
"&",
"$",
"commandIsProcessed",
",",
"\\",
"TYPO3",
"\\",
"CMS",
"\\",
"Core",
"\\",
"DataHandling",
"\\",
"DataHandler",
"&",
"$",
"... | Function to process the drag & drop copy action
@param string $command The command to be handled by the command map
@param string $table The name of the table we are working on
@param int $id The id of the record that is going to be copied
@param string $value The value that has been sent with the copy command
@param ... | [
"Function",
"to",
"process",
"the",
"drag",
"&",
"drop",
"copy",
"action"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Hooks/DataHandler.php#L110-L124 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.getButtons | public function getButtons()
{
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
$buttons = [
'csh' => '',
'view' => '',
'edit' => '',
'hide_un... | php | public function getButtons()
{
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
$buttons = [
'csh' => '',
'view' => '',
'edit' => '',
'hide_un... | [
"public",
"function",
"getButtons",
"(",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getModule",
"(",
")",
";",
"$",
"backendUser",
"=",
"$",
"this",
"->",
"getBackendUserAuthentication",
"(",
")",
";",
"$",
"lang",
"=",
"$",
"this",
"->",
"getLa... | Create the panel of buttons for submitting the form or otherwise perform
operations.
@return string[] All available buttons as an assoc. array
@throws RouteNotFoundException | [
"Create",
"the",
"panel",
"of",
"buttons",
"for",
"submitting",
"the",
"form",
"or",
"otherwise",
"perform",
"operations",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L259-L400 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.getDocHeaderButtons | public function getDocHeaderButtons(ModuleTemplate $moduleTemplate)
{
$buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
// Get users p... | php | public function getDocHeaderButtons(ModuleTemplate $moduleTemplate)
{
$buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
// Get users p... | [
"public",
"function",
"getDocHeaderButtons",
"(",
"ModuleTemplate",
"$",
"moduleTemplate",
")",
"{",
"$",
"buttonBar",
"=",
"$",
"moduleTemplate",
"->",
"getDocHeaderComponent",
"(",
")",
"->",
"getButtonBar",
"(",
")",
";",
"$",
"module",
"=",
"$",
"this",
"-... | Create the panel of buttons for submitting the form or otherwise perform
operations.
@param ModuleTemplate $moduleTemplate
@throws RouteNotFoundException | [
"Create",
"the",
"panel",
"of",
"buttons",
"for",
"submitting",
"the",
"form",
"or",
"otherwise",
"perform",
"operations",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L436-L587 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.getTable | public function getTable($table, $id, $rowList = '')
{
$backendLayout = $this->getBackendLayoutView()->getSelectedBackendLayout($id);
$backendLayoutColumns = [];
if (is_array($backendLayout['__items'])) {
foreach ($backendLayout['__items'] as $backendLayoutItem) {
... | php | public function getTable($table, $id, $rowList = '')
{
$backendLayout = $this->getBackendLayoutView()->getSelectedBackendLayout($id);
$backendLayoutColumns = [];
if (is_array($backendLayout['__items'])) {
foreach ($backendLayout['__items'] as $backendLayoutItem) {
... | [
"public",
"function",
"getTable",
"(",
"$",
"table",
",",
"$",
"id",
",",
"$",
"rowList",
"=",
"''",
")",
"{",
"$",
"backendLayout",
"=",
"$",
"this",
"->",
"getBackendLayoutView",
"(",
")",
"->",
"getSelectedBackendLayout",
"(",
"$",
"id",
")",
";",
"... | Creates the listing of records from a single table
@param string $table Table name
@param int $id Page id
@param string $rowList List of fields to show in the listing. Pseudo fields will be added including the record header.
@return string HTML table with the listing for the record.
@throws Exception | [
"Creates",
"the",
"listing",
"of",
"records",
"from",
"a",
"single",
"table"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L598-L1094 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.renderListNavigation | protected function renderListNavigation($renderPart = 'top')
{
$totalPages = ceil($this->totalItems / $this->iLimit);
// Show page selector if not all records fit into one page
if ($totalPages <= 1) {
return '';
}
$content = '';
$listURL = $this->listURL('... | php | protected function renderListNavigation($renderPart = 'top')
{
$totalPages = ceil($this->totalItems / $this->iLimit);
// Show page selector if not all records fit into one page
if ($totalPages <= 1) {
return '';
}
$content = '';
$listURL = $this->listURL('... | [
"protected",
"function",
"renderListNavigation",
"(",
"$",
"renderPart",
"=",
"'top'",
")",
"{",
"$",
"totalPages",
"=",
"ceil",
"(",
"$",
"this",
"->",
"totalItems",
"/",
"$",
"this",
"->",
"iLimit",
")",
";",
"// Show page selector if not all records fit into on... | Creates a page browser for tables with many records
@param string $renderPart Distinguish between 'top' and 'bottom' part of the navigation (above or below the records)
@return string Navigation HTML | [
"Creates",
"a",
"page",
"browser",
"for",
"tables",
"with",
"many",
"records"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1102-L1199 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.addHeaderRowToCSV | protected function addHeaderRowToCSV()
{
$fieldArray = array_combine($this->fieldArray, $this->fieldArray);
$hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][__CLASS__]['customizeCsvHeader'] ?? [];
if (!empty($hooks)) {
$hookParameters = [
'fields' => &$fieldArra... | php | protected function addHeaderRowToCSV()
{
$fieldArray = array_combine($this->fieldArray, $this->fieldArray);
$hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][__CLASS__]['customizeCsvHeader'] ?? [];
if (!empty($hooks)) {
$hookParameters = [
'fields' => &$fieldArra... | [
"protected",
"function",
"addHeaderRowToCSV",
"(",
")",
"{",
"$",
"fieldArray",
"=",
"array_combine",
"(",
"$",
"this",
"->",
"fieldArray",
",",
"$",
"this",
"->",
"fieldArray",
")",
";",
"$",
"hooks",
"=",
"$",
"GLOBALS",
"[",
"'TYPO3_CONF_VARS'",
"]",
"[... | Add header line with field names as CSV line | [
"Add",
"header",
"line",
"with",
"field",
"names",
"as",
"CSV",
"line"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1240-L1254 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.addToCSV | protected function addToCSV(array $row = [])
{
$rowReducedByControlFields = self::removeControlFieldsFromFieldRow($row);
// Get an field array without control fields but in the expected order
$fieldArray = array_intersect_key(array_flip($this->fieldArray), $rowReducedByControlFields);
... | php | protected function addToCSV(array $row = [])
{
$rowReducedByControlFields = self::removeControlFieldsFromFieldRow($row);
// Get an field array without control fields but in the expected order
$fieldArray = array_intersect_key(array_flip($this->fieldArray), $rowReducedByControlFields);
... | [
"protected",
"function",
"addToCSV",
"(",
"array",
"$",
"row",
"=",
"[",
"]",
")",
"{",
"$",
"rowReducedByControlFields",
"=",
"self",
"::",
"removeControlFieldsFromFieldRow",
"(",
"$",
"row",
")",
";",
"// Get an field array without control fields but in the expected o... | Adds selected columns of one table row as CSV line.
@param mixed[] $row Record array, from which the values of fields found in $this->fieldArray will be listed in the CSV output. | [
"Adds",
"selected",
"columns",
"of",
"one",
"table",
"row",
"as",
"CSV",
"line",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1267-L1278 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.setCsvRow | public function setCsvRow($csvRow)
{
$csvDelimiter = $this->modTSconfig['properties']['csvDelimiter'] ?? ',';
$csvQuote = $this->modTSconfig['properties']['csvQuote'] ?? '"';
$this->csvLines[] = CsvUtility::csvValues($csvRow, $csvDelimiter, $csvQuote);
} | php | public function setCsvRow($csvRow)
{
$csvDelimiter = $this->modTSconfig['properties']['csvDelimiter'] ?? ',';
$csvQuote = $this->modTSconfig['properties']['csvQuote'] ?? '"';
$this->csvLines[] = CsvUtility::csvValues($csvRow, $csvDelimiter, $csvQuote);
} | [
"public",
"function",
"setCsvRow",
"(",
"$",
"csvRow",
")",
"{",
"$",
"csvDelimiter",
"=",
"$",
"this",
"->",
"modTSconfig",
"[",
"'properties'",
"]",
"[",
"'csvDelimiter'",
"]",
"??",
"','",
";",
"$",
"csvQuote",
"=",
"$",
"this",
"->",
"modTSconfig",
"... | Adds input row of values to the internal csvLines array as a CSV formatted line
@param mixed[] $csvRow Array with values to be listed. | [
"Adds",
"input",
"row",
"of",
"values",
"to",
"the",
"internal",
"csvLines",
"array",
"as",
"a",
"CSV",
"formatted",
"line"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1305-L1311 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.renderListRow | public function renderListRow($table, $row, $cc, $titleCol, $thumbsCol, $indent = 0, $level = 0, $triggerContainer = 0, $expanded = '')
{
if (!is_array($row)) {
return '';
}
$rowOutput = '';
$id_orig = null;
// If in search mode, make sure the preview will show th... | php | public function renderListRow($table, $row, $cc, $titleCol, $thumbsCol, $indent = 0, $level = 0, $triggerContainer = 0, $expanded = '')
{
if (!is_array($row)) {
return '';
}
$rowOutput = '';
$id_orig = null;
// If in search mode, make sure the preview will show th... | [
"public",
"function",
"renderListRow",
"(",
"$",
"table",
",",
"$",
"row",
",",
"$",
"cc",
",",
"$",
"titleCol",
",",
"$",
"thumbsCol",
",",
"$",
"indent",
"=",
"0",
",",
"$",
"level",
"=",
"0",
",",
"$",
"triggerContainer",
"=",
"0",
",",
"$",
"... | Rendering a single row for the list
@param string $table Table name
@param mixed[] $row Current record
@param int $cc Counter, counting for each time an element is rendered (used for alternating colors)
@param string $titleCol Table field (column) where header value is found
@param string $thumbsCol Table field (colum... | [
"Rendering",
"a",
"single",
"row",
"for",
"the",
"list"
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1328-L1629 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.recPath | public function recPath($pid)
{
if (!isset($this->recPath_cache[$pid])) {
$this->recPath_cache[$pid] = BackendUtility::getRecordPath($pid, $this->perms_clause, 20);
}
return $this->recPath_cache[$pid];
} | php | public function recPath($pid)
{
if (!isset($this->recPath_cache[$pid])) {
$this->recPath_cache[$pid] = BackendUtility::getRecordPath($pid, $this->perms_clause, 20);
}
return $this->recPath_cache[$pid];
} | [
"public",
"function",
"recPath",
"(",
"$",
"pid",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"recPath_cache",
"[",
"$",
"pid",
"]",
")",
")",
"{",
"$",
"this",
"->",
"recPath_cache",
"[",
"$",
"pid",
"]",
"=",
"BackendUtility",
"::"... | Returns the path for a certain pid
The result is cached internally for the session, thus you can call
this function as much as you like without performance problems.
@param int $pid The page id for which to get the path
@return mixed[] The path. | [
"Returns",
"the",
"path",
"for",
"a",
"certain",
"pid",
"The",
"result",
"is",
"cached",
"internally",
"for",
"the",
"session",
"thus",
"you",
"can",
"call",
"this",
"function",
"as",
"much",
"as",
"you",
"like",
"without",
"performance",
"problems",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1639-L1645 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.createReferenceHtml | protected function createReferenceHtml($tableName, $uid)
{
$referenceCount = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('sys_refindex')
->count(
'*',
'sys_refindex',
[
'ref_table' => ... | php | protected function createReferenceHtml($tableName, $uid)
{
$referenceCount = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('sys_refindex')
->count(
'*',
'sys_refindex',
[
'ref_table' => ... | [
"protected",
"function",
"createReferenceHtml",
"(",
"$",
"tableName",
",",
"$",
"uid",
")",
"{",
"$",
"referenceCount",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"ConnectionPool",
"::",
"class",
")",
"->",
"getConnectionForTable",
"(",
"'sys_refindex'",
"... | Creates the HTML for a reference count for the record with the UID $uid
in the table $tableName.
@param string $tableName
@param int $uid
@return string HTML of reference a link, will be empty if there are no | [
"Creates",
"the",
"HTML",
"for",
"a",
"reference",
"count",
"for",
"the",
"record",
"with",
"the",
"UID",
"$uid",
"in",
"the",
"table",
"$tableName",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1661-L1679 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.makeControl | public function makeControl($table, $row)
{
$module = $this->getModule();
$rowUid = $row['uid'];
if (ExtensionManagementUtility::isLoaded('workspaces') && isset($row['_ORIG_uid'])) {
$rowUid = $row['_ORIG_uid'];
}
$cells = [
'primary' => [],
... | php | public function makeControl($table, $row)
{
$module = $this->getModule();
$rowUid = $row['uid'];
if (ExtensionManagementUtility::isLoaded('workspaces') && isset($row['_ORIG_uid'])) {
$rowUid = $row['_ORIG_uid'];
}
$cells = [
'primary' => [],
... | [
"public",
"function",
"makeControl",
"(",
"$",
"table",
",",
"$",
"row",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getModule",
"(",
")",
";",
"$",
"rowUid",
"=",
"$",
"row",
"[",
"'uid'",
"]",
";",
"if",
"(",
"ExtensionManagementUtility",
"::... | Creates the control panel for a single record in the listing.
@param string $table The table
@param mixed[] $row The record for which to make the control panel.
@throws \UnexpectedValueException
@throws RouteNotFoundException
@return string HTML table with the control panel (unless disabled) | [
"Creates",
"the",
"control",
"panel",
"for",
"a",
"single",
"record",
"in",
"the",
"listing",
"."
] | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L1690-L2045 |
TYPO3-extensions/gridelements | Classes/Xclass/DatabaseRecordList.php | DatabaseRecordList.overlayEditLockPermissions | protected function overlayEditLockPermissions($table, $row = [], $editPermission = true)
{
if ($editPermission && !$this->getBackendUserAuthentication()->isAdmin()) {
// If no $row is submitted we only check for general edit lock of current page (except for table "pages")
if (empty($... | php | protected function overlayEditLockPermissions($table, $row = [], $editPermission = true)
{
if ($editPermission && !$this->getBackendUserAuthentication()->isAdmin()) {
// If no $row is submitted we only check for general edit lock of current page (except for table "pages")
if (empty($... | [
"protected",
"function",
"overlayEditLockPermissions",
"(",
"$",
"table",
",",
"$",
"row",
"=",
"[",
"]",
",",
"$",
"editPermission",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"editPermission",
"&&",
"!",
"$",
"this",
"->",
"getBackendUserAuthentication",
"(",
... | Check if the current record is locked by editlock. Pages are locked if their editlock flag is set,
records are if they are locked themselves or if the page they are on is locked (a page’s editlock
is transitive for its content elements).
@param string $table
@param array $row
@param bool $editPermission
@return bool | [
"Check",
"if",
"the",
"current",
"record",
"is",
"locked",
"by",
"editlock",
".",
"Pages",
"are",
"locked",
"if",
"their",
"editlock",
"flag",
"is",
"set",
"records",
"are",
"if",
"they",
"are",
"locked",
"themselves",
"or",
"if",
"the",
"page",
"they",
... | train | https://github.com/TYPO3-extensions/gridelements/blob/50a1ee6965445938726ca33c423d30a29adaf0a6/Classes/Xclass/DatabaseRecordList.php#L2057-L2071 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.