diff --git a/admin/xmldb/actions/edit_table/edit_table.class.php b/admin/xmldb/actions/edit_table/edit_table.class.php
index a3b48cbdcaa..7de3de9c73f 100644
--- a/admin/xmldb/actions/edit_table/edit_table.class.php
+++ b/admin/xmldb/actions/edit_table/edit_table.class.php
@@ -1,31 +1,37 @@
-.
-/// This class will provide the interface for all the edit table actions
+/**
+ * @package xmldb-editor
+ * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+/**
+ * This class provides the interface for all the edit table actions
+ *
+ * Main page of edit table actions, from here fields/indexes/keys edition
+ * can be invoked, plus links to PHP code generator, view SQL, rearrange
+ * elements and so on.
+ *
+ * @package xmldb-editor
+ * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
class edit_table extends XMLDBAction {
/**
@@ -54,7 +60,8 @@ class edit_table extends XMLDBAction {
'down' => 'xmldb',
'delete' => 'xmldb',
'reserved' => 'xmldb',
- 'back' => 'xmldb'
+ 'back' => 'xmldb',
+ 'viewxml' => 'xmldb'
));
}
@@ -165,6 +172,12 @@ class edit_table extends XMLDBAction {
$o .= '
';
$row = 0;
foreach ($fields as $field) {
+ /// The field name (link to edit - if the field has no uses)
+ if (!$structure->getFieldUses($table->getName(), $field->getName())) {
+ $f = '' . $field->getName() . '';
+ } else {
+ $f = $field->getName();
+ }
/// Calculate buttons
$b = '| ';
/// The edit button (if the field has no uses)
@@ -195,6 +208,9 @@ class edit_table extends XMLDBAction {
} else {
$b .= '[' . $this->str['delete'] . ']';
}
+ $b .= ' | ';
+ /// The view xml button
+ $b .= '[' . $this->str['viewxml'] . ']';
/// Detect if the table name is a reserved word
if (array_key_exists($field->getName(), $reserved_words)) {
$b .= ' ' . $this->str['reserved'] . '';
@@ -202,7 +218,7 @@ class edit_table extends XMLDBAction {
/// The readable info
$r = ' | ' . $field->readableInfo() . ' | ';
/// Print table row
- $o .= '| ' . $field->getName() . '' . $b . $r . ' |
';
+ $o .= '| ' . $f . $b . $r . ' |
';
$row = ($row + 1) % 2;
}
$o .= '
';
@@ -214,13 +230,19 @@ class edit_table extends XMLDBAction {
$o .= '';
$row = 0;
foreach ($keys as $key) {
+ /// The key name (link to edit - if the key has no uses)
+ if (!$structure->getKeyUses($table->getName(), $key->getName())) {
+ $k = '' . $key->getName() . '';
+ } else {
+ $k = $key->getName();
+ }
/// Calculate buttons
$b = '| ';
/// The edit button (if the key hasn't uses)
if (!$structure->getKeyUses($table->getName(), $key->getName())) {
$b .= '[' . $this->str['edit'] . ']';
} else {
- $b .= '[' . $this->str['edit'] . ']';
+ $b .= '[' . $this->str['edit'] . ']';
}
$b .= ' | ';
/// The up button
@@ -243,10 +265,13 @@ class edit_table extends XMLDBAction {
} else {
$b .= '[' . $this->str['delete'] . ']';
}
+ $b .= ' | ';
+ /// The view xml button
+ $b .= '[' . $this->str['viewxml'] . ']';
/// The readable info
$r = ' | ' . $key->readableInfo() . ' | ';
/// Print table row
- $o .= '| ' . $key->getName() . '' . $b . $r .' |
';
+ $o .= '| ' . $k . $b . $r .' |
';
$row = ($row + 1) % 2;
}
$o .= '
';
@@ -258,10 +283,12 @@ class edit_table extends XMLDBAction {
$o .= '';