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.
This commit is contained in:
Luke Towers 2017-01-06 17:45:58 -06:00 committed by GitHub
parent 38b6c51381
commit 102831ecc2
1 changed files with 6 additions and 3 deletions

View File

@ -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;
}
}