Session key fix to relation manager
My Settings context now uses correct breadcrumb
This commit is contained in:
parent
582ef4fd72
commit
1221faae62
|
|
@ -285,6 +285,17 @@ class RelationController extends ControllerBehavior
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes the relation container only, useful for returning in custom AJAX requests.
|
||||
* @param string $field Relation definition.
|
||||
* @return array The relation element selector as the key, and the relation view contents are the value.
|
||||
*/
|
||||
public function relationRefresh($field)
|
||||
{
|
||||
$field = $this->validateField($field);
|
||||
return ['#'.$this->relationGetId('view') => $this->relationRenderView()];
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the toolbar only.
|
||||
* @param string $field The relationship field.
|
||||
|
|
@ -567,7 +578,7 @@ class RelationController extends ControllerBehavior
|
|||
$config = $this->makeConfig($this->config->list);
|
||||
$config->model = $this->relationModel;
|
||||
$config->alias = $this->alias . 'ViewList';
|
||||
$config->recordOnClick = sprintf("$.oc.relationBehavior.clickManageListRecord('%s', :id)", $this->field);
|
||||
$config->recordOnClick = sprintf("$.oc.relationBehavior.clickManageListRecord(:id, '%s', '%s')", $this->field, $this->relationGetSessionKey());
|
||||
$config->showCheckboxes = true;
|
||||
|
||||
if ($emptyMessage = $this->getConfig('emptyMessage'))
|
||||
|
|
@ -611,7 +622,7 @@ class RelationController extends ControllerBehavior
|
|||
$config->model = $this->relationModel;
|
||||
$config->alias = $this->alias . 'ManagePivotList';
|
||||
$config->showSetup = false;
|
||||
$config->recordOnClick = sprintf("$.oc.relationBehavior.clickManagePivotListRecord('%s', :id)", $this->field);
|
||||
$config->recordOnClick = sprintf("$.oc.relationBehavior.clickManagePivotListRecord(:id, '%s', '%s')", $this->field, $this->relationGetSessionKey());
|
||||
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -5,19 +5,20 @@
|
|||
|
||||
var RelationBehavior = function() {
|
||||
|
||||
this.clickManageListRecord = function(relationField, recordId) {
|
||||
this.clickManageListRecord = function(recordId, relationField, sessionKey) {
|
||||
var newPopup = $('<a />')
|
||||
|
||||
newPopup.popup({
|
||||
handler: 'onRelationManageForm',
|
||||
extraData: {
|
||||
'manage_id': recordId,
|
||||
'_relation_field': relationField,
|
||||
'manage_id': recordId
|
||||
'_session_key': sessionKey
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.clickManagePivotListRecord = function(relationField, foreignId) {
|
||||
this.clickManagePivotListRecord = function(foreignId, relationField, sessionKey) {
|
||||
var oldPopup = $('#relationManagePivotPopup'),
|
||||
newPopup = $('<a />')
|
||||
|
||||
|
|
@ -26,8 +27,9 @@
|
|||
newPopup.popup({
|
||||
handler: 'onRelationManagePivotForm',
|
||||
extraData: {
|
||||
'foreign_id': foreignId,
|
||||
'_relation_field': relationField,
|
||||
'foreign_id': foreignId
|
||||
'_session_key': sessionKey
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,9 +171,6 @@ return [
|
|||
'tooltips' => [
|
||||
'preview_website' => 'Preview the website'
|
||||
],
|
||||
'settings' => [
|
||||
'menu_label' => 'Settings',
|
||||
],
|
||||
'mysettings' => [
|
||||
'menu_label' => 'My Settings',
|
||||
'menu_description' => 'Settings relate to your administration account',
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class Settings extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
$this->pageTitle = Lang::get('backend::lang.settings.menu_label');
|
||||
$this->pageTitle = Lang::get('system::lang.settings.menu_label');
|
||||
$this->vars['items'] = SettingsManager::instance()->listItems('system');
|
||||
$this->bodyClass = 'compact-container';
|
||||
}
|
||||
|
|
@ -61,6 +61,15 @@ class Settings extends Controller
|
|||
$item = $this->findSettingItem($author, $plugin, $code);
|
||||
$this->pageTitle = $item->label;
|
||||
|
||||
if ($item->context == 'mysettings') {
|
||||
$this->vars['parentLink'] = Backend::url('system/settings/mysettings');
|
||||
$this->vars['parentLabel'] = Lang::get('backend::lang.mysettings.menu_label');
|
||||
}
|
||||
else {
|
||||
$this->vars['parentLink'] = Backend::url('system/settings');
|
||||
$this->vars['parentLabel'] = Lang::get('system::lang.settings.menu_label');
|
||||
}
|
||||
|
||||
$model = $this->createModel($item);
|
||||
$this->initWidgets($model);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('system/settings') ?>"><?= e(trans('system::lang.settings.menu_label')) ?></a></li>
|
||||
<li><a href="<?= $parentLink ?>"><?= e($parentLabel) ?></a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
|
@ -33,5 +33,5 @@
|
|||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<p><a href="<?= Backend::url('system/settings') ?>" class="btn btn-default"><?= e(trans('system::lang.settings.return')) ?></a></p>
|
||||
<p><a href="<?= $parentLink ?>" class="btn btn-default"><?= e(trans('system::lang.settings.return')) ?></a></p>
|
||||
<?php endif ?>
|
||||
Loading…
Reference in New Issue