Skip to content

Commit

Permalink
Urls, Types, Servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 26, 2024
1 parent dd5d806 commit bd13c2c
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 29 deletions.
14 changes: 12 additions & 2 deletions app/src/Controller/ApiUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ public function generate(string $id) {
'api.key',
$this->request->getParam('action'));
$this->set('vv_title', $title);

$this->render('/Standard/add-edit-view');

// Let the view render
if(in_array($this->name, [
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls'
])
) {
$this->render('/Standard/add-edit-view-new');
} else {
// Let the view render
$this->render('/Standard/add-edit-view');
}
}
}
9 changes: 6 additions & 3 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public function add() {

// Let the view render
if(in_array($this->name, [
'Cous', 'ApiUsers'
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -429,7 +430,8 @@ public function edit(string $id) {
$this->set('vv_subtitle', $subtitle);

if(in_array($this->name, [
'Cous'
'Cous', 'CoSettings', 'ApiUsers', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -884,7 +886,8 @@ public function view($id = null) {

// Let the view render
if(in_array($this->name, [
'Cous', 'ApiUsers'
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down
13 changes: 9 additions & 4 deletions app/templates/Servers/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
<?php
// This view does not support read-only
if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->control('description');
foreach (['description',
'status',
'plugin'
] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field
]]);
}

print $this->Field->control('status');

print $this->Field->control('plugin');
}
32 changes: 18 additions & 14 deletions app/templates/Types/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,23 @@
<?php
// This view does not support read-only
if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->control(
fieldName: 'attribute',
options: [
'onChange' => 'updateGadgets()',
'readonly' => $vv_action == 'edit'
]
);

print $this->Field->control('display_name');

print $this->Field->control('value');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'attribute',
'options' => [
'onChange' => 'updateGadgets()',
'readonly' => $vv_action == 'edit'
]
]]);

print $this->Field->control('status');

print $this->Field->control('edupersonaffiliation');
foreach (['display_name',
'value',
'status',
'edupersonaffiliation'
] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field
]]);
}
}
31 changes: 26 additions & 5 deletions app/templates/Urls/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,34 @@
*/

if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
print $this->Field->control('url');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'url'
]]);

print $this->Field->control('type_id', ['default' => $vv_default_type]);
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'type_id',
'options' => [
'default' => $vv_default_type
]
]]);

print $this->Field->control('description');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'description'
]]);

print $this->Field->control('frozen');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'frozen'
]]);
}

print $this->Field->sourceControl($vv_obj);
if($vv_action == 'edit' || $vv_action == 'view') {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'source',
'entity' => $vv_obj
]]);
}
2 changes: 2 additions & 0 deletions app/templates/element/form/fieldDiv.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
print $this->element('form/infoDiv/status');
} elseif(isset($vv_field_arguments['groupedControls'])) {
print $this->element('form/infoDiv/grouped');
} elseif(isset($vv_field_arguments['entity'])) {
print $this->element('form/infoDiv/source');
} else {
print $this->element('form/infoDiv/default');
}
Expand Down
1 change: 0 additions & 1 deletion app/templates/element/form/infoDiv/source.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@
<div>
<?= $this->Fieeld->sourceLink($entity) ?>
</div>

0 comments on commit bd13c2c

Please sign in to comment.