Skip to content
Permalink
Browse files

Refactor table secondary tabs tamplate

Implements inheritance on relation and structure templates

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
  • Loading branch information...
laps15 committed Jul 13, 2018
1 parent c2c5bfc commit 6b08a7c326c92fd1844ba2ee025755d1806ec580
@@ -163,21 +163,6 @@ public function indexAction()
);
}
// 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 @@ public function indexAction()
}
// 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,
@@ -288,20 +288,6 @@ public function indexAction()
}
}
// 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 @@ function ($key, $val) {
}
}
$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,
@@ -15,3 +15,7 @@
</ul>
<div class="clearfloat"></div>
{% endif %}

<div id="structure_content">
{% block content %}
{% endblock %}
@@ -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 %}
@@ -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 %}
@@ -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 %}

0 comments on commit 6b08a7c

Please sign in to comment.
You can’t perform that action at this time.