From 102831ecc2c8e9be0e7c98f1d2713a8eb665ff5b Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 6 Jan 2017 17:45:58 -0600 Subject: [PATCH] Improve RelationController evalManageTitle() Improves the evalManageTitle() method of the RelationController by making it possible to detect being the create manage form, which will enable us to utilize the results of the evalManageTitle in the manage_form partial. --- modules/backend/behaviors/RelationController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 9ad0d0dc6..27591bb79 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -326,14 +326,14 @@ class RelationController extends ControllerBehavior $this->relationObject = $this->model->{$field}(); $this->relationModel = $this->relationObject->getRelated(); + $this->manageId = post('manage_id'); + $this->foreignId = post('foreign_id'); $this->readOnly = $this->getConfig('readOnly'); $this->deferredBinding = $this->getConfig('deferredBinding') || !$this->model->exists; $this->toolbarButtons = $this->evalToolbarButtons(); $this->viewMode = $this->evalViewMode(); $this->manageMode = $this->evalManageMode(); $this->manageTitle = $this->evalManageTitle(); - $this->manageId = post('manage_id'); - $this->foreignId = post('foreign_id'); /* * Toolbar widget @@ -1435,9 +1435,12 @@ class RelationController extends ControllerBehavior if ($this->readOnly) { return 'backend::lang.relation.preview_name'; } - else { + elseif ($this->manageId) { return 'backend::lang.relation.update_name'; } + else { + return 'backend::lang.relation.create_name'; + } break; } }