Merge pull request #14483 from laps15/inheritance

Refactor table secondary tabs tamplate
This commit is contained in:
Maurício Meneghini Fauth 2018-07-13 20:09:33 -03:00 committed by GitHub
commit 1079140280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 29 deletions

View File

@ -163,21 +163,6 @@ class TableRelationController extends TableController
);
}
// display secondary level tabs if necessary
$engine = $this->dbi->getTable($this->db, $this->table)->getStorageEngine();
$this->response->addHTML(
$this->template->render('table/secondary_tabs', [
'url_params' => [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
],
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => $this->relation->getRelationsParam(),
])
);
$this->response->addHTML('<div id="structure_content">');
/**
* Dialog
*/
@ -202,8 +187,15 @@ class TableRelationController extends TableController
}
// common form
$engine = $this->dbi->getTable($this->db, $this->table)->getStorageEngine();
$this->response->addHTML(
$this->template->render('table/relation/common_form', [
'url_params' => [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
],
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => $this->relation->getRelationsParam(),
'db' => $this->db,
'table' => $this->table,
'cfg_relation' => $this->cfgRelation,

View File

@ -288,20 +288,6 @@ class TableStructureController extends TableController
}
}
// display secondary level tabs if necessary
$engine = $this->table_obj->getStorageEngine();
$this->response->addHTML(
$this->template->render('table/secondary_tabs', [
'url_params' => [
'db' => $this->db,
'table' => $this->table,
],
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => $this->relation->getRelationsParam(),
])
);
$this->response->addHTML('<div id="structure_content">');
/**
* Modifications have been submitted -> updates the table
*/
@ -1368,7 +1354,14 @@ class TableStructureController extends TableController
}
}
$engine = $this->table_obj->getStorageEngine();
return $this->template->render('table/structure/display_structure', [
'url_params' => [
'db' => $this->db,
'table' => $this->table,
],
'is_foreign_key_supported' => Util::isForeignKeySupported($engine),
'cfg_relation' => $this->relation->getRelationsParam(),
'hide_structure_actions' => $hideStructureActions,
'db' => $this->db,
'table' => $this->table,

View File

@ -15,3 +15,7 @@
</ul>
<div class="clearfloat"></div>
{% endif %}
<div id="structure_content">
{% block content %}
{% endblock %}

View File

@ -1,3 +1,6 @@
{% extends 'table/page_with_secondary_tabs.twig' %}
{% block content %}
<form method="post" action="tbl_relation.php">
{{ Url_getHiddenInputs(db, table) }}
{# InnoDB #}
@ -189,3 +192,4 @@
<input type="submit" value="{% trans 'Save' %}" />
</fieldset>
</form>
{% endblock %}

View File

@ -1,3 +1,5 @@
{% extends 'table/page_with_secondary_tabs.twig' %}
{% block content %}
<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm"
class="ajax{{ hide_structure_actions ? ' HideStructureActions' }}">
{{ Url_getHiddenInputs(db, table) }}
@ -501,3 +503,4 @@
{{ table_stats|raw }}
{% endif %}
<div class="clearfloat"></div>
{% endblock %}

View File

@ -1,3 +1,5 @@
{% extends 'table/page_with_secondary_tabs.twig' %}
{% block content %}
<div id="tablestatistics">
<fieldset>
<legend>{% trans 'Information' %}</legend>
@ -166,3 +168,4 @@
</table>
</fieldset>
</div>
{% endblock %}