Clean up event parameters to dev standards
This commit is contained in:
parent
2f3d42a3f9
commit
d912b73aab
|
|
@ -79,20 +79,20 @@ class FormController extends ControllerBehavior
|
|||
*/
|
||||
$this->formWidget = $this->makeWidget('Backend\Widgets\Form', $config);
|
||||
|
||||
$this->formWidget->bindEvent('form.extendFieldsBefore', function($host) {
|
||||
$this->controller->formExtendFieldsBefore($host);
|
||||
$this->formWidget->bindEvent('form.extendFieldsBefore', function() {
|
||||
$this->controller->formExtendFieldsBefore($this->formWidget);
|
||||
});
|
||||
|
||||
$this->formWidget->bindEvent('form.extendFields', function($host) {
|
||||
$this->controller->formExtendFields($host);
|
||||
$this->formWidget->bindEvent('form.extendFields', function() {
|
||||
$this->controller->formExtendFields($this->formWidget);
|
||||
});
|
||||
|
||||
$this->formWidget->bindEvent('form.refreshBefore', function($host, $saveData) {
|
||||
return $this->controller->formExtendRefreshData($host, $saveData);
|
||||
$this->formWidget->bindEvent('form.beforeRefresh', function($saveData) {
|
||||
return $this->controller->formExtendRefreshData($this->formWidget, $saveData);
|
||||
});
|
||||
|
||||
$this->formWidget->bindEvent('form.refresh', function($host, $result) {
|
||||
return $this->controller->formExtendRefreshResults($host, $result);
|
||||
$this->formWidget->bindEvent('form.refresh', function($result) {
|
||||
return $this->controller->formExtendRefreshResults($this->formWidget, $result);
|
||||
});
|
||||
|
||||
$this->formWidget->bindToController();
|
||||
|
|
|
|||
|
|
@ -128,23 +128,23 @@ class ListController extends ControllerBehavior
|
|||
/*
|
||||
* Extensibility helpers
|
||||
*/
|
||||
$widget->bindEvent('list.extendQueryBefore', function($host, $query) use ($definition) {
|
||||
$widget->bindEvent('list.extendQueryBefore', function($query) use ($definition) {
|
||||
$this->controller->listExtendQueryBefore($query, $definition);
|
||||
});
|
||||
|
||||
$widget->bindEvent('list.extendQuery', function($host, $query) use ($definition) {
|
||||
$widget->bindEvent('list.extendQuery', function($query) use ($definition) {
|
||||
$this->controller->listExtendQuery($query, $definition);
|
||||
});
|
||||
|
||||
$widget->bindEvent('list.injectRowClass', function($host, $record) use ($definition) {
|
||||
$widget->bindEvent('list.injectRowClass', function($record) use ($definition) {
|
||||
return $this->controller->listInjectRowClass($record, $definition);
|
||||
});
|
||||
|
||||
$widget->bindEvent('list.overrideColumnValue', function($host, $record, $column, $value) use ($definition) {
|
||||
$widget->bindEvent('list.overrideColumnValue', function($record, $column, $value) use ($definition) {
|
||||
return $this->controller->listOverrideColumnValue($record, $column->columnName, $definition);
|
||||
});
|
||||
|
||||
$widget->bindEvent('list.overrideHeaderValue', function($host, $column, $value) use ($definition) {
|
||||
$widget->bindEvent('list.overrideHeaderValue', function($column, $value) use ($definition) {
|
||||
return $this->controller->listOverrideHeaderValue($column->columnName, $definition);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ class RelationController extends ControllerBehavior
|
|||
$config->noRecordsMessage = $emptyMessage;
|
||||
|
||||
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);
|
||||
$widget->bindEvent('list.extendQueryBefore', function($host, $query) {
|
||||
$widget->bindEvent('list.extendQueryBefore', function($query) {
|
||||
$this->relationObject->setQuery($query);
|
||||
if ($this->model->exists) {
|
||||
$this->relationObject->addConstraints();
|
||||
|
|
@ -668,7 +668,7 @@ class RelationController extends ControllerBehavior
|
|||
* Exclude existing relationships
|
||||
*/
|
||||
if ($this->manageMode == 'pivot' || $this->manageMode == 'list') {
|
||||
$widget->bindEvent('list.extendQueryBefore', function($host, $query) {
|
||||
$widget->bindEvent('list.extendQueryBefore', function($query) {
|
||||
|
||||
/*
|
||||
* Where not in the current list of related records
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class RecordFinder extends FormWidgetBase
|
|||
$config->recordOnClick = sprintf("$('#%s').recordFinder('updateRecord', this, ':id')", $this->getId());
|
||||
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);
|
||||
|
||||
// $widget->bindEvent('list.extendQueryBefore', function($host, $query) {
|
||||
// $widget->bindEvent('list.extendQueryBefore', function($query) {
|
||||
|
||||
// /*
|
||||
// * Where not in the current list of related records
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ class Form extends WidgetBase
|
|||
/*
|
||||
* Extensibility
|
||||
*/
|
||||
$eventResults = $this->fireEvent('form.refreshBefore', [$this, $saveData]) + Event::fire('backend.form.refreshBefore', [$this, $saveData]);
|
||||
$eventResults = $this->fireEvent('form.beforeRefresh', [$saveData]) + Event::fire('backend.form.beforeRefresh', [$this, $saveData]);
|
||||
foreach ($eventResults as $eventResult)
|
||||
$saveData = $eventResult + $saveData;
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ class Form extends WidgetBase
|
|||
/*
|
||||
* Extensibility
|
||||
*/
|
||||
$eventResults = $this->fireEvent('form.refresh', [$this, $result]) + Event::fire('backend.form.refresh', [$this, $result]);
|
||||
$eventResults = $this->fireEvent('form.refresh', [$result]) + Event::fire('backend.form.refresh', [$this, $result]);
|
||||
foreach ($eventResults as $eventResult)
|
||||
$result = $eventResult + $result;
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ class Form extends WidgetBase
|
|||
* Extensibility
|
||||
*/
|
||||
Event::fire('backend.form.extendFieldsBefore', [$this]);
|
||||
$this->fireEvent('form.extendFieldsBefore', $this);
|
||||
$this->fireEvent('form.extendFieldsBefore');
|
||||
|
||||
/*
|
||||
* Outside fields
|
||||
|
|
@ -339,7 +339,7 @@ class Form extends WidgetBase
|
|||
* Extensibility
|
||||
*/
|
||||
Event::fire('backend.form.extendFields', [$this]);
|
||||
$this->fireEvent('form.extendFields', $this);
|
||||
$this->fireEvent('form.extendFields');
|
||||
|
||||
/*
|
||||
* Convert automatic spanned fields
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class Lists extends WidgetBase
|
|||
* Extensibility
|
||||
*/
|
||||
Event::fire('backend.list.extendQueryBefore', [$this, $query]);
|
||||
$this->fireEvent('list.extendQueryBefore', [$this, $query]);
|
||||
$this->fireEvent('list.extendQueryBefore', [$query]);
|
||||
|
||||
/*
|
||||
* Related custom selects, must come first
|
||||
|
|
@ -346,7 +346,7 @@ class Lists extends WidgetBase
|
|||
* Extensibility
|
||||
*/
|
||||
Event::fire('backend.list.extendQuery', [$this, $query]);
|
||||
$this->fireEvent('list.extendQuery', [$this, $query]);
|
||||
$this->fireEvent('list.extendQuery', [$query]);
|
||||
|
||||
// Grouping due to the joinWith() call
|
||||
$query->select($selects);
|
||||
|
|
@ -460,7 +460,7 @@ class Lists extends WidgetBase
|
|||
* Extensibility
|
||||
*/
|
||||
Event::fire('backend.list.extendColumns', [$this]);
|
||||
$this->fireEvent('list.extendColumns', $this);
|
||||
$this->fireEvent('list.extendColumns');
|
||||
|
||||
/*
|
||||
* Use a supplied column order
|
||||
|
|
@ -544,7 +544,7 @@ class Lists extends WidgetBase
|
|||
if ($response = Event::fire('backend.list.overrideHeaderValue', [$this, $column, $value], true))
|
||||
$value = $response;
|
||||
|
||||
if ($response = $this->fireEvent('list.overrideHeaderValue', [$this, $column, $value], true))
|
||||
if ($response = $this->fireEvent('list.overrideHeaderValue', [$column, $value], true))
|
||||
$value = $response;
|
||||
|
||||
return $value;
|
||||
|
|
@ -575,7 +575,7 @@ class Lists extends WidgetBase
|
|||
if ($response = Event::fire('backend.list.overrideColumnValue', [$this, $record, $column, $value], true))
|
||||
$value = $response;
|
||||
|
||||
if ($response = $this->fireEvent('list.overrideColumnValue', [$this, $record, $column, $value], true))
|
||||
if ($response = $this->fireEvent('list.overrideColumnValue', [$record, $column, $value], true))
|
||||
$value = $response;
|
||||
|
||||
return $value;
|
||||
|
|
@ -596,7 +596,7 @@ class Lists extends WidgetBase
|
|||
if ($response = Event::fire('backend.list.injectRowClass', [$this, $record], true))
|
||||
$value = $response;
|
||||
|
||||
if ($response = $this->fireEvent('list.injectRowClass', [$this, $record], true))
|
||||
if ($response = $this->fireEvent('list.injectRowClass', [$record], true))
|
||||
$value = $response;
|
||||
|
||||
return $value;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Controller extends BaseController
|
|||
if ($event = Event::fire('cms.page.beforeDisplay', [$this, $url, $page], true))
|
||||
return $event;
|
||||
|
||||
if ($event = $this->fireEvent('page.beforeDisplay', [$this, $url, $page], true))
|
||||
if ($event = $this->fireEvent('page.beforeDisplay', [$url, $page], true))
|
||||
return $event;
|
||||
|
||||
/*
|
||||
|
|
@ -215,7 +215,7 @@ class Controller extends BaseController
|
|||
if ($event = Event::fire('cms.page.display', [$this, $url, $page], true))
|
||||
return $event;
|
||||
|
||||
if ($event = $this->fireEvent('page.display', [$this, $url, $page], true))
|
||||
if ($event = $this->fireEvent('page.display', [$url, $page], true))
|
||||
return $event;
|
||||
|
||||
if (!is_string($result))
|
||||
|
|
@ -450,7 +450,7 @@ class Controller extends BaseController
|
|||
if ($event = Event::fire('cms.page.start', [$this], true))
|
||||
return $event;
|
||||
|
||||
if ($event = $this->fireEvent('page.start', [$this], true))
|
||||
if ($event = $this->fireEvent('page.start', [], true))
|
||||
return $event;
|
||||
|
||||
/*
|
||||
|
|
@ -492,7 +492,7 @@ class Controller extends BaseController
|
|||
if ($event = Event::fire('cms.page.end', [$this], true))
|
||||
return $event;
|
||||
|
||||
if ($event = $this->fireEvent('page.end', [$this], true))
|
||||
if ($event = $this->fireEvent('page.end', [], true))
|
||||
return $event;
|
||||
|
||||
return $response;
|
||||
|
|
|
|||
Loading…
Reference in New Issue