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,600
octobercms/october
modules/backend/classes/FormField.php
FormField.filterTriggerAttributes
protected function filterTriggerAttributes($attributes, $position = 'field') { if (!$this->trigger || !is_array($this->trigger)) { return $attributes; } $triggerAction = array_get($this->trigger, 'action'); $triggerField = array_get($this->trigger, 'field'); $tri...
php
protected function filterTriggerAttributes($attributes, $position = 'field') { if (!$this->trigger || !is_array($this->trigger)) { return $attributes; } $triggerAction = array_get($this->trigger, 'action'); $triggerField = array_get($this->trigger, 'field'); $tri...
[ "protected", "function", "filterTriggerAttributes", "(", "$", "attributes", ",", "$", "position", "=", "'field'", ")", "{", "if", "(", "!", "$", "this", "->", "trigger", "||", "!", "is_array", "(", "$", "this", "->", "trigger", ")", ")", "{", "return", ...
Adds attributes used specifically by the Trigger API @param array $attributes @param string $position @return array
[ "Adds", "attributes", "used", "specifically", "by", "the", "Trigger", "API" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L466-L518
208,601
octobercms/october
modules/backend/classes/FormField.php
FormField.filterPresetAttributes
protected function filterPresetAttributes($attributes, $position = 'field') { if (!$this->preset || $position != 'field') { return $attributes; } if (!is_array($this->preset)) { $this->preset = ['field' => $this->preset, 'type' => 'slug']; } $presetF...
php
protected function filterPresetAttributes($attributes, $position = 'field') { if (!$this->preset || $position != 'field') { return $attributes; } if (!is_array($this->preset)) { $this->preset = ['field' => $this->preset, 'type' => 'slug']; } $presetF...
[ "protected", "function", "filterPresetAttributes", "(", "$", "attributes", ",", "$", "position", "=", "'field'", ")", "{", "if", "(", "!", "$", "this", "->", "preset", "||", "$", "position", "!=", "'field'", ")", "{", "return", "$", "attributes", ";", "}...
Adds attributes used specifically by the Input Preset API @param array $attributes @param string $position @return array
[ "Adds", "attributes", "used", "specifically", "by", "the", "Input", "Preset", "API" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L526-L557
208,602
octobercms/october
modules/backend/classes/FormField.php
FormField.getName
public function getName($arrayName = null) { if ($arrayName === null) { $arrayName = $this->arrayName; } if ($arrayName) { return $arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']'; } return $this->fieldName; }
php
public function getName($arrayName = null) { if ($arrayName === null) { $arrayName = $this->arrayName; } if ($arrayName) { return $arrayName.'['.implode('][', HtmlHelper::nameToArray($this->fieldName)).']'; } return $this->fieldName; }
[ "public", "function", "getName", "(", "$", "arrayName", "=", "null", ")", "{", "if", "(", "$", "arrayName", "===", "null", ")", "{", "$", "arrayName", "=", "$", "this", "->", "arrayName", ";", "}", "if", "(", "$", "arrayName", ")", "{", "return", "...
Returns a value suitable for the field name property. @param string $arrayName Specify a custom array name @return string
[ "Returns", "a", "value", "suitable", "for", "the", "field", "name", "property", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L564-L575
208,603
octobercms/october
modules/backend/classes/FormField.php
FormField.getId
public function getId($suffix = null) { $id = 'field'; if ($this->arrayName) { $id .= '-'.$this->arrayName; } $id .= '-'.$this->fieldName; if ($suffix) { $id .= '-'.$suffix; } if ($this->idPrefix) { $id = $this->idPrefix ...
php
public function getId($suffix = null) { $id = 'field'; if ($this->arrayName) { $id .= '-'.$this->arrayName; } $id .= '-'.$this->fieldName; if ($suffix) { $id .= '-'.$suffix; } if ($this->idPrefix) { $id = $this->idPrefix ...
[ "public", "function", "getId", "(", "$", "suffix", "=", "null", ")", "{", "$", "id", "=", "'field'", ";", "if", "(", "$", "this", "->", "arrayName", ")", "{", "$", "id", ".=", "'-'", ".", "$", "this", "->", "arrayName", ";", "}", "$", "id", ".=...
Returns a value suitable for the field id property. @param string $suffix Specify a suffix string @return string
[ "Returns", "a", "value", "suitable", "for", "the", "field", "id", "property", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L582-L600
208,604
octobercms/october
modules/backend/classes/FormField.php
FormField.getValueFromData
public function getValueFromData($data, $default = null) { $fieldName = $this->valueFrom ?: $this->fieldName; return $this->getFieldNameFromData($fieldName, $data, $default); }
php
public function getValueFromData($data, $default = null) { $fieldName = $this->valueFrom ?: $this->fieldName; return $this->getFieldNameFromData($fieldName, $data, $default); }
[ "public", "function", "getValueFromData", "(", "$", "data", ",", "$", "default", "=", "null", ")", "{", "$", "fieldName", "=", "$", "this", "->", "valueFrom", "?", ":", "$", "this", "->", "fieldName", ";", "return", "$", "this", "->", "getFieldNameFromDa...
Returns this fields value from a supplied data set, which can be an array or a model or another generic collection. @param mixed $data @param mixed $default @return mixed
[ "Returns", "this", "fields", "value", "from", "a", "supplied", "data", "set", "which", "can", "be", "an", "array", "or", "a", "model", "or", "another", "generic", "collection", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L620-L624
208,605
octobercms/october
modules/backend/classes/FormField.php
FormField.getDefaultFromData
public function getDefaultFromData($data) { if ($this->defaultFrom) { return $this->getFieldNameFromData($this->defaultFrom, $data); } if ($this->defaults !== '') { return $this->defaults; } return null; }
php
public function getDefaultFromData($data) { if ($this->defaultFrom) { return $this->getFieldNameFromData($this->defaultFrom, $data); } if ($this->defaults !== '') { return $this->defaults; } return null; }
[ "public", "function", "getDefaultFromData", "(", "$", "data", ")", "{", "if", "(", "$", "this", "->", "defaultFrom", ")", "{", "return", "$", "this", "->", "getFieldNameFromData", "(", "$", "this", "->", "defaultFrom", ",", "$", "data", ")", ";", "}", ...
Returns the default value for this field, the supplied data is used to source data when defaultFrom is specified. @param mixed $data @return mixed
[ "Returns", "the", "default", "value", "for", "this", "field", "the", "supplied", "data", "is", "used", "to", "source", "data", "when", "defaultFrom", "is", "specified", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L632-L643
208,606
octobercms/october
modules/backend/classes/FormField.php
FormField.getFieldNameFromData
protected function getFieldNameFromData($fieldName, $data, $default = null) { /* * Array field name, eg: field[key][key2][key3] */ $keyParts = HtmlHelper::nameToArray($fieldName); $lastField = end($keyParts); $result = $data; /* * Loop the field ke...
php
protected function getFieldNameFromData($fieldName, $data, $default = null) { /* * Array field name, eg: field[key][key2][key3] */ $keyParts = HtmlHelper::nameToArray($fieldName); $lastField = end($keyParts); $result = $data; /* * Loop the field ke...
[ "protected", "function", "getFieldNameFromData", "(", "$", "fieldName", ",", "$", "data", ",", "$", "default", "=", "null", ")", "{", "/*\n * Array field name, eg: field[key][key2][key3]\n */", "$", "keyParts", "=", "HtmlHelper", "::", "nameToArray", "("...
Internal method to extract the value of a field name from a data set. @param string $fieldName @param mixed $data @param mixed $default @return mixed
[ "Internal", "method", "to", "extract", "the", "value", "of", "a", "field", "name", "from", "a", "data", "set", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormField.php#L676-L716
208,607
octobercms/october
modules/backend/classes/AuthManager.php
AuthManager.listPermissions
public function listPermissions() { if ($this->permissionCache !== false) { return $this->permissionCache; } /* * Load module items */ foreach ($this->callbacks as $callback) { $callback($this); } /* * Load plugin i...
php
public function listPermissions() { if ($this->permissionCache !== false) { return $this->permissionCache; } /* * Load module items */ foreach ($this->callbacks as $callback) { $callback($this); } /* * Load plugin i...
[ "public", "function", "listPermissions", "(", ")", "{", "if", "(", "$", "this", "->", "permissionCache", "!==", "false", ")", "{", "return", "$", "this", "->", "permissionCache", ";", "}", "/*\n * Load module items\n */", "foreach", "(", "$", "th...
Returns a list of the registered permissions items. @return array
[ "Returns", "a", "list", "of", "the", "registered", "permissions", "items", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/AuthManager.php#L103-L142
208,608
octobercms/october
modules/backend/classes/AuthManager.php
AuthManager.listTabbedPermissions
public function listTabbedPermissions() { $tabs = []; foreach ($this->listPermissions() as $permission) { $tab = $permission->tab ?? 'backend::lang.form.undefined_tab'; if (!array_key_exists($tab, $tabs)) { $tabs[$tab] = []; } $tabs[...
php
public function listTabbedPermissions() { $tabs = []; foreach ($this->listPermissions() as $permission) { $tab = $permission->tab ?? 'backend::lang.form.undefined_tab'; if (!array_key_exists($tab, $tabs)) { $tabs[$tab] = []; } $tabs[...
[ "public", "function", "listTabbedPermissions", "(", ")", "{", "$", "tabs", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "listPermissions", "(", ")", "as", "$", "permission", ")", "{", "$", "tab", "=", "$", "permission", "->", "tab", "??", "...
Returns an array of registered permissions, grouped by tabs. @return array
[ "Returns", "an", "array", "of", "registered", "permissions", "grouped", "by", "tabs", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/AuthManager.php#L148-L163
208,609
octobercms/october
modules/backend/classes/AuthManager.php
AuthManager.listPermissionsForRole
public function listPermissionsForRole($role, $includeOrphans = true) { if ($this->permissionRoles === false) { $this->permissionRoles = []; foreach ($this->listPermissions() as $permission) { if ($permission->roles) { foreach ((array) $permission...
php
public function listPermissionsForRole($role, $includeOrphans = true) { if ($this->permissionRoles === false) { $this->permissionRoles = []; foreach ($this->listPermissions() as $permission) { if ($permission->roles) { foreach ((array) $permission...
[ "public", "function", "listPermissionsForRole", "(", "$", "role", ",", "$", "includeOrphans", "=", "true", ")", "{", "if", "(", "$", "this", "->", "permissionRoles", "===", "false", ")", "{", "$", "this", "->", "permissionRoles", "=", "[", "]", ";", "for...
Returns an array of registered permissions belonging to a given role code @param string $role @param bool $includeOrphans @return array
[ "Returns", "an", "array", "of", "registered", "permissions", "belonging", "to", "a", "given", "role", "code" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/AuthManager.php#L199-L223
208,610
octobercms/october
modules/backend/classes/FilterScope.php
FilterScope.getId
public function getId($suffix = null) { $id = 'scope'; $id .= '-'.$this->scopeName; if ($suffix) { $id .= '-'.$suffix; } if ($this->idPrefix) { $id = $this->idPrefix . '-' . $id; } return HtmlHelper::nameToId($id); }
php
public function getId($suffix = null) { $id = 'scope'; $id .= '-'.$this->scopeName; if ($suffix) { $id .= '-'.$suffix; } if ($this->idPrefix) { $id = $this->idPrefix . '-' . $id; } return HtmlHelper::nameToId($id); }
[ "public", "function", "getId", "(", "$", "suffix", "=", "null", ")", "{", "$", "id", "=", "'scope'", ";", "$", "id", ".=", "'-'", ".", "$", "this", "->", "scopeName", ";", "if", "(", "$", "suffix", ")", "{", "$", "id", ".=", "'-'", ".", "$", ...
Returns a value suitable for the scope id property.
[ "Returns", "a", "value", "suitable", "for", "the", "scope", "id", "property", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FilterScope.php#L149-L163
208,611
octobercms/october
modules/backend/classes/FormTabs.php
FormTabs.addField
public function addField($name, FormField $field, $tab = null) { if (!$tab) { $tab = $this->defaultTab; } $this->fields[$tab][$name] = $field; }
php
public function addField($name, FormField $field, $tab = null) { if (!$tab) { $tab = $this->defaultTab; } $this->fields[$tab][$name] = $field; }
[ "public", "function", "addField", "(", "$", "name", ",", "FormField", "$", "field", ",", "$", "tab", "=", "null", ")", "{", "if", "(", "!", "$", "tab", ")", "{", "$", "tab", "=", "$", "this", "->", "defaultTab", ";", "}", "$", "this", "->", "fi...
Add a field to the collection of tabs. @param string $name @param FormField $field @param string $tab
[ "Add", "a", "field", "to", "the", "collection", "of", "tabs", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormTabs.php#L117-L124
208,612
octobercms/october
modules/backend/classes/FormTabs.php
FormTabs.removeField
public function removeField($name) { foreach ($this->fields as $tab => $fields) { foreach ($fields as $fieldName => $field) { if ($fieldName == $name) { unset($this->fields[$tab][$fieldName]); /* * Remove empty tabs fr...
php
public function removeField($name) { foreach ($this->fields as $tab => $fields) { foreach ($fields as $fieldName => $field) { if ($fieldName == $name) { unset($this->fields[$tab][$fieldName]); /* * Remove empty tabs fr...
[ "public", "function", "removeField", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "fields", "as", "$", "tab", "=>", "$", "fields", ")", "{", "foreach", "(", "$", "fields", "as", "$", "fieldName", "=>", "$", "field", ")", "{", "if"...
Remove a field from all tabs by name. @param string $name @return boolean
[ "Remove", "a", "field", "from", "all", "tabs", "by", "name", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormTabs.php#L131-L151
208,613
octobercms/october
modules/backend/classes/FormTabs.php
FormTabs.getPaneCssClass
public function getPaneCssClass($index = null, $label = null) { if (is_string($this->paneCssClass)) { return $this->paneCssClass; } if ($index !== null && isset($this->paneCssClass[$index])) { return $this->paneCssClass[$index]; } if ($label !== null...
php
public function getPaneCssClass($index = null, $label = null) { if (is_string($this->paneCssClass)) { return $this->paneCssClass; } if ($index !== null && isset($this->paneCssClass[$index])) { return $this->paneCssClass[$index]; } if ($label !== null...
[ "public", "function", "getPaneCssClass", "(", "$", "index", "=", "null", ",", "$", "label", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "this", "->", "paneCssClass", ")", ")", "{", "return", "$", "this", "->", "paneCssClass", ";", "}", "...
Returns a tab pane CSS class. @param string $index @param string $label @return string
[ "Returns", "a", "tab", "pane", "CSS", "class", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/FormTabs.php#L204-L217
208,614
octobercms/october
modules/backend/widgets/Form.php
Form.renderField
public function renderField($field, $options = []) { $this->prepareVars(); if (is_string($field)) { if (!isset($this->allFields[$field])) { throw new ApplicationException(Lang::get( 'backend::lang.form.missing_definition', compact(...
php
public function renderField($field, $options = []) { $this->prepareVars(); if (is_string($field)) { if (!isset($this->allFields[$field])) { throw new ApplicationException(Lang::get( 'backend::lang.form.missing_definition', compact(...
[ "public", "function", "renderField", "(", "$", "field", ",", "$", "options", "=", "[", "]", ")", "{", "$", "this", "->", "prepareVars", "(", ")", ";", "if", "(", "is_string", "(", "$", "field", ")", ")", "{", "if", "(", "!", "isset", "(", "$", ...
Renders a single form field Options: - useContainer: Wrap the result in a container, used by AJAX. Default: true @param string|array $field The field name or definition @param array $options @return string|bool The rendered partial contents, or false if suppressing an exception
[ "Renders", "a", "single", "form", "field" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L240-L261
208,615
octobercms/october
modules/backend/widgets/Form.php
Form.prepareVars
protected function prepareVars() { $this->defineFormFields(); $this->applyFiltersFromModel(); $this->vars['sessionKey'] = $this->getSessionKey(); $this->vars['outsideTabs'] = $this->allTabs->outside; $this->vars['primaryTabs'] = $this->allTabs->primary; $this->vars['s...
php
protected function prepareVars() { $this->defineFormFields(); $this->applyFiltersFromModel(); $this->vars['sessionKey'] = $this->getSessionKey(); $this->vars['outsideTabs'] = $this->allTabs->outside; $this->vars['primaryTabs'] = $this->allTabs->primary; $this->vars['s...
[ "protected", "function", "prepareVars", "(", ")", "{", "$", "this", "->", "defineFormFields", "(", ")", ";", "$", "this", "->", "applyFiltersFromModel", "(", ")", ";", "$", "this", "->", "vars", "[", "'sessionKey'", "]", "=", "$", "this", "->", "getSessi...
Prepares the form data @return void
[ "Prepares", "the", "form", "data" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L305-L313
208,616
octobercms/october
modules/backend/widgets/Form.php
Form.setFormValues
public function setFormValues($data = null) { if ($data === null) { $data = $this->getSaveData(); } /* * Fill the model as if it were to be saved */ $this->prepareModelsToSave($this->model, $data); /* * Data set differs from model ...
php
public function setFormValues($data = null) { if ($data === null) { $data = $this->getSaveData(); } /* * Fill the model as if it were to be saved */ $this->prepareModelsToSave($this->model, $data); /* * Data set differs from model ...
[ "public", "function", "setFormValues", "(", "$", "data", "=", "null", ")", "{", "if", "(", "$", "data", "===", "null", ")", "{", "$", "data", "=", "$", "this", "->", "getSaveData", "(", ")", ";", "}", "/*\n * Fill the model as if it were to be saved\...
Sets or resets form field values. @param array $data @return array
[ "Sets", "or", "resets", "form", "field", "values", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L320-L346
208,617
octobercms/october
modules/backend/widgets/Form.php
Form.onRefresh
public function onRefresh() { $result = []; $saveData = $this->getSaveData(); /** * @event backend.form.beforeRefresh * Called before the form is refreshed, modify the $dataHolder->data property in place * * Example usage: * * Event:...
php
public function onRefresh() { $result = []; $saveData = $this->getSaveData(); /** * @event backend.form.beforeRefresh * Called before the form is refreshed, modify the $dataHolder->data property in place * * Example usage: * * Event:...
[ "public", "function", "onRefresh", "(", ")", "{", "$", "result", "=", "[", "]", ";", "$", "saveData", "=", "$", "this", "->", "getSaveData", "(", ")", ";", "/**\n * @event backend.form.beforeRefresh\n * Called before the form is refreshed, modify the $data...
Event handler for refreshing the form. @return array
[ "Event", "handler", "for", "refreshing", "the", "form", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L353-L453
208,618
octobercms/october
modules/backend/widgets/Form.php
Form.defineFormFields
protected function defineFormFields() { if ($this->fieldsDefined) { return; } /** * @event backend.form.extendFieldsBefore * Called before the form fields are defined * * Example usage: * * Event::listen('backend.form.ext...
php
protected function defineFormFields() { if ($this->fieldsDefined) { return; } /** * @event backend.form.extendFieldsBefore * Called before the form fields are defined * * Example usage: * * Event::listen('backend.form.ext...
[ "protected", "function", "defineFormFields", "(", ")", "{", "if", "(", "$", "this", "->", "fieldsDefined", ")", "{", "return", ";", "}", "/**\n * @event backend.form.extendFieldsBefore\n * Called before the form fields are defined\n *\n * Example usa...
Creates a flat array of form fields from the configuration. Also slots fields in to their respective tabs. @return void
[ "Creates", "a", "flat", "array", "of", "form", "fields", "from", "the", "configuration", ".", "Also", "slots", "fields", "in", "to", "their", "respective", "tabs", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L461-L646
208,619
octobercms/october
modules/backend/widgets/Form.php
Form.processAutoSpan
protected function processAutoSpan($fields) { $prevSpan = null; foreach ($fields as $field) { if (strtolower($field->span) === 'auto') { if ($prevSpan === 'left') { $field->span = 'right'; } else { $...
php
protected function processAutoSpan($fields) { $prevSpan = null; foreach ($fields as $field) { if (strtolower($field->span) === 'auto') { if ($prevSpan === 'left') { $field->span = 'right'; } else { $...
[ "protected", "function", "processAutoSpan", "(", "$", "fields", ")", "{", "$", "prevSpan", "=", "null", ";", "foreach", "(", "$", "fields", "as", "$", "field", ")", "{", "if", "(", "strtolower", "(", "$", "field", "->", "span", ")", "===", "'auto'", ...
Converts fields with a span set to 'auto' as either 'left' or 'right' depending on the previous field. @return void
[ "Converts", "fields", "with", "a", "span", "set", "to", "auto", "as", "either", "left", "or", "right", "depending", "on", "the", "previous", "field", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L654-L670
208,620
octobercms/october
modules/backend/widgets/Form.php
Form.addFields
public function addFields(array $fields, $addToArea = null) { foreach ($fields as $name => $config) { $fieldObj = $this->makeFormField($name, $config); $fieldTab = is_array($config) ? array_get($config, 'tab') : null; /* * Check that the form field matches ...
php
public function addFields(array $fields, $addToArea = null) { foreach ($fields as $name => $config) { $fieldObj = $this->makeFormField($name, $config); $fieldTab = is_array($config) ? array_get($config, 'tab') : null; /* * Check that the form field matches ...
[ "public", "function", "addFields", "(", "array", "$", "fields", ",", "$", "addToArea", "=", "null", ")", "{", "foreach", "(", "$", "fields", "as", "$", "name", "=>", "$", "config", ")", "{", "$", "fieldObj", "=", "$", "this", "->", "makeFormField", "...
Programatically add fields, used internally and for extensibility. @param array $fields @param string $addToArea @return void
[ "Programatically", "add", "fields", "used", "internally", "and", "for", "extensibility", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L679-L710
208,621
octobercms/october
modules/backend/widgets/Form.php
Form.removeField
public function removeField($name) { if (!isset($this->allFields[$name])) { return false; } /* * Remove from tabs */ $this->allTabs->primary->removeField($name); $this->allTabs->secondary->removeField($name); $this->allTabs->outside->rem...
php
public function removeField($name) { if (!isset($this->allFields[$name])) { return false; } /* * Remove from tabs */ $this->allTabs->primary->removeField($name); $this->allTabs->secondary->removeField($name); $this->allTabs->outside->rem...
[ "public", "function", "removeField", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "allFields", "[", "$", "name", "]", ")", ")", "{", "return", "false", ";", "}", "/*\n * Remove from tabs\n */", "$", "this", ...
Programatically remove a field. @param string $name @return bool
[ "Programatically", "remove", "a", "field", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L738-L757
208,622
octobercms/october
modules/backend/widgets/Form.php
Form.removeTab
public function removeTab($name) { foreach ($this->allFields as $fieldName => $field) { if ($field->tab == $name) { $this->removeField($fieldName); } } }
php
public function removeTab($name) { foreach ($this->allFields as $fieldName => $field) { if ($field->tab == $name) { $this->removeField($fieldName); } } }
[ "public", "function", "removeTab", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "allFields", "as", "$", "fieldName", "=>", "$", "field", ")", "{", "if", "(", "$", "field", "->", "tab", "==", "$", "name", ")", "{", "$", "this", "...
Programatically remove all fields belonging to a tab. @param string $name @return bool
[ "Programatically", "remove", "all", "fields", "belonging", "to", "a", "tab", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L765-L772
208,623
octobercms/october
modules/backend/widgets/Form.php
Form.makeFormField
protected function makeFormField($name, $config = []) { $label = $config['label'] ?? null; list($fieldName, $fieldContext) = $this->getFieldName($name); $field = new FormField($fieldName, $label); if ($fieldContext) { $field->context = $fieldContext; } ...
php
protected function makeFormField($name, $config = []) { $label = $config['label'] ?? null; list($fieldName, $fieldContext) = $this->getFieldName($name); $field = new FormField($fieldName, $label); if ($fieldContext) { $field->context = $fieldContext; } ...
[ "protected", "function", "makeFormField", "(", "$", "name", ",", "$", "config", "=", "[", "]", ")", "{", "$", "label", "=", "$", "config", "[", "'label'", "]", "??", "null", ";", "list", "(", "$", "fieldName", ",", "$", "fieldContext", ")", "=", "$...
Creates a form field object from name and configuration. @param string $name @param array $config @return FormField
[ "Creates", "a", "form", "field", "object", "from", "name", "and", "configuration", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L781-L884
208,624
octobercms/october
modules/backend/widgets/Form.php
Form.isFormWidget
protected function isFormWidget($fieldType) { if ($fieldType === null) { return false; } if (strpos($fieldType, '\\')) { return true; } $widgetClass = $this->widgetManager->resolveFormWidget($fieldType); if (!class_exists($widgetClass)) { ...
php
protected function isFormWidget($fieldType) { if ($fieldType === null) { return false; } if (strpos($fieldType, '\\')) { return true; } $widgetClass = $this->widgetManager->resolveFormWidget($fieldType); if (!class_exists($widgetClass)) { ...
[ "protected", "function", "isFormWidget", "(", "$", "fieldType", ")", "{", "if", "(", "$", "fieldType", "===", "null", ")", "{", "return", "false", ";", "}", "if", "(", "strpos", "(", "$", "fieldType", ",", "'\\\\'", ")", ")", "{", "return", "true", "...
Check if a field type is a widget or not @param string $fieldType @return boolean
[ "Check", "if", "a", "field", "type", "is", "a", "widget", "or", "not" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L892-L913
208,625
octobercms/october
modules/backend/widgets/Form.php
Form.makeFormFieldWidget
protected function makeFormFieldWidget($field) { if ($field->type !== 'widget') { return null; } if (isset($this->formWidgets[$field->fieldName])) { return $this->formWidgets[$field->fieldName]; } $widgetConfig = $this->makeConfig($field->config); ...
php
protected function makeFormFieldWidget($field) { if ($field->type !== 'widget') { return null; } if (isset($this->formWidgets[$field->fieldName])) { return $this->formWidgets[$field->fieldName]; } $widgetConfig = $this->makeConfig($field->config); ...
[ "protected", "function", "makeFormFieldWidget", "(", "$", "field", ")", "{", "if", "(", "$", "field", "->", "type", "!==", "'widget'", ")", "{", "return", "null", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "formWidgets", "[", "$", "field", ...
Makes a widget object from a form field object. @param $field @return \Backend\Traits\FormWidgetBase|null
[ "Makes", "a", "widget", "object", "from", "a", "form", "field", "object", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L921-L964
208,626
octobercms/october
modules/backend/widgets/Form.php
Form.getFormWidget
public function getFormWidget($field) { if (isset($this->formWidgets[$field])) { return $this->formWidgets[$field]; } return null; }
php
public function getFormWidget($field) { if (isset($this->formWidgets[$field])) { return $this->formWidgets[$field]; } return null; }
[ "public", "function", "getFormWidget", "(", "$", "field", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "formWidgets", "[", "$", "field", "]", ")", ")", "{", "return", "$", "this", "->", "formWidgets", "[", "$", "field", "]", ";", "}", "ret...
Get a specified form widget @param string $field @return mixed
[ "Get", "a", "specified", "form", "widget" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L982-L989
208,627
octobercms/october
modules/backend/widgets/Form.php
Form.getField
public function getField($field) { if (isset($this->allFields[$field])) { return $this->allFields[$field]; } return null; }
php
public function getField($field) { if (isset($this->allFields[$field])) { return $this->allFields[$field]; } return null; }
[ "public", "function", "getField", "(", "$", "field", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "allFields", "[", "$", "field", "]", ")", ")", "{", "return", "$", "this", "->", "allFields", "[", "$", "field", "]", ";", "}", "return", "...
Get a specified field object @param string $field @return mixed
[ "Get", "a", "specified", "field", "object" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1007-L1014
208,628
octobercms/october
modules/backend/widgets/Form.php
Form.getFieldValue
protected function getFieldValue($field) { if (is_string($field)) { if (!isset($this->allFields[$field])) { throw new ApplicationException(Lang::get( 'backend::lang.form.missing_definition', compact('field') )); ...
php
protected function getFieldValue($field) { if (is_string($field)) { if (!isset($this->allFields[$field])) { throw new ApplicationException(Lang::get( 'backend::lang.form.missing_definition', compact('field') )); ...
[ "protected", "function", "getFieldValue", "(", "$", "field", ")", "{", "if", "(", "is_string", "(", "$", "field", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "allFields", "[", "$", "field", "]", ")", ")", "{", "throw", "new", ...
Looks up the field value. @param mixed $field @return string
[ "Looks", "up", "the", "field", "value", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1061-L1082
208,629
octobercms/october
modules/backend/widgets/Form.php
Form.getFieldDepends
protected function getFieldDepends($field) { if (!$field->dependsOn) { return ''; } $dependsOn = is_array($field->dependsOn) ? $field->dependsOn : [$field->dependsOn]; $dependsOn = htmlspecialchars(json_encode($dependsOn), ENT_QUOTES, 'UTF-8'); return $dependsOn;...
php
protected function getFieldDepends($field) { if (!$field->dependsOn) { return ''; } $dependsOn = is_array($field->dependsOn) ? $field->dependsOn : [$field->dependsOn]; $dependsOn = htmlspecialchars(json_encode($dependsOn), ENT_QUOTES, 'UTF-8'); return $dependsOn;...
[ "protected", "function", "getFieldDepends", "(", "$", "field", ")", "{", "if", "(", "!", "$", "field", "->", "dependsOn", ")", "{", "return", "''", ";", "}", "$", "dependsOn", "=", "is_array", "(", "$", "field", "->", "dependsOn", ")", "?", "$", "fie...
Returns a HTML encoded value containing the other fields this field depends on @param \Backend\Classes\FormField $field @return string
[ "Returns", "a", "HTML", "encoded", "value", "containing", "the", "other", "fields", "this", "field", "depends", "on" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1090-L1099
208,630
octobercms/october
modules/backend/widgets/Form.php
Form.showFieldLabels
protected function showFieldLabels($field) { if (in_array($field->type, ['checkbox', 'switch', 'section'])) { return false; } if ($field->type === 'widget') { return $this->makeFormFieldWidget($field)->showLabels; } return true; }
php
protected function showFieldLabels($field) { if (in_array($field->type, ['checkbox', 'switch', 'section'])) { return false; } if ($field->type === 'widget') { return $this->makeFormFieldWidget($field)->showLabels; } return true; }
[ "protected", "function", "showFieldLabels", "(", "$", "field", ")", "{", "if", "(", "in_array", "(", "$", "field", "->", "type", ",", "[", "'checkbox'", ",", "'switch'", ",", "'section'", "]", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$...
Helper method to determine if field should be rendered with label and comments. @param \Backend\Classes\FormField $field @return boolean
[ "Helper", "method", "to", "determine", "if", "field", "should", "be", "rendered", "with", "label", "and", "comments", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1107-L1118
208,631
octobercms/october
modules/backend/widgets/Form.php
Form.getSaveData
public function getSaveData() { $this->defineFormFields(); $result = []; /* * Source data */ $data = $this->arrayName ? post($this->arrayName) : post(); if (!$data) { $data = []; } /* * Spin over each field and extract...
php
public function getSaveData() { $this->defineFormFields(); $result = []; /* * Source data */ $data = $this->arrayName ? post($this->arrayName) : post(); if (!$data) { $data = []; } /* * Spin over each field and extract...
[ "public", "function", "getSaveData", "(", ")", "{", "$", "this", "->", "defineFormFields", "(", ")", ";", "$", "result", "=", "[", "]", ";", "/*\n * Source data\n */", "$", "data", "=", "$", "this", "->", "arrayName", "?", "post", "(", "$",...
Returns post data from a submitted form. @return array
[ "Returns", "post", "data", "from", "a", "submitted", "form", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1125-L1178
208,632
octobercms/october
modules/backend/widgets/Form.php
Form.getOptionsFromModel
protected function getOptionsFromModel($field, $fieldOptions) { /* * Advanced usage, supplied options are callable */ if (is_array($fieldOptions) && is_callable($fieldOptions)) { $fieldOptions = call_user_func($fieldOptions, $this, $field); } /* ...
php
protected function getOptionsFromModel($field, $fieldOptions) { /* * Advanced usage, supplied options are callable */ if (is_array($fieldOptions) && is_callable($fieldOptions)) { $fieldOptions = call_user_func($fieldOptions, $this, $field); } /* ...
[ "protected", "function", "getOptionsFromModel", "(", "$", "field", ",", "$", "fieldOptions", ")", "{", "/*\n * Advanced usage, supplied options are callable\n */", "if", "(", "is_array", "(", "$", "fieldOptions", ")", "&&", "is_callable", "(", "$", "fiel...
Looks at the model for defined options. @param $field @param $fieldOptions @return mixed
[ "Looks", "at", "the", "model", "for", "defined", "options", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1227-L1286
208,633
octobercms/october
modules/backend/widgets/Form.php
Form.objectMethodExists
protected function objectMethodExists($object, $method) { if (method_exists($object, 'methodExists')) { return $object->methodExists($method); } return method_exists($object, $method); }
php
protected function objectMethodExists($object, $method) { if (method_exists($object, 'methodExists')) { return $object->methodExists($method); } return method_exists($object, $method); }
[ "protected", "function", "objectMethodExists", "(", "$", "object", ",", "$", "method", ")", "{", "if", "(", "method_exists", "(", "$", "object", ",", "'methodExists'", ")", ")", "{", "return", "$", "object", "->", "methodExists", "(", "$", "method", ")", ...
Internal helper for method existence checks. @param object $object @param string $method @return boolean
[ "Internal", "helper", "for", "method", "existence", "checks", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Form.php#L1323-L1330
208,634
octobercms/october
modules/cms/classes/Asset.php
Asset.fill
public function fill(array $attributes) { foreach ($attributes as $key => $value) { if (!in_array($key, $this->fillable)) { throw new ApplicationException(Lang::get( 'cms::lang.cms_object.invalid_property', ['name' => $key] ...
php
public function fill(array $attributes) { foreach ($attributes as $key => $value) { if (!in_array($key, $this->fillable)) { throw new ApplicationException(Lang::get( 'cms::lang.cms_object.invalid_property', ['name' => $key] ...
[ "public", "function", "fill", "(", "array", "$", "attributes", ")", "{", "foreach", "(", "$", "attributes", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "in_array", "(", "$", "key", ",", "$", "this", "->", "fillable", ")", ")", ...
Sets the object attributes. @param array $attributes A list of attributes to set.
[ "Sets", "the", "object", "attributes", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Asset.php#L138-L150
208,635
octobercms/october
modules/cms/classes/Asset.php
Asset.save
public function save() { $this->validateFileName(); $fullPath = $this->getFilePath(); if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) { throw new ApplicationException(Lang::get( 'cms::lang.cms_object.file_already_exists', ...
php
public function save() { $this->validateFileName(); $fullPath = $this->getFilePath(); if (File::isFile($fullPath) && $this->originalFileName !== $this->fileName) { throw new ApplicationException(Lang::get( 'cms::lang.cms_object.file_already_exists', ...
[ "public", "function", "save", "(", ")", "{", "$", "this", "->", "validateFileName", "(", ")", ";", "$", "fullPath", "=", "$", "this", "->", "getFilePath", "(", ")", ";", "if", "(", "File", "::", "isFile", "(", "$", "fullPath", ")", "&&", "$", "this...
Saves the object to the disk.
[ "Saves", "the", "object", "to", "the", "disk", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Asset.php#L155-L210
208,636
octobercms/october
modules/cms/classes/Asset.php
Asset.validateFileName
protected function validateFileName($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } $fileName = trim($fileName); if (!strlen($fileName)) { throw new ValidationException(['fileName' => Lang::get('cms::lang.cms_obje...
php
protected function validateFileName($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } $fileName = trim($fileName); if (!strlen($fileName)) { throw new ValidationException(['fileName' => Lang::get('cms::lang.cms_obje...
[ "protected", "function", "validateFileName", "(", "$", "fileName", "=", "null", ")", "{", "if", "(", "$", "fileName", "===", "null", ")", "{", "$", "fileName", "=", "$", "this", "->", "fileName", ";", "}", "$", "fileName", "=", "trim", "(", "$", "fil...
Validate the supplied filename, extension and path. @param string $fileName
[ "Validate", "the", "supplied", "filename", "extension", "and", "path", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Asset.php#L233-L266
208,637
octobercms/october
modules/system/twig/Extension.php
Extension.getFilters
public function getFilters() { $filters = [ new Twig_SimpleFilter('app', [$this, 'appFilter'], ['is_safe' => ['html']]), new Twig_SimpleFilter('media', [$this, 'mediaFilter'], ['is_safe' => ['html']]), ]; /* * Include extensions provided by plugins ...
php
public function getFilters() { $filters = [ new Twig_SimpleFilter('app', [$this, 'appFilter'], ['is_safe' => ['html']]), new Twig_SimpleFilter('media', [$this, 'mediaFilter'], ['is_safe' => ['html']]), ]; /* * Include extensions provided by plugins ...
[ "public", "function", "getFilters", "(", ")", "{", "$", "filters", "=", "[", "new", "Twig_SimpleFilter", "(", "'app'", ",", "[", "$", "this", ",", "'appFilter'", "]", ",", "[", "'is_safe'", "=>", "[", "'html'", "]", "]", ")", ",", "new", "Twig_SimpleFi...
Returns a list of filters this extensions provides. @return array An array of filters
[ "Returns", "a", "list", "of", "filters", "this", "extensions", "provides", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/twig/Extension.php#L53-L66
208,638
octobercms/october
modules/backend/widgets/table/ServerEventDataSource.php
ServerEventDataSource.searchRecords
public function searchRecords($query, $offset, $count) { return $this->fireEvent('data.searchRecords', [$query, $offset, $count], true); }
php
public function searchRecords($query, $offset, $count) { return $this->fireEvent('data.searchRecords', [$query, $offset, $count], true); }
[ "public", "function", "searchRecords", "(", "$", "query", ",", "$", "offset", ",", "$", "count", ")", "{", "return", "$", "this", "->", "fireEvent", "(", "'data.searchRecords'", ",", "[", "$", "query", ",", "$", "offset", ",", "$", "count", "]", ",", ...
Identical to getRecords except provided with a search query.
[ "Identical", "to", "getRecords", "except", "provided", "with", "a", "search", "query", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/table/ServerEventDataSource.php#L25-L28
208,639
octobercms/october
modules/backend/widgets/Search.php
Search.onSubmit
public function onSubmit() { /* * Save or reset search term in session */ $this->setActiveTerm(post($this->getName())); /* * Trigger class event, merge results as viewable array */ $params = func_get_args(); $result = $this->fireEvent('sea...
php
public function onSubmit() { /* * Save or reset search term in session */ $this->setActiveTerm(post($this->getName())); /* * Trigger class event, merge results as viewable array */ $params = func_get_args(); $result = $this->fireEvent('sea...
[ "public", "function", "onSubmit", "(", ")", "{", "/*\n * Save or reset search term in session\n */", "$", "this", "->", "setActiveTerm", "(", "post", "(", "$", "this", "->", "getName", "(", ")", ")", ")", ";", "/*\n * Trigger class event, merge r...
Search field has been submitted.
[ "Search", "field", "has", "been", "submitted", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Search.php#L120-L135
208,640
octobercms/october
modules/backend/widgets/Search.php
Search.setActiveTerm
public function setActiveTerm($term) { if (strlen($term)) { $this->putSession('term', $term); } else { $this->resetSession(); } $this->activeTerm = $term; }
php
public function setActiveTerm($term) { if (strlen($term)) { $this->putSession('term', $term); } else { $this->resetSession(); } $this->activeTerm = $term; }
[ "public", "function", "setActiveTerm", "(", "$", "term", ")", "{", "if", "(", "strlen", "(", "$", "term", ")", ")", "{", "$", "this", "->", "putSession", "(", "'term'", ",", "$", "term", ")", ";", "}", "else", "{", "$", "this", "->", "resetSession"...
Sets an active search term for this widget instance.
[ "Sets", "an", "active", "search", "term", "for", "this", "widget", "instance", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/Search.php#L148-L157
208,641
octobercms/october
modules/backend/widgets/ReportContainer.php
ReportContainer.defineReportWidgets
protected function defineReportWidgets() { if ($this->reportsDefined) { return; } $result = []; $widgets = $this->getWidgetsFromUserPreferences(); foreach ($widgets as $alias => $widgetInfo) { if ($widget = $this->makeReportWidget($alias, $widgetInfo...
php
protected function defineReportWidgets() { if ($this->reportsDefined) { return; } $result = []; $widgets = $this->getWidgetsFromUserPreferences(); foreach ($widgets as $alias => $widgetInfo) { if ($widget = $this->makeReportWidget($alias, $widgetInfo...
[ "protected", "function", "defineReportWidgets", "(", ")", "{", "if", "(", "$", "this", "->", "reportsDefined", ")", "{", "return", ";", "}", "$", "result", "=", "[", "]", ";", "$", "widgets", "=", "$", "this", "->", "getWidgetsFromUserPreferences", "(", ...
Registers the report widgets that will be included in this container. The chosen widgets are based on the user preferences.
[ "Registers", "the", "report", "widgets", "that", "will", "be", "included", "in", "this", "container", ".", "The", "chosen", "widgets", "are", "based", "on", "the", "user", "preferences", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/widgets/ReportContainer.php#L300-L322
208,642
octobercms/october
modules/system/traits/EventEmitter.php
EventEmitter.fireSystemEvent
public function fireSystemEvent($event, $params = [], $halt = true) { $result = []; $shortEvent = substr($event, strpos($event, '.') + 1); $longArgs = array_merge([$this], $params); /* * Local event first */ if ($response = $this->fireEvent($shortEvent, $...
php
public function fireSystemEvent($event, $params = [], $halt = true) { $result = []; $shortEvent = substr($event, strpos($event, '.') + 1); $longArgs = array_merge([$this], $params); /* * Local event first */ if ($response = $this->fireEvent($shortEvent, $...
[ "public", "function", "fireSystemEvent", "(", "$", "event", ",", "$", "params", "=", "[", "]", ",", "$", "halt", "=", "true", ")", "{", "$", "result", "=", "[", "]", ";", "$", "shortEvent", "=", "substr", "(", "$", "event", ",", "strpos", "(", "$...
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default. For example: $this->fireSystemEvent('backend.list.myEvent', ['my value']); Is equivalent to: $this-...
[ "Fires", "a", "combination", "of", "local", "and", "global", "events", ".", "The", "first", "segment", "is", "removed", "from", "the", "event", "name", "locally", "and", "the", "local", "object", "is", "passed", "as", "the", "first", "argument", "to", "the...
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/EventEmitter.php#L36-L67
208,643
octobercms/october
modules/system/traits/EventEmitter.php
EventEmitter.fireViewEvent
public function fireViewEvent($event, $params = []) { // Add the local object to the first parameter always array_unshift($params, $this); if ($result = Event::fire($event, $params)) { return implode(PHP_EOL.PHP_EOL, (array) $result); } return ''; }
php
public function fireViewEvent($event, $params = []) { // Add the local object to the first parameter always array_unshift($params, $this); if ($result = Event::fire($event, $params)) { return implode(PHP_EOL.PHP_EOL, (array) $result); } return ''; }
[ "public", "function", "fireViewEvent", "(", "$", "event", ",", "$", "params", "=", "[", "]", ")", "{", "// Add the local object to the first parameter always", "array_unshift", "(", "$", "params", ",", "$", "this", ")", ";", "if", "(", "$", "result", "=", "E...
Special event function used for extending within view files, allowing HTML to be injected multiple times. For example: <?= $this->fireViewEvent('backend.auth.extendSigninView') ?> @param string $event Event name @param array $params Event parameters @return string
[ "Special", "event", "function", "used", "for", "extending", "within", "view", "files", "allowing", "HTML", "to", "be", "injected", "multiple", "times", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/EventEmitter.php#L81-L91
208,644
octobercms/october
modules/backend/behaviors/ReorderController.php
ReorderController.prepareVars
protected function prepareVars() { $this->vars['reorderRecords'] = $this->getRecords(); $this->vars['reorderModel'] = $this->model; $this->vars['reorderSortMode'] = $this->sortMode; $this->vars['reorderShowTree'] = $this->showTree; $this->vars['reorderToolbarWidget'] = $this-...
php
protected function prepareVars() { $this->vars['reorderRecords'] = $this->getRecords(); $this->vars['reorderModel'] = $this->model; $this->vars['reorderSortMode'] = $this->sortMode; $this->vars['reorderShowTree'] = $this->showTree; $this->vars['reorderToolbarWidget'] = $this-...
[ "protected", "function", "prepareVars", "(", ")", "{", "$", "this", "->", "vars", "[", "'reorderRecords'", "]", "=", "$", "this", "->", "getRecords", "(", ")", ";", "$", "this", "->", "vars", "[", "'reorderModel'", "]", "=", "$", "this", "->", "model",...
Prepares common form data
[ "Prepares", "common", "form", "data" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ReorderController.php#L165-L172
208,645
octobercms/october
modules/backend/behaviors/ReorderController.php
ReorderController.getRecords
protected function getRecords() { $records = null; $model = $this->controller->reorderGetModel(); $query = $model->newQuery(); $this->controller->reorderExtendQuery($query); if ($this->sortMode == 'simple') { $records = $query ->orderBy($model->g...
php
protected function getRecords() { $records = null; $model = $this->controller->reorderGetModel(); $query = $model->newQuery(); $this->controller->reorderExtendQuery($query); if ($this->sortMode == 'simple') { $records = $query ->orderBy($model->g...
[ "protected", "function", "getRecords", "(", ")", "{", "$", "records", "=", "null", ";", "$", "model", "=", "$", "this", "->", "controller", "->", "reorderGetModel", "(", ")", ";", "$", "query", "=", "$", "model", "->", "newQuery", "(", ")", ";", "$",...
Returns all the records from the supplied model. @return Collection
[ "Returns", "all", "the", "records", "from", "the", "supplied", "model", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/ReorderController.php#L230-L249
208,646
octobercms/october
modules/cms/classes/Content.php
Content.getParsedMarkupAttribute
public function getParsedMarkupAttribute() { if (array_key_exists('parsedMarkup', $this->attributes)) { return $this->attributes['parsedMarkup']; } return $this->attributes['parsedMarkup'] = $this->parseMarkup(); }
php
public function getParsedMarkupAttribute() { if (array_key_exists('parsedMarkup', $this->attributes)) { return $this->attributes['parsedMarkup']; } return $this->attributes['parsedMarkup'] = $this->parseMarkup(); }
[ "public", "function", "getParsedMarkupAttribute", "(", ")", "{", "if", "(", "array_key_exists", "(", "'parsedMarkup'", ",", "$", "this", "->", "attributes", ")", ")", "{", "return", "$", "this", "->", "attributes", "[", "'parsedMarkup'", "]", ";", "}", "retu...
Returns a default value for parsedMarkup attribute. @return string
[ "Returns", "a", "default", "value", "for", "parsedMarkup", "attribute", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Content.php#L43-L50
208,647
octobercms/october
modules/cms/classes/Content.php
Content.parseMarkup
public function parseMarkup() { $extension = strtolower(File::extension($this->fileName)); switch ($extension) { case 'txt': $result = htmlspecialchars($this->markup); break; case 'md': $result = Markdown::parse($this->markup);...
php
public function parseMarkup() { $extension = strtolower(File::extension($this->fileName)); switch ($extension) { case 'txt': $result = htmlspecialchars($this->markup); break; case 'md': $result = Markdown::parse($this->markup);...
[ "public", "function", "parseMarkup", "(", ")", "{", "$", "extension", "=", "strtolower", "(", "File", "::", "extension", "(", "$", "this", "->", "fileName", ")", ")", ";", "switch", "(", "$", "extension", ")", "{", "case", "'txt'", ":", "$", "result", ...
Parses the content markup according to the file type. @return string
[ "Parses", "the", "content", "markup", "according", "to", "the", "file", "type", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/Content.php#L56-L72
208,648
octobercms/october
modules/backend/formwidgets/CodeEditor.php
CodeEditor.applyEditorPreferences
protected function applyEditorPreferences() { // Load the editor system settings $preferences = BackendPreference::instance(); $this->fontSize = $preferences->editor_font_size; $this->wordWrap = $preferences->editor_word_wrap; $this->codeFolding = $preferences->editor_code_f...
php
protected function applyEditorPreferences() { // Load the editor system settings $preferences = BackendPreference::instance(); $this->fontSize = $preferences->editor_font_size; $this->wordWrap = $preferences->editor_word_wrap; $this->codeFolding = $preferences->editor_code_f...
[ "protected", "function", "applyEditorPreferences", "(", ")", "{", "// Load the editor system settings", "$", "preferences", "=", "BackendPreference", "::", "instance", "(", ")", ";", "$", "this", "->", "fontSize", "=", "$", "preferences", "->", "editor_font_size", "...
Looks at the user preferences and overrides any set values. @return void
[ "Looks", "at", "the", "user", "preferences", "and", "overrides", "any", "set", "values", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/formwidgets/CodeEditor.php#L198-L217
208,649
octobercms/october
modules/cms/ServiceProvider.php
ServiceProvider.registerComponents
protected function registerComponents() { ComponentManager::instance()->registerComponents(function ($manager) { $manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag'); $manager->registerComponent(\Cms\Components\Resources::class, 'resources'); }); }
php
protected function registerComponents() { ComponentManager::instance()->registerComponents(function ($manager) { $manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag'); $manager->registerComponent(\Cms\Components\Resources::class, 'resources'); }); }
[ "protected", "function", "registerComponents", "(", ")", "{", "ComponentManager", "::", "instance", "(", ")", "->", "registerComponents", "(", "function", "(", "$", "manager", ")", "{", "$", "manager", "->", "registerComponent", "(", "\\", "Cms", "\\", "Compon...
Register components.
[ "Register", "components", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L61-L67
208,650
octobercms/october
modules/cms/ServiceProvider.php
ServiceProvider.registerCombinerEvents
protected function registerCombinerEvents() { if (App::runningInBackend() || App::runningInConsole()) { return; } Event::listen('cms.combiner.beforePrepare', function ($combiner, $assets) { $filters = array_flatten($combiner->getFilters()); ThemeData::app...
php
protected function registerCombinerEvents() { if (App::runningInBackend() || App::runningInConsole()) { return; } Event::listen('cms.combiner.beforePrepare', function ($combiner, $assets) { $filters = array_flatten($combiner->getFilters()); ThemeData::app...
[ "protected", "function", "registerCombinerEvents", "(", ")", "{", "if", "(", "App", "::", "runningInBackend", "(", ")", "||", "App", "::", "runningInConsole", "(", ")", ")", "{", "return", ";", "}", "Event", "::", "listen", "(", "'cms.combiner.beforePrepare'",...
Registers events for the asset combiner.
[ "Registers", "events", "for", "the", "asset", "combiner", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L82-L96
208,651
octobercms/october
modules/cms/ServiceProvider.php
ServiceProvider.bootMenuItemEvents
protected function bootMenuItemEvents() { Event::listen('pages.menuitem.listTypes', function () { return [ 'cms-page' => 'cms::lang.page.cms_page' ]; }); Event::listen('pages.menuitem.getTypeInfo', function ($type) { if ($type === 'cms-pag...
php
protected function bootMenuItemEvents() { Event::listen('pages.menuitem.listTypes', function () { return [ 'cms-page' => 'cms::lang.page.cms_page' ]; }); Event::listen('pages.menuitem.getTypeInfo', function ($type) { if ($type === 'cms-pag...
[ "protected", "function", "bootMenuItemEvents", "(", ")", "{", "Event", "::", "listen", "(", "'pages.menuitem.listTypes'", ",", "function", "(", ")", "{", "return", "[", "'cms-page'", "=>", "'cms::lang.page.cms_page'", "]", ";", "}", ")", ";", "Event", "::", "l...
Registers events for menu items.
[ "Registers", "events", "for", "menu", "items", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L289-L308
208,652
octobercms/october
modules/cms/ServiceProvider.php
ServiceProvider.bootRichEditorEvents
protected function bootRichEditorEvents() { Event::listen('backend.richeditor.listTypes', function () { return [ 'cms-page' => 'cms::lang.page.cms_page' ]; }); Event::listen('backend.richeditor.getTypeInfo', function ($type) { if ($type ==...
php
protected function bootRichEditorEvents() { Event::listen('backend.richeditor.listTypes', function () { return [ 'cms-page' => 'cms::lang.page.cms_page' ]; }); Event::listen('backend.richeditor.getTypeInfo', function ($type) { if ($type ==...
[ "protected", "function", "bootRichEditorEvents", "(", ")", "{", "Event", "::", "listen", "(", "'backend.richeditor.listTypes'", ",", "function", "(", ")", "{", "return", "[", "'cms-page'", "=>", "'cms::lang.page.cms_page'", "]", ";", "}", ")", ";", "Event", "::"...
Registers events for rich editor page links.
[ "Registers", "events", "for", "rich", "editor", "page", "links", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/ServiceProvider.php#L313-L326
208,653
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.resetDefault
public function resetDefault() { if ($record = $this->getSettingsRecord()) { $record->delete(); unset(self::$instances[$this->recordCode]); Cache::forget($this->getCacheKey()); } }
php
public function resetDefault() { if ($record = $this->getSettingsRecord()) { $record->delete(); unset(self::$instances[$this->recordCode]); Cache::forget($this->getCacheKey()); } }
[ "public", "function", "resetDefault", "(", ")", "{", "if", "(", "$", "record", "=", "$", "this", "->", "getSettingsRecord", "(", ")", ")", "{", "$", "record", "->", "delete", "(", ")", ";", "unset", "(", "self", "::", "$", "instances", "[", "$", "t...
Reset the settings to their defaults, this will delete the record model
[ "Reset", "the", "settings", "to", "their", "defaults", "this", "will", "delete", "the", "record", "model" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L87-L94
208,654
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.set
public function set($key, $value = null) { $data = is_array($key) ? $key : [$key => $value]; $obj = self::instance(); $obj->fill($data); return $obj->save(); }
php
public function set($key, $value = null) { $data = is_array($key) ? $key : [$key => $value]; $obj = self::instance(); $obj->fill($data); return $obj->save(); }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "data", "=", "is_array", "(", "$", "key", ")", "?", "$", "key", ":", "[", "$", "key", "=>", "$", "value", "]", ";", "$", "obj", "=", "self", "::", ...
Set a single or array key pair of values, intended as a static method
[ "Set", "a", "single", "or", "array", "key", "pair", "of", "values", "intended", "as", "a", "static", "method" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L122-L128
208,655
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.getSettingsValue
public function getSettingsValue($key, $default = null) { if (array_key_exists($key, $this->fieldValues)) { return $this->fieldValues[$key]; } return array_get($this->fieldValues, $key, $default); }
php
public function getSettingsValue($key, $default = null) { if (array_key_exists($key, $this->fieldValues)) { return $this->fieldValues[$key]; } return array_get($this->fieldValues, $key, $default); }
[ "public", "function", "getSettingsValue", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "fieldValues", ")", ")", "{", "return", "$", "this", "->", "fieldValues", "["...
Get a single setting value, or return a default value
[ "Get", "a", "single", "setting", "value", "or", "return", "a", "default", "value" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L141-L148
208,656
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.setSettingsValue
public function setSettingsValue($key, $value) { if ($this->isKeyAllowed($key)) { return; } $this->fieldValues[$key] = $value; }
php
public function setSettingsValue($key, $value) { if ($this->isKeyAllowed($key)) { return; } $this->fieldValues[$key] = $value; }
[ "public", "function", "setSettingsValue", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "isKeyAllowed", "(", "$", "key", ")", ")", "{", "return", ";", "}", "$", "this", "->", "fieldValues", "[", "$", "key", "]", "=", ...
Set a single setting value, if allowed.
[ "Set", "a", "single", "setting", "value", "if", "allowed", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L153-L160
208,657
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.afterModelFetch
public function afterModelFetch() { $this->fieldValues = $this->model->value ?: []; $this->model->attributes = array_merge($this->fieldValues, $this->model->attributes); }
php
public function afterModelFetch() { $this->fieldValues = $this->model->value ?: []; $this->model->attributes = array_merge($this->fieldValues, $this->model->attributes); }
[ "public", "function", "afterModelFetch", "(", ")", "{", "$", "this", "->", "fieldValues", "=", "$", "this", "->", "model", "->", "value", "?", ":", "[", "]", ";", "$", "this", "->", "model", "->", "attributes", "=", "array_merge", "(", "$", "this", "...
Populate the field values from the database record.
[ "Populate", "the", "field", "values", "from", "the", "database", "record", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L172-L176
208,658
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.saveModelInternal
public function saveModelInternal() { // Purge the field values from the attributes $this->model->attributes = array_diff_key($this->model->attributes, $this->fieldValues); }
php
public function saveModelInternal() { // Purge the field values from the attributes $this->model->attributes = array_diff_key($this->model->attributes, $this->fieldValues); }
[ "public", "function", "saveModelInternal", "(", ")", "{", "// Purge the field values from the attributes", "$", "this", "->", "model", "->", "attributes", "=", "array_diff_key", "(", "$", "this", "->", "model", "->", "attributes", ",", "$", "this", "->", "fieldVal...
Internal save method for the model @return void
[ "Internal", "save", "method", "for", "the", "model" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L182-L186
208,659
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.afterModelSave
public function afterModelSave() { Cache::forget($this->getCacheKey()); try { Artisan::call('queue:restart'); } catch (Exception $e) { Log::warning($e->getMessage()); } }
php
public function afterModelSave() { Cache::forget($this->getCacheKey()); try { Artisan::call('queue:restart'); } catch (Exception $e) { Log::warning($e->getMessage()); } }
[ "public", "function", "afterModelSave", "(", ")", "{", "Cache", "::", "forget", "(", "$", "this", "->", "getCacheKey", "(", ")", ")", ";", "try", "{", "Artisan", "::", "call", "(", "'queue:restart'", ")", ";", "}", "catch", "(", "Exception", "$", "e", ...
After the model is saved, clear the cached query entry and restart queue workers so they have the latest settings @return void
[ "After", "the", "model", "is", "saved", "clear", "the", "cached", "query", "entry", "and", "restart", "queue", "workers", "so", "they", "have", "the", "latest", "settings" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L205-L214
208,660
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.isKeyAllowed
protected function isKeyAllowed($key) { /* * Let the core columns through */ if ($key == 'id' || $key == 'value' || $key == 'item') { return true; } /* * Let relations through */ if ($this->model->hasRelation($key)) { ...
php
protected function isKeyAllowed($key) { /* * Let the core columns through */ if ($key == 'id' || $key == 'value' || $key == 'item') { return true; } /* * Let relations through */ if ($this->model->hasRelation($key)) { ...
[ "protected", "function", "isKeyAllowed", "(", "$", "key", ")", "{", "/*\n * Let the core columns through\n */", "if", "(", "$", "key", "==", "'id'", "||", "$", "key", "==", "'value'", "||", "$", "key", "==", "'item'", ")", "{", "return", "true"...
Checks if a key is legitimate or should be added to the field value collection
[ "Checks", "if", "a", "key", "is", "legitimate", "or", "should", "be", "added", "to", "the", "field", "value", "collection" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L220-L237
208,661
octobercms/october
modules/system/behaviors/SettingsModel.php
SettingsModel.getFieldConfig
public function getFieldConfig() { if ($this->fieldConfig !== null) { return $this->fieldConfig; } return $this->fieldConfig = $this->makeConfig($this->model->settingsFields); }
php
public function getFieldConfig() { if ($this->fieldConfig !== null) { return $this->fieldConfig; } return $this->fieldConfig = $this->makeConfig($this->model->settingsFields); }
[ "public", "function", "getFieldConfig", "(", ")", "{", "if", "(", "$", "this", "->", "fieldConfig", "!==", "null", ")", "{", "return", "$", "this", "->", "fieldConfig", ";", "}", "return", "$", "this", "->", "fieldConfig", "=", "$", "this", "->", "make...
Returns the field configuration used by this model.
[ "Returns", "the", "field", "configuration", "used", "by", "this", "model", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/behaviors/SettingsModel.php#L242-L249
208,662
octobercms/october
modules/cms/traits/UrlMaker.php
UrlMaker.resetUrlComponent
public function resetUrlComponent($name, $property = null) { $this->urlComponentName = $name; if ($property) { $this->urlComponentProperty = $property; } static::$urlPageName = $this->url = null; }
php
public function resetUrlComponent($name, $property = null) { $this->urlComponentName = $name; if ($property) { $this->urlComponentProperty = $property; } static::$urlPageName = $this->url = null; }
[ "public", "function", "resetUrlComponent", "(", "$", "name", ",", "$", "property", "=", "null", ")", "{", "$", "this", "->", "urlComponentName", "=", "$", "name", ";", "if", "(", "$", "property", ")", "{", "$", "this", "->", "urlComponentProperty", "=", ...
Changes the component used for generating the URLs dynamically. @param string $name @param string $property @return void
[ "Changes", "the", "component", "used", "for", "generating", "the", "URLs", "dynamically", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/traits/UrlMaker.php#L89-L98
208,663
octobercms/october
modules/cms/traits/UrlMaker.php
UrlMaker.getUrlAttribute
public function getUrlAttribute() { if ($this->url === null) { $this->url = $this->makeUrl(); } return $this->url; }
php
public function getUrlAttribute() { if ($this->url === null) { $this->url = $this->makeUrl(); } return $this->url; }
[ "public", "function", "getUrlAttribute", "(", ")", "{", "if", "(", "$", "this", "->", "url", "===", "null", ")", "{", "$", "this", "->", "url", "=", "$", "this", "->", "makeUrl", "(", ")", ";", "}", "return", "$", "this", "->", "url", ";", "}" ]
Mutator for the "url" attribute. Returns the URL detected by the component. @return string
[ "Mutator", "for", "the", "url", "attribute", ".", "Returns", "the", "URL", "detected", "by", "the", "component", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/traits/UrlMaker.php#L104-L111
208,664
octobercms/october
modules/cms/traits/UrlMaker.php
UrlMaker.getUrlPageName
public function getUrlPageName() { if (static::$urlPageName !== null) { return static::$urlPageName; } /* * Cache */ $key = 'urlMaker'.$this->urlComponentName.crc32(get_class($this)); $cached = Cache::get($key, false); if ($cached !== f...
php
public function getUrlPageName() { if (static::$urlPageName !== null) { return static::$urlPageName; } /* * Cache */ $key = 'urlMaker'.$this->urlComponentName.crc32(get_class($this)); $cached = Cache::get($key, false); if ($cached !== f...
[ "public", "function", "getUrlPageName", "(", ")", "{", "if", "(", "static", "::", "$", "urlPageName", "!==", "null", ")", "{", "return", "static", "::", "$", "urlPageName", ";", "}", "/*\n * Cache\n */", "$", "key", "=", "'urlMaker'", ".", "$...
Locates the page name where the detected component is found. This method uses the Cache service to improve performance. @return string
[ "Locates", "the", "page", "name", "where", "the", "detected", "component", "is", "found", ".", "This", "method", "uses", "the", "Cache", "service", "to", "improve", "performance", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/traits/UrlMaker.php#L138-L196
208,665
octobercms/october
modules/cms/traits/UrlMaker.php
UrlMaker.makeUrl
protected function makeUrl() { $controller = Controller::getController() ?: new Controller; return $controller->pageUrl($this->getUrlPageName(), $this->getUrlParams()); }
php
protected function makeUrl() { $controller = Controller::getController() ?: new Controller; return $controller->pageUrl($this->getUrlPageName(), $this->getUrlParams()); }
[ "protected", "function", "makeUrl", "(", ")", "{", "$", "controller", "=", "Controller", "::", "getController", "(", ")", "?", ":", "new", "Controller", ";", "return", "$", "controller", "->", "pageUrl", "(", "$", "this", "->", "getUrlPageName", "(", ")", ...
Generates a real URL based on the page, detected by the primary component. The CMS Controller is used for this process passing the declared params. @return string
[ "Generates", "a", "real", "URL", "based", "on", "the", "page", "detected", "by", "the", "primary", "component", ".", "The", "CMS", "Controller", "is", "used", "for", "this", "process", "passing", "the", "declared", "params", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/traits/UrlMaker.php#L203-L208
208,666
octobercms/october
modules/backend/classes/ControllerBehavior.php
ControllerBehavior.hideAction
protected function hideAction($methodName) { if (!is_array($methodName)) { $methodName = [$methodName]; } $this->controller->hiddenActions = array_merge($this->controller->hiddenActions, $methodName); }
php
protected function hideAction($methodName) { if (!is_array($methodName)) { $methodName = [$methodName]; } $this->controller->hiddenActions = array_merge($this->controller->hiddenActions, $methodName); }
[ "protected", "function", "hideAction", "(", "$", "methodName", ")", "{", "if", "(", "!", "is_array", "(", "$", "methodName", ")", ")", "{", "$", "methodName", "=", "[", "$", "methodName", "]", ";", "}", "$", "this", "->", "controller", "->", "hiddenAct...
Protects a public method from being available as an controller action. These methods could be defined in a controller to override a behavior default action. Such methods should be defined as public, to allow the behavior object to access it. By default public methods of a controller are considered as actions. To preven...
[ "Protects", "a", "public", "method", "from", "being", "available", "as", "an", "controller", "action", ".", "These", "methods", "could", "be", "defined", "in", "a", "controller", "to", "override", "a", "behavior", "default", "action", ".", "Such", "methods", ...
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/ControllerBehavior.php#L125-L132
208,667
octobercms/october
modules/backend/classes/ControllerBehavior.php
ControllerBehavior.makeFileContents
public function makeFileContents($filePath, $extraParams = []) { $this->controller->vars = array_merge($this->controller->vars, $this->vars); return $this->controller->makeFileContents($filePath, $extraParams); }
php
public function makeFileContents($filePath, $extraParams = []) { $this->controller->vars = array_merge($this->controller->vars, $this->vars); return $this->controller->makeFileContents($filePath, $extraParams); }
[ "public", "function", "makeFileContents", "(", "$", "filePath", ",", "$", "extraParams", "=", "[", "]", ")", "{", "$", "this", "->", "controller", "->", "vars", "=", "array_merge", "(", "$", "this", "->", "controller", "->", "vars", ",", "$", "this", "...
Makes all views in context of the controller, not the behavior. @param string $filePath Absolute path to the view file. @param array $extraParams Parameters that should be available to the view. @return string
[ "Makes", "all", "views", "in", "context", "of", "the", "controller", "not", "the", "behavior", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/ControllerBehavior.php#L140-L144
208,668
octobercms/october
modules/backend/classes/WidgetBase.php
WidgetBase.bindToController
public function bindToController() { if ($this->controller->widget === null) { $this->controller->widget = new stdClass; } $this->controller->widget->{$this->alias} = $this; }
php
public function bindToController() { if ($this->controller->widget === null) { $this->controller->widget = new stdClass; } $this->controller->widget->{$this->alias} = $this; }
[ "public", "function", "bindToController", "(", ")", "{", "if", "(", "$", "this", "->", "controller", "->", "widget", "===", "null", ")", "{", "$", "this", "->", "controller", "->", "widget", "=", "new", "stdClass", ";", "}", "$", "this", "->", "control...
Binds a widget to the controller for safe use. @return void
[ "Binds", "a", "widget", "to", "the", "controller", "for", "safe", "use", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/WidgetBase.php#L113-L120
208,669
octobercms/october
modules/backend/classes/WidgetBase.php
WidgetBase.getConfig
public function getConfig($name, $default = null) { /* * Array field name, eg: field[key][key2][key3] */ $keyParts = HtmlHelper::nameToArray($name); /* * First part will be the field name, pop it off */ $fieldName = array_shift($keyParts); ...
php
public function getConfig($name, $default = null) { /* * Array field name, eg: field[key][key2][key3] */ $keyParts = HtmlHelper::nameToArray($name); /* * First part will be the field name, pop it off */ $fieldName = array_shift($keyParts); ...
[ "public", "function", "getConfig", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "/*\n * Array field name, eg: field[key][key2][key3]\n */", "$", "keyParts", "=", "HtmlHelper", "::", "nameToArray", "(", "$", "name", ")", ";", "/*\n ...
Safe accessor for configuration values. @param string $name Config name, supports array names like "field[key]" @param string $default Default value if nothing is found @return string
[ "Safe", "accessor", "for", "configuration", "values", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/WidgetBase.php#L178-L207
208,670
octobercms/october
modules/backend/traits/CollapsableWidget.php
CollapsableWidget.getCollapseStatuses
protected function getCollapseStatuses() { if ($this->collapseGroupStatusCache !== false) { return $this->collapseGroupStatusCache; } $groups = $this->getSession($this->collapseSessionKey, []); if (!is_array($groups)) { return $this->collapseGroupStatusCache...
php
protected function getCollapseStatuses() { if ($this->collapseGroupStatusCache !== false) { return $this->collapseGroupStatusCache; } $groups = $this->getSession($this->collapseSessionKey, []); if (!is_array($groups)) { return $this->collapseGroupStatusCache...
[ "protected", "function", "getCollapseStatuses", "(", ")", "{", "if", "(", "$", "this", "->", "collapseGroupStatusCache", "!==", "false", ")", "{", "return", "$", "this", "->", "collapseGroupStatusCache", ";", "}", "$", "groups", "=", "$", "this", "->", "getS...
Returns the array of all collapsed states belonging to this widget. @return array
[ "Returns", "the", "array", "of", "all", "collapsed", "states", "belonging", "to", "this", "widget", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/CollapsableWidget.php#L40-L53
208,671
octobercms/october
modules/backend/traits/CollapsableWidget.php
CollapsableWidget.setCollapseStatus
protected function setCollapseStatus($group, $status) { $statuses = $this->getCollapseStatuses(); $statuses[$group] = $status; $this->collapseGroupStatusCache = $statuses; $this->putSession($this->collapseSessionKey, $statuses); }
php
protected function setCollapseStatus($group, $status) { $statuses = $this->getCollapseStatuses(); $statuses[$group] = $status; $this->collapseGroupStatusCache = $statuses; $this->putSession($this->collapseSessionKey, $statuses); }
[ "protected", "function", "setCollapseStatus", "(", "$", "group", ",", "$", "status", ")", "{", "$", "statuses", "=", "$", "this", "->", "getCollapseStatuses", "(", ")", ";", "$", "statuses", "[", "$", "group", "]", "=", "$", "status", ";", "$", "this",...
Sets a collapsed state. @param string $group @param string $status
[ "Sets", "a", "collapsed", "state", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/CollapsableWidget.php#L61-L70
208,672
octobercms/october
modules/backend/traits/CollapsableWidget.php
CollapsableWidget.getCollapseStatus
protected function getCollapseStatus($group, $default = true) { $statuses = $this->getCollapseStatuses(); if (array_key_exists($group, $statuses)) { return $statuses[$group]; } return $default; }
php
protected function getCollapseStatus($group, $default = true) { $statuses = $this->getCollapseStatuses(); if (array_key_exists($group, $statuses)) { return $statuses[$group]; } return $default; }
[ "protected", "function", "getCollapseStatus", "(", "$", "group", ",", "$", "default", "=", "true", ")", "{", "$", "statuses", "=", "$", "this", "->", "getCollapseStatuses", "(", ")", ";", "if", "(", "array_key_exists", "(", "$", "group", ",", "$", "statu...
Gets a collapsed state. @param string $group @param bool $default @return bool|string
[ "Gets", "a", "collapsed", "state", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/CollapsableWidget.php#L79-L88
208,673
octobercms/october
modules/backend/models/EditorSetting.php
EditorSetting.getConfiguredStyles
public static function getConfiguredStyles($key, $default = null) { $instance = static::instance(); $value = $instance->get($key); $defaultValue = $instance->getDefaultValue($key); if (is_array($value)) { $value = array_build($value, function ($key, $value) { ...
php
public static function getConfiguredStyles($key, $default = null) { $instance = static::instance(); $value = $instance->get($key); $defaultValue = $instance->getDefaultValue($key); if (is_array($value)) { $value = array_build($value, function ($key, $value) { ...
[ "public", "static", "function", "getConfiguredStyles", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "instance", "=", "static", "::", "instance", "(", ")", ";", "$", "value", "=", "$", "instance", "->", "get", "(", "$", "key", ")"...
Same as getConfigured but uses special style structure. @return mixed
[ "Same", "as", "getConfigured", "but", "uses", "special", "style", "structure", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/EditorSetting.php#L122-L137
208,674
octobercms/october
modules/backend/models/EditorSetting.php
EditorSetting.getConfigured
public static function getConfigured($key, $default = null) { $instance = static::instance(); $value = $instance->get($key); $defaultValue = $instance->getDefaultValue($key); return $value != $defaultValue ? $value : $default; }
php
public static function getConfigured($key, $default = null) { $instance = static::instance(); $value = $instance->get($key); $defaultValue = $instance->getDefaultValue($key); return $value != $defaultValue ? $value : $default; }
[ "public", "static", "function", "getConfigured", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "instance", "=", "static", "::", "instance", "(", ")", ";", "$", "value", "=", "$", "instance", "->", "get", "(", "$", "key", ")", ";...
Returns the value only if it differs from the default value. @return mixed
[ "Returns", "the", "value", "only", "if", "it", "differs", "from", "the", "default", "value", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/models/EditorSetting.php#L143-L152
208,675
octobercms/october
modules/system/controllers/Updates.php
Updates.listInjectRowClass
public function listInjectRowClass($record, $definition = null) { if ($record->disabledByConfig) { return 'hidden'; } if ($record->orphaned || $record->is_disabled) { return 'safe disabled'; } if ($definition != 'manage') { return; ...
php
public function listInjectRowClass($record, $definition = null) { if ($record->disabledByConfig) { return 'hidden'; } if ($record->orphaned || $record->is_disabled) { return 'safe disabled'; } if ($definition != 'manage') { return; ...
[ "public", "function", "listInjectRowClass", "(", "$", "record", ",", "$", "definition", "=", "null", ")", "{", "if", "(", "$", "record", "->", "disabledByConfig", ")", "{", "return", "'hidden'", ";", "}", "if", "(", "$", "record", "->", "orphaned", "||",...
Override for ListController behavior. Modifies the CSS class for each row in the list to - hidden - Disabled by configuration - safe disabled - Orphaned or disabled - negative - Disabled by system - frozen - Frozen by the user - positive - Default CSS class @see Backend\Behaviors\ListController @return string
[ "Override", "for", "ListController", "behavior", ".", "Modifies", "the", "CSS", "class", "for", "each", "row", "in", "the", "list", "to" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L230-L253
208,676
octobercms/october
modules/system/controllers/Updates.php
Updates.onExecuteStep
public function onExecuteStep() { /* * Address timeout limits */ @set_time_limit(3600); $manager = UpdateManager::instance(); $stepCode = post('code'); switch ($stepCode) { case 'downloadCore': $manager->downloadCore(post('hash'...
php
public function onExecuteStep() { /* * Address timeout limits */ @set_time_limit(3600); $manager = UpdateManager::instance(); $stepCode = post('code'); switch ($stepCode) { case 'downloadCore': $manager->downloadCore(post('hash'...
[ "public", "function", "onExecuteStep", "(", ")", "{", "/*\n * Address timeout limits\n */", "@", "set_time_limit", "(", "3600", ")", ";", "$", "manager", "=", "UpdateManager", "::", "instance", "(", ")", ";", "$", "stepCode", "=", "post", "(", "'...
Runs a specific update step.
[ "Runs", "a", "specific", "update", "step", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L258-L307
208,677
octobercms/october
modules/system/controllers/Updates.php
Updates.processImportantUpdates
protected function processImportantUpdates($result) { $hasImportantUpdates = false; /* * Core */ if (isset($result['core'])) { $coreImportant = false; foreach (array_get($result, 'core.updates', []) as $build => $description) { if (...
php
protected function processImportantUpdates($result) { $hasImportantUpdates = false; /* * Core */ if (isset($result['core'])) { $coreImportant = false; foreach (array_get($result, 'core.updates', []) as $build => $description) { if (...
[ "protected", "function", "processImportantUpdates", "(", "$", "result", ")", "{", "$", "hasImportantUpdates", "=", "false", ";", "/*\n * Core\n */", "if", "(", "isset", "(", "$", "result", "[", "'core'", "]", ")", ")", "{", "$", "coreImportant", ...
Loops the update list and checks for actionable updates. @param array $result @return array
[ "Loops", "the", "update", "list", "and", "checks", "for", "actionable", "updates", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L351-L394
208,678
octobercms/october
modules/system/controllers/Updates.php
Updates.processUpdateLists
protected function processUpdateLists($result) { if ($core = array_get($result, 'core')) { $result['core']['updates'] = array_reverse(array_get($core, 'updates', []), true); } foreach (array_get($result, 'plugins', []) as $code => $plugin) { $result['plugins'][$code]...
php
protected function processUpdateLists($result) { if ($core = array_get($result, 'core')) { $result['core']['updates'] = array_reverse(array_get($core, 'updates', []), true); } foreach (array_get($result, 'plugins', []) as $code => $plugin) { $result['plugins'][$code]...
[ "protected", "function", "processUpdateLists", "(", "$", "result", ")", "{", "if", "(", "$", "core", "=", "array_get", "(", "$", "result", ",", "'core'", ")", ")", "{", "$", "result", "[", "'core'", "]", "[", "'updates'", "]", "=", "array_reverse", "("...
Reverses the update lists for the core and all plugins. @param array $result @return array
[ "Reverses", "the", "update", "lists", "for", "the", "core", "and", "all", "plugins", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L401-L412
208,679
octobercms/october
modules/system/controllers/Updates.php
Updates.onApplyUpdates
public function onApplyUpdates() { try { /* * Process core */ $coreHash = post('hash'); $coreBuild = post('build'); $core = [$coreHash, $coreBuild]; /* * Process plugins */ $plugins =...
php
public function onApplyUpdates() { try { /* * Process core */ $coreHash = post('hash'); $coreBuild = post('build'); $core = [$coreHash, $coreBuild]; /* * Process plugins */ $plugins =...
[ "public", "function", "onApplyUpdates", "(", ")", "{", "try", "{", "/*\n * Process core\n */", "$", "coreHash", "=", "post", "(", "'hash'", ")", ";", "$", "coreBuild", "=", "post", "(", "'build'", ")", ";", "$", "core", "=", "[", "$",...
Converts the update data to an actionable array of steps.
[ "Converts", "the", "update", "data", "to", "an", "actionable", "array", "of", "steps", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L464-L554
208,680
octobercms/october
modules/system/controllers/Updates.php
Updates.onAttachProject
public function onAttachProject() { try { if (!$projectId = trim(post('project_id'))) { throw new ApplicationException(Lang::get('system::lang.project.id.missing')); } $manager = UpdateManager::instance(); $result = $manager->requestProjectDet...
php
public function onAttachProject() { try { if (!$projectId = trim(post('project_id'))) { throw new ApplicationException(Lang::get('system::lang.project.id.missing')); } $manager = UpdateManager::instance(); $result = $manager->requestProjectDet...
[ "public", "function", "onAttachProject", "(", ")", "{", "try", "{", "if", "(", "!", "$", "projectId", "=", "trim", "(", "post", "(", "'project_id'", ")", ")", ")", "{", "throw", "new", "ApplicationException", "(", "Lang", "::", "get", "(", "'system::lang...
Validate the project ID and execute the project installation
[ "Validate", "the", "project", "ID", "and", "execute", "the", "project", "installation" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L656-L678
208,681
octobercms/october
modules/system/controllers/Updates.php
Updates.onInstallPlugin
public function onInstallPlugin() { try { if (!$code = trim(post('code'))) { throw new ApplicationException(Lang::get('system::lang.install.missing_plugin_name')); } $manager = UpdateManager::instance(); $result = $manager->requestPluginDetail...
php
public function onInstallPlugin() { try { if (!$code = trim(post('code'))) { throw new ApplicationException(Lang::get('system::lang.install.missing_plugin_name')); } $manager = UpdateManager::instance(); $result = $manager->requestPluginDetail...
[ "public", "function", "onInstallPlugin", "(", ")", "{", "try", "{", "if", "(", "!", "$", "code", "=", "trim", "(", "post", "(", "'code'", ")", ")", ")", "{", "throw", "new", "ApplicationException", "(", "Lang", "::", "get", "(", "'system::lang.install.mi...
Validate the plugin code and execute the plugin installation
[ "Validate", "the", "plugin", "code", "and", "execute", "the", "plugin", "installation" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L699-L739
208,682
octobercms/october
modules/system/controllers/Updates.php
Updates.onRemovePlugin
public function onRemovePlugin() { if ($pluginCode = post('code')) { PluginManager::instance()->deletePlugin($pluginCode); Flash::success(Lang::get('system::lang.plugins.remove_success')); } return Redirect::refresh(); }
php
public function onRemovePlugin() { if ($pluginCode = post('code')) { PluginManager::instance()->deletePlugin($pluginCode); Flash::success(Lang::get('system::lang.plugins.remove_success')); } return Redirect::refresh(); }
[ "public", "function", "onRemovePlugin", "(", ")", "{", "if", "(", "$", "pluginCode", "=", "post", "(", "'code'", ")", ")", "{", "PluginManager", "::", "instance", "(", ")", "->", "deletePlugin", "(", "$", "pluginCode", ")", ";", "Flash", "::", "success",...
Rollback and remove a single plugin from the system. @return void
[ "Rollback", "and", "remove", "a", "single", "plugin", "from", "the", "system", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L745-L753
208,683
octobercms/october
modules/system/controllers/Updates.php
Updates.onBulkAction
public function onBulkAction() { if (($bulkAction = post('action')) && ($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds) ) { $manager = PluginManager::instance(); foreach ($checkedIds as $pluginId) { ...
php
public function onBulkAction() { if (($bulkAction = post('action')) && ($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds) ) { $manager = PluginManager::instance(); foreach ($checkedIds as $pluginId) { ...
[ "public", "function", "onBulkAction", "(", ")", "{", "if", "(", "(", "$", "bulkAction", "=", "post", "(", "'action'", ")", ")", "&&", "(", "$", "checkedIds", "=", "post", "(", "'checked'", ")", ")", "&&", "is_array", "(", "$", "checkedIds", ")", "&&"...
Perform a bulk action on the provided plugins @return void
[ "Perform", "a", "bulk", "action", "on", "the", "provided", "plugins" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L759-L818
208,684
octobercms/october
modules/system/controllers/Updates.php
Updates.onRemoveTheme
public function onRemoveTheme() { if ($themeCode = post('code')) { ThemeManager::instance()->deleteTheme($themeCode); Flash::success(trans('cms::lang.theme.delete_theme_success')); } return Redirect::refresh(); }
php
public function onRemoveTheme() { if ($themeCode = post('code')) { ThemeManager::instance()->deleteTheme($themeCode); Flash::success(trans('cms::lang.theme.delete_theme_success')); } return Redirect::refresh(); }
[ "public", "function", "onRemoveTheme", "(", ")", "{", "if", "(", "$", "themeCode", "=", "post", "(", "'code'", ")", ")", "{", "ThemeManager", "::", "instance", "(", ")", "->", "deleteTheme", "(", "$", "themeCode", ")", ";", "Flash", "::", "success", "(...
Deletes a single theme from the system. @return void
[ "Deletes", "a", "single", "theme", "from", "the", "system", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L873-L883
208,685
octobercms/october
modules/system/controllers/Updates.php
Updates.appendRequiredPlugins
protected function appendRequiredPlugins(array $plugins, array $result) { foreach ((array) array_get($result, 'require') as $plugin) { if ( ($name = array_get($plugin, 'code')) && ($hash = array_get($plugin, 'hash')) && !PluginManager::instance()->...
php
protected function appendRequiredPlugins(array $plugins, array $result) { foreach ((array) array_get($result, 'require') as $plugin) { if ( ($name = array_get($plugin, 'code')) && ($hash = array_get($plugin, 'hash')) && !PluginManager::instance()->...
[ "protected", "function", "appendRequiredPlugins", "(", "array", "$", "plugins", ",", "array", "$", "result", ")", "{", "foreach", "(", "(", "array", ")", "array_get", "(", "$", "result", ",", "'require'", ")", "as", "$", "plugin", ")", "{", "if", "(", ...
Adds require plugin codes to the collection based on a result. @param array $plugins @param array $result @return array
[ "Adds", "require", "plugin", "codes", "to", "the", "collection", "based", "on", "a", "result", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L986-L999
208,686
octobercms/october
modules/system/helpers/View.php
View.getGlobalVars
public static function getGlobalVars() { if (static::$globalVarCache !== null) { return static::$globalVarCache; } $vars = array_filter(ViewFacade::getShared(), function ($var) { return is_scalar($var) || is_array($var); }); return static::$globalVar...
php
public static function getGlobalVars() { if (static::$globalVarCache !== null) { return static::$globalVarCache; } $vars = array_filter(ViewFacade::getShared(), function ($var) { return is_scalar($var) || is_array($var); }); return static::$globalVar...
[ "public", "static", "function", "getGlobalVars", "(", ")", "{", "if", "(", "static", "::", "$", "globalVarCache", "!==", "null", ")", "{", "return", "static", "::", "$", "globalVarCache", ";", "}", "$", "vars", "=", "array_filter", "(", "ViewFacade", "::",...
Returns shared view variables, this should be used for simple rendering cycles. Such as content blocks and mail templates. @return array
[ "Returns", "shared", "view", "variables", "this", "should", "be", "used", "for", "simple", "rendering", "cycles", ".", "Such", "as", "content", "blocks", "and", "mail", "templates", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/helpers/View.php#L28-L39
208,687
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.loadCached
public static function loadCached($theme, $fileName) { return static::inTheme($theme) ->remember(Config::get('cms.parsedPageCacheTTL', 1440)) ->find($fileName) ; }
php
public static function loadCached($theme, $fileName) { return static::inTheme($theme) ->remember(Config::get('cms.parsedPageCacheTTL', 1440)) ->find($fileName) ; }
[ "public", "static", "function", "loadCached", "(", "$", "theme", ",", "$", "fileName", ")", "{", "return", "static", "::", "inTheme", "(", "$", "theme", ")", "->", "remember", "(", "Config", "::", "get", "(", "'cms.parsedPageCacheTTL'", ",", "1440", ")", ...
Loads the object from a cache. This method is used by the CMS in the runtime. If the cache is not found, it is created. @param \Cms\Classes\Theme $theme Specifies the theme the object belongs to. @param string $fileName Specifies the file name, with the extension. @return mixed Returns a CMS object instance or null if ...
[ "Loads", "the", "object", "from", "a", "cache", ".", "This", "method", "is", "used", "by", "the", "CMS", "in", "the", "runtime", ".", "If", "the", "cache", "is", "not", "found", "it", "is", "created", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L106-L112
208,688
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.listInTheme
public static function listInTheme($theme, $skipCache = false) { $result = []; $instance = static::inTheme($theme); if ($skipCache) { $result = $instance->get(); } else { $items = $instance->newQuery()->lists('fileName'); $loadedItems = []; ...
php
public static function listInTheme($theme, $skipCache = false) { $result = []; $instance = static::inTheme($theme); if ($skipCache) { $result = $instance->get(); } else { $items = $instance->newQuery()->lists('fileName'); $loadedItems = []; ...
[ "public", "static", "function", "listInTheme", "(", "$", "theme", ",", "$", "skipCache", "=", "false", ")", "{", "$", "result", "=", "[", "]", ";", "$", "instance", "=", "static", "::", "inTheme", "(", "$", "theme", ")", ";", "if", "(", "$", "skipC...
Returns the list of objects in the specified theme. This method is used internally by the system. @param \Cms\Classes\Theme $theme Specifies a parent theme. @param boolean $skipCache Indicates if objects should be reloaded from the disk bypassing the cache. @return Collection Returns a collection of CMS objects.
[ "Returns", "the", "list", "of", "objects", "in", "the", "specified", "theme", ".", "This", "method", "is", "used", "internally", "by", "the", "system", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L121-L171
208,689
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.inTheme
public static function inTheme($theme) { if (is_string($theme)) { $theme = Theme::load($theme); } return static::on($theme->getDirName()); }
php
public static function inTheme($theme) { if (is_string($theme)) { $theme = Theme::load($theme); } return static::on($theme->getDirName()); }
[ "public", "static", "function", "inTheme", "(", "$", "theme", ")", "{", "if", "(", "is_string", "(", "$", "theme", ")", ")", "{", "$", "theme", "=", "Theme", "::", "load", "(", "$", "theme", ")", ";", "}", "return", "static", "::", "on", "(", "$"...
Prepares the theme datasource for the model. @param \Cms\Classes\Theme $theme Specifies a parent theme. @return $this
[ "Prepares", "the", "theme", "datasource", "for", "the", "model", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L178-L185
208,690
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.save
public function save(array $options = null) { try { parent::save($options); } catch (Exception $ex) { $this->throwHalcyonSaveException($ex); } }
php
public function save(array $options = null) { try { parent::save($options); } catch (Exception $ex) { $this->throwHalcyonSaveException($ex); } }
[ "public", "function", "save", "(", "array", "$", "options", "=", "null", ")", "{", "try", "{", "parent", "::", "save", "(", "$", "options", ")", ";", "}", "catch", "(", "Exception", "$", "ex", ")", "{", "$", "this", "->", "throwHalcyonSaveException", ...
Save the object to the theme. @param array $options @return bool
[ "Save", "the", "object", "to", "the", "theme", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L193-L201
208,691
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.getThemeAttribute
public function getThemeAttribute() { if ($this->themeCache !== null) { return $this->themeCache; } $themeName = $this->getDatasourceName() ?: static::getDatasourceResolver()->getDefaultDatasource(); return $this->themeCache = Theme::load($themeName); }
php
public function getThemeAttribute() { if ($this->themeCache !== null) { return $this->themeCache; } $themeName = $this->getDatasourceName() ?: static::getDatasourceResolver()->getDefaultDatasource(); return $this->themeCache = Theme::load($themeName); }
[ "public", "function", "getThemeAttribute", "(", ")", "{", "if", "(", "$", "this", "->", "themeCache", "!==", "null", ")", "{", "return", "$", "this", "->", "themeCache", ";", "}", "$", "themeName", "=", "$", "this", "->", "getDatasourceName", "(", ")", ...
Returns the CMS theme this object belongs to. @return \Cms\Classes\Theme
[ "Returns", "the", "CMS", "theme", "this", "object", "belongs", "to", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L207-L217
208,692
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.getFilePath
public function getFilePath($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } return $this->theme->getPath().'/'.$this->getObjectTypeDirName().'/'.$fileName; }
php
public function getFilePath($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } return $this->theme->getPath().'/'.$this->getObjectTypeDirName().'/'.$fileName; }
[ "public", "function", "getFilePath", "(", "$", "fileName", "=", "null", ")", "{", "if", "(", "$", "fileName", "===", "null", ")", "{", "$", "fileName", "=", "$", "this", "->", "fileName", ";", "}", "return", "$", "this", "->", "theme", "->", "getPath...
Returns the full path to the template file corresponding to this object. @param string $fileName @return string
[ "Returns", "the", "full", "path", "to", "the", "template", "file", "corresponding", "to", "this", "object", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L224-L231
208,693
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.getTwigCacheKey
public function getTwigCacheKey() { $key = $this->getFilePath(); if ($event = $this->fireEvent('cmsObject.getTwigCacheKey', compact('key'), true)) { $key = $event; } return $key; }
php
public function getTwigCacheKey() { $key = $this->getFilePath(); if ($event = $this->fireEvent('cmsObject.getTwigCacheKey', compact('key'), true)) { $key = $event; } return $key; }
[ "public", "function", "getTwigCacheKey", "(", ")", "{", "$", "key", "=", "$", "this", "->", "getFilePath", "(", ")", ";", "if", "(", "$", "event", "=", "$", "this", "->", "fireEvent", "(", "'cmsObject.getTwigCacheKey'", ",", "compact", "(", "'key'", ")",...
Returns the key used by the Twig cache. @return string
[ "Returns", "the", "key", "used", "by", "the", "Twig", "cache", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L288-L297
208,694
octobercms/october
modules/cms/classes/CmsObject.php
CmsObject.throwHalcyonSaveException
protected function throwHalcyonSaveException(Exception $ex) { if ($ex instanceof \October\Rain\Halcyon\Exception\MissingFileNameException) { throw new ValidationException([ 'fileName' => Lang::get('cms::lang.cms_object.file_name_required') ]); } elseif...
php
protected function throwHalcyonSaveException(Exception $ex) { if ($ex instanceof \October\Rain\Halcyon\Exception\MissingFileNameException) { throw new ValidationException([ 'fileName' => Lang::get('cms::lang.cms_object.file_name_required') ]); } elseif...
[ "protected", "function", "throwHalcyonSaveException", "(", "Exception", "$", "ex", ")", "{", "if", "(", "$", "ex", "instanceof", "\\", "October", "\\", "Rain", "\\", "Halcyon", "\\", "Exception", "\\", "MissingFileNameException", ")", "{", "throw", "new", "Val...
Converts an exception type thrown by Halcyon to a native CMS exception. @param Exception $ex
[ "Converts", "an", "exception", "type", "thrown", "by", "Halcyon", "to", "a", "native", "CMS", "exception", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/classes/CmsObject.php#L307-L345
208,695
octobercms/october
modules/backend/classes/Controller.php
Controller.run
public function run($action = null, $params = []) { $this->action = $action; $this->params = $params; /* * Check security token. */ if (!$this->verifyCsrfToken()) { return Response::make(Lang::get('backend::lang.page.invalid_token.label'), 403); ...
php
public function run($action = null, $params = []) { $this->action = $action; $this->params = $params; /* * Check security token. */ if (!$this->verifyCsrfToken()) { return Response::make(Lang::get('backend::lang.page.invalid_token.label'), 403); ...
[ "public", "function", "run", "(", "$", "action", "=", "null", ",", "$", "params", "=", "[", "]", ")", "{", "$", "this", "->", "action", "=", "$", "action", ";", "$", "this", "->", "params", "=", "$", "params", ";", "/*\n * Check security token....
Execute the controller action. @param string $action The action name. @param array $params Routing parameters to pass to the action. @return mixed The action result.
[ "Execute", "the", "controller", "action", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L166-L253
208,696
octobercms/october
modules/backend/classes/Controller.php
Controller.actionExists
public function actionExists($name, $internal = false) { if (!strlen($name) || substr($name, 0, 1) == '_' || !$this->methodExists($name)) { return false; } foreach ($this->hiddenActions as $method) { if (strtolower($name) == strtolower($method)) { ret...
php
public function actionExists($name, $internal = false) { if (!strlen($name) || substr($name, 0, 1) == '_' || !$this->methodExists($name)) { return false; } foreach ($this->hiddenActions as $method) { if (strtolower($name) == strtolower($method)) { ret...
[ "public", "function", "actionExists", "(", "$", "name", ",", "$", "internal", "=", "false", ")", "{", "if", "(", "!", "strlen", "(", "$", "name", ")", "||", "substr", "(", "$", "name", ",", "0", ",", "1", ")", "==", "'_'", "||", "!", "$", "this...
This method is used internally. Determines whether an action with the specified name exists. Action must be a class public method. Action name can not be prefixed with the underscore character. @param string $name Specifies the action name. @param bool $internal Allow protected actions. @return boolean
[ "This", "method", "is", "used", "internally", ".", "Determines", "whether", "an", "action", "with", "the", "specified", "name", "exists", ".", "Action", "must", "be", "a", "class", "public", "method", ".", "Action", "name", "can", "not", "be", "prefixed", ...
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L263-L294
208,697
octobercms/october
modules/backend/classes/Controller.php
Controller.actionUrl
public function actionUrl($action = null, $path = null) { if ($action === null) { $action = $this->action; } $class = get_called_class(); $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class)))); $controllerName = strtolower(class_basename($class))...
php
public function actionUrl($action = null, $path = null) { if ($action === null) { $action = $this->action; } $class = get_called_class(); $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class)))); $controllerName = strtolower(class_basename($class))...
[ "public", "function", "actionUrl", "(", "$", "action", "=", "null", ",", "$", "path", "=", "null", ")", "{", "if", "(", "$", "action", "===", "null", ")", "{", "$", "action", "=", "$", "this", "->", "action", ";", "}", "$", "class", "=", "get_cal...
Returns a URL for this controller and supplied action.
[ "Returns", "a", "URL", "for", "this", "controller", "and", "supplied", "action", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L299-L315
208,698
octobercms/october
modules/backend/classes/Controller.php
Controller.pageAction
public function pageAction() { if (!$this->action) { return; } $this->suppressView = true; $this->execPageAction($this->action, $this->params); }
php
public function pageAction() { if (!$this->action) { return; } $this->suppressView = true; $this->execPageAction($this->action, $this->params); }
[ "public", "function", "pageAction", "(", ")", "{", "if", "(", "!", "$", "this", "->", "action", ")", "{", "return", ";", "}", "$", "this", "->", "suppressView", "=", "true", ";", "$", "this", "->", "execPageAction", "(", "$", "this", "->", "action", ...
Invokes the current controller action without rendering a view, used by AJAX handler that may rely on the logic inside the action.
[ "Invokes", "the", "current", "controller", "action", "without", "rendering", "a", "view", "used", "by", "AJAX", "handler", "that", "may", "rely", "on", "the", "logic", "inside", "the", "action", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L321-L329
208,699
octobercms/october
modules/backend/classes/Controller.php
Controller.execPageAction
protected function execPageAction($actionName, $parameters) { $result = null; if (!$this->actionExists($actionName)) { if (Config::get('app.debug', false)) { throw new SystemException(sprintf( "Action %s is not found in the controller %s", ...
php
protected function execPageAction($actionName, $parameters) { $result = null; if (!$this->actionExists($actionName)) { if (Config::get('app.debug', false)) { throw new SystemException(sprintf( "Action %s is not found in the controller %s", ...
[ "protected", "function", "execPageAction", "(", "$", "actionName", ",", "$", "parameters", ")", "{", "$", "result", "=", "null", ";", "if", "(", "!", "$", "this", "->", "actionExists", "(", "$", "actionName", ")", ")", "{", "if", "(", "Config", "::", ...
This method is used internally. Invokes the controller action and loads the corresponding view. @param string $actionName Specifies a action name to execute. @param array $parameters A list of the action parameters.
[ "This", "method", "is", "used", "internally", ".", "Invokes", "the", "controller", "action", "and", "loads", "the", "corresponding", "view", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/Controller.php#L337-L372