id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
208,400 | octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.makeTwigFunctions | public function makeTwigFunctions($functions = [])
{
if (!is_array($functions)) {
$functions = [];
}
foreach ($this->listFunctions() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false &&... | php | public function makeTwigFunctions($functions = [])
{
if (!is_array($functions)) {
$functions = [];
}
foreach ($this->listFunctions() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false &&... | [
"public",
"function",
"makeTwigFunctions",
"(",
"$",
"functions",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"functions",
")",
")",
"{",
"$",
"functions",
"=",
"[",
"]",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"listFunctions"... | Makes a set of Twig functions for use in a twig extension.
@param array $functions Current collection
@return array | [
"Makes",
"a",
"set",
"of",
"Twig",
"functions",
"for",
"use",
"in",
"a",
"twig",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L223-L250 |
208,401 | octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.makeTwigFilters | public function makeTwigFilters($filters = [])
{
if (!is_array($filters)) {
$filters = [];
}
foreach ($this->listFilters() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false && $this->is... | php | public function makeTwigFilters($filters = [])
{
if (!is_array($filters)) {
$filters = [];
}
foreach ($this->listFilters() as $name => $callable) {
/*
* Handle a wildcard function
*/
if (strpos($name, '*') !== false && $this->is... | [
"public",
"function",
"makeTwigFilters",
"(",
"$",
"filters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"listFilters",
"(",
... | Makes a set of Twig filters for use in a twig extension.
@param array $filters Current collection
@return array | [
"Makes",
"a",
"set",
"of",
"Twig",
"filters",
"for",
"use",
"in",
"a",
"twig",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L257-L284 |
208,402 | octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.makeTwigTokenParsers | public function makeTwigTokenParsers($parsers = [])
{
if (!is_array($parsers)) {
$parsers = [];
}
$extraParsers = $this->listTokenParsers();
foreach ($extraParsers as $obj) {
if (!$obj instanceof Twig_TokenParser) {
continue;
}
... | php | public function makeTwigTokenParsers($parsers = [])
{
if (!is_array($parsers)) {
$parsers = [];
}
$extraParsers = $this->listTokenParsers();
foreach ($extraParsers as $obj) {
if (!$obj instanceof Twig_TokenParser) {
continue;
}
... | [
"public",
"function",
"makeTwigTokenParsers",
"(",
"$",
"parsers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"parsers",
")",
")",
"{",
"$",
"parsers",
"=",
"[",
"]",
";",
"}",
"$",
"extraParsers",
"=",
"$",
"this",
"->",
"listT... | Makes a set of Twig token parsers for use in a twig extension.
@param array $parsers Current collection
@return array | [
"Makes",
"a",
"set",
"of",
"Twig",
"token",
"parsers",
"for",
"use",
"in",
"a",
"twig",
"extension",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L291-L307 |
208,403 | octobercms/october | modules/system/classes/MarkupManager.php | MarkupManager.isWildCallable | protected function isWildCallable($callable, $replaceWith = false)
{
$isWild = false;
if (is_string($callable) && strpos($callable, '*') !== false) {
$isWild = $replaceWith ? str_replace('*', $replaceWith, $callable) : true;
}
if (is_array($callable)) {
if (... | php | protected function isWildCallable($callable, $replaceWith = false)
{
$isWild = false;
if (is_string($callable) && strpos($callable, '*') !== false) {
$isWild = $replaceWith ? str_replace('*', $replaceWith, $callable) : true;
}
if (is_array($callable)) {
if (... | [
"protected",
"function",
"isWildCallable",
"(",
"$",
"callable",
",",
"$",
"replaceWith",
"=",
"false",
")",
"{",
"$",
"isWild",
"=",
"false",
";",
"if",
"(",
"is_string",
"(",
"$",
"callable",
")",
"&&",
"strpos",
"(",
"$",
"callable",
",",
"'*'",
")"... | Tests if a callable type contains a wildcard, also acts as a
utility to replace the wildcard with a string.
@param callable $callable
@param string|bool $replaceWith
@return mixed | [
"Tests",
"if",
"a",
"callable",
"type",
"contains",
"a",
"wildcard",
"also",
"acts",
"as",
"a",
"utility",
"to",
"replace",
"the",
"wildcard",
"with",
"a",
"string",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MarkupManager.php#L316-L347 |
208,404 | octobercms/october | modules/backend/traits/WidgetMaker.php | WidgetMaker.makeWidget | public function makeWidget($class, $widgetConfig = [])
{
$controller = property_exists($this, 'controller') && $this->controller
? $this->controller
: $this;
if (!class_exists($class)) {
throw new SystemException(Lang::get('backend::lang.widget.not_registered', [... | php | public function makeWidget($class, $widgetConfig = [])
{
$controller = property_exists($this, 'controller') && $this->controller
? $this->controller
: $this;
if (!class_exists($class)) {
throw new SystemException(Lang::get('backend::lang.widget.not_registered', [... | [
"public",
"function",
"makeWidget",
"(",
"$",
"class",
",",
"$",
"widgetConfig",
"=",
"[",
"]",
")",
"{",
"$",
"controller",
"=",
"property_exists",
"(",
"$",
"this",
",",
"'controller'",
")",
"&&",
"$",
"this",
"->",
"controller",
"?",
"$",
"this",
"-... | Makes a widget object with the supplied configuration file.
@param string $class Widget class name
@param array $widgetConfig An array of config.
@return \Backend\Classes\WidgetBase The widget object | [
"Makes",
"a",
"widget",
"object",
"with",
"the",
"supplied",
"configuration",
"file",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/WidgetMaker.php#L24-L37 |
208,405 | octobercms/october | modules/backend/traits/WidgetMaker.php | WidgetMaker.makeFormWidget | public function makeFormWidget($class, $fieldConfig = [], $widgetConfig = [])
{
$controller = property_exists($this, 'controller') && $this->controller
? $this->controller
: $this;
if (!class_exists($class)) {
throw new SystemException(Lang::get('backend::lang.wi... | php | public function makeFormWidget($class, $fieldConfig = [], $widgetConfig = [])
{
$controller = property_exists($this, 'controller') && $this->controller
? $this->controller
: $this;
if (!class_exists($class)) {
throw new SystemException(Lang::get('backend::lang.wi... | [
"public",
"function",
"makeFormWidget",
"(",
"$",
"class",
",",
"$",
"fieldConfig",
"=",
"[",
"]",
",",
"$",
"widgetConfig",
"=",
"[",
"]",
")",
"{",
"$",
"controller",
"=",
"property_exists",
"(",
"$",
"this",
",",
"'controller'",
")",
"&&",
"$",
"thi... | Makes a form widget object with the supplied form field and widget configuration.
@param string $class Widget class name
@param mixed $fieldConfig A field name, an array of config or a FormField object.
@param array $widgetConfig An array of config.
@return \Backend\Classes\FormWidgetBase The widget object | [
"Makes",
"a",
"form",
"widget",
"object",
"with",
"the",
"supplied",
"form",
"field",
"and",
"widget",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/WidgetMaker.php#L46-L74 |
208,406 | octobercms/october | modules/backend/models/ImportModel.php | ImportModel.processImportRow | protected function processImportRow($rowData, $matches)
{
$newRow = [];
foreach ($matches as $columnIndex => $dbNames) {
$value = array_get($rowData, $columnIndex);
foreach ((array) $dbNames as $dbName) {
$newRow[$dbName] = $value;
}
}
... | php | protected function processImportRow($rowData, $matches)
{
$newRow = [];
foreach ($matches as $columnIndex => $dbNames) {
$value = array_get($rowData, $columnIndex);
foreach ((array) $dbNames as $dbName) {
$newRow[$dbName] = $value;
}
}
... | [
"protected",
"function",
"processImportRow",
"(",
"$",
"rowData",
",",
"$",
"matches",
")",
"{",
"$",
"newRow",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"matches",
"as",
"$",
"columnIndex",
"=>",
"$",
"dbNames",
")",
"{",
"$",
"value",
"=",
"array_get"... | Converts a single row of CSV data to the column map.
@return array | [
"Converts",
"a",
"single",
"row",
"of",
"CSV",
"data",
"to",
"the",
"column",
"map",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L157-L169 |
208,407 | octobercms/october | modules/backend/models/ImportModel.php | ImportModel.getImportFilePath | public function getImportFilePath($sessionKey = null)
{
$file = $this
->import_file()
->withDeferred($sessionKey)
->orderBy('id', 'desc')
->first()
;
if (!$file) {
return null;
}
return $file->getLocalPath();
} | php | public function getImportFilePath($sessionKey = null)
{
$file = $this
->import_file()
->withDeferred($sessionKey)
->orderBy('id', 'desc')
->first()
;
if (!$file) {
return null;
}
return $file->getLocalPath();
} | [
"public",
"function",
"getImportFilePath",
"(",
"$",
"sessionKey",
"=",
"null",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"import_file",
"(",
")",
"->",
"withDeferred",
"(",
"$",
"sessionKey",
")",
"->",
"orderBy",
"(",
"'id'",
",",
"'desc'",
")",
... | Returns an attached imported file local path, if available.
@return string | [
"Returns",
"an",
"attached",
"imported",
"file",
"local",
"path",
"if",
"available",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L193-L207 |
208,408 | octobercms/october | modules/backend/models/ImportModel.php | ImportModel.getFormatEncodingOptions | public function getFormatEncodingOptions()
{
$options = [
'utf-8',
'us-ascii',
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8... | php | public function getFormatEncodingOptions()
{
$options = [
'utf-8',
'us-ascii',
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8... | [
"public",
"function",
"getFormatEncodingOptions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"'utf-8'",
",",
"'us-ascii'",
",",
"'iso-8859-1'",
",",
"'iso-8859-2'",
",",
"'iso-8859-3'",
",",
"'iso-8859-4'",
",",
"'iso-8859-5'",
",",
"'iso-8859-6'",
",",
"'iso-8859-7... | Returns all available encodings values from the localization config
@return array | [
"Returns",
"all",
"available",
"encodings",
"values",
"from",
"the",
"localization",
"config"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/ImportModel.php#L213-L241 |
208,409 | octobercms/october | modules/backend/formwidgets/PermissionEditor.php | PermissionEditor.getSaveValueSecure | protected function getSaveValueSecure($value)
{
$newPermissions = is_array($value) ? array_map('intval', $value) : [];
if (!empty($newPermissions)) {
$existingPermissions = $this->model->permissions ?: [];
$allowedPermissions = array_map(function ($permissionObject) {
... | php | protected function getSaveValueSecure($value)
{
$newPermissions = is_array($value) ? array_map('intval', $value) : [];
if (!empty($newPermissions)) {
$existingPermissions = $this->model->permissions ?: [];
$allowedPermissions = array_map(function ($permissionObject) {
... | [
"protected",
"function",
"getSaveValueSecure",
"(",
"$",
"value",
")",
"{",
"$",
"newPermissions",
"=",
"is_array",
"(",
"$",
"value",
")",
"?",
"array_map",
"(",
"'intval'",
",",
"$",
"value",
")",
":",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"... | Returns a safely parsed set of permissions, ensuring the user cannot elevate
their own permissions or permissions of another user above their own.
@param string $value
@return array | [
"Returns",
"a",
"safely",
"parsed",
"set",
"of",
"permissions",
"ensuring",
"the",
"user",
"cannot",
"elevate",
"their",
"own",
"permissions",
"or",
"permissions",
"of",
"another",
"user",
"above",
"their",
"own",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/PermissionEditor.php#L94-L115 |
208,410 | octobercms/october | modules/backend/formwidgets/PermissionEditor.php | PermissionEditor.getFilteredPermissions | protected function getFilteredPermissions()
{
$permissions = BackendAuth::listTabbedPermissions();
if ($this->user->isSuperUser()) {
return $permissions;
}
foreach ($permissions as $tab => $permissionsArray) {
foreach ($permissionsArray as $index => $permiss... | php | protected function getFilteredPermissions()
{
$permissions = BackendAuth::listTabbedPermissions();
if ($this->user->isSuperUser()) {
return $permissions;
}
foreach ($permissions as $tab => $permissionsArray) {
foreach ($permissionsArray as $index => $permiss... | [
"protected",
"function",
"getFilteredPermissions",
"(",
")",
"{",
"$",
"permissions",
"=",
"BackendAuth",
"::",
"listTabbedPermissions",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user",
"->",
"isSuperUser",
"(",
")",
")",
"{",
"return",
"$",
"permissions... | Returns the available permissions; removing those that the logged-in user does not have access to
@return array The permissions that the logged-in user does have access to | [
"Returns",
"the",
"available",
"permissions",
";",
"removing",
"those",
"that",
"the",
"logged",
"-",
"in",
"user",
"does",
"not",
"have",
"access",
"to"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/PermissionEditor.php#L122-L146 |
208,411 | octobercms/october | modules/system/models/PluginVersion.php | PluginVersion.afterFetch | public function afterFetch()
{
/*
* Override the database columns with the plugin details
* found in the plugin registration file.
*/
$manager = PluginManager::instance();
$pluginObj = $manager->findByIdentifier($this->code);
if ($pluginObj) {
... | php | public function afterFetch()
{
/*
* Override the database columns with the plugin details
* found in the plugin registration file.
*/
$manager = PluginManager::instance();
$pluginObj = $manager->findByIdentifier($this->code);
if ($pluginObj) {
... | [
"public",
"function",
"afterFetch",
"(",
")",
"{",
"/*\n * Override the database columns with the plugin details\n * found in the plugin registration file.\n */",
"$",
"manager",
"=",
"PluginManager",
"::",
"instance",
"(",
")",
";",
"$",
"pluginObj",
"=",... | After the model is populated | [
"After",
"the",
"model",
"is",
"populated"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/models/PluginVersion.php#L82-L117 |
208,412 | octobercms/october | modules/system/models/PluginVersion.php | PluginVersion.getVersion | public static function getVersion($pluginCode)
{
if (self::$versionCache === null) {
self::$versionCache = self::lists('version', 'code');
}
return self::$versionCache[$pluginCode] ?? null;
} | php | public static function getVersion($pluginCode)
{
if (self::$versionCache === null) {
self::$versionCache = self::lists('version', 'code');
}
return self::$versionCache[$pluginCode] ?? null;
} | [
"public",
"static",
"function",
"getVersion",
"(",
"$",
"pluginCode",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"versionCache",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"versionCache",
"=",
"self",
"::",
"lists",
"(",
"'version'",
",",
"'code'",
")",
... | Returns the current version for a plugin
@param string $pluginCode Plugin code. Eg: Acme.Blog
@return string | [
"Returns",
"the",
"current",
"version",
"for",
"a",
"plugin"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/models/PluginVersion.php#L143-L150 |
208,413 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.beforeSave | public function beforeSave()
{
/*
* Dynamic attributes are stored in the jsonable attribute 'data'.
*/
$staticAttributes = ['id', 'theme', 'data', 'created_at', 'updated_at'];
$dynamicAttributes = array_except($this->getAttributes(), $staticAttributes);
$this->data... | php | public function beforeSave()
{
/*
* Dynamic attributes are stored in the jsonable attribute 'data'.
*/
$staticAttributes = ['id', 'theme', 'data', 'created_at', 'updated_at'];
$dynamicAttributes = array_except($this->getAttributes(), $staticAttributes);
$this->data... | [
"public",
"function",
"beforeSave",
"(",
")",
"{",
"/*\n * Dynamic attributes are stored in the jsonable attribute 'data'.\n */",
"$",
"staticAttributes",
"=",
"[",
"'id'",
",",
"'theme'",
",",
"'data'",
",",
"'created_at'",
",",
"'updated_at'",
"]",
";",
... | Before saving the model, strip dynamic attributes applied from config.
@return void | [
"Before",
"saving",
"the",
"model",
"strip",
"dynamic",
"attributes",
"applied",
"from",
"config",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L59-L69 |
208,414 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.forTheme | public static function forTheme($theme)
{
$dirName = $theme->getDirName();
if ($themeData = array_get(self::$instances, $dirName)) {
return $themeData;
}
try {
$themeData = self::firstOrCreate(['theme' => $dirName]);
}
catch (Exception $ex) {
... | php | public static function forTheme($theme)
{
$dirName = $theme->getDirName();
if ($themeData = array_get(self::$instances, $dirName)) {
return $themeData;
}
try {
$themeData = self::firstOrCreate(['theme' => $dirName]);
}
catch (Exception $ex) {
... | [
"public",
"static",
"function",
"forTheme",
"(",
"$",
"theme",
")",
"{",
"$",
"dirName",
"=",
"$",
"theme",
"->",
"getDirName",
"(",
")",
";",
"if",
"(",
"$",
"themeData",
"=",
"array_get",
"(",
"self",
"::",
"$",
"instances",
",",
"$",
"dirName",
")... | Returns a cached version of this model, based on a Theme object.
@param $theme Cms\Classes\Theme
@return self | [
"Returns",
"a",
"cached",
"version",
"of",
"this",
"model",
"based",
"on",
"a",
"Theme",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L88-L104 |
208,415 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.afterFetch | public function afterFetch()
{
$data = (array) $this->data + $this->getDefaultValues();
/*
* Repeater form fields store arrays and must be jsonable.
*/
foreach ($this->getFormFields() as $id => $field) {
if (!isset($field['type'])) {
continue;
... | php | public function afterFetch()
{
$data = (array) $this->data + $this->getDefaultValues();
/*
* Repeater form fields store arrays and must be jsonable.
*/
foreach ($this->getFormFields() as $id => $field) {
if (!isset($field['type'])) {
continue;
... | [
"public",
"function",
"afterFetch",
"(",
")",
"{",
"$",
"data",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"data",
"+",
"$",
"this",
"->",
"getDefaultValues",
"(",
")",
";",
"/*\n * Repeater form fields store arrays and must be jsonable.\n */",
"fore... | After fetching the model, intiialize model relationships based
on form field definitions.
@return void | [
"After",
"fetching",
"the",
"model",
"intiialize",
"model",
"relationships",
"based",
"on",
"form",
"field",
"definitions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L111-L136 |
208,416 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.getDefaultValues | public function getDefaultValues()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (($value = array_get($field, 'default')) === null) {
continue;
}
$result[$attribute] = $value;
}
return $result;
... | php | public function getDefaultValues()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (($value = array_get($field, 'default')) === null) {
continue;
}
$result[$attribute] = $value;
}
return $result;
... | [
"public",
"function",
"getDefaultValues",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFormFields",
"(",
")",
"as",
"$",
"attribute",
"=>",
"$",
"field",
")",
"{",
"if",
"(",
"(",
"$",
"value",
"=",
"arra... | Gets default values for this model based on form field definitions.
@return array | [
"Gets",
"default",
"values",
"for",
"this",
"model",
"based",
"on",
"form",
"field",
"definitions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L171-L184 |
208,417 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.getFormFields | public function getFormFields()
{
if (!$theme = CmsTheme::load($this->theme)) {
throw new Exception(Lang::get('Unable to find theme with name :name', $this->theme));
}
$config = $theme->getFormConfig();
return array_get($config, 'fields', []) +
array_get($co... | php | public function getFormFields()
{
if (!$theme = CmsTheme::load($this->theme)) {
throw new Exception(Lang::get('Unable to find theme with name :name', $this->theme));
}
$config = $theme->getFormConfig();
return array_get($config, 'fields', []) +
array_get($co... | [
"public",
"function",
"getFormFields",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"theme",
"=",
"CmsTheme",
"::",
"load",
"(",
"$",
"this",
"->",
"theme",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"Lang",
"::",
"get",
"(",
"'Unable to find theme with nam... | Returns all fields defined for this model, based on form field definitions.
@return array | [
"Returns",
"all",
"fields",
"defined",
"for",
"this",
"model",
"based",
"on",
"form",
"field",
"definitions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L190-L201 |
208,418 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.getAssetVariables | public function getAssetVariables()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (!$varName = array_get($field, 'assetVar')) {
continue;
}
$result[$varName] = $this->{$attribute};
}
return $result... | php | public function getAssetVariables()
{
$result = [];
foreach ($this->getFormFields() as $attribute => $field) {
if (!$varName = array_get($field, 'assetVar')) {
continue;
}
$result[$varName] = $this->{$attribute};
}
return $result... | [
"public",
"function",
"getAssetVariables",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFormFields",
"(",
")",
"as",
"$",
"attribute",
"=>",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"varName",
"=",
"a... | Returns variables that should be passed to the asset combiner.
@return array | [
"Returns",
"variables",
"that",
"should",
"be",
"passed",
"to",
"the",
"asset",
"combiner",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L207-L220 |
208,419 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.applyAssetVariablesToCombinerFilters | public static function applyAssetVariablesToCombinerFilters($filters)
{
$theme = CmsTheme::getActiveTheme();
if (!$theme){
return;
}
if (!$theme->hasCustomData()) {
return;
}
$assetVars = $theme->getCustomData()->getAssetVariables();
... | php | public static function applyAssetVariablesToCombinerFilters($filters)
{
$theme = CmsTheme::getActiveTheme();
if (!$theme){
return;
}
if (!$theme->hasCustomData()) {
return;
}
$assetVars = $theme->getCustomData()->getAssetVariables();
... | [
"public",
"static",
"function",
"applyAssetVariablesToCombinerFilters",
"(",
"$",
"filters",
")",
"{",
"$",
"theme",
"=",
"CmsTheme",
"::",
"getActiveTheme",
"(",
")",
";",
"if",
"(",
"!",
"$",
"theme",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
... | Applies asset variables to the combiner filters that support it.
@return void | [
"Applies",
"asset",
"variables",
"to",
"the",
"combiner",
"filters",
"that",
"support",
"it",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L226-L245 |
208,420 | octobercms/october | modules/cms/models/ThemeData.php | ThemeData.getCombinerCacheKey | public static function getCombinerCacheKey()
{
$theme = CmsTheme::getActiveTheme();
if (!$theme->hasCustomData()) {
return '';
}
$customData = $theme->getCustomData();
return (string) $customData->updated_at ?: '';
} | php | public static function getCombinerCacheKey()
{
$theme = CmsTheme::getActiveTheme();
if (!$theme->hasCustomData()) {
return '';
}
$customData = $theme->getCustomData();
return (string) $customData->updated_at ?: '';
} | [
"public",
"static",
"function",
"getCombinerCacheKey",
"(",
")",
"{",
"$",
"theme",
"=",
"CmsTheme",
"::",
"getActiveTheme",
"(",
")",
";",
"if",
"(",
"!",
"$",
"theme",
"->",
"hasCustomData",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"customD... | Generate a cache key for the combiner, this allows variables to bust the cache.
@return string | [
"Generate",
"a",
"cache",
"key",
"for",
"the",
"combiner",
"this",
"allows",
"variables",
"to",
"bust",
"the",
"cache",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L251-L261 |
208,421 | octobercms/october | modules/system/controllers/Settings.php | Settings.createModel | protected function createModel($item)
{
if (!isset($item->class) || !strlen($item->class)) {
throw new ApplicationException(Lang::get('system::lang.settings.missing_model'));
}
$class = $item->class;
return $class::instance();
} | php | protected function createModel($item)
{
if (!isset($item->class) || !strlen($item->class)) {
throw new ApplicationException(Lang::get('system::lang.settings.missing_model'));
}
$class = $item->class;
return $class::instance();
} | [
"protected",
"function",
"createModel",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"item",
"->",
"class",
")",
"||",
"!",
"strlen",
"(",
"$",
"item",
"->",
"class",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"Lang... | Internal method, prepare the list model object | [
"Internal",
"method",
"prepare",
"the",
"list",
"model",
"object"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Settings.php#L161-L169 |
208,422 | octobercms/october | modules/system/controllers/Settings.php | Settings.findSettingItem | protected function findSettingItem($author, $plugin, $code)
{
$manager = SettingsManager::instance();
$moduleOwner = $author;
$moduleCode = $plugin;
$item = $manager->findSettingItem($moduleOwner, $moduleCode);
if (!$item) {
$pluginOwner = $author . '.' . $plugi... | php | protected function findSettingItem($author, $plugin, $code)
{
$manager = SettingsManager::instance();
$moduleOwner = $author;
$moduleCode = $plugin;
$item = $manager->findSettingItem($moduleOwner, $moduleCode);
if (!$item) {
$pluginOwner = $author . '.' . $plugi... | [
"protected",
"function",
"findSettingItem",
"(",
"$",
"author",
",",
"$",
"plugin",
",",
"$",
"code",
")",
"{",
"$",
"manager",
"=",
"SettingsManager",
"::",
"instance",
"(",
")",
";",
"$",
"moduleOwner",
"=",
"$",
"author",
";",
"$",
"moduleCode",
"=",
... | Locates a setting item for a module or plugin | [
"Locates",
"a",
"setting",
"item",
"for",
"a",
"module",
"or",
"plugin"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Settings.php#L174-L189 |
208,423 | octobercms/october | modules/system/classes/PluginBase.php | PluginBase.pluginDetails | public function pluginDetails()
{
$thisClass = get_class($this);
$configuration = $this->getConfigurationFromYaml(sprintf('Plugin configuration file plugin.yaml is not '.
'found for the plugin class %s. Create the file or override pluginDetails() '.
'method in the plugin cla... | php | public function pluginDetails()
{
$thisClass = get_class($this);
$configuration = $this->getConfigurationFromYaml(sprintf('Plugin configuration file plugin.yaml is not '.
'found for the plugin class %s. Create the file or override pluginDetails() '.
'method in the plugin cla... | [
"public",
"function",
"pluginDetails",
"(",
")",
"{",
"$",
"thisClass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfigurationFromYaml",
"(",
"sprintf",
"(",
"'Plugin configuration file plugin.yaml is not '",
... | Returns information about this plugin, including plugin name and developer name.
@return array
@throws SystemException | [
"Returns",
"information",
"about",
"this",
"plugin",
"including",
"plugin",
"name",
"and",
"developer",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginBase.php#L43-L58 |
208,424 | octobercms/october | modules/system/classes/PluginBase.php | PluginBase.registerNavigation | public function registerNavigation()
{
$configuration = $this->getConfigurationFromYaml();
if (array_key_exists('navigation', $configuration)) {
$navigation = $configuration['navigation'];
if (is_array($navigation)) {
array_walk_recursive($navigation, functio... | php | public function registerNavigation()
{
$configuration = $this->getConfigurationFromYaml();
if (array_key_exists('navigation', $configuration)) {
$navigation = $configuration['navigation'];
if (is_array($navigation)) {
array_walk_recursive($navigation, functio... | [
"public",
"function",
"registerNavigation",
"(",
")",
"{",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfigurationFromYaml",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'navigation'",
",",
"$",
"configuration",
")",
")",
"{",
"$",
"navigation",... | Registers back-end navigation items for this plugin.
@return array | [
"Registers",
"back",
"-",
"end",
"navigation",
"items",
"for",
"this",
"plugin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginBase.php#L103-L119 |
208,425 | octobercms/october | modules/system/classes/PluginBase.php | PluginBase.getConfigurationFromYaml | protected function getConfigurationFromYaml($exceptionMessage = null)
{
if ($this->loadedYamlConfiguration !== false) {
return $this->loadedYamlConfiguration;
}
$reflection = new ReflectionClass(get_class($this));
$yamlFilePath = dirname($reflection->getFileName()).'/plu... | php | protected function getConfigurationFromYaml($exceptionMessage = null)
{
if ($this->loadedYamlConfiguration !== false) {
return $this->loadedYamlConfiguration;
}
$reflection = new ReflectionClass(get_class($this));
$yamlFilePath = dirname($reflection->getFileName()).'/plu... | [
"protected",
"function",
"getConfigurationFromYaml",
"(",
"$",
"exceptionMessage",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loadedYamlConfiguration",
"!==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"loadedYamlConfiguration",
";",
"}",
"$",
... | Read configuration from YAML file
@param string|null $exceptionMessage
@return array|bool
@throws SystemException | [
"Read",
"configuration",
"from",
"YAML",
"file"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginBase.php#L278-L302 |
208,426 | octobercms/october | modules/cms/classes/ComponentBase.php | ComponentBase.renderPartial | public function renderPartial()
{
$this->controller->setComponentContext($this);
$result = call_user_func_array([$this->controller, 'renderPartial'], func_get_args());
$this->controller->setComponentContext(null);
return $result;
} | php | public function renderPartial()
{
$this->controller->setComponentContext($this);
$result = call_user_func_array([$this->controller, 'renderPartial'], func_get_args());
$this->controller->setComponentContext(null);
return $result;
} | [
"public",
"function",
"renderPartial",
"(",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"setComponentContext",
"(",
"$",
"this",
")",
";",
"$",
"result",
"=",
"call_user_func_array",
"(",
"[",
"$",
"this",
"->",
"controller",
",",
"'renderPartial'",
"]"... | Renders a requested partial in context of this component,
see Cms\Classes\Controller@renderPartial for usage. | [
"Renders",
"a",
"requested",
"partial",
"in",
"context",
"of",
"this",
"component",
"see",
"Cms",
"\\",
"Classes",
"\\",
"Controller"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentBase.php#L140-L146 |
208,427 | octobercms/october | modules/cms/classes/ComponentBase.php | ComponentBase.runAjaxHandler | public function runAjaxHandler($handler)
{
/**
* @event cms.component.beforeRunAjaxHandler
* Provides an opportunity to modify an AJAX request to a component before it is processed by the component
*
* The parameter provided is `$handler` (the requested AJAX handler to be... | php | public function runAjaxHandler($handler)
{
/**
* @event cms.component.beforeRunAjaxHandler
* Provides an opportunity to modify an AJAX request to a component before it is processed by the component
*
* The parameter provided is `$handler` (the requested AJAX handler to be... | [
"public",
"function",
"runAjaxHandler",
"(",
"$",
"handler",
")",
"{",
"/**\n * @event cms.component.beforeRunAjaxHandler\n * Provides an opportunity to modify an AJAX request to a component before it is processed by the component\n *\n * The parameter provided is `$h... | Executes the event cycle when running an AJAX handler.
@return boolean Returns true if the handler was found. Returns false otherwise. | [
"Executes",
"the",
"event",
"cycle",
"when",
"running",
"an",
"AJAX",
"handler",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentBase.php#L152-L217 |
208,428 | octobercms/october | modules/cms/classes/ComponentBase.php | ComponentBase.paramName | public function paramName($name, $default = null)
{
if (($extName = $this->propertyName($name)) && substr($extName, 0, 1) == ':') {
return substr($extName, 1);
}
return $default;
} | php | public function paramName($name, $default = null)
{
if (($extName = $this->propertyName($name)) && substr($extName, 0, 1) == ':') {
return substr($extName, 1);
}
return $default;
} | [
"public",
"function",
"paramName",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"extName",
"=",
"$",
"this",
"->",
"propertyName",
"(",
"$",
"name",
")",
")",
"&&",
"substr",
"(",
"$",
"extName",
",",
"0",
",... | Returns the external property name when the property value is a routing parameter reference.
Otherwise the default value specified is returned.
@param string $name The property name
@param mixed $default
@return string | [
"Returns",
"the",
"external",
"property",
"name",
"when",
"the",
"property",
"value",
"is",
"a",
"routing",
"parameter",
"reference",
".",
"Otherwise",
"the",
"default",
"value",
"specified",
"is",
"returned",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentBase.php#L285-L292 |
208,429 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.makeLists | public function makeLists()
{
foreach ($this->listDefinitions as $definition => $config) {
$this->listWidgets[$definition] = $this->makeList($definition);
}
return $this->listWidgets;
} | php | public function makeLists()
{
foreach ($this->listDefinitions as $definition => $config) {
$this->listWidgets[$definition] = $this->makeList($definition);
}
return $this->listWidgets;
} | [
"public",
"function",
"makeLists",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listDefinitions",
"as",
"$",
"definition",
"=>",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"listWidgets",
"[",
"$",
"definition",
"]",
"=",
"$",
"this",
"->",
"make... | Creates all the list widgets based on the definitions.
@return array | [
"Creates",
"all",
"the",
"list",
"widgets",
"based",
"on",
"the",
"definitions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L101-L108 |
208,430 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.index | public function index()
{
$this->controller->pageTitle = $this->controller->pageTitle ?: Lang::get($this->getConfig(
'title',
'backend::lang.list.default_title'
));
$this->controller->bodyClass = 'slim-container';
$this->makeLists();
} | php | public function index()
{
$this->controller->pageTitle = $this->controller->pageTitle ?: Lang::get($this->getConfig(
'title',
'backend::lang.list.default_title'
));
$this->controller->bodyClass = 'slim-container';
$this->makeLists();
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"pageTitle",
"=",
"$",
"this",
"->",
"controller",
"->",
"pageTitle",
"?",
":",
"Lang",
"::",
"get",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'title'",
",",
"'backen... | Index Controller action.
@return void | [
"Index",
"Controller",
"action",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L271-L279 |
208,431 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.index_onDelete | public function index_onDelete()
{
if (method_exists($this->controller, 'onDelete')) {
return call_user_func_array([$this->controller, 'onDelete'], func_get_args());
}
/*
* Validate checked identifiers
*/
$checkedIds = post('checked');
if (!$ch... | php | public function index_onDelete()
{
if (method_exists($this->controller, 'onDelete')) {
return call_user_func_array([$this->controller, 'onDelete'], func_get_args());
}
/*
* Validate checked identifiers
*/
$checkedIds = post('checked');
if (!$ch... | [
"public",
"function",
"index_onDelete",
"(",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"controller",
",",
"'onDelete'",
")",
")",
"{",
"return",
"call_user_func_array",
"(",
"[",
"$",
"this",
"->",
"controller",
",",
"'onDelete'",
"]",
... | Bulk delete records.
@return void | [
"Bulk",
"delete",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L285-L345 |
208,432 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.listRender | public function listRender($definition = null)
{
if (!count($this->listWidgets)) {
throw new ApplicationException(Lang::get('backend::lang.list.behavior_not_ready'));
}
if (!$definition || !isset($this->listDefinitions[$definition])) {
$definition = $this->primaryDef... | php | public function listRender($definition = null)
{
if (!count($this->listWidgets)) {
throw new ApplicationException(Lang::get('backend::lang.list.behavior_not_ready'));
}
if (!$definition || !isset($this->listDefinitions[$definition])) {
$definition = $this->primaryDef... | [
"public",
"function",
"listRender",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"listWidgets",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"Lang",
"::",
"get",
"(",
"'backend::lang.list.be... | Renders the widget collection.
@param string $definition Optional list definition.
@return string Rendered HTML for the list. | [
"Renders",
"the",
"widget",
"collection",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L352-L381 |
208,433 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.listMakePartial | public function listMakePartial($partial, $params = [])
{
$contents = $this->controller->makePartial('list_'.$partial, $params + $this->vars, false);
if (!$contents) {
$contents = $this->makePartial($partial, $params);
}
return $contents;
} | php | public function listMakePartial($partial, $params = [])
{
$contents = $this->controller->makePartial('list_'.$partial, $params + $this->vars, false);
if (!$contents) {
$contents = $this->makePartial($partial, $params);
}
return $contents;
} | [
"public",
"function",
"listMakePartial",
"(",
"$",
"partial",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"controller",
"->",
"makePartial",
"(",
"'list_'",
".",
"$",
"partial",
",",
"$",
"params",
"+",
"$",
... | Controller accessor for making partials within this behavior.
@param string $partial
@param array $params
@return string Partial contents | [
"Controller",
"accessor",
"for",
"making",
"partials",
"within",
"this",
"behavior",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L389-L397 |
208,434 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.listRefresh | public function listRefresh($definition = null)
{
if (!count($this->listWidgets)) {
$this->makeLists();
}
if (!$definition || !isset($this->listDefinitions[$definition])) {
$definition = $this->primaryDefinition;
}
return $this->listWidgets[$definiti... | php | public function listRefresh($definition = null)
{
if (!count($this->listWidgets)) {
$this->makeLists();
}
if (!$definition || !isset($this->listDefinitions[$definition])) {
$definition = $this->primaryDefinition;
}
return $this->listWidgets[$definiti... | [
"public",
"function",
"listRefresh",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"listWidgets",
")",
")",
"{",
"$",
"this",
"->",
"makeLists",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"definition"... | Refreshes the list container only, useful for returning in custom AJAX requests.
@param string $definition Optional list definition.
@return array The list element selector as the key, and the list contents are the value. | [
"Refreshes",
"the",
"list",
"container",
"only",
"useful",
"for",
"returning",
"in",
"custom",
"AJAX",
"requests",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L404-L415 |
208,435 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.listGetWidget | public function listGetWidget($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
return array_get($this->listWidgets, $definition);
} | php | public function listGetWidget($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
return array_get($this->listWidgets, $definition);
} | [
"public",
"function",
"listGetWidget",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"definition",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"primaryDefinition",
";",
"}",
"return",
"array_get",
"(",
"$",
"this",
"->",
... | Returns the widget used by this behavior.
@return \Backend\Classes\WidgetBase | [
"Returns",
"the",
"widget",
"used",
"by",
"this",
"behavior",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L421-L428 |
208,436 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.listGetConfig | public function listGetConfig($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
if (!$config = array_get($this->listConfig, $definition)) {
$config = $this->listConfig[$definition] = $this->makeConfig($this->listDefinitions[$definiti... | php | public function listGetConfig($definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
}
if (!$config = array_get($this->listConfig, $definition)) {
$config = $this->listConfig[$definition] = $this->makeConfig($this->listDefinitions[$definiti... | [
"public",
"function",
"listGetConfig",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"definition",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"primaryDefinition",
";",
"}",
"if",
"(",
"!",
"$",
"config",
"=",
"array_get"... | Returns the configuration used by this behavior.
@return \Backend\Classes\WidgetBase | [
"Returns",
"the",
"configuration",
"used",
"by",
"this",
"behavior",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L434-L445 |
208,437 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.extendListColumns | public static function extendListColumns($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.list.extendColumns', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
}
... | php | public static function extendListColumns($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.list.extendColumns', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
}
... | [
"public",
"static",
"function",
"extendListColumns",
"(",
"$",
"callback",
")",
"{",
"$",
"calledClass",
"=",
"self",
"::",
"getCalledExtensionClass",
"(",
")",
";",
"Event",
"::",
"listen",
"(",
"'backend.list.extendColumns'",
",",
"function",
"(",
"$",
"widget... | Static helper for extending list columns.
@param callable $callback
@return void | [
"Static",
"helper",
"for",
"extending",
"list",
"columns",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L552-L561 |
208,438 | octobercms/october | modules/backend/behaviors/ListController.php | ListController.extendListFilterScopes | public static function extendListFilterScopes($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.filter.extendScopes', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
... | php | public static function extendListFilterScopes($callback)
{
$calledClass = self::getCalledExtensionClass();
Event::listen('backend.filter.extendScopes', function ($widget) use ($calledClass, $callback) {
if (!is_a($widget->getController(), $calledClass)) {
return;
... | [
"public",
"static",
"function",
"extendListFilterScopes",
"(",
"$",
"callback",
")",
"{",
"$",
"calledClass",
"=",
"self",
"::",
"getCalledExtensionClass",
"(",
")",
";",
"Event",
"::",
"listen",
"(",
"'backend.filter.extendScopes'",
",",
"function",
"(",
"$",
"... | Static helper for extending filter scopes.
@param callable $callback
@return void | [
"Static",
"helper",
"for",
"extending",
"filter",
"scopes",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ListController.php#L568-L577 |
208,439 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.loadComponents | protected function loadComponents()
{
/*
* Load module components
*/
foreach ($this->callbacks as $callback) {
$callback($this);
}
/*
* Load plugin components
*/
$pluginManager = PluginManager::instance();
$plugins = $p... | php | protected function loadComponents()
{
/*
* Load module components
*/
foreach ($this->callbacks as $callback) {
$callback($this);
}
/*
* Load plugin components
*/
$pluginManager = PluginManager::instance();
$plugins = $p... | [
"protected",
"function",
"loadComponents",
"(",
")",
"{",
"/*\n * Load module components\n */",
"foreach",
"(",
"$",
"this",
"->",
"callbacks",
"as",
"$",
"callback",
")",
"{",
"$",
"callback",
"(",
"$",
"this",
")",
";",
"}",
"/*\n * Load ... | Scans each plugin an loads it's components.
@return void | [
"Scans",
"each",
"plugin",
"an",
"loads",
"it",
"s",
"components",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L47-L72 |
208,440 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.registerComponent | public function registerComponent($className, $code = null, $plugin = null)
{
if (!$this->classMap) {
$this->classMap = [];
}
if (!$this->codeMap) {
$this->codeMap = [];
}
if (!$code) {
$code = Str::getClassId($className);
}
... | php | public function registerComponent($className, $code = null, $plugin = null)
{
if (!$this->classMap) {
$this->classMap = [];
}
if (!$this->codeMap) {
$this->codeMap = [];
}
if (!$code) {
$code = Str::getClassId($className);
}
... | [
"public",
"function",
"registerComponent",
"(",
"$",
"className",
",",
"$",
"code",
"=",
"null",
",",
"$",
"plugin",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"classMap",
")",
"{",
"$",
"this",
"->",
"classMap",
"=",
"[",
"]",
";",
... | Registers a single component. | [
"Registers",
"a",
"single",
"component",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L93-L120 |
208,441 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.listComponentDetails | public function listComponentDetails()
{
if ($this->detailsCache !== null) {
return $this->detailsCache;
}
$details = [];
foreach ($this->listComponents() as $componentAlias => $componentClass) {
$details[$componentAlias] = $this->makeComponent($componentClas... | php | public function listComponentDetails()
{
if ($this->detailsCache !== null) {
return $this->detailsCache;
}
$details = [];
foreach ($this->listComponents() as $componentAlias => $componentClass) {
$details[$componentAlias] = $this->makeComponent($componentClas... | [
"public",
"function",
"listComponentDetails",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"detailsCache",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"detailsCache",
";",
"}",
"$",
"details",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Returns an array of all component detail definitions.
@return array Array keys are component codes, values are the details defined in the component. | [
"Returns",
"an",
"array",
"of",
"all",
"component",
"detail",
"definitions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L139-L151 |
208,442 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.resolve | public function resolve($name)
{
$codes = $this->listComponents();
if (isset($codes[$name])) {
return $codes[$name];
}
$name = Str::normalizeClassName($name);
if (isset($this->classMap[$name])) {
return $name;
}
return null;
} | php | public function resolve($name)
{
$codes = $this->listComponents();
if (isset($codes[$name])) {
return $codes[$name];
}
$name = Str::normalizeClassName($name);
if (isset($this->classMap[$name])) {
return $name;
}
return null;
} | [
"public",
"function",
"resolve",
"(",
"$",
"name",
")",
"{",
"$",
"codes",
"=",
"$",
"this",
"->",
"listComponents",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"codes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"codes",
"[",
"$",
"... | Returns a class name from a component code
Normalizes a class name or converts an code to it's class name.
@return string The class name resolved, or null. | [
"Returns",
"a",
"class",
"name",
"from",
"a",
"component",
"code",
"Normalizes",
"a",
"class",
"name",
"or",
"converts",
"an",
"code",
"to",
"it",
"s",
"class",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L158-L172 |
208,443 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.hasComponent | public function hasComponent($name)
{
$className = $this->resolve($name);
if (!$className) {
return false;
}
return isset($this->classMap[$className]);
} | php | public function hasComponent($name)
{
$className = $this->resolve($name);
if (!$className) {
return false;
}
return isset($this->classMap[$className]);
} | [
"public",
"function",
"hasComponent",
"(",
"$",
"name",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"resolve",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"className",
")",
"{",
"return",
"false",
";",
"}",
"return",
"isset",
"(",
"$",... | Checks to see if a component has been registered.
@param string $name A component class name or code.
@return bool Returns true if the component is registered, otherwise false. | [
"Checks",
"to",
"see",
"if",
"a",
"component",
"has",
"been",
"registered",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L179-L187 |
208,444 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.makeComponent | public function makeComponent($name, $cmsObject = null, $properties = [])
{
$className = $this->resolve($name);
if (!$className) {
throw new SystemException(sprintf(
'Class name is not registered for the component "%s". Check the component plugin.',
$name
... | php | public function makeComponent($name, $cmsObject = null, $properties = [])
{
$className = $this->resolve($name);
if (!$className) {
throw new SystemException(sprintf(
'Class name is not registered for the component "%s". Check the component plugin.',
$name
... | [
"public",
"function",
"makeComponent",
"(",
"$",
"name",
",",
"$",
"cmsObject",
"=",
"null",
",",
"$",
"properties",
"=",
"[",
"]",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"resolve",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"c... | Makes a component object with properties set.
@param string $name A component class name or code.
@param CmsObject $cmsObject The Cms object that spawned this component.
@param array $properties The properties set by the Page or Layout.
@return ComponentBase The component object. | [
"Makes",
"a",
"component",
"object",
"with",
"properties",
"set",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L196-L217 |
208,445 | octobercms/october | modules/cms/classes/ComponentManager.php | ComponentManager.findComponentPlugin | public function findComponentPlugin($component)
{
$className = Str::normalizeClassName(get_class($component));
if (isset($this->pluginMap[$className])) {
return $this->pluginMap[$className];
}
return null;
} | php | public function findComponentPlugin($component)
{
$className = Str::normalizeClassName(get_class($component));
if (isset($this->pluginMap[$className])) {
return $this->pluginMap[$className];
}
return null;
} | [
"public",
"function",
"findComponentPlugin",
"(",
"$",
"component",
")",
"{",
"$",
"className",
"=",
"Str",
"::",
"normalizeClassName",
"(",
"get_class",
"(",
"$",
"component",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"pluginMap",
"[",
... | Returns a parent plugin for a specific component object.
@param mixed $component A component to find the plugin for.
@return mixed Returns the plugin object or null. | [
"Returns",
"a",
"parent",
"plugin",
"for",
"a",
"specific",
"component",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/ComponentManager.php#L224-L232 |
208,446 | octobercms/october | modules/system/classes/MediaLibraryItem.php | MediaLibraryItem.sizeToString | public function sizeToString()
{
return $this->type == self::TYPE_FILE
? File::sizeToString($this->size)
: $this->size.' '.trans('system::lang.media.folder_size_items');
} | php | public function sizeToString()
{
return $this->type == self::TYPE_FILE
? File::sizeToString($this->size)
: $this->size.' '.trans('system::lang.media.folder_size_items');
} | [
"public",
"function",
"sizeToString",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"type",
"==",
"self",
"::",
"TYPE_FILE",
"?",
"File",
"::",
"sizeToString",
"(",
"$",
"this",
"->",
"size",
")",
":",
"$",
"this",
"->",
"size",
".",
"' '",
".",
"trans... | Returns the item size as string.
For file-type items the size is the number of bytes. For folder-type items
the size is the number of items contained by the item.
@return string Returns the size as string. | [
"Returns",
"the",
"item",
"size",
"as",
"string",
".",
"For",
"file",
"-",
"type",
"items",
"the",
"size",
"is",
"the",
"number",
"of",
"bytes",
".",
"For",
"folder",
"-",
"type",
"items",
"the",
"size",
"is",
"the",
"number",
"of",
"items",
"contained... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MediaLibraryItem.php#L136-L141 |
208,447 | octobercms/october | modules/backend/classes/ListColumn.php | ListColumn.getId | public function getId($suffix = null)
{
$id = 'column';
$id .= '-'.$this->columnName;
if ($suffix) {
$id .= '-'.$suffix;
}
return HtmlHelper::nameToId($id);
} | php | public function getId($suffix = null)
{
$id = 'column';
$id .= '-'.$this->columnName;
if ($suffix) {
$id .= '-'.$suffix;
}
return HtmlHelper::nameToId($id);
} | [
"public",
"function",
"getId",
"(",
"$",
"suffix",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"'column'",
";",
"$",
"id",
".=",
"'-'",
".",
"$",
"this",
"->",
"columnName",
";",
"if",
"(",
"$",
"suffix",
")",
"{",
"$",
"id",
".=",
"'-'",
".",
"$",
... | Returns a value suitable for the column id property.
@param string $suffix Specify a suffix string
@return string | [
"Returns",
"a",
"value",
"suitable",
"for",
"the",
"column",
"id",
"property",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/ListColumn.php#L192-L203 |
208,448 | octobercms/october | modules/backend/classes/ListColumn.php | ListColumn.getValueFromData | public function getValueFromData($data, $default = null)
{
$columnName = $this->valueFrom ?: $this->columnName;
return $this->getColumnNameFromData($columnName, $data, $default);
} | php | public function getValueFromData($data, $default = null)
{
$columnName = $this->valueFrom ?: $this->columnName;
return $this->getColumnNameFromData($columnName, $data, $default);
} | [
"public",
"function",
"getValueFromData",
"(",
"$",
"data",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"columnName",
"=",
"$",
"this",
"->",
"valueFrom",
"?",
":",
"$",
"this",
"->",
"columnName",
";",
"return",
"$",
"this",
"->",
"getColumnNameFro... | Returns this columns value from a supplied data set, which can be
an array or a model or another generic collection.
@param mixed $data
@param mixed $default
@return mixed | [
"Returns",
"this",
"columns",
"value",
"from",
"a",
"supplied",
"data",
"set",
"which",
"can",
"be",
"an",
"array",
"or",
"a",
"model",
"or",
"another",
"generic",
"collection",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/ListColumn.php#L221-L225 |
208,449 | octobercms/october | modules/backend/classes/ListColumn.php | ListColumn.getColumnNameFromData | protected function getColumnNameFromData($columnName, $data, $default = null)
{
/*
* Array column name, eg: column[key][key2][key3]
*/
$keyParts = HtmlHelper::nameToArray($columnName);
$result = $data;
/*
* Loop the column key parts and build a value.
... | php | protected function getColumnNameFromData($columnName, $data, $default = null)
{
/*
* Array column name, eg: column[key][key2][key3]
*/
$keyParts = HtmlHelper::nameToArray($columnName);
$result = $data;
/*
* Loop the column key parts and build a value.
... | [
"protected",
"function",
"getColumnNameFromData",
"(",
"$",
"columnName",
",",
"$",
"data",
",",
"$",
"default",
"=",
"null",
")",
"{",
"/*\n * Array column name, eg: column[key][key2][key3]\n */",
"$",
"keyParts",
"=",
"HtmlHelper",
"::",
"nameToArray",
... | Internal method to extract the value of a column name from a data set.
@param string $columnName
@param mixed $data
@param mixed $default
@return mixed | [
"Internal",
"method",
"to",
"extract",
"the",
"value",
"of",
"a",
"column",
"name",
"from",
"a",
"data",
"set",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/ListColumn.php#L234-L264 |
208,450 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.validateField | protected function validateField($field = null)
{
$field = $field ?: post(self::PARAM_FIELD);
if ($field && $field != $this->field) {
$this->initRelation($this->model, $field);
}
if (!$field && !$this->field) {
throw new ApplicationException(Lang::get('backe... | php | protected function validateField($field = null)
{
$field = $field ?: post(self::PARAM_FIELD);
if ($field && $field != $this->field) {
$this->initRelation($this->model, $field);
}
if (!$field && !$this->field) {
throw new ApplicationException(Lang::get('backe... | [
"protected",
"function",
"validateField",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"field",
"=",
"$",
"field",
"?",
":",
"post",
"(",
"self",
"::",
"PARAM_FIELD",
")",
";",
"if",
"(",
"$",
"field",
"&&",
"$",
"field",
"!=",
"$",
"this",
"->",... | Validates the supplied field and initializes the relation manager.
@param string $field The relationship field.
@return string The active field name. | [
"Validates",
"the",
"supplied",
"field",
"and",
"initializes",
"the",
"relation",
"manager",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L225-L238 |
208,451 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.relationRender | public function relationRender($field, $options = [])
{
/*
* Session key
*/
if (is_string($options)) {
$options = ['sessionKey' => $options];
}
if (isset($options['sessionKey'])) {
$this->sessionKey = $options['sessionKey'];
}
... | php | public function relationRender($field, $options = [])
{
/*
* Session key
*/
if (is_string($options)) {
$options = ['sessionKey' => $options];
}
if (isset($options['sessionKey'])) {
$this->sessionKey = $options['sessionKey'];
}
... | [
"public",
"function",
"relationRender",
"(",
"$",
"field",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"/*\n * Session key\n */",
"if",
"(",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"$",
"options",
"=",
"[",
"'sessionKey'",
"=>",
... | Renders the relationship manager.
@param string $field The relationship field.
@param array $options
@return string Rendered HTML for the relationship manager. | [
"Renders",
"the",
"relationship",
"manager",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L393-L434 |
208,452 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.relationRefresh | public function relationRefresh($field = null)
{
$field = $this->validateField($field);
$result = ['#'.$this->relationGetId('view') => $this->relationRenderView($field)];
if ($toolbar = $this->relationRenderToolbar($field)) {
$result['#'.$this->relationGetId('toolbar')] = $toolb... | php | public function relationRefresh($field = null)
{
$field = $this->validateField($field);
$result = ['#'.$this->relationGetId('view') => $this->relationRenderView($field)];
if ($toolbar = $this->relationRenderToolbar($field)) {
$result['#'.$this->relationGetId('toolbar')] = $toolb... | [
"public",
"function",
"relationRefresh",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"validateField",
"(",
"$",
"field",
")",
";",
"$",
"result",
"=",
"[",
"'#'",
".",
"$",
"this",
"->",
"relationGetId",
"(",
"'vie... | Refreshes the relation container only, useful for returning in custom AJAX requests.
@param string $field Relation definition.
@return array The relation element selector as the key, and the relation view contents are the value. | [
"Refreshes",
"the",
"relation",
"container",
"only",
"useful",
"for",
"returning",
"in",
"custom",
"AJAX",
"requests",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L441-L455 |
208,453 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.relationGetId | public function relationGetId($suffix = null)
{
$id = class_basename($this);
if ($this->field) {
$id .= '-' . $this->field;
}
if ($suffix !== null) {
$id .= '-' . $suffix;
}
return $this->controller->getId($id);
} | php | public function relationGetId($suffix = null)
{
$id = class_basename($this);
if ($this->field) {
$id .= '-' . $this->field;
}
if ($suffix !== null) {
$id .= '-' . $suffix;
}
return $this->controller->getId($id);
} | [
"public",
"function",
"relationGetId",
"(",
"$",
"suffix",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"class_basename",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"this",
"->",
"field",
")",
"{",
"$",
"id",
".=",
"'-'",
".",
"$",
"this",
"->",
"fiel... | Returns a unique ID for this relation and field combination.
@param string $suffix A suffix to use with the identifier.
@return string | [
"Returns",
"a",
"unique",
"ID",
"for",
"this",
"relation",
"and",
"field",
"combination",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L498-L510 |
208,454 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageCreate | public function onRelationManageCreate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey(true) : null;
if ($this->viewMode == 'multi') {
$n... | php | public function onRelationManageCreate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey(true) : null;
if ($this->viewMode == 'multi') {
$n... | [
"public",
"function",
"onRelationManageCreate",
"(",
")",
"{",
"$",
"this",
"->",
"forceManageMode",
"=",
"'form'",
";",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"$",
"saveData",
"=",
"$",
"this",
"->",
"manageWidget",
"->",
"getSaveData",
"(",
")",... | Create a new related model | [
"Create",
"a",
"new",
"related",
"model"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L998-L1053 |
208,455 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageUpdate | public function onRelationManageUpdate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
if ($this->viewMode == 'multi') {
$model = $this->relationModel->find($this->manageId);
$modelsToSave = $this->pre... | php | public function onRelationManageUpdate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
if ($this->viewMode == 'multi') {
$model = $this->relationModel->find($this->manageId);
$modelsToSave = $this->pre... | [
"public",
"function",
"onRelationManageUpdate",
"(",
")",
"{",
"$",
"this",
"->",
"forceManageMode",
"=",
"'form'",
";",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"$",
"saveData",
"=",
"$",
"this",
"->",
"manageWidget",
"->",
"getSaveData",
"(",
")",... | Updated an existing related model's fields | [
"Updated",
"an",
"existing",
"related",
"model",
"s",
"fields"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1058-L1077 |
208,456 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageDelete | public function onRelationManageDelete()
{
$this->beforeAjax();
/*
* Multiple (has many, belongs to many)
*/
if ($this->viewMode == 'multi') {
if (($checkedIds = post('checked')) && is_array($checkedIds)) {
foreach ($checkedIds as $relationId) ... | php | public function onRelationManageDelete()
{
$this->beforeAjax();
/*
* Multiple (has many, belongs to many)
*/
if ($this->viewMode == 'multi') {
if (($checkedIds = post('checked')) && is_array($checkedIds)) {
foreach ($checkedIds as $relationId) ... | [
"public",
"function",
"onRelationManageDelete",
"(",
")",
"{",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"/*\n * Multiple (has many, belongs to many)\n */",
"if",
"(",
"$",
"this",
"->",
"viewMode",
"==",
"'multi'",
")",
"{",
"if",
"(",
"(",
... | Delete an existing related model completely | [
"Delete",
"an",
"existing",
"related",
"model",
"completely"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1082-L1114 |
208,457 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageAdd | public function onRelationManageAdd()
{
$this->beforeAjax();
$recordId = post('record_id');
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
/*
* Add
*/
if ($this->viewMode == 'multi') {
$checkedIds = $recordId ? [... | php | public function onRelationManageAdd()
{
$this->beforeAjax();
$recordId = post('record_id');
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
/*
* Add
*/
if ($this->viewMode == 'multi') {
$checkedIds = $recordId ? [... | [
"public",
"function",
"onRelationManageAdd",
"(",
")",
"{",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"$",
"recordId",
"=",
"post",
"(",
"'record_id'",
")",
";",
"$",
"sessionKey",
"=",
"$",
"this",
"->",
"deferredBinding",
"?",
"$",
"this",
"->",
... | Add an existing related model to the primary model | [
"Add",
"an",
"existing",
"related",
"model",
"to",
"the",
"primary",
"model"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1119-L1172 |
208,458 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.onRelationManageRemove | public function onRelationManageRemove()
{
$this->beforeAjax();
$recordId = post('record_id');
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
$relatedModel = $this->relationModel;
/*
* Remove
*/
if ($this->viewMode ==... | php | public function onRelationManageRemove()
{
$this->beforeAjax();
$recordId = post('record_id');
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
$relatedModel = $this->relationModel;
/*
* Remove
*/
if ($this->viewMode ==... | [
"public",
"function",
"onRelationManageRemove",
"(",
")",
"{",
"$",
"this",
"->",
"beforeAjax",
"(",
")",
";",
"$",
"recordId",
"=",
"post",
"(",
"'record_id'",
")",
";",
"$",
"sessionKey",
"=",
"$",
"this",
"->",
"deferredBinding",
"?",
"$",
"this",
"->... | Remove an existing related model from the primary model | [
"Remove",
"an",
"existing",
"related",
"model",
"from",
"the",
"primary",
"model"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1177-L1222 |
208,459 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.findExistingRelationIds | protected function findExistingRelationIds($checkIds = null)
{
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
$results = $this->relationObject
->getBaseQuery()
->select($foreignKeyName);
if ($checkIds !== null && is_array($checkIds) && count($checkId... | php | protected function findExistingRelationIds($checkIds = null)
{
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
$results = $this->relationObject
->getBaseQuery()
->select($foreignKeyName);
if ($checkIds !== null && is_array($checkIds) && count($checkId... | [
"protected",
"function",
"findExistingRelationIds",
"(",
"$",
"checkIds",
"=",
"null",
")",
"{",
"$",
"foreignKeyName",
"=",
"$",
"this",
"->",
"relationModel",
"->",
"getQualifiedKeyName",
"(",
")",
";",
"$",
"results",
"=",
"$",
"this",
"->",
"relationObject... | Returns the existing record IDs for the relation. | [
"Returns",
"the",
"existing",
"record",
"IDs",
"for",
"the",
"relation",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1354-L1367 |
208,460 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.evalToolbarButtons | protected function evalToolbarButtons()
{
$buttons = $this->getConfig('view[toolbarButtons]');
if ($buttons === false) {
return null;
}
elseif (is_string($buttons)) {
return array_map('trim', explode('|', $buttons));
}
elseif (is_array($button... | php | protected function evalToolbarButtons()
{
$buttons = $this->getConfig('view[toolbarButtons]');
if ($buttons === false) {
return null;
}
elseif (is_string($buttons)) {
return array_map('trim', explode('|', $buttons));
}
elseif (is_array($button... | [
"protected",
"function",
"evalToolbarButtons",
"(",
")",
"{",
"$",
"buttons",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'view[toolbarButtons]'",
")",
";",
"if",
"(",
"$",
"buttons",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"elseif",
"(",
"i... | Determine the default buttons based on the model relationship type.
@return string | [
"Determine",
"the",
"default",
"buttons",
"based",
"on",
"the",
"model",
"relationship",
"type",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1373-L1404 |
208,461 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.evalManageTitle | protected function evalManageTitle()
{
if ($customTitle = $this->getConfig('manage[title]')) {
return $customTitle;
}
switch ($this->manageMode) {
case 'pivot':
case 'list':
if ($this->eventTarget == 'button-link') {
re... | php | protected function evalManageTitle()
{
if ($customTitle = $this->getConfig('manage[title]')) {
return $customTitle;
}
switch ($this->manageMode) {
case 'pivot':
case 'list':
if ($this->eventTarget == 'button-link') {
re... | [
"protected",
"function",
"evalManageTitle",
"(",
")",
"{",
"if",
"(",
"$",
"customTitle",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'manage[title]'",
")",
")",
"{",
"return",
"$",
"customTitle",
";",
"}",
"switch",
"(",
"$",
"this",
"->",
"manageMode",
... | Determine the management mode popup title.
@return string | [
"Determine",
"the",
"management",
"mode",
"popup",
"title",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1435-L1460 |
208,462 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.evalManageMode | protected function evalManageMode()
{
if ($mode = post(self::PARAM_MODE)) {
return $mode;
}
if ($this->forceManageMode) {
return $this->forceManageMode;
}
switch ($this->eventTarget) {
case 'button-create':
case 'button-update... | php | protected function evalManageMode()
{
if ($mode = post(self::PARAM_MODE)) {
return $mode;
}
if ($this->forceManageMode) {
return $this->forceManageMode;
}
switch ($this->eventTarget) {
case 'button-create':
case 'button-update... | [
"protected",
"function",
"evalManageMode",
"(",
")",
"{",
"if",
"(",
"$",
"mode",
"=",
"post",
"(",
"self",
"::",
"PARAM_MODE",
")",
")",
"{",
"return",
"$",
"mode",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"forceManageMode",
")",
"{",
"return",
"$",
... | Determine the management mode based on the relation type and settings.
@return string | [
"Determine",
"the",
"management",
"mode",
"based",
"on",
"the",
"relation",
"type",
"and",
"settings",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1466-L1512 |
208,463 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.evalFormContext | protected function evalFormContext($mode = 'manage', $exists = false)
{
$config = $this->config->{$mode} ?? [];
if (($context = array_get($config, 'context')) && is_array($context)) {
$context = $exists
? array_get($context, 'update')
: array_get($context... | php | protected function evalFormContext($mode = 'manage', $exists = false)
{
$config = $this->config->{$mode} ?? [];
if (($context = array_get($config, 'context')) && is_array($context)) {
$context = $exists
? array_get($context, 'update')
: array_get($context... | [
"protected",
"function",
"evalFormContext",
"(",
"$",
"mode",
"=",
"'manage'",
",",
"$",
"exists",
"=",
"false",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"{",
"$",
"mode",
"}",
"??",
"[",
"]",
";",
"if",
"(",
"(",
"$",
"co... | Determine supplied form context. | [
"Determine",
"supplied",
"form",
"context",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1517-L1532 |
208,464 | octobercms/october | modules/backend/behaviors/RelationController.php | RelationController.applyExtraConfig | protected function applyExtraConfig($config, $field = null)
{
if (!$field) {
$field = $this->field;
}
if (!$config || !isset($this->originalConfig->{$field})) {
return;
}
if (
!is_array($config) &&
(!$config = @json_decode(@ba... | php | protected function applyExtraConfig($config, $field = null)
{
if (!$field) {
$field = $this->field;
}
if (!$config || !isset($this->originalConfig->{$field})) {
return;
}
if (
!is_array($config) &&
(!$config = @json_decode(@ba... | [
"protected",
"function",
"applyExtraConfig",
"(",
"$",
"config",
",",
"$",
"field",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"field",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"field",
";",
"}",
"if",
"(",
"!",
"$",
"config",
"||",
"!",
... | Apply extra configuration | [
"Apply",
"extra",
"configuration"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1537-L1561 |
208,465 | octobercms/october | modules/cms/models/MaintenanceSetting.php | MaintenanceSetting.beforeValidate | public function beforeValidate()
{
if (!$theme = Theme::getEditTheme()) {
throw new ApplicationException('Unable to find the active theme.');
}
$themeMap = $this->getSettingsValue('theme_map', []);
$themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page');
... | php | public function beforeValidate()
{
if (!$theme = Theme::getEditTheme()) {
throw new ApplicationException('Unable to find the active theme.');
}
$themeMap = $this->getSettingsValue('theme_map', []);
$themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page');
... | [
"public",
"function",
"beforeValidate",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"theme",
"=",
"Theme",
"::",
"getEditTheme",
"(",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"'Unable to find the active theme.'",
")",
";",
"}",
"$",
"themeMap",
"=... | Ensure each theme has its own CMS page, store it inside a mapping array.
@return void | [
"Ensure",
"each",
"theme",
"has",
"its",
"own",
"CMS",
"page",
"store",
"it",
"inside",
"a",
"mapping",
"array",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/MaintenanceSetting.php#L63-L72 |
208,466 | octobercms/october | modules/cms/models/MaintenanceSetting.php | MaintenanceSetting.afterFetch | public function afterFetch()
{
if (
($theme = Theme::getEditTheme())
&& ($themeMap = array_get($this->attributes, 'theme_map'))
&& ($cmsPage = array_get($themeMap, $theme->getDirName()))
) {
$this->cms_page = $cmsPage;
}
else {
... | php | public function afterFetch()
{
if (
($theme = Theme::getEditTheme())
&& ($themeMap = array_get($this->attributes, 'theme_map'))
&& ($cmsPage = array_get($themeMap, $theme->getDirName()))
) {
$this->cms_page = $cmsPage;
}
else {
... | [
"public",
"function",
"afterFetch",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"theme",
"=",
"Theme",
"::",
"getEditTheme",
"(",
")",
")",
"&&",
"(",
"$",
"themeMap",
"=",
"array_get",
"(",
"$",
"this",
"->",
"attributes",
",",
"'theme_map'",
")",
")",
"&&"... | Restore the CMS page found in the mapping array, or disable the
maintenance mode.
@return void | [
"Restore",
"the",
"CMS",
"page",
"found",
"in",
"the",
"mapping",
"array",
"or",
"disable",
"the",
"maintenance",
"mode",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/MaintenanceSetting.php#L79-L91 |
208,467 | octobercms/october | modules/cms/classes/PartialStack.php | PartialStack.stackPartial | public function stackPartial()
{
if ($this->activePartial !== null) {
array_unshift($this->partialStack, $this->activePartial);
}
$this->activePartial = [
'components' => []
];
} | php | public function stackPartial()
{
if ($this->activePartial !== null) {
array_unshift($this->partialStack, $this->activePartial);
}
$this->activePartial = [
'components' => []
];
} | [
"public",
"function",
"stackPartial",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"activePartial",
"!==",
"null",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"partialStack",
",",
"$",
"this",
"->",
"activePartial",
")",
";",
"}",
"$",
"this",
"... | Partial entry point, appends a new partial to the stack. | [
"Partial",
"entry",
"point",
"appends",
"a",
"new",
"partial",
"to",
"the",
"stack",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/PartialStack.php#L26-L35 |
208,468 | octobercms/october | modules/cms/classes/PartialStack.php | PartialStack.getComponent | public function getComponent($name)
{
if (!$this->activePartial) {
return null;
}
$component = $this->findComponentFromStack($name, $this->activePartial);
if ($component !== null) {
return $component;
}
foreach ($this->partialStack as $stack)... | php | public function getComponent($name)
{
if (!$this->activePartial) {
return null;
}
$component = $this->findComponentFromStack($name, $this->activePartial);
if ($component !== null) {
return $component;
}
foreach ($this->partialStack as $stack)... | [
"public",
"function",
"getComponent",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"activePartial",
")",
"{",
"return",
"null",
";",
"}",
"$",
"component",
"=",
"$",
"this",
"->",
"findComponentFromStack",
"(",
"$",
"name",
",",
"$",
... | Returns a component by its alias from the partial stack. | [
"Returns",
"a",
"component",
"by",
"its",
"alias",
"from",
"the",
"partial",
"stack",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/PartialStack.php#L59-L78 |
208,469 | octobercms/october | modules/cms/classes/PartialStack.php | PartialStack.findComponentFromStack | protected function findComponentFromStack($name, $stack)
{
foreach ($stack['components'] as $componentInfo) {
if ($componentInfo['name'] == $name) {
return $componentInfo['obj'];
}
}
return null;
} | php | protected function findComponentFromStack($name, $stack)
{
foreach ($stack['components'] as $componentInfo) {
if ($componentInfo['name'] == $name) {
return $componentInfo['obj'];
}
}
return null;
} | [
"protected",
"function",
"findComponentFromStack",
"(",
"$",
"name",
",",
"$",
"stack",
")",
"{",
"foreach",
"(",
"$",
"stack",
"[",
"'components'",
"]",
"as",
"$",
"componentInfo",
")",
"{",
"if",
"(",
"$",
"componentInfo",
"[",
"'name'",
"]",
"==",
"$"... | Locates a component by its alias from the supplied stack. | [
"Locates",
"a",
"component",
"by",
"its",
"alias",
"from",
"the",
"supplied",
"stack",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/PartialStack.php#L83-L92 |
208,470 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.init | protected function init()
{
$this->bindContainerObjects();
$this->metaFile = storage_path('cms/disabled.json');
$this->loadDisabled();
$this->loadPlugins();
if ($this->app->runningInBackend()) {
$this->loadDependencies();
}
} | php | protected function init()
{
$this->bindContainerObjects();
$this->metaFile = storage_path('cms/disabled.json');
$this->loadDisabled();
$this->loadPlugins();
if ($this->app->runningInBackend()) {
$this->loadDependencies();
}
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"bindContainerObjects",
"(",
")",
";",
"$",
"this",
"->",
"metaFile",
"=",
"storage_path",
"(",
"'cms/disabled.json'",
")",
";",
"$",
"this",
"->",
"loadDisabled",
"(",
")",
";",
"$",
"th... | Initializes the plugin manager | [
"Initializes",
"the",
"plugin",
"manager"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L74-L84 |
208,471 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.loadPlugin | public function loadPlugin($namespace, $path)
{
$className = $namespace.'\Plugin';
$classPath = $path.'/Plugin.php';
try {
// Autoloader failed?
if (!class_exists($className)) {
include_once $classPath;
}
// Not a valid plugin... | php | public function loadPlugin($namespace, $path)
{
$className = $namespace.'\Plugin';
$classPath = $path.'/Plugin.php';
try {
// Autoloader failed?
if (!class_exists($className)) {
include_once $classPath;
}
// Not a valid plugin... | [
"public",
"function",
"loadPlugin",
"(",
"$",
"namespace",
",",
"$",
"path",
")",
"{",
"$",
"className",
"=",
"$",
"namespace",
".",
"'\\Plugin'",
";",
"$",
"classPath",
"=",
"$",
"path",
".",
"'/Plugin.php'",
";",
"try",
"{",
"// Autoloader failed?",
"if"... | Loads a single plugin in to the manager.
@param string $namespace Eg: Acme\Blog
@param string $path Eg: plugins_path().'/acme/blog';
@return void | [
"Loads",
"a",
"single",
"plugin",
"in",
"to",
"the",
"manager",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L120-L160 |
208,472 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getPluginPath | public function getPluginPath($id)
{
$classId = $this->getIdentifier($id);
if (!isset($this->pathMap[$classId])) {
return null;
}
return File::normalizePath($this->pathMap[$classId]);
} | php | public function getPluginPath($id)
{
$classId = $this->getIdentifier($id);
if (!isset($this->pathMap[$classId])) {
return null;
}
return File::normalizePath($this->pathMap[$classId]);
} | [
"public",
"function",
"getPluginPath",
"(",
"$",
"id",
")",
"{",
"$",
"classId",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pathMap",
"[",
"$",
"classId",
"]",
")",
")",
"{... | Returns the directory path to a plugin | [
"Returns",
"the",
"directory",
"path",
"to",
"a",
"plugin"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L300-L308 |
208,473 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getPluginNamespaces | public function getPluginNamespaces()
{
$classNames = [];
foreach ($this->getVendorAndPluginNames() as $vendorName => $vendorList) {
foreach ($vendorList as $pluginName => $pluginPath) {
$namespace = '\\'.$vendorName.'\\'.$pluginName;
$namespace = Str::no... | php | public function getPluginNamespaces()
{
$classNames = [];
foreach ($this->getVendorAndPluginNames() as $vendorName => $vendorList) {
foreach ($vendorList as $pluginName => $pluginPath) {
$namespace = '\\'.$vendorName.'\\'.$pluginName;
$namespace = Str::no... | [
"public",
"function",
"getPluginNamespaces",
"(",
")",
"{",
"$",
"classNames",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getVendorAndPluginNames",
"(",
")",
"as",
"$",
"vendorName",
"=>",
"$",
"vendorList",
")",
"{",
"foreach",
"(",
"$",
"v... | Returns a flat array of vendor plugin namespaces and their paths | [
"Returns",
"a",
"flat",
"array",
"of",
"vendor",
"plugin",
"namespaces",
"and",
"their",
"paths"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L372-L385 |
208,474 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getVendorAndPluginNames | public function getVendorAndPluginNames()
{
$plugins = [];
$dirPath = plugins_path();
if (!File::isDirectory($dirPath)) {
return $plugins;
}
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dirPath, RecursiveDirectoryIterator::FOL... | php | public function getVendorAndPluginNames()
{
$plugins = [];
$dirPath = plugins_path();
if (!File::isDirectory($dirPath)) {
return $plugins;
}
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dirPath, RecursiveDirectoryIterator::FOL... | [
"public",
"function",
"getVendorAndPluginNames",
"(",
")",
"{",
"$",
"plugins",
"=",
"[",
"]",
";",
"$",
"dirPath",
"=",
"plugins_path",
"(",
")",
";",
"if",
"(",
"!",
"File",
"::",
"isDirectory",
"(",
"$",
"dirPath",
")",
")",
"{",
"return",
"$",
"p... | Returns a 2 dimensional array of vendors and their plugins. | [
"Returns",
"a",
"2",
"dimensional",
"array",
"of",
"vendors",
"and",
"their",
"plugins",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L390-L417 |
208,475 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getIdentifier | public function getIdentifier($namespace)
{
$namespace = Str::normalizeClassName($namespace);
if (strpos($namespace, '\\') === null) {
return $namespace;
}
$parts = explode('\\', $namespace);
$slice = array_slice($parts, 1, 2);
$namespace = implode('.', $... | php | public function getIdentifier($namespace)
{
$namespace = Str::normalizeClassName($namespace);
if (strpos($namespace, '\\') === null) {
return $namespace;
}
$parts = explode('\\', $namespace);
$slice = array_slice($parts, 1, 2);
$namespace = implode('.', $... | [
"public",
"function",
"getIdentifier",
"(",
"$",
"namespace",
")",
"{",
"$",
"namespace",
"=",
"Str",
"::",
"normalizeClassName",
"(",
"$",
"namespace",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"namespace",
",",
"'\\\\'",
")",
"===",
"null",
")",
"{",
... | Resolves a plugin identifier from a plugin class name or object.
@param mixed Plugin class name or object
@return string Identifier in format of Vendor.Plugin | [
"Resolves",
"a",
"plugin",
"identifier",
"from",
"a",
"plugin",
"class",
"name",
"or",
"object",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L424-L436 |
208,476 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getRegistrationMethodValues | public function getRegistrationMethodValues($methodName)
{
if (isset($this->registrationMethodCache[$methodName])) {
return $this->registrationMethodCache[$methodName];
}
$results = [];
$plugins = $this->getPlugins();
foreach ($plugins as $id => $plugin) {
... | php | public function getRegistrationMethodValues($methodName)
{
if (isset($this->registrationMethodCache[$methodName])) {
return $this->registrationMethodCache[$methodName];
}
$results = [];
$plugins = $this->getPlugins();
foreach ($plugins as $id => $plugin) {
... | [
"public",
"function",
"getRegistrationMethodValues",
"(",
"$",
"methodName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"registrationMethodCache",
"[",
"$",
"methodName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"registrationMethodCache",
"[... | Spins over every plugin object and collects the results of a method call.
@param string $methodName
@return array | [
"Spins",
"over",
"every",
"plugin",
"object",
"and",
"collects",
"the",
"results",
"of",
"a",
"method",
"call",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L459-L477 |
208,477 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.loadDisabled | protected function loadDisabled()
{
$path = $this->metaFile;
if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
foreach ($configDisabled as $disabled) {
$this->disabledPlugins[$disabled] = true;
}
}
if (... | php | protected function loadDisabled()
{
$path = $this->metaFile;
if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
foreach ($configDisabled as $disabled) {
$this->disabledPlugins[$disabled] = true;
}
}
if (... | [
"protected",
"function",
"loadDisabled",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"metaFile",
";",
"if",
"(",
"(",
"$",
"configDisabled",
"=",
"Config",
"::",
"get",
"(",
"'cms.disablePlugins'",
")",
")",
"&&",
"is_array",
"(",
"$",
"configDis... | Loads all disables plugins from the meta file. | [
"Loads",
"all",
"disables",
"plugins",
"from",
"the",
"meta",
"file",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L492-L510 |
208,478 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.isDisabled | public function isDisabled($id)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return true;
}
return false;
} | php | public function isDisabled($id)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return true;
}
return false;
} | [
"public",
"function",
"isDisabled",
"(",
"$",
"id",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"id",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"disabledPlugins",
")",
")",
"{",
... | Determines if a plugin is disabled by looking at the meta information
or the application configuration.
@return boolean | [
"Determines",
"if",
"a",
"plugin",
"is",
"disabled",
"by",
"looking",
"at",
"the",
"meta",
"information",
"or",
"the",
"application",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L517-L526 |
208,479 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.populateDisabledPluginsFromDb | protected function populateDisabledPluginsFromDb()
{
if (!App::hasDatabase()) {
return;
}
if (!Schema::hasTable('system_plugin_versions')) {
return;
}
$disabled = Db::table('system_plugin_versions')->where('is_disabled', 1)->lists('code');
f... | php | protected function populateDisabledPluginsFromDb()
{
if (!App::hasDatabase()) {
return;
}
if (!Schema::hasTable('system_plugin_versions')) {
return;
}
$disabled = Db::table('system_plugin_versions')->where('is_disabled', 1)->lists('code');
f... | [
"protected",
"function",
"populateDisabledPluginsFromDb",
"(",
")",
"{",
"if",
"(",
"!",
"App",
"::",
"hasDatabase",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"Schema",
"::",
"hasTable",
"(",
"'system_plugin_versions'",
")",
")",
"{",
"return... | Populates information about disabled plugins from database
@return void | [
"Populates",
"information",
"about",
"disabled",
"plugins",
"from",
"database"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L540-L555 |
208,480 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.disablePlugin | public function disablePlugin($id, $isUser = false)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return false;
}
$this->disabledPlugins[$code] = $isUser;
$this->writeDisabled();
if ($pluginObj = $this->findB... | php | public function disablePlugin($id, $isUser = false)
{
$code = $this->getIdentifier($id);
if (array_key_exists($code, $this->disabledPlugins)) {
return false;
}
$this->disabledPlugins[$code] = $isUser;
$this->writeDisabled();
if ($pluginObj = $this->findB... | [
"public",
"function",
"disablePlugin",
"(",
"$",
"id",
",",
"$",
"isUser",
"=",
"false",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"id",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"-... | Disables a single plugin in the system.
@param string $id Plugin code/namespace
@param bool $isUser Set to true if disabled by the user
@return bool | [
"Disables",
"a",
"single",
"plugin",
"in",
"the",
"system",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L563-L578 |
208,481 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.findMissingDependencies | public function findMissingDependencies()
{
$missing = [];
foreach ($this->plugins as $id => $plugin) {
if (!$required = $this->getDependencies($plugin)) {
continue;
}
foreach ($required as $require) {
if ($this->hasPlugin($requir... | php | public function findMissingDependencies()
{
$missing = [];
foreach ($this->plugins as $id => $plugin) {
if (!$required = $this->getDependencies($plugin)) {
continue;
}
foreach ($required as $require) {
if ($this->hasPlugin($requir... | [
"public",
"function",
"findMissingDependencies",
"(",
")",
"{",
"$",
"missing",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"plugins",
"as",
"$",
"id",
"=>",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"$",
"required",
"=",
"$",
"this",
"->... | Scans the system plugins to locate any dependencies that are not currently
installed. Returns an array of plugin codes that are needed.
PluginManager::instance()->findMissingDependencies();
@return array | [
"Scans",
"the",
"system",
"plugins",
"to",
"locate",
"any",
"dependencies",
"that",
"are",
"not",
"currently",
"installed",
".",
"Returns",
"an",
"array",
"of",
"plugin",
"codes",
"that",
"are",
"needed",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L620-L641 |
208,482 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.loadDependencies | protected function loadDependencies()
{
foreach ($this->plugins as $id => $plugin) {
if (!$required = $this->getDependencies($plugin)) {
continue;
}
$disable = false;
foreach ($required as $require) {
if (!$pluginObj = $this->... | php | protected function loadDependencies()
{
foreach ($this->plugins as $id => $plugin) {
if (!$required = $this->getDependencies($plugin)) {
continue;
}
$disable = false;
foreach ($required as $require) {
if (!$pluginObj = $this->... | [
"protected",
"function",
"loadDependencies",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"plugins",
"as",
"$",
"id",
"=>",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"$",
"required",
"=",
"$",
"this",
"->",
"getDependencies",
"(",
"$",
"plugin",
... | Cross checks all plugins and their dependancies, if not met plugins
are disabled and vice versa.
@return void | [
"Cross",
"checks",
"all",
"plugins",
"and",
"their",
"dependancies",
"if",
"not",
"met",
"plugins",
"are",
"disabled",
"and",
"vice",
"versa",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L648-L673 |
208,483 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.getDependencies | public function getDependencies($plugin)
{
if (is_string($plugin) && (!$plugin = $this->findByIdentifier($plugin))) {
return false;
}
if (!isset($plugin->require) || !$plugin->require) {
return null;
}
return is_array($plugin->require) ? $plugin->req... | php | public function getDependencies($plugin)
{
if (is_string($plugin) && (!$plugin = $this->findByIdentifier($plugin))) {
return false;
}
if (!isset($plugin->require) || !$plugin->require) {
return null;
}
return is_array($plugin->require) ? $plugin->req... | [
"public",
"function",
"getDependencies",
"(",
"$",
"plugin",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"plugin",
")",
"&&",
"(",
"!",
"$",
"plugin",
"=",
"$",
"this",
"->",
"findByIdentifier",
"(",
"$",
"plugin",
")",
")",
")",
"{",
"return",
"fals... | Returns the plugin identifiers that are required by the supplied plugin.
@param string $plugin Plugin identifier, object or class
@return array | [
"Returns",
"the",
"plugin",
"identifiers",
"that",
"are",
"required",
"by",
"the",
"supplied",
"plugin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L680-L691 |
208,484 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.sortByDependencies | public function sortByDependencies($plugins = null)
{
if (!is_array($plugins)) {
$plugins = $this->getPlugins();
}
$result = [];
$checklist = $plugins;
$loopCount = 0;
while (count($checklist)) {
if (++$loopCount > 999) {
thr... | php | public function sortByDependencies($plugins = null)
{
if (!is_array($plugins)) {
$plugins = $this->getPlugins();
}
$result = [];
$checklist = $plugins;
$loopCount = 0;
while (count($checklist)) {
if (++$loopCount > 999) {
thr... | [
"public",
"function",
"sortByDependencies",
"(",
"$",
"plugins",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"plugins",
")",
")",
"{",
"$",
"plugins",
"=",
"$",
"this",
"->",
"getPlugins",
"(",
")",
";",
"}",
"$",
"result",
"=",
"[... | Sorts a collection of plugins, in the order that they should be actioned,
according to their given dependencies. Least dependent come first.
@param array $plugins Object collection to sort, or null to sort all.
@return array Collection of sorted plugin identifiers | [
"Sorts",
"a",
"collection",
"of",
"plugins",
"in",
"the",
"order",
"that",
"they",
"should",
"be",
"actioned",
"according",
"to",
"their",
"given",
"dependencies",
".",
"Least",
"dependent",
"come",
"first",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L699-L752 |
208,485 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.deletePlugin | public function deletePlugin($id)
{
/*
* Rollback plugin
*/
UpdateManager::instance()->rollbackPlugin($id);
/*
* Delete from file system
*/
if ($pluginPath = self::instance()->getPluginPath($id)) {
File::deleteDirectory($pluginPath);
... | php | public function deletePlugin($id)
{
/*
* Rollback plugin
*/
UpdateManager::instance()->rollbackPlugin($id);
/*
* Delete from file system
*/
if ($pluginPath = self::instance()->getPluginPath($id)) {
File::deleteDirectory($pluginPath);
... | [
"public",
"function",
"deletePlugin",
"(",
"$",
"id",
")",
"{",
"/*\n * Rollback plugin\n */",
"UpdateManager",
"::",
"instance",
"(",
")",
"->",
"rollbackPlugin",
"(",
"$",
"id",
")",
";",
"/*\n * Delete from file system\n */",
"if",
"("... | Completely roll back and delete a plugin from the system.
@param string $id Plugin code/namespace
@return void | [
"Completely",
"roll",
"back",
"and",
"delete",
"a",
"plugin",
"from",
"the",
"system",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L763-L776 |
208,486 | octobercms/october | modules/system/classes/PluginManager.php | PluginManager.refreshPlugin | public function refreshPlugin($id)
{
$manager = UpdateManager::instance();
$manager->rollbackPlugin($id);
$manager->updatePlugin($id);
} | php | public function refreshPlugin($id)
{
$manager = UpdateManager::instance();
$manager->rollbackPlugin($id);
$manager->updatePlugin($id);
} | [
"public",
"function",
"refreshPlugin",
"(",
"$",
"id",
")",
"{",
"$",
"manager",
"=",
"UpdateManager",
"::",
"instance",
"(",
")",
";",
"$",
"manager",
"->",
"rollbackPlugin",
"(",
"$",
"id",
")",
";",
"$",
"manager",
"->",
"updatePlugin",
"(",
"$",
"i... | Tears down a plugin's database tables and rebuilds them.
@param string $id Plugin code/namespace
@return void | [
"Tears",
"down",
"a",
"plugin",
"s",
"database",
"tables",
"and",
"rebuilds",
"them",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginManager.php#L783-L788 |
208,487 | octobercms/october | modules/backend/helpers/Backend.php | Backend.url | public function url($path = null, $parameters = [], $secure = null)
{
return Url::to($this->uri() . '/' . $path, $parameters, $secure);
} | php | public function url($path = null, $parameters = [], $secure = null)
{
return Url::to($this->uri() . '/' . $path, $parameters, $secure);
} | [
"public",
"function",
"url",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Url",
"::",
"to",
"(",
"$",
"this",
"->",
"uri",
"(",
")",
".",
"'/'",
".",
"$",
"path",
... | Returns a URL in context of the Backend | [
"Returns",
"a",
"URL",
"in",
"context",
"of",
"the",
"Backend"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L32-L35 |
208,488 | octobercms/october | modules/backend/helpers/Backend.php | Backend.baseUrl | public function baseUrl($path = null)
{
$backendUri = $this->uri();
$baseUrl = Request::getBaseUrl();
if ($path === null) {
return $baseUrl . '/' . $backendUri;
}
$path = RouterHelper::normalizeUrl($path);
return $baseUrl . '/' . $backendUri . $path;
... | php | public function baseUrl($path = null)
{
$backendUri = $this->uri();
$baseUrl = Request::getBaseUrl();
if ($path === null) {
return $baseUrl . '/' . $backendUri;
}
$path = RouterHelper::normalizeUrl($path);
return $baseUrl . '/' . $backendUri . $path;
... | [
"public",
"function",
"baseUrl",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"backendUri",
"=",
"$",
"this",
"->",
"uri",
"(",
")",
";",
"$",
"baseUrl",
"=",
"Request",
"::",
"getBaseUrl",
"(",
")",
";",
"if",
"(",
"$",
"path",
"===",
"null",
"... | Returns the base backend URL | [
"Returns",
"the",
"base",
"backend",
"URL"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L40-L51 |
208,489 | octobercms/october | modules/backend/helpers/Backend.php | Backend.skinAsset | public function skinAsset($path = null)
{
$skinPath = Skin::getActive()->getPath($path, true);
return Url::asset($skinPath);
} | php | public function skinAsset($path = null)
{
$skinPath = Skin::getActive()->getPath($path, true);
return Url::asset($skinPath);
} | [
"public",
"function",
"skinAsset",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"skinPath",
"=",
"Skin",
"::",
"getActive",
"(",
")",
"->",
"getPath",
"(",
"$",
"path",
",",
"true",
")",
";",
"return",
"Url",
"::",
"asset",
"(",
"$",
"skinPath",
"... | Returns a URL in context of the active Backend skin | [
"Returns",
"a",
"URL",
"in",
"context",
"of",
"the",
"active",
"Backend",
"skin"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L56-L60 |
208,490 | octobercms/october | modules/backend/helpers/Backend.php | Backend.redirect | public function redirect($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::to($this->uri() . '/' . $path, $status, $headers, $secure);
} | php | public function redirect($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::to($this->uri() . '/' . $path, $status, $headers, $secure);
} | [
"public",
"function",
"redirect",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"to",
"(",
"$",
"this",
"->",
"uri",
"(",
")",
".",
"... | Create a new redirect response to a given backend path. | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"a",
"given",
"backend",
"path",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L65-L68 |
208,491 | octobercms/october | modules/backend/helpers/Backend.php | Backend.redirectGuest | public function redirectGuest($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::guest($this->uri() . '/' . $path, $status, $headers, $secure);
} | php | public function redirectGuest($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::guest($this->uri() . '/' . $path, $status, $headers, $secure);
} | [
"public",
"function",
"redirectGuest",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"guest",
"(",
"$",
"this",
"->",
"uri",
"(",
")",
... | Create a new backend redirect response, while putting the current URL in the session. | [
"Create",
"a",
"new",
"backend",
"redirect",
"response",
"while",
"putting",
"the",
"current",
"URL",
"in",
"the",
"session",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L73-L76 |
208,492 | octobercms/october | modules/backend/helpers/Backend.php | Backend.redirectIntended | public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
} | php | public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
{
return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
} | [
"public",
"function",
"redirectIntended",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"intended",
"(",
"$",
"this",
"->",
"uri",
"(",
"... | Create a new redirect response to the previously intended backend location. | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"the",
"previously",
"intended",
"backend",
"location",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/helpers/Backend.php#L81-L84 |
208,493 | octobercms/october | modules/system/controllers/EventLogs.php | EventLogs.preview | public function preview($id)
{
$this->addCss('/modules/system/assets/css/eventlogs/exception-beautifier.css', 'core');
$this->addJs('/modules/system/assets/js/eventlogs/exception-beautifier.js', 'core');
if (in_array(App::environment(), ['dev', 'local'])) {
$this->addJs('/module... | php | public function preview($id)
{
$this->addCss('/modules/system/assets/css/eventlogs/exception-beautifier.css', 'core');
$this->addJs('/modules/system/assets/js/eventlogs/exception-beautifier.js', 'core');
if (in_array(App::environment(), ['dev', 'local'])) {
$this->addJs('/module... | [
"public",
"function",
"preview",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"addCss",
"(",
"'/modules/system/assets/css/eventlogs/exception-beautifier.css'",
",",
"'core'",
")",
";",
"$",
"this",
"->",
"addJs",
"(",
"'/modules/system/assets/js/eventlogs/exception-beau... | Preview page action
@return void | [
"Preview",
"page",
"action"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/EventLogs.php#L87-L97 |
208,494 | octobercms/october | modules/backend/classes/Skin.php | Skin.getPath | public function getPath($path = null, $isPublic = false)
{
$path = RouterHelper::normalizeUrl($path);
$assetFile = $this->skinPath . $path;
if (File::isFile($assetFile)) {
return $isPublic
? $this->publicSkinPath . $path
: $this->skinPath . $path;... | php | public function getPath($path = null, $isPublic = false)
{
$path = RouterHelper::normalizeUrl($path);
$assetFile = $this->skinPath . $path;
if (File::isFile($assetFile)) {
return $isPublic
? $this->publicSkinPath . $path
: $this->skinPath . $path;... | [
"public",
"function",
"getPath",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"isPublic",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"RouterHelper",
"::",
"normalizeUrl",
"(",
"$",
"path",
")",
";",
"$",
"assetFile",
"=",
"$",
"this",
"->",
"skinPath",
".... | Looks up a path to a skin-based file, if it doesn't exist, the default path is used.
@param string $path
@param boolean $isPublic
@return string | [
"Looks",
"up",
"a",
"path",
"to",
"a",
"skin",
"-",
"based",
"file",
"if",
"it",
"doesn",
"t",
"exist",
"the",
"default",
"path",
"is",
"used",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Skin.php#L73-L87 |
208,495 | octobercms/october | modules/backend/classes/Skin.php | Skin.getActive | public static function getActive()
{
if (self::$skinCache !== null) {
return self::$skinCache;
}
$skinClass = Config::get('cms.backendSkin');
$skinObject = new $skinClass();
return self::$skinCache = $skinObject;
} | php | public static function getActive()
{
if (self::$skinCache !== null) {
return self::$skinCache;
}
$skinClass = Config::get('cms.backendSkin');
$skinObject = new $skinClass();
return self::$skinCache = $skinObject;
} | [
"public",
"static",
"function",
"getActive",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"skinCache",
"!==",
"null",
")",
"{",
"return",
"self",
"::",
"$",
"skinCache",
";",
"}",
"$",
"skinClass",
"=",
"Config",
"::",
"get",
"(",
"'cms.backendSkin'",
... | Returns the active skin. | [
"Returns",
"the",
"active",
"skin",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Skin.php#L101-L110 |
208,496 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.prepareVars | protected function prepareVars($model)
{
$this->controller->vars['formModel'] = $model;
$this->controller->vars['formContext'] = $this->formGetContext();
$this->controller->vars['formRecordName'] = Lang::get($this->getConfig('name', 'backend::lang.model.name'));
} | php | protected function prepareVars($model)
{
$this->controller->vars['formModel'] = $model;
$this->controller->vars['formContext'] = $this->formGetContext();
$this->controller->vars['formRecordName'] = Lang::get($this->getConfig('name', 'backend::lang.model.name'));
} | [
"protected",
"function",
"prepareVars",
"(",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"vars",
"[",
"'formModel'",
"]",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"controller",
"->",
"vars",
"[",
"'formContext'",
"]",
"=",
"$",
"th... | Prepares commonly used view data.
@param October\Rain\Database\Model $model | [
"Prepares",
"commonly",
"used",
"view",
"data",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L185-L190 |
208,497 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.create | public function create($context = null)
{
try {
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
"{$this->context}[title]",
... | php | public function create($context = null)
{
try {
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
"{$this->context}[title]",
... | [
"public",
"function",
"create",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"context",
"=",
"strlen",
"(",
"$",
"context",
")",
"?",
"$",
"context",
":",
"$",
"this",
"->",
"getConfig",
"(",
"'create[context]'",
",",
"s... | Controller "create" action used for creating new model records.
@param string $context Form context
@return void | [
"Controller",
"create",
"action",
"used",
"for",
"creating",
"new",
"model",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L202-L219 |
208,498 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.create_onSave | public function create_onSave($context = null)
{
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$model = $this->controller->formCreateModelObject();
$model = $this->controller->formExtendModel($model) ?: $model;
$this->init... | php | public function create_onSave($context = null)
{
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
$model = $this->controller->formCreateModelObject();
$model = $this->controller->formExtendModel($model) ?: $model;
$this->init... | [
"public",
"function",
"create_onSave",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"strlen",
"(",
"$",
"context",
")",
"?",
"$",
"context",
":",
"$",
"this",
"->",
"getConfig",
"(",
"'create[context]'",
",",
"self",
"... | AJAX handler "onSave" called from the create action and
primarily used for creating new records.
This handler will invoke the unique controller overrides
`formBeforeCreate` and `formAfterCreate`.
@param string $context Form context
@return mixed | [
"AJAX",
"handler",
"onSave",
"called",
"from",
"the",
"create",
"action",
"and",
"primarily",
"used",
"for",
"creating",
"new",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L231-L258 |
208,499 | octobercms/october | modules/backend/behaviors/FormController.php | FormController.update_onSave | public function update_onSave($recordId = null, $context = null)
{
$this->context = strlen($context) ? $context : $this->getConfig('update[context]', self::CONTEXT_UPDATE);
$model = $this->controller->formFindModelObject($recordId);
$this->initForm($model);
$this->controller->formBe... | php | public function update_onSave($recordId = null, $context = null)
{
$this->context = strlen($context) ? $context : $this->getConfig('update[context]', self::CONTEXT_UPDATE);
$model = $this->controller->formFindModelObject($recordId);
$this->initForm($model);
$this->controller->formBe... | [
"public",
"function",
"update_onSave",
"(",
"$",
"recordId",
"=",
"null",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"strlen",
"(",
"$",
"context",
")",
"?",
"$",
"context",
":",
"$",
"this",
"->",
"getConfig",
"("... | AJAX handler "onSave" called from the update action and
primarily used for updating existing records.
This handler will invoke the unique controller overrides
`formBeforeUpdate` and `formAfterUpdate`.
@param int $recordId Record identifier
@param string $context Form context
@return mixed | [
"AJAX",
"handler",
"onSave",
"called",
"from",
"the",
"update",
"action",
"and",
"primarily",
"used",
"for",
"updating",
"existing",
"records",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/FormController.php#L301-L325 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.