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,200 | octobercms/october | modules/cms/controllers/Index.php | Index.onDelete | public function onDelete()
{
$this->validateRequestTheme();
$type = Request::input('templateType');
$this->loadTemplate($type, trim(Request::input('templatePath')))->delete();
/*
* Extensibility - documented above
*/
$this->fireSystemEvent('cms.template.d... | php | public function onDelete()
{
$this->validateRequestTheme();
$type = Request::input('templateType');
$this->loadTemplate($type, trim(Request::input('templatePath')))->delete();
/*
* Extensibility - documented above
*/
$this->fireSystemEvent('cms.template.d... | [
"public",
"function",
"onDelete",
"(",
")",
"{",
"$",
"this",
"->",
"validateRequestTheme",
"(",
")",
";",
"$",
"type",
"=",
"Request",
"::",
"input",
"(",
"'templateType'",
")",
";",
"$",
"this",
"->",
"loadTemplate",
"(",
"$",
"type",
",",
"trim",
"(... | Deletes a template
@return void | [
"Deletes",
"a",
"template"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L336-L348 |
208,201 | octobercms/october | modules/cms/controllers/Index.php | Index.onGetTemplateList | public function onGetTemplateList()
{
$this->validateRequestTheme();
$page = Page::inTheme($this->theme);
return [
'layouts' => $page->getLayoutOptions()
];
} | php | public function onGetTemplateList()
{
$this->validateRequestTheme();
$page = Page::inTheme($this->theme);
return [
'layouts' => $page->getLayoutOptions()
];
} | [
"public",
"function",
"onGetTemplateList",
"(",
")",
"{",
"$",
"this",
"->",
"validateRequestTheme",
"(",
")",
";",
"$",
"page",
"=",
"Page",
"::",
"inTheme",
"(",
"$",
"this",
"->",
"theme",
")",
";",
"return",
"[",
"'layouts'",
"=>",
"$",
"page",
"->... | Returns list of available templates
@return array | [
"Returns",
"list",
"of",
"available",
"templates"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L354-L362 |
208,202 | octobercms/october | modules/cms/controllers/Index.php | Index.onExpandMarkupToken | public function onExpandMarkupToken()
{
if (!$alias = post('tokenName')) {
throw new ApplicationException(trans('cms::lang.component.no_records'));
}
// Can only expand components at this stage
if ((!$type = post('tokenType')) && $type !== 'component') {
retu... | php | public function onExpandMarkupToken()
{
if (!$alias = post('tokenName')) {
throw new ApplicationException(trans('cms::lang.component.no_records'));
}
// Can only expand components at this stage
if ((!$type = post('tokenType')) && $type !== 'component') {
retu... | [
"public",
"function",
"onExpandMarkupToken",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"alias",
"=",
"post",
"(",
"'tokenName'",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"trans",
"(",
"'cms::lang.component.no_records'",
")",
")",
";",
"}",
"// C... | Remembers an open or closed state for a supplied token, for example, component folders.
@return array | [
"Remembers",
"an",
"open",
"or",
"closed",
"state",
"for",
"a",
"supplied",
"token",
"for",
"example",
"component",
"folders",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L368-L398 |
208,203 | octobercms/october | modules/cms/controllers/Index.php | Index.resolveTypeClassName | protected function resolveTypeClassName($type)
{
$types = [
'page' => Page::class,
'partial' => Partial::class,
'layout' => Layout::class,
'content' => Content::class,
'asset' => Asset::class
];
if (!array_key_exists($type, $... | php | protected function resolveTypeClassName($type)
{
$types = [
'page' => Page::class,
'partial' => Partial::class,
'layout' => Layout::class,
'content' => Content::class,
'asset' => Asset::class
];
if (!array_key_exists($type, $... | [
"protected",
"function",
"resolveTypeClassName",
"(",
"$",
"type",
")",
"{",
"$",
"types",
"=",
"[",
"'page'",
"=>",
"Page",
"::",
"class",
",",
"'partial'",
"=>",
"Partial",
"::",
"class",
",",
"'layout'",
"=>",
"Layout",
"::",
"class",
",",
"'content'",
... | Reolves a template type to its class name
@param string $type
@return string | [
"Reolves",
"a",
"template",
"type",
"to",
"its",
"class",
"name"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L420-L435 |
208,204 | octobercms/october | modules/cms/controllers/Index.php | Index.loadTemplate | protected function loadTemplate($type, $path)
{
$class = $this->resolveTypeClassName($type);
if (!($template = call_user_func([$class, 'load'], $this->theme, $path))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
/**
* @event cms.te... | php | protected function loadTemplate($type, $path)
{
$class = $this->resolveTypeClassName($type);
if (!($template = call_user_func([$class, 'load'], $this->theme, $path))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
/**
* @event cms.te... | [
"protected",
"function",
"loadTemplate",
"(",
"$",
"type",
",",
"$",
"path",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"resolveTypeClassName",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"(",
"$",
"template",
"=",
"call_user_func",
"(",
"[",
"$... | Returns an existing template of a given type
@param string $type
@param string $path
@return mixed | [
"Returns",
"an",
"existing",
"template",
"of",
"a",
"given",
"type"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L443-L471 |
208,205 | octobercms/october | modules/cms/controllers/Index.php | Index.createTemplate | protected function createTemplate($type)
{
$class = $this->resolveTypeClassName($type);
if (!($template = $class::inTheme($this->theme))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
return $template;
} | php | protected function createTemplate($type)
{
$class = $this->resolveTypeClassName($type);
if (!($template = $class::inTheme($this->theme))) {
throw new ApplicationException(trans('cms::lang.template.not_found'));
}
return $template;
} | [
"protected",
"function",
"createTemplate",
"(",
"$",
"type",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"resolveTypeClassName",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"(",
"$",
"template",
"=",
"$",
"class",
"::",
"inTheme",
"(",
"$",
"this... | Creates a new template of a given type
@param string $type
@return mixed | [
"Creates",
"a",
"new",
"template",
"of",
"a",
"given",
"type"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L478-L487 |
208,206 | octobercms/october | modules/cms/controllers/Index.php | Index.getTabTitle | protected function getTabTitle($type, $template)
{
if ($type === 'page') {
$result = $template->title ?: $template->getFileName();
if (!$result) {
$result = trans('cms::lang.page.new');
}
return $result;
}
if ($type === 'parti... | php | protected function getTabTitle($type, $template)
{
if ($type === 'page') {
$result = $template->title ?: $template->getFileName();
if (!$result) {
$result = trans('cms::lang.page.new');
}
return $result;
}
if ($type === 'parti... | [
"protected",
"function",
"getTabTitle",
"(",
"$",
"type",
",",
"$",
"template",
")",
"{",
"if",
"(",
"$",
"type",
"===",
"'page'",
")",
"{",
"$",
"result",
"=",
"$",
"template",
"->",
"title",
"?",
":",
"$",
"template",
"->",
"getFileName",
"(",
")",... | Returns the text for a template tab
@param string $type
@param string $template
@return string | [
"Returns",
"the",
"text",
"for",
"a",
"template",
"tab"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L495-L516 |
208,207 | octobercms/october | modules/cms/controllers/Index.php | Index.makeTemplateFormWidget | protected function makeTemplateFormWidget($type, $template, $alias = null)
{
$formConfigs = [
'page' => '~/modules/cms/classes/page/fields.yaml',
'partial' => '~/modules/cms/classes/partial/fields.yaml',
'layout' => '~/modules/cms/classes/layout/fields.yaml',
... | php | protected function makeTemplateFormWidget($type, $template, $alias = null)
{
$formConfigs = [
'page' => '~/modules/cms/classes/page/fields.yaml',
'partial' => '~/modules/cms/classes/partial/fields.yaml',
'layout' => '~/modules/cms/classes/layout/fields.yaml',
... | [
"protected",
"function",
"makeTemplateFormWidget",
"(",
"$",
"type",
",",
"$",
"template",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"formConfigs",
"=",
"[",
"'page'",
"=>",
"'~/modules/cms/classes/page/fields.yaml'",
",",
"'partial'",
"=>",
"'~/modules/cms/c... | Returns a form widget for a specified template type.
@param string $type
@param string $template
@param string $alias
@return Backend\Widgets\Form | [
"Returns",
"a",
"form",
"widget",
"for",
"a",
"specified",
"template",
"type",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L525-L544 |
208,208 | octobercms/october | modules/cms/controllers/Index.php | Index.upgradeSettings | protected function upgradeSettings($settings)
{
/*
* Handle component usage
*/
$componentProperties = post('component_properties');
$componentNames = post('component_names');
$componentAliases = post('component_aliases');
if ($componentProperties !== null) ... | php | protected function upgradeSettings($settings)
{
/*
* Handle component usage
*/
$componentProperties = post('component_properties');
$componentNames = post('component_names');
$componentAliases = post('component_aliases');
if ($componentProperties !== null) ... | [
"protected",
"function",
"upgradeSettings",
"(",
"$",
"settings",
")",
"{",
"/*\n * Handle component usage\n */",
"$",
"componentProperties",
"=",
"post",
"(",
"'component_properties'",
")",
";",
"$",
"componentNames",
"=",
"post",
"(",
"'component_names'"... | Processes the component settings so they are ready to be saved
@param array $settings
@return array | [
"Processes",
"the",
"component",
"settings",
"so",
"they",
"are",
"ready",
"to",
"be",
"saved"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L551-L614 |
208,209 | octobercms/october | modules/cms/controllers/Index.php | Index.bindFormWidgetToController | protected function bindFormWidgetToController()
{
$alias = Request::input('formWidgetAlias');
$type = Request::input('templateType');
$object = $this->loadTemplate($type, Request::input('templatePath'));
$widget = $this->makeTemplateFormWidget($type, $object, $alias);
$widge... | php | protected function bindFormWidgetToController()
{
$alias = Request::input('formWidgetAlias');
$type = Request::input('templateType');
$object = $this->loadTemplate($type, Request::input('templatePath'));
$widget = $this->makeTemplateFormWidget($type, $object, $alias);
$widge... | [
"protected",
"function",
"bindFormWidgetToController",
"(",
")",
"{",
"$",
"alias",
"=",
"Request",
"::",
"input",
"(",
"'formWidgetAlias'",
")",
";",
"$",
"type",
"=",
"Request",
"::",
"input",
"(",
"'templateType'",
")",
";",
"$",
"object",
"=",
"$",
"th... | Binds the active form widget to the controller
@return void | [
"Binds",
"the",
"active",
"form",
"widget",
"to",
"the",
"controller"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L620-L628 |
208,210 | octobercms/october | modules/backend/controllers/Index.php | Index.checkPermissionRedirect | protected function checkPermissionRedirect()
{
if (!$this->user->hasAccess('backend.access_dashboard')) {
$true = function () { return true; };
if ($first = array_first(BackendMenu::listMainMenuItems(), $true)) {
return Redirect::intended($first->url);
}
... | php | protected function checkPermissionRedirect()
{
if (!$this->user->hasAccess('backend.access_dashboard')) {
$true = function () { return true; };
if ($first = array_first(BackendMenu::listMainMenuItems(), $true)) {
return Redirect::intended($first->url);
}
... | [
"protected",
"function",
"checkPermissionRedirect",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"user",
"->",
"hasAccess",
"(",
"'backend.access_dashboard'",
")",
")",
"{",
"$",
"true",
"=",
"function",
"(",
")",
"{",
"return",
"true",
";",
"}",
";... | Custom permissions check that will redirect to the next
available menu item, if permission to this page is denied. | [
"Custom",
"permissions",
"check",
"that",
"will",
"redirect",
"to",
"the",
"next",
"available",
"menu",
"item",
"if",
"permission",
"to",
"this",
"page",
"is",
"denied",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/controllers/Index.php#L71-L79 |
208,211 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.addViewPath | public function addViewPath($path)
{
$this->viewPath = (array) $this->viewPath;
if (is_array($path)) {
$this->viewPath = array_merge($path, $this->viewPath);
}
else {
array_unshift($this->viewPath, $path);
}
} | php | public function addViewPath($path)
{
$this->viewPath = (array) $this->viewPath;
if (is_array($path)) {
$this->viewPath = array_merge($path, $this->viewPath);
}
else {
array_unshift($this->viewPath, $path);
}
} | [
"public",
"function",
"addViewPath",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"viewPath",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"viewPath",
";",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"viewPath",
"=",
... | Prepends a path on the available view path locations.
@param string|array $path
@return void | [
"Prepends",
"a",
"path",
"on",
"the",
"available",
"view",
"path",
"locations",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L51-L61 |
208,212 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makePartial | public function makePartial($partial, $params = [], $throwException = true)
{
$notRealPath = realpath($partial) === false || is_dir($partial) === true;
if (!File::isPathSymbol($partial) && $notRealPath) {
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
... | php | public function makePartial($partial, $params = [], $throwException = true)
{
$notRealPath = realpath($partial) === false || is_dir($partial) === true;
if (!File::isPathSymbol($partial) && $notRealPath) {
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
... | [
"public",
"function",
"makePartial",
"(",
"$",
"partial",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"throwException",
"=",
"true",
")",
"{",
"$",
"notRealPath",
"=",
"realpath",
"(",
"$",
"partial",
")",
"===",
"false",
"||",
"is_dir",
"(",
"$",
"... | Render a partial file contents located in the views folder.
@param string $partial The view to load.
@param array $params Parameter variables to pass to the view.
@param bool $throwException Throw an exception if the partial is not found.
@return mixed Partial contents or false if not throwing an exception. | [
"Render",
"a",
"partial",
"file",
"contents",
"located",
"in",
"the",
"views",
"folder",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L79-L98 |
208,213 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeView | public function makeView($view)
{
$viewPath = $this->getViewPath(strtolower($view) . '.htm');
$contents = $this->makeFileContents($viewPath);
return $this->makeViewContent($contents);
} | php | public function makeView($view)
{
$viewPath = $this->getViewPath(strtolower($view) . '.htm');
$contents = $this->makeFileContents($viewPath);
return $this->makeViewContent($contents);
} | [
"public",
"function",
"makeView",
"(",
"$",
"view",
")",
"{",
"$",
"viewPath",
"=",
"$",
"this",
"->",
"getViewPath",
"(",
"strtolower",
"(",
"$",
"view",
")",
".",
"'.htm'",
")",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"makeFileContents",
"(",
... | Loads a view with the name specified. Applies layout if its name is provided by the parent object.
The view file must be situated in the views directory, and has the extension "htm".
@param string $view Specifies the view name, without extension. Eg: "index".
@return string | [
"Loads",
"a",
"view",
"with",
"the",
"name",
"specified",
".",
"Applies",
"layout",
"if",
"its",
"name",
"is",
"provided",
"by",
"the",
"parent",
"object",
".",
"The",
"view",
"file",
"must",
"be",
"situated",
"in",
"the",
"views",
"directory",
"and",
"h... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L106-L111 |
208,214 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeViewContent | public function makeViewContent($contents, $layout = null)
{
if ($this->suppressLayout || $this->layout == '') {
return $contents;
}
// Append any undefined block content to the body block
Block::set('undefinedBlock', $contents);
Block::append('body', Block::get(... | php | public function makeViewContent($contents, $layout = null)
{
if ($this->suppressLayout || $this->layout == '') {
return $contents;
}
// Append any undefined block content to the body block
Block::set('undefinedBlock', $contents);
Block::append('body', Block::get(... | [
"public",
"function",
"makeViewContent",
"(",
"$",
"contents",
",",
"$",
"layout",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"suppressLayout",
"||",
"$",
"this",
"->",
"layout",
"==",
"''",
")",
"{",
"return",
"$",
"contents",
";",
"}",
"/... | Renders supplied contents inside a layout.
@param string $contents The inner contents as a string.
@param string $layout Specifies the layout name.
@return string | [
"Renders",
"supplied",
"contents",
"inside",
"a",
"layout",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L119-L129 |
208,215 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeLayout | public function makeLayout($name = null, $params = [], $throwException = true)
{
$layout = $name ?? $this->layout;
if ($layout == '') {
return '';
}
$layoutPath = $this->getViewPath($layout . '.htm', $this->layoutPath);
if (!File::exists($layoutPath)) {
... | php | public function makeLayout($name = null, $params = [], $throwException = true)
{
$layout = $name ?? $this->layout;
if ($layout == '') {
return '';
}
$layoutPath = $this->getViewPath($layout . '.htm', $this->layoutPath);
if (!File::exists($layoutPath)) {
... | [
"public",
"function",
"makeLayout",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"throwException",
"=",
"true",
")",
"{",
"$",
"layout",
"=",
"$",
"name",
"??",
"$",
"this",
"->",
"layout",
";",
"if",
"(",
"$",
"lay... | Render a layout.
@param string $name Specifies the layout name.
If this parameter is omitted, the $layout property will be used.
@param array $params Parameter variables to pass to the view.
@param bool $throwException Throw an exception if the layout is not found
@return mixed The layout contents, or false. | [
"Render",
"a",
"layout",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L139-L157 |
208,216 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeLayoutPartial | public function makeLayoutPartial($partial, $params = [])
{
if (!File::isLocalPath($partial) && !File::isPathSymbol($partial)) {
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
$partial = $folder . '_' . strtolower(basename($partial));
}
ret... | php | public function makeLayoutPartial($partial, $params = [])
{
if (!File::isLocalPath($partial) && !File::isPathSymbol($partial)) {
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
$partial = $folder . '_' . strtolower(basename($partial));
}
ret... | [
"public",
"function",
"makeLayoutPartial",
"(",
"$",
"partial",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"File",
"::",
"isLocalPath",
"(",
"$",
"partial",
")",
"&&",
"!",
"File",
"::",
"isPathSymbol",
"(",
"$",
"partial",
")",
")"... | Renders a layout partial
@param string $partial The view to load.
@param array $params Parameter variables to pass to the view.
@return string The layout partial contents | [
"Renders",
"a",
"layout",
"partial"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L165-L173 |
208,217 | octobercms/october | modules/system/traits/ViewMaker.php | ViewMaker.makeFileContents | public function makeFileContents($filePath, $extraParams = [])
{
if (!strlen($filePath) ||
!File::isFile($filePath) ||
(!File::isLocalPath($filePath) && Config::get('cms.restrictBaseDir', true))
) {
return '';
}
if (!is_array($extraParams)) {
... | php | public function makeFileContents($filePath, $extraParams = [])
{
if (!strlen($filePath) ||
!File::isFile($filePath) ||
(!File::isLocalPath($filePath) && Config::get('cms.restrictBaseDir', true))
) {
return '';
}
if (!is_array($extraParams)) {
... | [
"public",
"function",
"makeFileContents",
"(",
"$",
"filePath",
",",
"$",
"extraParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"strlen",
"(",
"$",
"filePath",
")",
"||",
"!",
"File",
"::",
"isFile",
"(",
"$",
"filePath",
")",
"||",
"(",
"!",
"Fi... | Includes a file path using output buffering.
Ensures that vars are available.
@param string $filePath Absolute path to the view file.
@param array $extraParams Parameters that should be available to the view.
@return string | [
"Includes",
"a",
"file",
"path",
"using",
"output",
"buffering",
".",
"Ensures",
"that",
"vars",
"are",
"available",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/ViewMaker.php#L222-L257 |
208,218 | octobercms/october | modules/system/console/OctoberInstall.php | OctoberInstall.getConfigFile | protected function getConfigFile($name = 'app')
{
$env = $this->option('env') ? $this->option('env').'/' : '';
$name .= '.php';
$contents = File::get($path = $this->laravel['path.config']."/{$env}{$name}");
return $path;
} | php | protected function getConfigFile($name = 'app')
{
$env = $this->option('env') ? $this->option('env').'/' : '';
$name .= '.php';
$contents = File::get($path = $this->laravel['path.config']."/{$env}{$name}");
return $path;
} | [
"protected",
"function",
"getConfigFile",
"(",
"$",
"name",
"=",
"'app'",
")",
"{",
"$",
"env",
"=",
"$",
"this",
"->",
"option",
"(",
"'env'",
")",
"?",
"$",
"this",
"->",
"option",
"(",
"'env'",
")",
".",
"'/'",
":",
"''",
";",
"$",
"name",
".=... | Get a config file and contents.
@return array | [
"Get",
"a",
"config",
"file",
"and",
"contents",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberInstall.php#L372-L381 |
208,219 | octobercms/october | modules/system/classes/ComposerManager.php | ComposerManager.stripVendorDir | protected function stripVendorDir($path, $vendorDir)
{
$path = realpath($path);
$vendorDir = realpath($vendorDir);
if (strpos($path, $vendorDir) === 0) {
$path = substr($path, strlen($vendorDir));
}
return $path;
} | php | protected function stripVendorDir($path, $vendorDir)
{
$path = realpath($path);
$vendorDir = realpath($vendorDir);
if (strpos($path, $vendorDir) === 0) {
$path = substr($path, strlen($vendorDir));
}
return $path;
} | [
"protected",
"function",
"stripVendorDir",
"(",
"$",
"path",
",",
"$",
"vendorDir",
")",
"{",
"$",
"path",
"=",
"realpath",
"(",
"$",
"path",
")",
";",
"$",
"vendorDir",
"=",
"realpath",
"(",
"$",
"vendorDir",
")",
";",
"if",
"(",
"strpos",
"(",
"$",... | Removes the vendor directory from a path.
@param string $path
@return string | [
"Removes",
"the",
"vendor",
"directory",
"from",
"a",
"path",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/ComposerManager.php#L113-L123 |
208,220 | octobercms/october | modules/system/classes/MailManager.php | MailManager.addRawContentToMailer | public function addRawContentToMailer($message, $content, $data)
{
$template = new MailTemplate;
$template->fillFromContent($content);
$this->addContentToMailerInternal($message, $template, $data);
return true;
} | php | public function addRawContentToMailer($message, $content, $data)
{
$template = new MailTemplate;
$template->fillFromContent($content);
$this->addContentToMailerInternal($message, $template, $data);
return true;
} | [
"public",
"function",
"addRawContentToMailer",
"(",
"$",
"message",
",",
"$",
"content",
",",
"$",
"data",
")",
"{",
"$",
"template",
"=",
"new",
"MailTemplate",
";",
"$",
"template",
"->",
"fillFromContent",
"(",
"$",
"content",
")",
";",
"$",
"this",
"... | Same as `addContentToMailer` except with raw content.
@return bool | [
"Same",
"as",
"addContentToMailer",
"except",
"with",
"raw",
"content",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L62-L71 |
208,221 | octobercms/october | modules/system/classes/MailManager.php | MailManager.addContentToMailer | public function addContentToMailer($message, $code, $data, $plainOnly = false)
{
if (isset($this->templateCache[$code])) {
$template = $this->templateCache[$code];
}
else {
$this->templateCache[$code] = $template = MailTemplate::findOrMakeTemplate($code);
}
... | php | public function addContentToMailer($message, $code, $data, $plainOnly = false)
{
if (isset($this->templateCache[$code])) {
$template = $this->templateCache[$code];
}
else {
$this->templateCache[$code] = $template = MailTemplate::findOrMakeTemplate($code);
}
... | [
"public",
"function",
"addContentToMailer",
"(",
"$",
"message",
",",
"$",
"code",
",",
"$",
"data",
",",
"$",
"plainOnly",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"templateCache",
"[",
"$",
"code",
"]",
")",
")",
"{",
"... | This function hijacks the `addContent` method of the `October\Rain\Mail\Mailer`
class, using the `mailer.beforeAddContent` event.
@param \Illuminate\Mail\Message $message
@param string $code
@param array $data
@param bool $plainOnly Add only plain text content to the message
@return bool | [
"This",
"function",
"hijacks",
"the",
"addContent",
"method",
"of",
"the",
"October",
"\\",
"Rain",
"\\",
"Mail",
"\\",
"Mailer",
"class",
"using",
"the",
"mailer",
".",
"beforeAddContent",
"event",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L83-L99 |
208,222 | octobercms/october | modules/system/classes/MailManager.php | MailManager.addContentToMailerInternal | protected function addContentToMailerInternal($message, $template, $data, $plainOnly = false)
{
/*
* Start twig transaction
*/
$this->startTwig();
/*
* Inject global view variables
*/
$globalVars = ViewHelper::getGlobalVars();
if (!empty($... | php | protected function addContentToMailerInternal($message, $template, $data, $plainOnly = false)
{
/*
* Start twig transaction
*/
$this->startTwig();
/*
* Inject global view variables
*/
$globalVars = ViewHelper::getGlobalVars();
if (!empty($... | [
"protected",
"function",
"addContentToMailerInternal",
"(",
"$",
"message",
",",
"$",
"template",
",",
"$",
"data",
",",
"$",
"plainOnly",
"=",
"false",
")",
"{",
"/*\n * Start twig transaction\n */",
"$",
"this",
"->",
"startTwig",
"(",
")",
";",
... | Internal method used to share logic between `addRawContentToMailer` and `addContentToMailer`
@param \Illuminate\Mail\Message $message
@param string $template
@param array $data
@param bool $plainOnly Add only plain text content to the message
@return void | [
"Internal",
"method",
"used",
"to",
"share",
"logic",
"between",
"addRawContentToMailer",
"and",
"addContentToMailer"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L110-L158 |
208,223 | octobercms/october | modules/system/classes/MailManager.php | MailManager.renderTwig | protected function renderTwig($content, $data = [])
{
if ($this->isTwigStarted) {
return Twig::parse($content, $data);
}
$this->startTwig();
$result = Twig::parse($content, $data);
$this->stopTwig();
return $result;
} | php | protected function renderTwig($content, $data = [])
{
if ($this->isTwigStarted) {
return Twig::parse($content, $data);
}
$this->startTwig();
$result = Twig::parse($content, $data);
$this->stopTwig();
return $result;
} | [
"protected",
"function",
"renderTwig",
"(",
"$",
"content",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isTwigStarted",
")",
"{",
"return",
"Twig",
"::",
"parse",
"(",
"$",
"content",
",",
"$",
"data",
")",
";",
"}",
... | Internal helper for rendering Twig | [
"Internal",
"helper",
"for",
"rendering",
"Twig"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L277-L290 |
208,224 | octobercms/october | modules/system/classes/MailManager.php | MailManager.startTwig | protected function startTwig()
{
if ($this->isTwigStarted) {
return;
}
$this->isTwigStarted = true;
$markupManager = MarkupManager::instance();
$markupManager->beginTransaction();
$markupManager->registerTokenParsers([
new MailPartialTokenPar... | php | protected function startTwig()
{
if ($this->isTwigStarted) {
return;
}
$this->isTwigStarted = true;
$markupManager = MarkupManager::instance();
$markupManager->beginTransaction();
$markupManager->registerTokenParsers([
new MailPartialTokenPar... | [
"protected",
"function",
"startTwig",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isTwigStarted",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"isTwigStarted",
"=",
"true",
";",
"$",
"markupManager",
"=",
"MarkupManager",
"::",
"instance",
"(",
")"... | Temporarily registers mail based token parsers with Twig.
@return void | [
"Temporarily",
"registers",
"mail",
"based",
"token",
"parsers",
"with",
"Twig",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L296-L309 |
208,225 | octobercms/october | modules/system/classes/MailManager.php | MailManager.stopTwig | protected function stopTwig()
{
if (!$this->isTwigStarted) {
return;
}
$markupManager = MarkupManager::instance();
$markupManager->endTransaction();
$this->isTwigStarted = false;
} | php | protected function stopTwig()
{
if (!$this->isTwigStarted) {
return;
}
$markupManager = MarkupManager::instance();
$markupManager->endTransaction();
$this->isTwigStarted = false;
} | [
"protected",
"function",
"stopTwig",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isTwigStarted",
")",
"{",
"return",
";",
"}",
"$",
"markupManager",
"=",
"MarkupManager",
"::",
"instance",
"(",
")",
";",
"$",
"markupManager",
"->",
"endTransaction",... | Indicates that we are finished with Twig.
@return void | [
"Indicates",
"that",
"we",
"are",
"finished",
"with",
"Twig",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L315-L325 |
208,226 | octobercms/october | modules/system/classes/MailManager.php | MailManager.loadRegisteredTemplates | public function loadRegisteredTemplates()
{
foreach ($this->callbacks as $callback) {
$callback($this);
}
$plugins = PluginManager::instance()->getPlugins();
foreach ($plugins as $pluginId => $pluginObj) {
$layouts = $pluginObj->registerMailLayouts();
... | php | public function loadRegisteredTemplates()
{
foreach ($this->callbacks as $callback) {
$callback($this);
}
$plugins = PluginManager::instance()->getPlugins();
foreach ($plugins as $pluginId => $pluginObj) {
$layouts = $pluginObj->registerMailLayouts();
... | [
"public",
"function",
"loadRegisteredTemplates",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"callbacks",
"as",
"$",
"callback",
")",
"{",
"$",
"callback",
"(",
"$",
"this",
")",
";",
"}",
"$",
"plugins",
"=",
"PluginManager",
"::",
"instance",
"("... | Loads registered mail templates from modules and plugins
@return void | [
"Loads",
"registered",
"mail",
"templates",
"from",
"modules",
"and",
"plugins"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L335-L358 |
208,227 | octobercms/october | modules/system/classes/MailManager.php | MailManager.registerMailTemplates | public function registerMailTemplates(array $definitions)
{
if (!$this->registeredTemplates) {
$this->registeredTemplates = [];
}
// Prior sytax where (key) code => (value) description
if (!isset($definitions[0])) {
$definitions = array_keys($definitions);
... | php | public function registerMailTemplates(array $definitions)
{
if (!$this->registeredTemplates) {
$this->registeredTemplates = [];
}
// Prior sytax where (key) code => (value) description
if (!isset($definitions[0])) {
$definitions = array_keys($definitions);
... | [
"public",
"function",
"registerMailTemplates",
"(",
"array",
"$",
"definitions",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"registeredTemplates",
")",
"{",
"$",
"this",
"->",
"registeredTemplates",
"=",
"[",
"]",
";",
"}",
"// Prior sytax where (key) code => ... | Registers mail views and manageable templates. | [
"Registers",
"mail",
"views",
"and",
"manageable",
"templates",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MailManager.php#L419-L433 |
208,228 | octobercms/october | modules/backend/widgets/Filter.php | Filter.onFilterUpdate | public function onFilterUpdate()
{
$this->defineFilterScopes();
if (!$scope = post('scopeName')) {
return;
}
$scope = $this->getScope($scope);
switch ($scope->type) {
case 'group':
$active = $this->optionsFromAjax(post('options.activ... | php | public function onFilterUpdate()
{
$this->defineFilterScopes();
if (!$scope = post('scopeName')) {
return;
}
$scope = $this->getScope($scope);
switch ($scope->type) {
case 'group':
$active = $this->optionsFromAjax(post('options.activ... | [
"public",
"function",
"onFilterUpdate",
"(",
")",
"{",
"$",
"this",
"->",
"defineFilterScopes",
"(",
")",
";",
"if",
"(",
"!",
"$",
"scope",
"=",
"post",
"(",
"'scopeName'",
")",
")",
"{",
"return",
";",
"}",
"$",
"scope",
"=",
"$",
"this",
"->",
"... | Update a filter scope value.
@return array | [
"Update",
"a",
"filter",
"scope",
"value",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L181-L287 |
208,229 | octobercms/october | modules/backend/widgets/Filter.php | Filter.onFilterGetOptions | public function onFilterGetOptions()
{
$this->defineFilterScopes();
$searchQuery = post('search');
if (!$scopeName = post('scopeName')) {
return;
}
$scope = $this->getScope($scopeName);
$activeKeys = $scope->value ? array_keys($scope->value) : [];
... | php | public function onFilterGetOptions()
{
$this->defineFilterScopes();
$searchQuery = post('search');
if (!$scopeName = post('scopeName')) {
return;
}
$scope = $this->getScope($scopeName);
$activeKeys = $scope->value ? array_keys($scope->value) : [];
... | [
"public",
"function",
"onFilterGetOptions",
"(",
")",
"{",
"$",
"this",
"->",
"defineFilterScopes",
"(",
")",
";",
"$",
"searchQuery",
"=",
"post",
"(",
"'search'",
")",
";",
"if",
"(",
"!",
"$",
"scopeName",
"=",
"post",
"(",
"'scopeName'",
")",
")",
... | Returns available options for group scope type.
@return array | [
"Returns",
"available",
"options",
"for",
"group",
"scope",
"type",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L293-L314 |
208,230 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getAvailableOptions | protected function getAvailableOptions($scope, $searchQuery = null)
{
if ($scope->options) {
return $this->getOptionsFromArray($scope, $searchQuery);
}
$available = [];
$nameColumn = $this->getScopeNameFrom($scope);
$options = $this->getOptionsFromModel($scope, $... | php | protected function getAvailableOptions($scope, $searchQuery = null)
{
if ($scope->options) {
return $this->getOptionsFromArray($scope, $searchQuery);
}
$available = [];
$nameColumn = $this->getScopeNameFrom($scope);
$options = $this->getOptionsFromModel($scope, $... | [
"protected",
"function",
"getAvailableOptions",
"(",
"$",
"scope",
",",
"$",
"searchQuery",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"scope",
"->",
"options",
")",
"{",
"return",
"$",
"this",
"->",
"getOptionsFromArray",
"(",
"$",
"scope",
",",
"$",
"searc... | Returns the available options a scope can use, either from the
model relation or from a supplied array. Optionally apply a search
constraint to the options.
@param string $scope
@param string $searchQuery
@return array | [
"Returns",
"the",
"available",
"options",
"a",
"scope",
"can",
"use",
"either",
"from",
"the",
"model",
"relation",
"or",
"from",
"a",
"supplied",
"array",
".",
"Optionally",
"apply",
"a",
"search",
"constraint",
"to",
"the",
"options",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L328-L342 |
208,231 | octobercms/october | modules/backend/widgets/Filter.php | Filter.filterActiveOptions | protected function filterActiveOptions(array $activeKeys, array &$availableOptions)
{
$active = [];
foreach ($availableOptions as $id => $option) {
if (!in_array($id, $activeKeys)) {
continue;
}
$active[$id] = $option;
unset($available... | php | protected function filterActiveOptions(array $activeKeys, array &$availableOptions)
{
$active = [];
foreach ($availableOptions as $id => $option) {
if (!in_array($id, $activeKeys)) {
continue;
}
$active[$id] = $option;
unset($available... | [
"protected",
"function",
"filterActiveOptions",
"(",
"array",
"$",
"activeKeys",
",",
"array",
"&",
"$",
"availableOptions",
")",
"{",
"$",
"active",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"availableOptions",
"as",
"$",
"id",
"=>",
"$",
"option",
")",
... | Removes any already selected options from the available options, returns
a newly built array.
@param array $activeKeys
@param array $availableOptions
@return array | [
"Removes",
"any",
"already",
"selected",
"options",
"from",
"the",
"available",
"options",
"returns",
"a",
"newly",
"built",
"array",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L351-L364 |
208,232 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getOptionsFromModel | protected function getOptionsFromModel($scope, $searchQuery = null)
{
$model = $this->scopeModels[$scope->scopeName];
$query = $model->newQuery();
/*
* The 'group' scope has trouble supporting more than 500 records at a time
* @todo Introduce a more advanced version with ... | php | protected function getOptionsFromModel($scope, $searchQuery = null)
{
$model = $this->scopeModels[$scope->scopeName];
$query = $model->newQuery();
/*
* The 'group' scope has trouble supporting more than 500 records at a time
* @todo Introduce a more advanced version with ... | [
"protected",
"function",
"getOptionsFromModel",
"(",
"$",
"scope",
",",
"$",
"searchQuery",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"scopeModels",
"[",
"$",
"scope",
"->",
"scopeName",
"]",
";",
"$",
"query",
"=",
"$",
"model",
"->... | Looks at the model for defined scope items.
@return Collection | [
"Looks",
"at",
"the",
"model",
"for",
"defined",
"scope",
"items",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L370-L411 |
208,233 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getOptionsFromArray | protected function getOptionsFromArray($scope, $searchQuery = null)
{
/*
* Load the data
*/
$options = $scope->options;
if (is_scalar($options)) {
$model = $this->scopeModels[$scope->scopeName];
$methodName = $options;
if (!$model->meth... | php | protected function getOptionsFromArray($scope, $searchQuery = null)
{
/*
* Load the data
*/
$options = $scope->options;
if (is_scalar($options)) {
$model = $this->scopeModels[$scope->scopeName];
$methodName = $options;
if (!$model->meth... | [
"protected",
"function",
"getOptionsFromArray",
"(",
"$",
"scope",
",",
"$",
"searchQuery",
"=",
"null",
")",
"{",
"/*\n * Load the data\n */",
"$",
"options",
"=",
"$",
"scope",
"->",
"options",
";",
"if",
"(",
"is_scalar",
"(",
"$",
"options",
... | Look at the defined set of options for scope items, or the model method.
@return array | [
"Look",
"at",
"the",
"defined",
"set",
"of",
"options",
"for",
"scope",
"items",
"or",
"the",
"model",
"method",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L417-L451 |
208,234 | octobercms/october | modules/backend/widgets/Filter.php | Filter.filterOptionsBySearch | protected function filterOptionsBySearch($options, $query)
{
$filteredOptions = [];
$optionMatchesSearch = function ($words, $option) {
foreach ($words as $word) {
$word = trim($word);
if (!strlen($word)) {
continue;
}
... | php | protected function filterOptionsBySearch($options, $query)
{
$filteredOptions = [];
$optionMatchesSearch = function ($words, $option) {
foreach ($words as $word) {
$word = trim($word);
if (!strlen($word)) {
continue;
}
... | [
"protected",
"function",
"filterOptionsBySearch",
"(",
"$",
"options",
",",
"$",
"query",
")",
"{",
"$",
"filteredOptions",
"=",
"[",
"]",
";",
"$",
"optionMatchesSearch",
"=",
"function",
"(",
"$",
"words",
",",
"$",
"option",
")",
"{",
"foreach",
"(",
... | Filters an array of options by a search term.
@param array $options
@param string $query
@return array | [
"Filters",
"an",
"array",
"of",
"options",
"by",
"a",
"search",
"term",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L459-L499 |
208,235 | octobercms/october | modules/backend/widgets/Filter.php | Filter.defineFilterScopes | protected function defineFilterScopes()
{
if ($this->scopesDefined) {
return;
}
/**
* @event backend.filter.extendScopesBefore
* Provides an opportunity to interact with the Filter widget before defining the filter scopes
*
* Example usage:
... | php | protected function defineFilterScopes()
{
if ($this->scopesDefined) {
return;
}
/**
* @event backend.filter.extendScopesBefore
* Provides an opportunity to interact with the Filter widget before defining the filter scopes
*
* Example usage:
... | [
"protected",
"function",
"defineFilterScopes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scopesDefined",
")",
"{",
"return",
";",
"}",
"/**\n * @event backend.filter.extendScopesBefore\n * Provides an opportunity to interact with the Filter widget before definin... | Creates a flat array of filter scopes from the configuration. | [
"Creates",
"a",
"flat",
"array",
"of",
"filter",
"scopes",
"from",
"the",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L504-L562 |
208,236 | octobercms/october | modules/backend/widgets/Filter.php | Filter.addScopes | public function addScopes(array $scopes)
{
foreach ($scopes as $name => $config) {
$scopeObj = $this->makeFilterScope($name, $config);
/*
* Check that the filter scope matches the active context
*/
if ($scopeObj->context !== null) {
... | php | public function addScopes(array $scopes)
{
foreach ($scopes as $name => $config) {
$scopeObj = $this->makeFilterScope($name, $config);
/*
* Check that the filter scope matches the active context
*/
if ($scopeObj->context !== null) {
... | [
"public",
"function",
"addScopes",
"(",
"array",
"$",
"scopes",
")",
"{",
"foreach",
"(",
"$",
"scopes",
"as",
"$",
"name",
"=>",
"$",
"config",
")",
"{",
"$",
"scopeObj",
"=",
"$",
"this",
"->",
"makeFilterScope",
"(",
"$",
"name",
",",
"$",
"config... | Programatically add scopes, used internally and for extensibility. | [
"Programatically",
"add",
"scopes",
"used",
"internally",
"and",
"for",
"extensibility",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L567-L619 |
208,237 | octobercms/october | modules/backend/widgets/Filter.php | Filter.makeFilterScope | protected function makeFilterScope($name, $config)
{
$label = $config['label'] ?? null;
$scopeType = $config['type'] ?? null;
$scope = new FilterScope($name, $label);
$scope->displayAs($scopeType, $config);
/*
* Set scope value
*/
$scope->value = $... | php | protected function makeFilterScope($name, $config)
{
$label = $config['label'] ?? null;
$scopeType = $config['type'] ?? null;
$scope = new FilterScope($name, $label);
$scope->displayAs($scopeType, $config);
/*
* Set scope value
*/
$scope->value = $... | [
"protected",
"function",
"makeFilterScope",
"(",
"$",
"name",
",",
"$",
"config",
")",
"{",
"$",
"label",
"=",
"$",
"config",
"[",
"'label'",
"]",
"??",
"null",
";",
"$",
"scopeType",
"=",
"$",
"config",
"[",
"'type'",
"]",
"??",
"null",
";",
"$",
... | Creates a filter scope object from name and configuration. | [
"Creates",
"a",
"filter",
"scope",
"object",
"from",
"name",
"and",
"configuration",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L635-L649 |
208,238 | octobercms/october | modules/backend/widgets/Filter.php | Filter.applyAllScopesToQuery | public function applyAllScopesToQuery($query)
{
$this->defineFilterScopes();
foreach ($this->allScopes as $scope) {
$this->applyScopeToQuery($scope, $query);
}
return $query;
} | php | public function applyAllScopesToQuery($query)
{
$this->defineFilterScopes();
foreach ($this->allScopes as $scope) {
$this->applyScopeToQuery($scope, $query);
}
return $query;
} | [
"public",
"function",
"applyAllScopesToQuery",
"(",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"defineFilterScopes",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"allScopes",
"as",
"$",
"scope",
")",
"{",
"$",
"this",
"->",
"applyScopeToQuery",
"(",
... | Applies all scopes to a DB query.
@param Builder $query
@return Builder | [
"Applies",
"all",
"scopes",
"to",
"a",
"DB",
"query",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L660-L669 |
208,239 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getScopeValue | public function getScopeValue($scope, $default = null)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
$cacheKey = 'scope-'.$scope->scopeName;
return $this->getSession($cacheKey, $default);
} | php | public function getScopeValue($scope, $default = null)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
$cacheKey = 'scope-'.$scope->scopeName;
return $this->getSession($cacheKey, $default);
} | [
"public",
"function",
"getScopeValue",
"(",
"$",
"scope",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"->",
"getScope",
"(",
"$",
"scope",
")",
";",
"}",
"$... | Returns a scope value for this widget instance. | [
"Returns",
"a",
"scope",
"value",
"for",
"this",
"widget",
"instance",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L853-L861 |
208,240 | octobercms/october | modules/backend/widgets/Filter.php | Filter.setScopeValue | public function setScopeValue($scope, $value)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
$cacheKey = 'scope-'.$scope->scopeName;
$this->putSession($cacheKey, $value);
$scope->value = $value;
} | php | public function setScopeValue($scope, $value)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
$cacheKey = 'scope-'.$scope->scopeName;
$this->putSession($cacheKey, $value);
$scope->value = $value;
} | [
"public",
"function",
"setScopeValue",
"(",
"$",
"scope",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"->",
"getScope",
"(",
"$",
"scope",
")",
";",
"}",
"$",
"cacheKey",
... | Sets an scope value for this widget instance. | [
"Sets",
"an",
"scope",
"value",
"for",
"this",
"widget",
"instance",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L866-L876 |
208,241 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getScope | public function getScope($scope)
{
if (!isset($this->allScopes[$scope])) {
throw new ApplicationException('No definition for scope ' . $scope);
}
return $this->allScopes[$scope];
} | php | public function getScope($scope)
{
if (!isset($this->allScopes[$scope])) {
throw new ApplicationException('No definition for scope ' . $scope);
}
return $this->allScopes[$scope];
} | [
"public",
"function",
"getScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"allScopes",
"[",
"$",
"scope",
"]",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"'No definition for scope '",
".",
"$",
"scop... | Get a specified scope object
@param string $scope
@return mixed | [
"Get",
"a",
"specified",
"scope",
"object"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L892-L899 |
208,242 | octobercms/october | modules/backend/widgets/Filter.php | Filter.getScopeNameFrom | public function getScopeNameFrom($scope)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
return $scope->nameFrom;
} | php | public function getScopeNameFrom($scope)
{
if (is_string($scope)) {
$scope = $this->getScope($scope);
}
return $scope->nameFrom;
} | [
"public",
"function",
"getScopeNameFrom",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"->",
"getScope",
"(",
"$",
"scope",
")",
";",
"}",
"return",
"$",
"scope",
"->",
"name... | Returns the display name column for a scope.
@param string $scope
@return string | [
"Returns",
"the",
"display",
"name",
"column",
"for",
"a",
"scope",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L906-L913 |
208,243 | octobercms/october | modules/backend/widgets/Filter.php | Filter.datesFromAjax | protected function datesFromAjax($ajaxDates)
{
$dates = [];
$dateRegex = '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/';
if (null !== $ajaxDates) {
if (!is_array($ajaxDates)) {
if(preg_match($dateRegex, $ajaxDates)) {
$dates = [$ajaxDates];
... | php | protected function datesFromAjax($ajaxDates)
{
$dates = [];
$dateRegex = '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/';
if (null !== $ajaxDates) {
if (!is_array($ajaxDates)) {
if(preg_match($dateRegex, $ajaxDates)) {
$dates = [$ajaxDates];
... | [
"protected",
"function",
"datesFromAjax",
"(",
"$",
"ajaxDates",
")",
"{",
"$",
"dates",
"=",
"[",
"]",
";",
"$",
"dateRegex",
"=",
"'/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/'",
";",
"if",
"(",
"null",
"!==",
"$",
"ajaxDates",
")",
"{",
"if",
"(",
"!",
... | Convert an array from the posted dates
@param array $dates
@return array | [
"Convert",
"an",
"array",
"from",
"the",
"posted",
"dates"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L971-L999 |
208,244 | octobercms/october | modules/backend/widgets/Filter.php | Filter.numbersFromAjax | protected function numbersFromAjax($ajaxNumbers)
{
$numbers = [];
$numberRegex = '/\d/';
if (!empty($ajaxNumbers)) {
if (!is_array($ajaxNumbers) && preg_match($numberRegex, $ajaxNumbers)) {
$numbers = [$ajaxNumbers];
} else {
foreach (... | php | protected function numbersFromAjax($ajaxNumbers)
{
$numbers = [];
$numberRegex = '/\d/';
if (!empty($ajaxNumbers)) {
if (!is_array($ajaxNumbers) && preg_match($numberRegex, $ajaxNumbers)) {
$numbers = [$ajaxNumbers];
} else {
foreach (... | [
"protected",
"function",
"numbersFromAjax",
"(",
"$",
"ajaxNumbers",
")",
"{",
"$",
"numbers",
"=",
"[",
"]",
";",
"$",
"numberRegex",
"=",
"'/\\d/'",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"ajaxNumbers",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"... | Convert an array from the posted numbers
@param array $dates
@return array | [
"Convert",
"an",
"array",
"from",
"the",
"posted",
"numbers"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Filter.php#L1008-L1029 |
208,245 | octobercms/october | modules/backend/formwidgets/TagList.php | TagList.getFieldOptions | public function getFieldOptions()
{
$options = $this->formField->options();
if (!$options && $this->mode === static::MODE_RELATION) {
$options = $this->getRelationModel()->lists($this->nameFrom);
}
return $options;
} | php | public function getFieldOptions()
{
$options = $this->formField->options();
if (!$options && $this->mode === static::MODE_RELATION) {
$options = $this->getRelationModel()->lists($this->nameFrom);
}
return $options;
} | [
"public",
"function",
"getFieldOptions",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"formField",
"->",
"options",
"(",
")",
";",
"if",
"(",
"!",
"$",
"options",
"&&",
"$",
"this",
"->",
"mode",
"===",
"static",
"::",
"MODE_RELATION",
")",
... | Returns defined field options, or from the relation if available.
@return array | [
"Returns",
"defined",
"field",
"options",
"or",
"from",
"the",
"relation",
"if",
"available",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/TagList.php#L166-L175 |
208,246 | octobercms/october | modules/backend/formwidgets/DataTable.php | DataTable.getDataTableOptions | public function getDataTableOptions($field, $data)
{
$methodName = 'get'.studly_case($this->fieldName).'DataTableOptions';
if (!$this->model->methodExists($methodName) && !$this->model->methodExists('getDataTableOptions')) {
throw new ApplicationException(Lang::get('backend::lang.model.... | php | public function getDataTableOptions($field, $data)
{
$methodName = 'get'.studly_case($this->fieldName).'DataTableOptions';
if (!$this->model->methodExists($methodName) && !$this->model->methodExists('getDataTableOptions')) {
throw new ApplicationException(Lang::get('backend::lang.model.... | [
"public",
"function",
"getDataTableOptions",
"(",
"$",
"field",
",",
"$",
"data",
")",
"{",
"$",
"methodName",
"=",
"'get'",
".",
"studly_case",
"(",
"$",
"this",
"->",
"fieldName",
")",
".",
"'DataTableOptions'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
... | Looks at the model for getXXXDataTableOptions or getDataTableOptions methods
to obtain values for autocomplete field types.
@param string $field Table field name
@param string $data Data for the entire table
@return array | [
"Looks",
"at",
"the",
"model",
"for",
"getXXXDataTableOptions",
"or",
"getDataTableOptions",
"methods",
"to",
"obtain",
"values",
"for",
"autocomplete",
"field",
"types",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/DataTable.php#L169-L189 |
208,247 | octobercms/october | modules/backend/traits/ErrorMaker.php | ErrorMaker.handleError | public function handleError($exception)
{
$errorMessage = ErrorHandler::getDetailedMessage($exception);
$this->fatalError = $errorMessage;
$this->vars['fatalError'] = $errorMessage;
} | php | public function handleError($exception)
{
$errorMessage = ErrorHandler::getDetailedMessage($exception);
$this->fatalError = $errorMessage;
$this->vars['fatalError'] = $errorMessage;
} | [
"public",
"function",
"handleError",
"(",
"$",
"exception",
")",
"{",
"$",
"errorMessage",
"=",
"ErrorHandler",
"::",
"getDetailedMessage",
"(",
"$",
"exception",
")",
";",
"$",
"this",
"->",
"fatalError",
"=",
"$",
"errorMessage",
";",
"$",
"this",
"->",
... | Sets standard page variables in the case of a controller error. | [
"Sets",
"standard",
"page",
"variables",
"in",
"the",
"case",
"of",
"a",
"controller",
"error",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/ErrorMaker.php#L22-L27 |
208,248 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.combineAssets | public function combineAssets(array $assets, $localPath = '')
{
// Short circuit if no assets actually provided
if (empty($assets)) {
return '';
}
$assetPath = !empty($localPath) ? $localPath : $this->assetPath;
return Url::to(CombineAssets::combine($assets, $asse... | php | public function combineAssets(array $assets, $localPath = '')
{
// Short circuit if no assets actually provided
if (empty($assets)) {
return '';
}
$assetPath = !empty($localPath) ? $localPath : $this->assetPath;
return Url::to(CombineAssets::combine($assets, $asse... | [
"public",
"function",
"combineAssets",
"(",
"array",
"$",
"assets",
",",
"$",
"localPath",
"=",
"''",
")",
"{",
"// Short circuit if no assets actually provided",
"if",
"(",
"empty",
"(",
"$",
"assets",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"assetPat... | Run the provided assets through the Asset Combiner
@param array $assets Collection of assets
@param string $localPath Prefix all assets with this path (optional)
@return string | [
"Run",
"the",
"provided",
"assets",
"through",
"the",
"Asset",
"Combiner"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L198-L206 |
208,249 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.getAssetPaths | public function getAssetPaths()
{
$this->removeDuplicates();
$assets = [];
foreach ($this->assets as $type => $collection) {
$assets[$type] = [];
foreach ($collection as $asset) {
$assets[$type][] = $this->getAssetEntryBuildPath($asset);
}... | php | public function getAssetPaths()
{
$this->removeDuplicates();
$assets = [];
foreach ($this->assets as $type => $collection) {
$assets[$type] = [];
foreach ($collection as $asset) {
$assets[$type][] = $this->getAssetEntryBuildPath($asset);
}... | [
"public",
"function",
"getAssetPaths",
"(",
")",
"{",
"$",
"this",
"->",
"removeDuplicates",
"(",
")",
";",
"$",
"assets",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"assets",
"as",
"$",
"type",
"=>",
"$",
"collection",
")",
"{",
"$",
"... | Returns an array of all registered asset paths.
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"registered",
"asset",
"paths",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L212-L225 |
208,250 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.getAssetPath | public function getAssetPath($fileName, $assetPath = null)
{
if (starts_with($fileName, ['//', 'http://', 'https://'])) {
return $fileName;
}
if (!$assetPath) {
$assetPath = $this->assetPath;
}
if (substr($fileName, 0, 1) == '/' || $assetPath === nul... | php | public function getAssetPath($fileName, $assetPath = null)
{
if (starts_with($fileName, ['//', 'http://', 'https://'])) {
return $fileName;
}
if (!$assetPath) {
$assetPath = $this->assetPath;
}
if (substr($fileName, 0, 1) == '/' || $assetPath === nul... | [
"public",
"function",
"getAssetPath",
"(",
"$",
"fileName",
",",
"$",
"assetPath",
"=",
"null",
")",
"{",
"if",
"(",
"starts_with",
"(",
"$",
"fileName",
",",
"[",
"'//'",
",",
"'http://'",
",",
"'https://'",
"]",
")",
")",
"{",
"return",
"$",
"fileNam... | Locates a file based on it's definition. If the file starts with
a forward slash, it will be returned in context of the application public path,
otherwise it will be returned in context of the asset path.
@param string $fileName File to load.
@param string $assetPath Explicitly define an asset path.
@return string Rela... | [
"Locates",
"a",
"file",
"based",
"on",
"it",
"s",
"definition",
".",
"If",
"the",
"file",
"starts",
"with",
"a",
"forward",
"slash",
"it",
"will",
"be",
"returned",
"in",
"context",
"of",
"the",
"application",
"public",
"path",
"otherwise",
"it",
"will",
... | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L235-L250 |
208,251 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.getAssetEntryBuildPath | protected function getAssetEntryBuildPath($asset)
{
$path = $asset['path'];
if (isset($asset['attributes']['build'])) {
$build = $asset['attributes']['build'];
if ($build == 'core') {
$build = 'v' . Parameter::get('system::core.build', 1);
}
... | php | protected function getAssetEntryBuildPath($asset)
{
$path = $asset['path'];
if (isset($asset['attributes']['build'])) {
$build = $asset['attributes']['build'];
if ($build == 'core') {
$build = 'v' . Parameter::get('system::core.build', 1);
}
... | [
"protected",
"function",
"getAssetEntryBuildPath",
"(",
"$",
"asset",
")",
"{",
"$",
"path",
"=",
"$",
"asset",
"[",
"'path'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"asset",
"[",
"'attributes'",
"]",
"[",
"'build'",
"]",
")",
")",
"{",
"$",
"build"... | Internal helper, attaches a build code to an asset path
@param array $asset Stored asset array
@return string | [
"Internal",
"helper",
"attaches",
"a",
"build",
"code",
"to",
"an",
"asset",
"path"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L266-L283 |
208,252 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.getAssetScheme | protected function getAssetScheme($asset)
{
if (starts_with($asset, ['//', 'http://', 'https://'])) {
return $asset;
}
if (substr($asset, 0, 1) == '/') {
$asset = Url::asset($asset);
}
return $asset;
} | php | protected function getAssetScheme($asset)
{
if (starts_with($asset, ['//', 'http://', 'https://'])) {
return $asset;
}
if (substr($asset, 0, 1) == '/') {
$asset = Url::asset($asset);
}
return $asset;
} | [
"protected",
"function",
"getAssetScheme",
"(",
"$",
"asset",
")",
"{",
"if",
"(",
"starts_with",
"(",
"$",
"asset",
",",
"[",
"'//'",
",",
"'http://'",
",",
"'https://'",
"]",
")",
")",
"{",
"return",
"$",
"asset",
";",
"}",
"if",
"(",
"substr",
"("... | Internal helper, get asset scheme
@param string $asset Specifies a path (URL) to the asset.
@return string | [
"Internal",
"helper",
"get",
"asset",
"scheme"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L290-L301 |
208,253 | octobercms/october | modules/system/traits/AssetMaker.php | AssetMaker.removeDuplicates | protected function removeDuplicates()
{
foreach ($this->assets as $type => &$collection) {
$pathCache = [];
foreach ($collection as $key => $asset) {
if (!$path = array_get($asset, 'path')) {
continue;
}
if (isset... | php | protected function removeDuplicates()
{
foreach ($this->assets as $type => &$collection) {
$pathCache = [];
foreach ($collection as $key => $asset) {
if (!$path = array_get($asset, 'path')) {
continue;
}
if (isset... | [
"protected",
"function",
"removeDuplicates",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"assets",
"as",
"$",
"type",
"=>",
"&",
"$",
"collection",
")",
"{",
"$",
"pathCache",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"k... | Removes duplicate assets from the entire collection.
@return void | [
"Removes",
"duplicate",
"assets",
"from",
"the",
"entire",
"collection",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L307-L327 |
208,254 | octobercms/october | modules/cms/classes/Controller.php | Controller.render | public static function render($pageFile, $parameters = [], $theme = null)
{
if (!$theme && (!$theme = Theme::getActiveTheme())) {
throw new CmsException(Lang::get('cms::lang.theme.active.not_found'));
}
$controller = new static($theme);
$controller->getRouter()->setParam... | php | public static function render($pageFile, $parameters = [], $theme = null)
{
if (!$theme && (!$theme = Theme::getActiveTheme())) {
throw new CmsException(Lang::get('cms::lang.theme.active.not_found'));
}
$controller = new static($theme);
$controller->getRouter()->setParam... | [
"public",
"static",
"function",
"render",
"(",
"$",
"pageFile",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"theme",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"theme",
"&&",
"(",
"!",
"$",
"theme",
"=",
"Theme",
"::",
"getActiveTheme",
"(",
... | Renders a page in its entirety, including component initialization.
AJAX will be disabled for this process.
@param string $pageFile Specifies the CMS page file name to run.
@param array $parameters Routing parameters.
@param \Cms\Classes\Theme $theme Theme object | [
"Renders",
"a",
"page",
"in",
"its",
"entirety",
"including",
"component",
"initialization",
".",
"AJAX",
"will",
"be",
"disabled",
"for",
"this",
"process",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L270-L284 |
208,255 | octobercms/october | modules/cms/classes/Controller.php | Controller.execPageCycle | protected function execPageCycle()
{
/**
* @event cms.page.start
* Fires before all of the page & layout lifecycle handlers are run
*
* Example usage:
*
* Event::listen('cms.page.start', function ((\Cms\Classes\Controller) $controller) {
* ... | php | protected function execPageCycle()
{
/**
* @event cms.page.start
* Fires before all of the page & layout lifecycle handlers are run
*
* Example usage:
*
* Event::listen('cms.page.start', function ((\Cms\Classes\Controller) $controller) {
* ... | [
"protected",
"function",
"execPageCycle",
"(",
")",
"{",
"/**\n * @event cms.page.start\n * Fires before all of the page & layout lifecycle handlers are run\n *\n * Example usage:\n *\n * Event::listen('cms.page.start', function ((\\Cms\\Classes\\Contr... | Executes the page life cycle.
Creates an object from the PHP sections of the page and
it's layout, then executes their life cycle functions. | [
"Executes",
"the",
"page",
"life",
"cycle",
".",
"Creates",
"an",
"object",
"from",
"the",
"PHP",
"sections",
"of",
"the",
"page",
"and",
"it",
"s",
"layout",
"then",
"executes",
"their",
"life",
"cycle",
"functions",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L454-L540 |
208,256 | octobercms/october | modules/cms/classes/Controller.php | Controller.postProcessResult | protected function postProcessResult($page, $url, $content)
{
$content = MediaViewHelper::instance()->processHtml($content);
/**
* @event cms.page.postprocess
* Provides oportunity to hook into the post processing of page HTML code before being sent to the client. `$dataHolder` = ... | php | protected function postProcessResult($page, $url, $content)
{
$content = MediaViewHelper::instance()->processHtml($content);
/**
* @event cms.page.postprocess
* Provides oportunity to hook into the post processing of page HTML code before being sent to the client. `$dataHolder` = ... | [
"protected",
"function",
"postProcessResult",
"(",
"$",
"page",
",",
"$",
"url",
",",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"MediaViewHelper",
"::",
"instance",
"(",
")",
"->",
"processHtml",
"(",
"$",
"content",
")",
";",
"/**\n * @event cm... | Post-processes page HTML code before it's sent to the client.
Note for pre-processing see cms.template.processTwigContent event.
@param \Cms\Classes\Page $page Specifies the current CMS page.
@param string $url Specifies the current URL.
@param string $content The page markup to post processs.
@return string Returns th... | [
"Post",
"-",
"processes",
"page",
"HTML",
"code",
"before",
"it",
"s",
"sent",
"to",
"the",
"client",
".",
"Note",
"for",
"pre",
"-",
"processing",
"see",
"cms",
".",
"template",
".",
"processTwigContent",
"event",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L550-L575 |
208,257 | octobercms/october | modules/cms/classes/Controller.php | Controller.initTwigEnvironment | protected function initTwigEnvironment()
{
$this->loader = new TwigLoader;
$useCache = !Config::get('cms.twigNoCache');
$isDebugMode = Config::get('app.debug', false);
$strictVariables = Config::get('cms.enableTwigStrictVariables', false);
$strictVariables = $strictVariables... | php | protected function initTwigEnvironment()
{
$this->loader = new TwigLoader;
$useCache = !Config::get('cms.twigNoCache');
$isDebugMode = Config::get('app.debug', false);
$strictVariables = Config::get('cms.enableTwigStrictVariables', false);
$strictVariables = $strictVariables... | [
"protected",
"function",
"initTwigEnvironment",
"(",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"new",
"TwigLoader",
";",
"$",
"useCache",
"=",
"!",
"Config",
"::",
"get",
"(",
"'cms.twigNoCache'",
")",
";",
"$",
"isDebugMode",
"=",
"Config",
"::",
"get",... | Initializes the Twig environment and loader.
Registers the \Cms\Twig\Extension object with Twig.
@return void | [
"Initializes",
"the",
"Twig",
"environment",
"and",
"loader",
".",
"Registers",
"the",
"\\",
"Cms",
"\\",
"Twig",
"\\",
"Extension",
"object",
"with",
"Twig",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L586-L616 |
208,258 | octobercms/october | modules/cms/classes/Controller.php | Controller.initCustomObjects | protected function initCustomObjects()
{
$this->layoutObj = null;
if (!$this->layout->isFallBack()) {
CmsException::mask($this->layout, 300);
$parser = new CodeParser($this->layout);
$this->layoutObj = $parser->source($this->page, $this->layout, $this);
... | php | protected function initCustomObjects()
{
$this->layoutObj = null;
if (!$this->layout->isFallBack()) {
CmsException::mask($this->layout, 300);
$parser = new CodeParser($this->layout);
$this->layoutObj = $parser->source($this->page, $this->layout, $this);
... | [
"protected",
"function",
"initCustomObjects",
"(",
")",
"{",
"$",
"this",
"->",
"layoutObj",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"layout",
"->",
"isFallBack",
"(",
")",
")",
"{",
"CmsException",
"::",
"mask",
"(",
"$",
"this",
"->",
... | Initializes the custom layout and page objects.
@return void | [
"Initializes",
"the",
"custom",
"layout",
"and",
"page",
"objects",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L622-L637 |
208,259 | octobercms/october | modules/cms/classes/Controller.php | Controller.initComponents | protected function initComponents()
{
if (!$this->layout->isFallBack()) {
foreach ($this->layout->settings['components'] as $component => $properties) {
list($name, $alias) = strpos($component, ' ')
? explode(' ', $component)
: [$component,... | php | protected function initComponents()
{
if (!$this->layout->isFallBack()) {
foreach ($this->layout->settings['components'] as $component => $properties) {
list($name, $alias) = strpos($component, ' ')
? explode(' ', $component)
: [$component,... | [
"protected",
"function",
"initComponents",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"layout",
"->",
"isFallBack",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"layout",
"->",
"settings",
"[",
"'components'",
"]",
"as",
"$",
"componen... | Initializes the components for the layout and page.
@return void | [
"Initializes",
"the",
"components",
"for",
"the",
"layout",
"and",
"page",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L643-L681 |
208,260 | octobercms/october | modules/cms/classes/Controller.php | Controller.getAjaxHandler | public function getAjaxHandler()
{
if (!Request::ajax() || Request::method() != 'POST') {
return null;
}
if ($handler = Request::header('X_OCTOBER_REQUEST_HANDLER')) {
return trim($handler);
}
return null;
} | php | public function getAjaxHandler()
{
if (!Request::ajax() || Request::method() != 'POST') {
return null;
}
if ($handler = Request::header('X_OCTOBER_REQUEST_HANDLER')) {
return trim($handler);
}
return null;
} | [
"public",
"function",
"getAjaxHandler",
"(",
")",
"{",
"if",
"(",
"!",
"Request",
"::",
"ajax",
"(",
")",
"||",
"Request",
"::",
"method",
"(",
")",
"!=",
"'POST'",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"handler",
"=",
"Request",
":... | Returns the AJAX handler for the current request, if available.
@return string | [
"Returns",
"the",
"AJAX",
"handler",
"for",
"the",
"current",
"request",
"if",
"available",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L691-L702 |
208,261 | octobercms/october | modules/cms/classes/Controller.php | Controller.execAjaxHandlers | protected function execAjaxHandlers()
{
if ($handler = $this->getAjaxHandler()) {
try {
/*
* Validate the handler name
*/
if (!preg_match('/^(?:\w+\:{2})?on[A-Z]{1}[\w+]*$/', $handler)) {
throw new CmsException... | php | protected function execAjaxHandlers()
{
if ($handler = $this->getAjaxHandler()) {
try {
/*
* Validate the handler name
*/
if (!preg_match('/^(?:\w+\:{2})?on[A-Z]{1}[\w+]*$/', $handler)) {
throw new CmsException... | [
"protected",
"function",
"execAjaxHandlers",
"(",
")",
"{",
"if",
"(",
"$",
"handler",
"=",
"$",
"this",
"->",
"getAjaxHandler",
"(",
")",
")",
"{",
"try",
"{",
"/*\n * Validate the handler name\n */",
"if",
"(",
"!",
"preg_match",
... | Executes the page, layout, component and plugin AJAX handlers.
@return mixed Returns the AJAX Response object or null. | [
"Executes",
"the",
"page",
"layout",
"component",
"and",
"plugin",
"AJAX",
"handlers",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L708-L797 |
208,262 | octobercms/october | modules/cms/classes/Controller.php | Controller.runAjaxHandler | protected function runAjaxHandler($handler)
{
/**
* @event cms.ajax.beforeRunHandler
* Provides an opportunity to modify an AJAX request
*
* The parameter provided is `$handler` (the requested AJAX handler to be run)
*
* Example usage (forwards AJAX hand... | php | protected function runAjaxHandler($handler)
{
/**
* @event cms.ajax.beforeRunHandler
* Provides an opportunity to modify an AJAX request
*
* The parameter provided is `$handler` (the requested AJAX handler to be run)
*
* Example usage (forwards AJAX hand... | [
"protected",
"function",
"runAjaxHandler",
"(",
"$",
"handler",
")",
"{",
"/**\n * @event cms.ajax.beforeRunHandler\n * Provides an opportunity to modify an AJAX request\n *\n * The parameter provided is `$handler` (the requested AJAX handler to be run)\n *\n ... | Tries to find and run an AJAX handler in the page, layout, components and plugins.
The method stops as soon as the handler is found.
@param string $handler name of the ajax handler
@return boolean Returns true if the handler was found. Returns false otherwise. | [
"Tries",
"to",
"find",
"and",
"run",
"an",
"AJAX",
"handler",
"in",
"the",
"page",
"layout",
"components",
"and",
"plugins",
".",
"The",
"method",
"stops",
"as",
"soon",
"as",
"the",
"handler",
"is",
"found",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L805-L886 |
208,263 | octobercms/october | modules/cms/classes/Controller.php | Controller.renderPage | public function renderPage()
{
$contents = $this->pageContents;
/**
* @event cms.page.render
* Provides an oportunity to manipulate the page's rendered contents
*
* Example usage:
*
* Event::listen('cms.page.render', function ((\Cms\Classes\... | php | public function renderPage()
{
$contents = $this->pageContents;
/**
* @event cms.page.render
* Provides an oportunity to manipulate the page's rendered contents
*
* Example usage:
*
* Event::listen('cms.page.render', function ((\Cms\Classes\... | [
"public",
"function",
"renderPage",
"(",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"pageContents",
";",
"/**\n * @event cms.page.render\n * Provides an oportunity to manipulate the page's rendered contents\n *\n * Example usage:\n *\n ... | Renders a requested page.
The framework uses this method internally. | [
"Renders",
"a",
"requested",
"page",
".",
"The",
"framework",
"uses",
"this",
"method",
"internally",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L896-L922 |
208,264 | octobercms/october | modules/cms/classes/Controller.php | Controller.renderContent | public function renderContent($name, $parameters = [])
{
/**
* @event cms.page.beforeRenderContent
* Provides an oportunity to manipulate the name of the content file being rendered before it renders
*
* Example usage:
*
* Event::listen('cms.page.bef... | php | public function renderContent($name, $parameters = [])
{
/**
* @event cms.page.beforeRenderContent
* Provides an oportunity to manipulate the name of the content file being rendered before it renders
*
* Example usage:
*
* Event::listen('cms.page.bef... | [
"public",
"function",
"renderContent",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"/**\n * @event cms.page.beforeRenderContent\n * Provides an oportunity to manipulate the name of the content file being rendered before it renders\n *\n ... | Renders a requested content file.
The framework uses this method internally.
@param string $name The content view to load.
@param array $parameters Parameter variables to pass to the view.
@return string | [
"Renders",
"a",
"requested",
"content",
"file",
".",
"The",
"framework",
"uses",
"this",
"method",
"internally",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1130-L1198 |
208,265 | octobercms/october | modules/cms/classes/Controller.php | Controller.renderComponent | public function renderComponent($name, $parameters = [])
{
$result = null;
$previousContext = $this->componentContext;
if ($componentObj = $this->findComponentByName($name)) {
$componentObj->id = uniqid($name);
$componentObj->setProperties(array_merge($componentObj->... | php | public function renderComponent($name, $parameters = [])
{
$result = null;
$previousContext = $this->componentContext;
if ($componentObj = $this->findComponentByName($name)) {
$componentObj->id = uniqid($name);
$componentObj->setProperties(array_merge($componentObj->... | [
"public",
"function",
"renderComponent",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"previousContext",
"=",
"$",
"this",
"->",
"componentContext",
";",
"if",
"(",
"$",
"componentObj",
"=",
"... | Renders a component's default content, preserves the previous component context.
@param $name
@param array $parameters
@return string Returns the component default contents. | [
"Renders",
"a",
"component",
"s",
"default",
"content",
"preserves",
"the",
"previous",
"component",
"context",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1206-L1224 |
208,266 | octobercms/october | modules/cms/classes/Controller.php | Controller.currentPageUrl | public function currentPageUrl($parameters = [], $routePersistence = true)
{
if (!$currentFile = $this->page->getFileName()) {
return null;
}
return $this->pageUrl($currentFile, $parameters, $routePersistence);
} | php | public function currentPageUrl($parameters = [], $routePersistence = true)
{
if (!$currentFile = $this->page->getFileName()) {
return null;
}
return $this->pageUrl($currentFile, $parameters, $routePersistence);
} | [
"public",
"function",
"currentPageUrl",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"routePersistence",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"currentFile",
"=",
"$",
"this",
"->",
"page",
"->",
"getFileName",
"(",
")",
")",
"{",
"return",
... | Looks up the current page URL with supplied parameters and route persistence.
@param array $parameters
@param bool $routePersistence
@return null|string | [
"Looks",
"up",
"the",
"current",
"page",
"URL",
"with",
"supplied",
"parameters",
"and",
"route",
"persistence",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1386-L1393 |
208,267 | octobercms/october | modules/cms/classes/Controller.php | Controller.themeUrl | public function themeUrl($url = null)
{
$themeDir = $this->getTheme()->getDirName();
if (is_array($url)) {
$_url = Url::to(CombineAssets::combine($url, themes_path().'/'.$themeDir));
}
else {
$_url = Config::get('cms.themesPath', '/themes').'/'.$themeDir;
... | php | public function themeUrl($url = null)
{
$themeDir = $this->getTheme()->getDirName();
if (is_array($url)) {
$_url = Url::to(CombineAssets::combine($url, themes_path().'/'.$themeDir));
}
else {
$_url = Config::get('cms.themesPath', '/themes').'/'.$themeDir;
... | [
"public",
"function",
"themeUrl",
"(",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"themeDir",
"=",
"$",
"this",
"->",
"getTheme",
"(",
")",
"->",
"getDirName",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"url",
")",
")",
"{",
"$",
"_url",
"=",
... | Converts supplied URL to a theme URL relative to the website root. If the URL provided is an
array then the files will be combined.
@param mixed $url Specifies the theme-relative URL. If null, the theme path is returned.
@return string | [
"Converts",
"supplied",
"URL",
"to",
"a",
"theme",
"URL",
"relative",
"to",
"the",
"website",
"root",
".",
"If",
"the",
"URL",
"provided",
"is",
"an",
"array",
"then",
"the",
"files",
"will",
"be",
"combined",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1401-L1417 |
208,268 | octobercms/october | modules/cms/classes/Controller.php | Controller.addComponent | public function addComponent($name, $alias, $properties, $addToLayout = false)
{
$manager = ComponentManager::instance();
if ($addToLayout) {
if (!$componentObj = $manager->makeComponent($name, $this->layoutObj, $properties)) {
throw new CmsException(Lang::get('cms::lang... | php | public function addComponent($name, $alias, $properties, $addToLayout = false)
{
$manager = ComponentManager::instance();
if ($addToLayout) {
if (!$componentObj = $manager->makeComponent($name, $this->layoutObj, $properties)) {
throw new CmsException(Lang::get('cms::lang... | [
"public",
"function",
"addComponent",
"(",
"$",
"name",
",",
"$",
"alias",
",",
"$",
"properties",
",",
"$",
"addToLayout",
"=",
"false",
")",
"{",
"$",
"manager",
"=",
"ComponentManager",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"addToLayout",
... | Adds a component to the page object
@param mixed $name Component class name or short name
@param string $alias Alias to give the component
@param array $properties Component properties
@param bool $addToLayout Add to layout, instead of page
@return ComponentBase Component object | [
"Adds",
"a",
"component",
"to",
"the",
"page",
"object"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1442-L1466 |
208,269 | octobercms/october | modules/cms/classes/Controller.php | Controller.findComponentByName | public function findComponentByName($name)
{
if (isset($this->page->components[$name])) {
return $this->page->components[$name];
}
if (isset($this->layout->components[$name])) {
return $this->layout->components[$name];
}
$partialComponent = $this->pa... | php | public function findComponentByName($name)
{
if (isset($this->page->components[$name])) {
return $this->page->components[$name];
}
if (isset($this->layout->components[$name])) {
return $this->layout->components[$name];
}
$partialComponent = $this->pa... | [
"public",
"function",
"findComponentByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"page",
"->",
"components",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"page",
"->",
"components",
"[",
"$",
... | Searches the layout and page components by an alias
@param $name
@return ComponentBase The component object, if found | [
"Searches",
"the",
"layout",
"and",
"page",
"components",
"by",
"an",
"alias"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1473-L1489 |
208,270 | octobercms/october | modules/cms/classes/Controller.php | Controller.findComponentByHandler | public function findComponentByHandler($handler)
{
foreach ($this->page->components as $component) {
if ($component->methodExists($handler)) {
return $component;
}
}
foreach ($this->layout->components as $component) {
if ($component->metho... | php | public function findComponentByHandler($handler)
{
foreach ($this->page->components as $component) {
if ($component->methodExists($handler)) {
return $component;
}
}
foreach ($this->layout->components as $component) {
if ($component->metho... | [
"public",
"function",
"findComponentByHandler",
"(",
"$",
"handler",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"page",
"->",
"components",
"as",
"$",
"component",
")",
"{",
"if",
"(",
"$",
"component",
"->",
"methodExists",
"(",
"$",
"handler",
")",
"... | Searches the layout and page components by an AJAX handler
@param string $handler
@return ComponentBase The component object, if found | [
"Searches",
"the",
"layout",
"and",
"page",
"components",
"by",
"an",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1496-L1511 |
208,271 | octobercms/october | modules/cms/classes/Controller.php | Controller.findComponentByPartial | public function findComponentByPartial($partial)
{
foreach ($this->page->components as $component) {
if (ComponentPartial::check($component, $partial)) {
return $component;
}
}
foreach ($this->layout->components as $component) {
if (Compon... | php | public function findComponentByPartial($partial)
{
foreach ($this->page->components as $component) {
if (ComponentPartial::check($component, $partial)) {
return $component;
}
}
foreach ($this->layout->components as $component) {
if (Compon... | [
"public",
"function",
"findComponentByPartial",
"(",
"$",
"partial",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"page",
"->",
"components",
"as",
"$",
"component",
")",
"{",
"if",
"(",
"ComponentPartial",
"::",
"check",
"(",
"$",
"component",
",",
"$",
... | Searches the layout and page components by a partial file
@param string $partial
@return ComponentBase The component object, if found | [
"Searches",
"the",
"layout",
"and",
"page",
"components",
"by",
"a",
"partial",
"file"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Controller.php#L1518-L1533 |
208,272 | octobercms/october | modules/backend/classes/FormWidgetBase.php | FormWidgetBase.getLoadValue | public function getLoadValue()
{
if ($this->formField->value !== null) {
return $this->formField->value;
}
$defaultValue = !$this->model->exists
? $this->formField->getDefaultFromData($this->data ?: $this->model)
: null;
return $this->formField->... | php | public function getLoadValue()
{
if ($this->formField->value !== null) {
return $this->formField->value;
}
$defaultValue = !$this->model->exists
? $this->formField->getDefaultFromData($this->data ?: $this->model)
: null;
return $this->formField->... | [
"public",
"function",
"getLoadValue",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"formField",
"->",
"value",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"formField",
"->",
"value",
";",
"}",
"$",
"defaultValue",
"=",
"!",
"$",
"this",
"->... | Returns the value for this form field,
supports nesting via HTML array.
@return string | [
"Returns",
"the",
"value",
"for",
"this",
"form",
"field",
"supports",
"nesting",
"via",
"HTML",
"array",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormWidgetBase.php#L140-L151 |
208,273 | octobercms/october | modules/backend/behaviors/UserPreferencesModel.php | UserPreferencesModel.instance | public function instance()
{
if (isset(self::$instances[$this->recordCode])) {
return self::$instances[$this->recordCode];
}
if (!$item = $this->getSettingsRecord()) {
$this->model->initSettingsData();
$item = $this->model;
}
return self:... | php | public function instance()
{
if (isset(self::$instances[$this->recordCode])) {
return self::$instances[$this->recordCode];
}
if (!$item = $this->getSettingsRecord()) {
$this->model->initSettingsData();
$item = $this->model;
}
return self:... | [
"public",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"this",
"->",
"recordCode",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"instances",
"[",
"$",
"this",
"->",
"recordCode",
"]",
... | Create an instance of the settings model, intended as a static method | [
"Create",
"an",
"instance",
"of",
"the",
"settings",
"model",
"intended",
"as",
"a",
"static",
"method"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/UserPreferencesModel.php#L37-L49 |
208,274 | octobercms/october | modules/backend/behaviors/UserPreferencesModel.php | UserPreferencesModel.getCacheKey | protected function getCacheKey()
{
$item = UserPreference::forUser();
$userId = $item->userContext ? $item->userContext->id : 0;
return $this->recordCode.'-userpreference-'.$userId;
} | php | protected function getCacheKey()
{
$item = UserPreference::forUser();
$userId = $item->userContext ? $item->userContext->id : 0;
return $this->recordCode.'-userpreference-'.$userId;
} | [
"protected",
"function",
"getCacheKey",
"(",
")",
"{",
"$",
"item",
"=",
"UserPreference",
"::",
"forUser",
"(",
")",
";",
"$",
"userId",
"=",
"$",
"item",
"->",
"userContext",
"?",
"$",
"item",
"->",
"userContext",
"->",
"id",
":",
"0",
";",
"return",... | Returns a cache key for this record. | [
"Returns",
"a",
"cache",
"key",
"for",
"this",
"record",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/UserPreferencesModel.php#L111-L116 |
208,275 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onSearch | public function onSearch()
{
$this->setSearchTerm(Input::get('search'));
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
'#'.$this->getId('folder-path') => $this->makePartial('folder-path')
];
} | php | public function onSearch()
{
$this->setSearchTerm(Input::get('search'));
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
'#'.$this->getId('folder-path') => $this->makePartial('folder-path')
];
} | [
"public",
"function",
"onSearch",
"(",
")",
"{",
"$",
"this",
"->",
"setSearchTerm",
"(",
"Input",
"::",
"get",
"(",
"'search'",
")",
")",
";",
"$",
"this",
"->",
"prepareVars",
"(",
")",
";",
"return",
"[",
"'#'",
".",
"$",
"this",
"->",
"getId",
... | Perform search AJAX handler
@return array | [
"Perform",
"search",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L115-L125 |
208,276 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onGoToFolder | public function onGoToFolder()
{
$path = Input::get('path');
if (Input::get('clearCache')) {
MediaLibrary::instance()->resetCache();
}
if (Input::get('resetSearch')) {
$this->setSearchTerm(null);
}
$this->setCurrentFolder($path);
$th... | php | public function onGoToFolder()
{
$path = Input::get('path');
if (Input::get('clearCache')) {
MediaLibrary::instance()->resetCache();
}
if (Input::get('resetSearch')) {
$this->setSearchTerm(null);
}
$this->setCurrentFolder($path);
$th... | [
"public",
"function",
"onGoToFolder",
"(",
")",
"{",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"if",
"(",
"Input",
"::",
"get",
"(",
"'clearCache'",
")",
")",
"{",
"MediaLibrary",
"::",
"instance",
"(",
")",
"->",
"resetCache",
... | Change view AJAX handler
@return array | [
"Change",
"view",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L131-L150 |
208,277 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onGenerateThumbnails | public function onGenerateThumbnails()
{
$batch = Input::get('batch');
if (!is_array($batch)) {
return;
}
$result = [];
foreach ($batch as $thumbnailInfo) {
$result[] = $this->generateThumbnail($thumbnailInfo);
}
return [
... | php | public function onGenerateThumbnails()
{
$batch = Input::get('batch');
if (!is_array($batch)) {
return;
}
$result = [];
foreach ($batch as $thumbnailInfo) {
$result[] = $this->generateThumbnail($thumbnailInfo);
}
return [
... | [
"public",
"function",
"onGenerateThumbnails",
"(",
")",
"{",
"$",
"batch",
"=",
"Input",
"::",
"get",
"(",
"'batch'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"batch",
")",
")",
"{",
"return",
";",
"}",
"$",
"result",
"=",
"[",
"]",
";",
"... | Generate thumbnail AJAX handler
@return array | [
"Generate",
"thumbnail",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L156-L171 |
208,278 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onGetSidebarThumbnail | public function onGetSidebarThumbnail()
{
$path = Input::get('path');
$lastModified = Input::get('lastModified');
$thumbnailParams = $this->getThumbnailParams();
$thumbnailParams['width'] = 300;
$thumbnailParams['height'] = 255;
$thumbnailParams['mode'] = 'auto';
... | php | public function onGetSidebarThumbnail()
{
$path = Input::get('path');
$lastModified = Input::get('lastModified');
$thumbnailParams = $this->getThumbnailParams();
$thumbnailParams['width'] = 300;
$thumbnailParams['height'] = 255;
$thumbnailParams['mode'] = 'auto';
... | [
"public",
"function",
"onGetSidebarThumbnail",
"(",
")",
"{",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"lastModified",
"=",
"Input",
"::",
"get",
"(",
"'lastModified'",
")",
";",
"$",
"thumbnailParams",
"=",
"$",
"this",
"->"... | Get thumbnail AJAX handler
@return array | [
"Get",
"thumbnail",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L177-L213 |
208,279 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onChangeView | public function onChangeView()
{
$viewMode = Input::get('view');
$path = Input::get('path');
$this->setViewMode($viewMode);
$this->setCurrentFolder($path);
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
... | php | public function onChangeView()
{
$viewMode = Input::get('view');
$path = Input::get('path');
$this->setViewMode($viewMode);
$this->setCurrentFolder($path);
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
... | [
"public",
"function",
"onChangeView",
"(",
")",
"{",
"$",
"viewMode",
"=",
"Input",
"::",
"get",
"(",
"'view'",
")",
";",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"this",
"->",
"setViewMode",
"(",
"$",
"viewMode",
")",
... | Set view preference AJAX handler
@return array | [
"Set",
"view",
"preference",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L219-L234 |
208,280 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onSetFilter | public function onSetFilter()
{
$filter = Input::get('filter');
$path = Input::get('path');
$this->setFilter($filter);
$this->setCurrentFolder($path);
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
... | php | public function onSetFilter()
{
$filter = Input::get('filter');
$path = Input::get('path');
$this->setFilter($filter);
$this->setCurrentFolder($path);
$this->prepareVars();
return [
'#'.$this->getId('item-list') => $this->makePartial('item-list'),
... | [
"public",
"function",
"onSetFilter",
"(",
")",
"{",
"$",
"filter",
"=",
"Input",
"::",
"get",
"(",
"'filter'",
")",
";",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"this",
"->",
"setFilter",
"(",
"$",
"filter",
")",
";",
... | Set filter preference AJAX handler
@return array | [
"Set",
"filter",
"preference",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L240-L255 |
208,281 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onSetSorting | public function onSetSorting()
{
$sortBy = Input::get('sortBy', $this->getSortBy());
$sortDirection = Input::get('sortDirection', $this->getSortDirection());
$path = Input::get('path');
$this->setSortBy($sortBy);
$this->setSortDirection($sortDirection);
$this->setCur... | php | public function onSetSorting()
{
$sortBy = Input::get('sortBy', $this->getSortBy());
$sortDirection = Input::get('sortDirection', $this->getSortDirection());
$path = Input::get('path');
$this->setSortBy($sortBy);
$this->setSortDirection($sortDirection);
$this->setCur... | [
"public",
"function",
"onSetSorting",
"(",
")",
"{",
"$",
"sortBy",
"=",
"Input",
"::",
"get",
"(",
"'sortBy'",
",",
"$",
"this",
"->",
"getSortBy",
"(",
")",
")",
";",
"$",
"sortDirection",
"=",
"Input",
"::",
"get",
"(",
"'sortDirection'",
",",
"$",
... | Set sorting preference AJAX handler
@return array | [
"Set",
"sorting",
"preference",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L261-L277 |
208,282 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onDeleteItem | public function onDeleteItem()
{
$this->abortIfReadOnly();
$paths = Input::get('paths');
if (!is_array($paths)) {
throw new ApplicationException('Invalid input data');
}
$library = MediaLibrary::instance();
$filesToDelete = [];
foreach ($paths ... | php | public function onDeleteItem()
{
$this->abortIfReadOnly();
$paths = Input::get('paths');
if (!is_array($paths)) {
throw new ApplicationException('Invalid input data');
}
$library = MediaLibrary::instance();
$filesToDelete = [];
foreach ($paths ... | [
"public",
"function",
"onDeleteItem",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"paths",
"=",
"Input",
"::",
"get",
"(",
"'paths'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"paths",
")",
")",
"{",
"throw",
"new... | Delete library item AJAX handler
@return array | [
"Delete",
"library",
"item",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L283-L374 |
208,283 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onLoadRenamePopup | public function onLoadRenamePopup()
{
$this->abortIfReadOnly();
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
$this->vars['originalPath'] = $path;
$this->vars['name'] = basename($path);
$this->vars['listId'] = Input::get('listId');
$... | php | public function onLoadRenamePopup()
{
$this->abortIfReadOnly();
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
$this->vars['originalPath'] = $path;
$this->vars['name'] = basename($path);
$this->vars['listId'] = Input::get('listId');
$... | [
"public",
"function",
"onLoadRenamePopup",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"path",
"=",
"MediaLibrary",
"::",
"validatePath",
"(",
"$",
"path",
")... | Show rename item popup AJAX handler
@return array | [
"Show",
"rename",
"item",
"popup",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L380-L393 |
208,284 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onApplyName | public function onApplyName()
{
$this->abortIfReadOnly();
$newName = trim(Input::get('name'));
if (!strlen($newName)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($newName)) {
throw... | php | public function onApplyName()
{
$this->abortIfReadOnly();
$newName = trim(Input::get('name'));
if (!strlen($newName)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($newName)) {
throw... | [
"public",
"function",
"onApplyName",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"newName",
"=",
"trim",
"(",
"Input",
"::",
"get",
"(",
"'name'",
")",
")",
";",
"if",
"(",
"!",
"strlen",
"(",
"$",
"newName",
")",
")",
... | Reanem library item AJAX handler
@return array | [
"Reanem",
"library",
"item",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L399-L476 |
208,285 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onCreateFolder | public function onCreateFolder()
{
$this->abortIfReadOnly();
$name = trim(Input::get('name'));
if (!strlen($name)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($name)) {
throw new A... | php | public function onCreateFolder()
{
$this->abortIfReadOnly();
$name = trim(Input::get('name'));
if (!strlen($name)) {
throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
}
if (!$this->validateFileName($name)) {
throw new A... | [
"public",
"function",
"onCreateFolder",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"name",
"=",
"trim",
"(",
"Input",
"::",
"get",
"(",
"'name'",
")",
")",
";",
"if",
"(",
"!",
"strlen",
"(",
"$",
"name",
")",
")",
"... | Create library folder AJAX handler
@return array | [
"Create",
"library",
"folder",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L482-L539 |
208,286 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onLoadMovePopup | public function onLoadMovePopup()
{
$this->abortIfReadOnly();
$exclude = Input::get('exclude', []);
if (!is_array($exclude)) {
throw new ApplicationException('Invalid input data');
}
$folders = MediaLibrary::instance()->listAllDirectories($exclude);
$fo... | php | public function onLoadMovePopup()
{
$this->abortIfReadOnly();
$exclude = Input::get('exclude', []);
if (!is_array($exclude)) {
throw new ApplicationException('Invalid input data');
}
$folders = MediaLibrary::instance()->listAllDirectories($exclude);
$fo... | [
"public",
"function",
"onLoadMovePopup",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"exclude",
"=",
"Input",
"::",
"get",
"(",
"'exclude'",
",",
"[",
"]",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"exclude",
")",
... | Show move item popup AJAX handler
@return array | [
"Show",
"move",
"item",
"popup",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L545-L575 |
208,287 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onMoveItems | public function onMoveItems()
{
$this->abortIfReadOnly();
$dest = trim(Input::get('dest'));
if (!strlen($dest)) {
throw new ApplicationException(Lang::get('backend::lang.media.please_select_move_dest'));
}
$dest = MediaLibrary::validatePath($dest);
if ($... | php | public function onMoveItems()
{
$this->abortIfReadOnly();
$dest = trim(Input::get('dest'));
if (!strlen($dest)) {
throw new ApplicationException(Lang::get('backend::lang.media.please_select_move_dest'));
}
$dest = MediaLibrary::validatePath($dest);
if ($... | [
"public",
"function",
"onMoveItems",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"dest",
"=",
"trim",
"(",
"Input",
"::",
"get",
"(",
"'dest'",
")",
")",
";",
"if",
"(",
"!",
"strlen",
"(",
"$",
"dest",
")",
")",
"{",... | Move library item AJAX handler
@return array | [
"Move",
"library",
"item",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L581-L666 |
208,288 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onLoadPopup | public function onLoadPopup()
{
$this->bottomToolbar = Input::get('bottomToolbar', $this->bottomToolbar);
$this->cropAndInsertButton = Input::get('cropAndInsertButton', $this->cropAndInsertButton);
return $this->makePartial('popup-body');
} | php | public function onLoadPopup()
{
$this->bottomToolbar = Input::get('bottomToolbar', $this->bottomToolbar);
$this->cropAndInsertButton = Input::get('cropAndInsertButton', $this->cropAndInsertButton);
return $this->makePartial('popup-body');
} | [
"public",
"function",
"onLoadPopup",
"(",
")",
"{",
"$",
"this",
"->",
"bottomToolbar",
"=",
"Input",
"::",
"get",
"(",
"'bottomToolbar'",
",",
"$",
"this",
"->",
"bottomToolbar",
")",
";",
"$",
"this",
"->",
"cropAndInsertButton",
"=",
"Input",
"::",
"get... | Start image cropping session AJAX handler
@return array | [
"Start",
"image",
"cropping",
"session",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L683-L690 |
208,289 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onLoadImageCropPopup | public function onLoadImageCropPopup()
{
$this->abortIfReadOnly();
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
$cropSessionKey = md5(FormHelper::getSessionKey());
$selectionParams = $this->getSelectionParams();
$urlAndSize = $this->getCrop... | php | public function onLoadImageCropPopup()
{
$this->abortIfReadOnly();
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
$cropSessionKey = md5(FormHelper::getSessionKey());
$selectionParams = $this->getSelectionParams();
$urlAndSize = $this->getCrop... | [
"public",
"function",
"onLoadImageCropPopup",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"path",
"=",
"Input",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"path",
"=",
"MediaLibrary",
"::",
"validatePath",
"(",
"$",
"path",
... | Load image for cropping AJAX handler
@return array | [
"Load",
"image",
"for",
"cropping",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L696-L719 |
208,290 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onEndCroppingSession | public function onEndCroppingSession()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$this->removeCropEditDir($cropSessionK... | php | public function onEndCroppingSession()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$this->removeCropEditDir($cropSessionK... | [
"public",
"function",
"onEndCroppingSession",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"cropSessionKey",
"=",
"Input",
"::",
"get",
"(",
"'cropSessionKey'",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[0-9a-z]+$/'",
",",
... | End crop session AJAX handler
@return array | [
"End",
"crop",
"session",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L725-L735 |
208,291 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onCropImage | public function onCropImage()
{
$this->abortIfReadOnly();
$imageSrcPath = trim(Input::get('img'));
$selectionData = Input::get('selection');
$cropSessionKey = Input::get('cropSessionKey');
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
... | php | public function onCropImage()
{
$this->abortIfReadOnly();
$imageSrcPath = trim(Input::get('img'));
$selectionData = Input::get('selection');
$cropSessionKey = Input::get('cropSessionKey');
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
... | [
"public",
"function",
"onCropImage",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"imageSrcPath",
"=",
"trim",
"(",
"Input",
"::",
"get",
"(",
"'img'",
")",
")",
";",
"$",
"selectionData",
"=",
"Input",
"::",
"get",
"(",
"... | Crop image AJAX handler
@return array | [
"Crop",
"image",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L741-L772 |
208,292 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.onResizeImage | public function onResizeImage()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$width = trim(Input::get('width'));
i... | php | public function onResizeImage()
{
$this->abortIfReadOnly();
$cropSessionKey = Input::get('cropSessionKey');
if (!preg_match('/^[0-9a-z]+$/', $cropSessionKey)) {
throw new ApplicationException('Invalid input data');
}
$width = trim(Input::get('width'));
i... | [
"public",
"function",
"onResizeImage",
"(",
")",
"{",
"$",
"this",
"->",
"abortIfReadOnly",
"(",
")",
";",
"$",
"cropSessionKey",
"=",
"Input",
"::",
"get",
"(",
"'cropSessionKey'",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[0-9a-z]+$/'",
",",
"$",
... | Resize image AJAX handler
@return array | [
"Resize",
"image",
"AJAX",
"handler"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L778-L806 |
208,293 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.prepareVars | protected function prepareVars()
{
clearstatcache();
$folder = $this->getCurrentFolder();
$viewMode = $this->getViewMode();
$filter = $this->getFilter();
$sortBy = $this->getSortBy();
$sortDirection = $this->getSortDirection();
$searchTerm = $this->getSearchT... | php | protected function prepareVars()
{
clearstatcache();
$folder = $this->getCurrentFolder();
$viewMode = $this->getViewMode();
$filter = $this->getFilter();
$sortBy = $this->getSortBy();
$sortDirection = $this->getSortDirection();
$searchTerm = $this->getSearchT... | [
"protected",
"function",
"prepareVars",
"(",
")",
"{",
"clearstatcache",
"(",
")",
";",
"$",
"folder",
"=",
"$",
"this",
"->",
"getCurrentFolder",
"(",
")",
";",
"$",
"viewMode",
"=",
"$",
"this",
"->",
"getViewMode",
"(",
")",
";",
"$",
"filter",
"=",... | Internal method to prepare view variables.
@return array | [
"Internal",
"method",
"to",
"prepare",
"view",
"variables",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L816-L846 |
208,294 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.findFiles | protected function findFiles($searchTerm, $filter, $sortBy)
{
$filter = $filter !== self::FILTER_EVERYTHING ? $filter : null;
return MediaLibrary::instance()->findFiles($searchTerm, $sortBy, $filter);
} | php | protected function findFiles($searchTerm, $filter, $sortBy)
{
$filter = $filter !== self::FILTER_EVERYTHING ? $filter : null;
return MediaLibrary::instance()->findFiles($searchTerm, $sortBy, $filter);
} | [
"protected",
"function",
"findFiles",
"(",
"$",
"searchTerm",
",",
"$",
"filter",
",",
"$",
"sortBy",
")",
"{",
"$",
"filter",
"=",
"$",
"filter",
"!==",
"self",
"::",
"FILTER_EVERYTHING",
"?",
"$",
"filter",
":",
"null",
";",
"return",
"MediaLibrary",
"... | Finds files from within the media library based on supplied criteria,
returns an array of MediaLibraryItem objects.
@param string $searchTerm
@param string $filter
@param string $sortBy
@param array[System\Classes\MediaLibraryItem] | [
"Finds",
"files",
"from",
"within",
"the",
"media",
"library",
"based",
"on",
"supplied",
"criteria",
"returns",
"an",
"array",
"of",
"MediaLibraryItem",
"objects",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L870-L875 |
208,295 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.setFilter | protected function setFilter($filter)
{
if (!in_array($filter, [
self::FILTER_EVERYTHING,
MediaLibraryItem::FILE_TYPE_IMAGE,
MediaLibraryItem::FILE_TYPE_AUDIO,
MediaLibraryItem::FILE_TYPE_DOCUMENT,
MediaLibraryItem::FILE_TYPE_VIDEO
])) {
... | php | protected function setFilter($filter)
{
if (!in_array($filter, [
self::FILTER_EVERYTHING,
MediaLibraryItem::FILE_TYPE_IMAGE,
MediaLibraryItem::FILE_TYPE_AUDIO,
MediaLibraryItem::FILE_TYPE_DOCUMENT,
MediaLibraryItem::FILE_TYPE_VIDEO
])) {
... | [
"protected",
"function",
"setFilter",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"filter",
",",
"[",
"self",
"::",
"FILTER_EVERYTHING",
",",
"MediaLibraryItem",
"::",
"FILE_TYPE_IMAGE",
",",
"MediaLibraryItem",
"::",
"FILE_TYPE_AUDIO",
... | Sets the user filter from the session state
@param string $filter
@return void | [
"Sets",
"the",
"user",
"filter",
"from",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L903-L916 |
208,296 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.setSortBy | protected function setSortBy($sortBy)
{
if (!in_array($sortBy, [
MediaLibrary::SORT_BY_TITLE,
MediaLibrary::SORT_BY_SIZE,
MediaLibrary::SORT_BY_MODIFIED
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('m... | php | protected function setSortBy($sortBy)
{
if (!in_array($sortBy, [
MediaLibrary::SORT_BY_TITLE,
MediaLibrary::SORT_BY_SIZE,
MediaLibrary::SORT_BY_MODIFIED
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('m... | [
"protected",
"function",
"setSortBy",
"(",
"$",
"sortBy",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"sortBy",
",",
"[",
"MediaLibrary",
"::",
"SORT_BY_TITLE",
",",
"MediaLibrary",
"::",
"SORT_BY_SIZE",
",",
"MediaLibrary",
"::",
"SORT_BY_MODIFIED",
"]",
... | Sets the user sort column from the session state
@param string $sortBy
@return void | [
"Sets",
"the",
"user",
"sort",
"column",
"from",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L951-L962 |
208,297 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.setSortDirection | protected function setSortDirection($sortDirection)
{
if (!in_array($sortDirection, [
MediaLibrary::SORT_DIRECTION_ASC,
MediaLibrary::SORT_DIRECTION_DESC
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('media_sort_d... | php | protected function setSortDirection($sortDirection)
{
if (!in_array($sortDirection, [
MediaLibrary::SORT_DIRECTION_ASC,
MediaLibrary::SORT_DIRECTION_DESC
])) {
throw new ApplicationException('Invalid input data');
}
$this->putSession('media_sort_d... | [
"protected",
"function",
"setSortDirection",
"(",
"$",
"sortDirection",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"sortDirection",
",",
"[",
"MediaLibrary",
"::",
"SORT_DIRECTION_ASC",
",",
"MediaLibrary",
"::",
"SORT_DIRECTION_DESC",
"]",
")",
")",
"{",
... | Sets the user sort direction from the session state
@param string $sortDirection
@return void | [
"Sets",
"the",
"user",
"sort",
"direction",
"from",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L978-L988 |
208,298 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.getSelectionParams | protected function getSelectionParams()
{
$result = $this->getSession('media_crop_selection_params');
if ($result) {
if (!isset($result['mode'])) {
$result['mode'] = self::SELECTION_MODE_NORMAL;
}
if (!isset($result['width'])) {
$... | php | protected function getSelectionParams()
{
$result = $this->getSession('media_crop_selection_params');
if ($result) {
if (!isset($result['mode'])) {
$result['mode'] = self::SELECTION_MODE_NORMAL;
}
if (!isset($result['width'])) {
$... | [
"protected",
"function",
"getSelectionParams",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getSession",
"(",
"'media_crop_selection_params'",
")",
";",
"if",
"(",
"$",
"result",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"result",
"[",
"'mod... | Gets the user selection parameters from the session state
@return array | [
"Gets",
"the",
"user",
"selection",
"parameters",
"from",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1003-L1028 |
208,299 | octobercms/october | modules/backend/widgets/MediaManager.php | MediaManager.setSelectionParams | protected function setSelectionParams($selectionMode, $selectionWidth, $selectionHeight)
{
if (!in_array($selectionMode, [
self::SELECTION_MODE_NORMAL,
self::SELECTION_MODE_FIXED_RATIO,
self::SELECTION_MODE_FIXED_SIZE
])) {
throw new ApplicationExcepti... | php | protected function setSelectionParams($selectionMode, $selectionWidth, $selectionHeight)
{
if (!in_array($selectionMode, [
self::SELECTION_MODE_NORMAL,
self::SELECTION_MODE_FIXED_RATIO,
self::SELECTION_MODE_FIXED_SIZE
])) {
throw new ApplicationExcepti... | [
"protected",
"function",
"setSelectionParams",
"(",
"$",
"selectionMode",
",",
"$",
"selectionWidth",
",",
"$",
"selectionHeight",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"selectionMode",
",",
"[",
"self",
"::",
"SELECTION_MODE_NORMAL",
",",
"self",
":... | Stores the user selection parameters in the session state
@param string $selectionMode
@param int $selectionWidth
@param int $selectionHeight
@return void | [
"Stores",
"the",
"user",
"selection",
"parameters",
"in",
"the",
"session",
"state"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/MediaManager.php#L1037-L1060 |
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.