Skip to content

Commit b3735eb

Browse files
committed
Generalize the form title to be content aware, #6545
1 parent 476b8e8 commit b3735eb

15 files changed

+16
-21
lines changed

interface/lib/classes/tform_actions.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ function onShowEdit() {
580580

581581
$this->dataRecord = $record;
582582

583+
if(isset($app->tform->formDef['record_name_field'])) {
584+
$app->tform->formDef['title'] = $app->lng($app->tform->formDef['title']) . ' ' . $this->dataRecord[$app->tform->formDef['record_name_field']];
585+
}
586+
583587
// Userdaten umwandeln
584588
$record = $app->tform->getHTML($record, $this->active_tab, 'EDIT');
585589
$record['id'] = $this->id;

interface/web/client/form/client.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
$form["title"] = "Client";
4242
$form["description"] = "";
4343
$form["name"] = "client";
44+
$form["record_name_field"] = "username";
4445
$form["action"] = "client_edit.php";
4546
$form["db_table"] = "client";
4647
$form["db_table_idx"] = "client_id";

interface/web/client/form/domain.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
$form["title"] = "Domain";
6464
$form["description"] = "";
6565
$form["name"] = "domain";
66+
$form["record_name_field"] = "domain";
6667
$form["action"] = "domain_edit.php";
6768
$form["db_table"] = "domain";
6869
$form["db_table_idx"] = "domain_id";

interface/web/client/form/reseller.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
$form["title"] = "Reseller";
4242
$form["description"] = "";
4343
$form["name"] = "reseller";
44+
$form["record_name_field"] = "username";
4445
$form["action"] = "reseller_edit.php";
4546
$form["db_table"] = "client";
4647
$form["db_table_idx"] = "client_id";

interface/web/dns/dns_soa_edit.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ function onShowNew() {
7979
parent::onShowNew();
8080
}
8181

82-
function onShowEdit() {
83-
global $app, $conf;
84-
85-
parent::onShowEdit();
86-
87-
if(isset($this->dataRecord)) {
88-
$app->tform->formDef['title'] = $app->lng('DNS Zone') . ' ' . $this->dataRecord['origin'];
89-
}
90-
}
91-
9282
function onShowEnd() {
9383
global $app, $conf;
9484

interface/web/dns/form/dns_soa.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
$form["title"] = "DNS Zone";
4343
$form["description"] = "";
4444
$form["name"] = "dns_soa";
45+
$form["record_name_field"] = "origin";
4546
$form["action"] = "dns_soa_edit.php";
4647
$form["db_table"] = "dns_soa";
4748
$form["db_table_idx"] = "id";

interface/web/mail/form/mail_domain.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
$form["title"] = "Mail Domain";
4242
$form["description"] = "";
4343
$form["name"] = "mail_domain";
44+
$form["record_name_field"] = "domain";
4445
$form["action"] = "mail_domain_edit.php";
4546
$form["db_table"] = "mail_domain";
4647
$form["db_table_idx"] = "domain_id";

interface/web/mail/form/mail_user.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
$form["title"] = "Mailbox";
5252
$form["description"] = "";
5353
$form["name"] = "mail_user";
54+
$form["record_name_field"] = "email";
5455
$form["action"] = "mail_user_edit.php";
5556
$form["db_table"] = "mail_user";
5657
$form["db_table_idx"] = "mailuser_id";

interface/web/mail/mail_user_edit.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ function onShowNew() {
6767
parent::onShowNew();
6868
}
6969

70-
function onShowEdit() {
71-
global $app, $conf;
72-
73-
parent::onShowEdit();
74-
75-
if(isset($this->dataRecord)) {
76-
$app->tform->formDef['title'] = $app->lng('Mailbox') . ' ' . $this->dataRecord['email'];
77-
}
78-
}
79-
80-
8170
function onShowEnd() {
8271
global $app, $conf;
8372

interface/web/sites/form/database.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
$form["title"] = "Database";
4242
$form["description"] = "";
4343
$form["name"] = "database";
44+
$form["record_name_field"] = "database_name";
4445
$form["action"] = "database_edit.php";
4546
$form["db_table"] = "web_database";
4647
$form["db_table_idx"] = "database_id";

0 commit comments

Comments
 (0)