';
if (! $print_mode) {
$this_params = $GLOBALS['url_params'];
$this_params['index'] = $index->getName();
$r .= '| '
. ' ' . Util::getIcon('b_edit', __('Edit')) . ''
. ' | ' . "\n";
$this_params = $GLOBALS['url_params'];
if ($index->getName() == 'PRIMARY') {
$this_params['sql_query'] = 'ALTER TABLE '
. Util::backquote($table)
. ' DROP PRIMARY KEY;';
$this_params['message_to_show']
= __('The primary key has been dropped.');
$js_msg = Sanitize::jsFormat($this_params['sql_query'], false);
} else {
$this_params['sql_query'] = 'ALTER TABLE '
. Util::backquote($table) . ' DROP INDEX '
. Util::backquote($index->getName()) . ';';
$this_params['message_to_show'] = sprintf(
__('Index %s has been dropped.'), htmlspecialchars($index->getName())
);
$js_msg = Sanitize::jsFormat($this_params['sql_query'], false);
}
$r .= '';
$r .= '';
$r .= Util::linkOrButton(
'sql.php' . Url::getCommon($this_params),
Util::getIcon('b_drop', __('Drop')),
array('class' => 'drop_primary_key_index_anchor ajax')
);
$r .= ' | ' . "\n";
}
if (! $print_mode) {
$r .= ''
. htmlspecialchars($index->getName())
. ' | ';
} else {
$r .= ''
. htmlspecialchars($index->getName())
. ' | ';
}
$r .= '';
$type = $index->getType();
if (! empty($type)) {
$r .= htmlspecialchars($type);
} else {
$r .= htmlspecialchars($index->getChoice());
}
$r .= ' | ';
$r .= '' . $index->isUnique(true) . ' | ';
$r .= '' . $index->isPacked() . ' | ';
foreach ($index->getColumns() as $column) {
if ($column->getSeqInIndex() > 1) {
$r .= '
';
}
$r .= '| ' . htmlspecialchars($column->getName());
if ($column->getSubPart()) {
$r .= ' (' . htmlspecialchars($column->getSubPart()) . ')';
}
$r .= ' | ';
$r .= ''
. htmlspecialchars($column->getCardinality())
. ' | ';
$r .= ''
. htmlspecialchars($column->getCollation())
. ' | ';
$r .= ''
. htmlspecialchars($column->getNull(true))
. ' | ';
if ($column->getSeqInIndex() == 1
) {
$r .= ''
. htmlspecialchars($index->getComments()) . ' | ';
}
$r .= '
';
} // end foreach $index['Sequences']
$r .= '