diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php index 73f8bce48..22c6f1da3 100644 --- a/modules/backend/behaviors/FormController.php +++ b/modules/backend/behaviors/FormController.php @@ -79,11 +79,11 @@ class FormController extends ControllerBehavior */ $this->formWidget = $this->makeWidget('Backend\Widgets\Form', $config); - $this->formWidget->bind('form.extendFieldsBefore', function($host) { + $this->formWidget->bindEvent('form.extendFieldsBefore', function($host) { $this->controller->formExtendFieldsBefore($host); }); - $this->formWidget->bind('form.extendFields', function($host) { + $this->formWidget->bindEvent('form.extendFields', function($host) { $this->controller->formExtendFields($host); }); diff --git a/modules/backend/behaviors/ListController.php b/modules/backend/behaviors/ListController.php index d2d19e80e..ef93ddf20 100644 --- a/modules/backend/behaviors/ListController.php +++ b/modules/backend/behaviors/ListController.php @@ -128,23 +128,23 @@ class ListController extends ControllerBehavior /* * Extensibility helpers */ - $widget->bind('list.extendQueryBefore', function($host, $query) use ($definition) { + $widget->bindEvent('list.extendQueryBefore', function($host, $query) use ($definition) { $this->controller->listExtendQueryBefore($query, $definition); }); - $widget->bind('list.extendQuery', function($host, $query) use ($definition) { + $widget->bindEvent('list.extendQuery', function($host, $query) use ($definition) { $this->controller->listExtendQuery($query, $definition); }); - $widget->bind('list.injectRowClass', function($host, $record) use ($definition) { + $widget->bindEvent('list.injectRowClass', function($host, $record) use ($definition) { return $this->controller->listInjectRowClass($record, $definition); }); - $widget->bind('list.overrideColumnValue', function($host, $record, $column, $value) use ($definition) { + $widget->bindEvent('list.overrideColumnValue', function($host, $record, $column, $value) use ($definition) { return $this->controller->listOverrideColumnValue($record, $column->columnName, $definition); }); - $widget->bind('list.overrideHeaderValue', function($host, $column, $value) use ($definition) { + $widget->bindEvent('list.overrideHeaderValue', function($host, $column, $value) use ($definition) { return $this->controller->listOverrideHeaderValue($column->columnName, $definition); }); @@ -162,7 +162,7 @@ class ListController extends ControllerBehavior * Link the Search Widget to the List Widget */ if ($searchWidget = $toolbarWidget->getSearchWidget()) { - $searchWidget->bind('search.submit', function() use ($widget, $searchWidget) { + $searchWidget->bindEvent('search.submit', function() use ($widget, $searchWidget) { $widget->setSearchTerm($searchWidget->getActiveTerm()); return $widget->onRender(); }); diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 4f441618e..e36e2c8ad 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -498,7 +498,7 @@ class RelationController extends ControllerBehavior $config->showCheckboxes = true; $widget = $this->makeWidget('Backend\Widgets\Lists', $config); - $widget->bind('list.extendQueryBefore', function($host, $query) { + $widget->bindEvent('list.extendQueryBefore', function($host, $query) { $this->relationObject->setQuery($query); $this->relationObject->addConstraints(); }); @@ -572,7 +572,7 @@ class RelationController extends ControllerBehavior * Exclude exisiting relationships */ if ($this->manageMode == 'pivot' || $this->manageMode == 'list') { - $widget->bind('list.extendQueryBefore', function($host, $query) { + $widget->bindEvent('list.extendQueryBefore', function($host, $query) { /* * Where not in the current list of related records diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index 43c6ea7b1..ec6848472 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -218,7 +218,7 @@ class Form extends WidgetBase * Extensibility */ Event::fire('backend.form.extendFieldsBefore', [$this]); - $this->trigger('form.extendFieldsBefore', $this); + $this->fireEvent('form.extendFieldsBefore', $this); /* * Outside fields @@ -248,7 +248,7 @@ class Form extends WidgetBase * Extensibility */ Event::fire('backend.form.extendFields', [$this]); - $this->trigger('form.extendFields', $this); + $this->fireEvent('form.extendFields', $this); /* * Convert automatic spanned fields diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index dd5bd0592..67e4f9974 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -259,7 +259,7 @@ class Lists extends WidgetBase * Extensibility */ Event::fire('backend.list.extendQueryBefore', [$this, $query]); - $this->trigger('list.extendQueryBefore', $this, $query); + $this->fireEvent('list.extendQueryBefore', [$this, $query]); /* * Related custom selects, must come first @@ -331,7 +331,7 @@ class Lists extends WidgetBase * Extensibility */ Event::fire('backend.list.extendQuery', [$this, $query]); - $this->trigger('list.extendQuery', $this, $query); + $this->fireEvent('list.extendQuery', [$this, $query]); // Grouping due to the joinWith() call $query->select($selects); @@ -517,8 +517,8 @@ class Lists extends WidgetBase if ($response = Event::fire('backend.list.overrideHeaderValue', [$this, $column, $value], true)) $value = $response; - if (($response = $this->trigger('list.overrideHeaderValue', $this, $column, $value)) && is_array($response)) - $value = array_pop($response); + if ($response = $this->fireEvent('list.overrideHeaderValue', [$this, $column, $value], true)) + $value = $response; return $value; } @@ -539,8 +539,8 @@ class Lists extends WidgetBase if ($response = Event::fire('backend.list.overrideColumnValue', [$this, $record, $column, $value], true)) $value = $response; - if (($response = $this->trigger('list.overrideColumnValue', $this, $record, $column, $value)) && is_array($response)) - $value = array_pop($response); + if ($response = $this->fireEvent('list.overrideColumnValue', [$this, $record, $column, $value], true)) + $value = $response; return $value; } @@ -560,8 +560,8 @@ class Lists extends WidgetBase if ($response = Event::fire('backend.list.injectRowClass', [$this, $record], true)) $value = $response; - if (($response = $this->trigger('list.injectRowClass', $this, $record)) && is_array($response)) - $value = array_pop($response); + if ($response = $this->fireEvent('list.injectRowClass', [$this, $record], true)) + $value = $response; return $value; } diff --git a/modules/backend/widgets/Search.php b/modules/backend/widgets/Search.php index 8832fb805..1cf2dca6e 100644 --- a/modules/backend/widgets/Search.php +++ b/modules/backend/widgets/Search.php @@ -90,7 +90,7 @@ class Search extends WidgetBase * Trigger class event, merge results as viewable array */ $params = func_get_args(); - $result = $this->trigger('search.submit', $params); + $result = $this->fireEvent('search.submit', [$params]); return Util::arrayMerge($result); } diff --git a/modules/system/behaviors/SettingsModel.php b/modules/system/behaviors/SettingsModel.php index 88a8ebd89..70e958928 100644 --- a/modules/system/behaviors/SettingsModel.php +++ b/modules/system/behaviors/SettingsModel.php @@ -52,9 +52,9 @@ class SettingsModel extends ModelBehavior /* * Access to model's overrides is unavailable, using events instead */ - $this->model->bind('model.afterFetch', [$this, 'afterModelFetch']); - $this->model->bind('model.beforeSave', [$this, 'beforeModelSave']); - $this->model->bind('model.afterSetAttribute', [$this, 'setModelAttribute']); + $this->model->bindEvent('model.afterFetch', [$this, 'afterModelFetch']); + $this->model->bindEvent('model.beforeSave', [$this, 'beforeModelSave']); + $this->model->bindEvent('model.afterSetAttribute', [$this, 'setModelAttribute']); /* * Parse the config