Skip to content

Commit

Permalink
View ExternalIdentitySourceRecord render in Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Aug 29, 2024
1 parent be76a40 commit d7ad224
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
14 changes: 13 additions & 1 deletion app/src/Model/Table/ExtIdentitySourceRecordsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,19 @@ class ExtIdentitySourceRecordsTable extends Table {
use \App\Lib\Traits\SearchFilterTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\ValidationTrait;


/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(string $action = ''): string {
return match($action) {
default => 'iframe'
};
}

/**
* Perform Cake Model initialization.
*
Expand Down
4 changes: 4 additions & 0 deletions app/templates/ExternalIdentities/fields-nav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ $topLinks = [
[
'icon' => 'visibility',
'order' => 'Default',
'class' => 'cm-modal-link nospin', // launch this in a modal
'dataAttrs' => [
['data-cm-modal-title',__d('controller', 'ExtIdentitySourceRecords', 1)]
],
'label' => __d('operation', 'view.a', [__d('controller', 'ExtIdentitySourceRecords', 1)]),
'link' => [
'controller' => 'ext_identity_source_records',
Expand Down
4 changes: 4 additions & 0 deletions app/templates/ExternalIdentitySources/retrieve.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
$action_args['vv_actions'][] = [
'order' => 3,
'icon' => 'visibility',
'class' => 'cm-modal-link nospin', // launch this in a modal
'dataAttrs' => [
['data-cm-modal-title',__d('controller', 'ExtIdentitySourceRecords', 1)]
],
'url' => [
'controller' => 'ext-identity-source-records',
'action' => 'view',
Expand Down
15 changes: 7 additions & 8 deletions app/templates/Standard/add-edit-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,13 @@
}

if($perm) {
$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder($t['order']),
'icon' => $this->Menu->getMenuIcon($t['icon']),
'url' => $t['link'],
'label' => $t['label'],
'class' => !empty($t['class']) ? $t['class'] : '',
'confirm' => !empty($t['confirm']) ? $t['confirm'] : []
];
$action_args['vv_actions'][] = $t;
$key = array_key_last($action_args['vv_actions']);
$action_args['vv_actions'][$key]['order'] = $this->Menu->getMenuOrder($t['order']);
$action_args['vv_actions'][$key]['icon'] = $this->Menu->getMenuIcon($t['icon']);
$action_args['vv_actions'][$key]['url'] = $t['link'] ?? '';
$action_args['vv_actions'][$key]['class'] = $t['class'] ?? '';
$action_args['vv_actions'][$key]['confirm'] = $t['confirm'] ?? '';
}
}

Expand Down

0 comments on commit d7ad224

Please sign in to comment.