Dieser Commit ist enthalten in:
Ursprung
2b21070b1a
Commit
f7a7c71f86
1583 geänderte Dateien mit 454759 neuen und 0 gelöschten Zeilen
89
application/views/scripts/sql/databases/create-database.phtml
Normale Datei
89
application/views/scripts/sql/databases/create-database.phtml
Normale Datei
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
$formUrl = $this->url(array('controller'=>'sql','action'=>'create.database'));
|
||||
?>
|
||||
<div id="content">
|
||||
<h2><?php echo $this->lang->L_CREATE_DATABASE;?></h2>
|
||||
<?php echo $this->sqlHeadNavi(); ?>
|
||||
<h4><?php echo $this->lang->L_CREATE_DATABASE;?>:</h4>
|
||||
<form method="post" action="<?php echo $formUrl;?>">
|
||||
<table class="bdr" summary="create new database">
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DB_NAME; ?>:</td>
|
||||
<td><input type="text" class="text" id="dbName" name="newDbInfo[dbName]" value="<?php echo (isset($this->dbCreated) && !$this->dbCreated) ? $this->out($this->newDbInfo['dbName']) : ''; ?>"/></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_DEFAULT_CHARSET;?>:</td>
|
||||
<td><select class="select" id="dbCharset" name="newDbInfo[dbCharset]"><?php foreach ($this->charsets as $charset) { ?>
|
||||
<option value="<?php echo $this->out($charset); ?>"<?php echo ($charset == $this->newDbInfo['dbCharset']) ? ' selected="selected"' : ''; ?>><?php echo $this->out($charset); ?></option>
|
||||
<?php } ?></select></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DEFAULT_COLLATION_NAME;?>:</td>
|
||||
<td><select class="select" id="dbCollation" name="newDbInfo[dbCollation]"><?php foreach ($this->collations[$this->newDbInfo['dbCharset']] as $collation) { ?>
|
||||
<option value="<?php echo $this->out($collation); ?>"<?php echo ($collation == $this->newDbInfo['dbCollation']) ? ' selected="selected"' : ''; ?>><?php echo $this->out($collation); ?></option>
|
||||
<?php } ?></select></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td> </td>
|
||||
<td class="buttonBar">
|
||||
<button type="submit" class="Formbutton"><?php echo $this->getIcon('Database', '', 16); echo $this->lang->L_CREATE_DATABASE; ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php $this->jQuery()->onLoadCaptureStart(); ?>
|
||||
var dbCollations = <?php echo json_encode($this->collations); ?>;
|
||||
var dbDefaultCollations = <?php echo json_encode($this->defaultCollations); ?>;
|
||||
$('#dbCharset').bind('change', function() {
|
||||
var newOpts = '';
|
||||
var curCharset = $(this).val();
|
||||
$(dbCollations[curCharset]).each(function(id, v) {
|
||||
var selected = '';
|
||||
if (v == dbDefaultCollations[curCharset]) {
|
||||
selected = ' selected="selected"';
|
||||
}
|
||||
newOpts += '<option value="' + v +'"' + selected + '>' + v + '</option>';
|
||||
$('#dbCollation').html(newOpts);
|
||||
});
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('#dbName').focus();
|
||||
});
|
||||
<?php
|
||||
$this->jQuery()->onLoadCaptureEnd();
|
||||
|
||||
if (isset($this->dbCreated)) {
|
||||
if ($this->dbCreated) {
|
||||
$this->popUpMessage()->addMessage(
|
||||
'dialogDbCreation',
|
||||
'L_CREATE_DATABASE',
|
||||
array('L_DATABASE_CREATED_SUCCESS', $this->newDbInfo['dbName']),
|
||||
array(
|
||||
'modal' => 'true',
|
||||
'autoOpen' => 'true',
|
||||
'buttons' => array(
|
||||
'L_OK' => 'function(){$(this).dialog("close"); }',
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->popUpMessage()->addMessage(
|
||||
'dialogDbCreation',
|
||||
'L_CREATE_DATABASE',
|
||||
array(
|
||||
'L_DATABASE_CREATED_FAILED',
|
||||
'<span class="error">(' . $this->errorInfo['code'] . ') '
|
||||
. $this->errorInfo['message'] .'</span>'
|
||||
),
|
||||
array(
|
||||
'modal' => 'true',
|
||||
'autoOpen' => 'true',
|
||||
'buttons' => array(
|
||||
'L_OK' => 'function(){$(this).dialog("close"); }',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
44
application/views/scripts/sql/databases/database-header.phtml
Normale Datei
44
application/views/scripts/sql/databases/database-header.phtml
Normale Datei
|
|
@ -0,0 +1,44 @@
|
|||
<tr class="thead">
|
||||
<th> </th>
|
||||
<th>
|
||||
<img src="<?php echo $this->getIconSrc('plus', '');?>"
|
||||
class="pointer tooltip"
|
||||
title="<?php echo $this->lang->L_SELECT_ALL;?>"
|
||||
alt="<?php echo $this->lang->L_SELECT_ALL;?>"
|
||||
onclick="checkAll('.dbCheckbox');checkButtonState();"/>
|
||||
<img src="<?php echo $this->getIconSrc('minus', '');?>"
|
||||
class="pointer tooltip"
|
||||
title="<?php echo $this->lang->L_DESELECT_ALL;?>"
|
||||
alt="<?php echo $this->lang->L_DESELECT_ALL;?>"
|
||||
onclick="unCheckAll('.dbCheckbox');checkButtonState();"/>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th><?php echo $this->lang->L_DB_NAME;?></th>
|
||||
<th>
|
||||
<span class="tooltip explain"
|
||||
title="<?php echo $this->lang->L_MYSQL_TABLES_EXPLAIN;?>">
|
||||
<?php echo $this->lang->L_TABLES;?>
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="tooltip explain"
|
||||
title="<?php echo $this->lang->L_DATASIZE_INFO;?>">
|
||||
<?php echo $this->lang->L_DATASIZE;?>
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="tooltip explain"
|
||||
title="<?php echo $this->lang->L_MYSQL_VIEWS_EXPLAIN;?>">
|
||||
<?php echo $this->lang->L_MYSQL_VIEWS;?>
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="tooltip explain"
|
||||
title="<?php echo $this->lang->L_MYSQL_ROUTINES_EXPLAIN;?>">
|
||||
<?php echo $this->lang->L_MYSQL_ROUTINES;?>
|
||||
</span>
|
||||
</th>
|
||||
<th><?php echo $this->lang->L_DEFAULT_CHARACTER_SET_NAME;?></th>
|
||||
<th><?php echo $this->lang->L_DEFAULT_COLLATION_NAME;?></th>
|
||||
</tr>
|
||||
|
||||
212
application/views/scripts/sql/databases/show-databases.phtml
Normale Datei
212
application/views/scripts/sql/databases/show-databases.phtml
Normale Datei
|
|
@ -0,0 +1,212 @@
|
|||
<?php
|
||||
$systemDatabases = $this->config->get('config.systemDatabases');
|
||||
$formUrl = $this->url(array('controller'=>'sql','action'=>'index'));
|
||||
$cycleHelper = $this->getHelper('cycle')->cycle(array('row-even', 'row-odd'));
|
||||
?>
|
||||
<div id="content">
|
||||
<h2><?php echo $this->lang->L_DATABASES_OF_USER;?> '<?php echo $this->config->get('config.dbuser.user').'\'@\''.$this->config->get('config.dbuser.host');?>'</h2>
|
||||
<?php echo $this->sqlHeadNavi(); ?>
|
||||
<?php
|
||||
if (isset($this->actionResults)) {
|
||||
?>
|
||||
<h4><?php echo $this->lang->L_ACTION . ' - ' . $this->lang->getTranslator()->translate($this->executedAction); ?>:</h4>
|
||||
|
||||
<table class="bdr" summary="Table shows formatted result of action">
|
||||
<tr class="thead nowrap">
|
||||
<td class="right">#</td>
|
||||
<th class="left"><?php echo $this->lang->L_DB; ?></th>
|
||||
<th class="small"><?php echo $this->lang->L_QUERY; ?></th>
|
||||
<th colspan="2" class="left"><?php echo $this->lang->L_SQL_OUTPUT; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$row = 0;
|
||||
foreach ($this->actionResults as $dbName => $dbResults) {
|
||||
foreach ($dbResults as $dbResult) {
|
||||
$row++;
|
||||
if ($dbResult['result']) {
|
||||
?>
|
||||
<tr class="nowrap <?php echo $cycleHelper->next();?>">
|
||||
<td class="small right"><?php echo $row; ?>.</td>
|
||||
<td class="small"><?php echo $dbName; ?></td>
|
||||
<td class="small"><?php echo $dbResult['query']; ?></td>
|
||||
<td class="small right"><?php echo $this->getIcon('Ok', '', 16); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr class="error">
|
||||
<td class="right"><?php echo $row; ?>.</td>
|
||||
<td class="small"><?php echo $dbName; ?></td>
|
||||
<td><?php echo $dbResult['query']; ?></td>
|
||||
<td class="error"><?php echo $dbResult['errorInfo']['code'] . ': ' . $dbResult['errorInfo']['message']; ?></td>
|
||||
<td class="right"><?php echo $this->getIcon('Attention', '', 16); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($this->actionResults) && empty($this->actionResults)) {
|
||||
?>
|
||||
<tr class="nowrap <?php echo $cycleHelper->next();?>">
|
||||
<td colspan="4">
|
||||
<?php echo $this->lang->L_NOTHING_TO_DO; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table><br/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<form method="post" action="<?php echo $formUrl;?>" class="dbForm" id="dbForm">
|
||||
<table class="bdr" summary="Table lists all databases">
|
||||
<tr class="thead">
|
||||
<th colspan="10">
|
||||
<button class="Formbutton" type="button" onclick="window.location.href='<?php echo $this->url(array('controller' => 'sql', 'action' => 'create.database')); ?>';">
|
||||
<?php
|
||||
echo $this->getIcon('Database', '', 16);
|
||||
echo $this->lang->L_CREATE_DATABASE;
|
||||
?>
|
||||
</button>
|
||||
<button id="buttonTruncate" disabled="disabled" class="Formbutton" type="button"
|
||||
onclick="if (!hasCheckedElements('.dbCheckbox')) return false;$('#confirmTruncateDb').dialog('open');">
|
||||
<?php
|
||||
echo $this->getIcon('DeleteTables', '', 16);
|
||||
echo $this->lang->L_SQL_EMPTYDB;
|
||||
?>
|
||||
</button>
|
||||
<button id="buttonDrop" disabled="disabled" class="Formbutton" type="button"
|
||||
onclick="if (!hasCheckedElements('.dbCheckbox')) return false;$('#confirmDropDb').dialog('open');">
|
||||
<?php
|
||||
echo $this->getIcon('DeleteDatabase', '', 16);
|
||||
echo $this->lang->L_DELETE_DATABASE;
|
||||
?>
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
echo $this->partial('sql/databases/database-header.phtml',
|
||||
array('lang' => $this->lang));
|
||||
$i=1;
|
||||
$iconShowTable = $this->getIcon('Tables', '', 16);
|
||||
foreach($this->dbInfos as $dbName => $data):
|
||||
$dbNameEncoded = base64_encode($dbName);
|
||||
$viewUrl = $this->url(array(
|
||||
'controller'=>'sql',
|
||||
'action'=>'show.tables',
|
||||
'database'=> $dbNameEncoded)
|
||||
);
|
||||
?>
|
||||
<tr class="nowrap
|
||||
<?php
|
||||
if ($dbName == $this->config->get('dynamic.dbActual')) {
|
||||
echo 'row-highlight';
|
||||
} else {
|
||||
echo $this->cycle(array('row-even', 'row-odd'))->next();
|
||||
}
|
||||
?>">
|
||||
<td class="small right">
|
||||
<a href="<?php echo $this->url(array('controller' => 'sql', 'action' => 'show.tables', 'dbName' => $dbNameEncoded)); ?>"
|
||||
title="<?php echo $this->lang->L_SHOW_TABLES . ': ' . $dbName;?>" class="tooltip">
|
||||
<?php echo $iconShowTable; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="small right">
|
||||
<?php
|
||||
if (!in_array($dbName, $systemDatabases)) {
|
||||
?>
|
||||
<input id="<?php echo $this->out($dbName);?>" type="checkbox" name="dbNames[]" class="dbCheckbox checkbox" value="<?php echo $dbNameEncoded; ?>"/>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="small right"><?php echo $i;?>.</td>
|
||||
<td class="small">
|
||||
<?php
|
||||
if (!in_array($dbName, $systemDatabases)) {
|
||||
?>
|
||||
<label class="block tooltip" for="<?php echo $this->out($dbName);?>" title="<?php echo $this->lang->L_SELECT . ': ' . $this->out($dbName);?>">
|
||||
<?php echo $dbName;?>
|
||||
</label>
|
||||
<?php } else {
|
||||
echo $dbName;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="small right">
|
||||
<?php echo $this->numberFormat($data['tables']);?>
|
||||
</td>
|
||||
<td class="small right">
|
||||
<?php echo $this->byteOutput($data['size']);?>
|
||||
</td>
|
||||
<td class="small right">
|
||||
<?php echo $this->numberFormat($data['views']);?>
|
||||
</td>
|
||||
<td class="small right">
|
||||
<?php echo $this->numberFormat($data['routines']);?>
|
||||
</td>
|
||||
<td class="small">
|
||||
<?php echo $data['DEFAULT_CHARACTER_SET_NAME'];?>
|
||||
</td>
|
||||
<td class="small">
|
||||
<?php echo $data['DEFAULT_COLLATION_NAME'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$i++;
|
||||
endforeach;
|
||||
echo $this->partial('sql/databases/database-header.phtml',
|
||||
array('lang' => $this->lang));
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$dropDatabaseUrl = $this->url(array('controller' => 'sql', 'action' => 'drop.database'));
|
||||
$this->popUpMessage()->addMessage(
|
||||
'confirmDropDb',
|
||||
'L_DELETE_DATABASE',
|
||||
'L_CONFIRM_DROP_DATABASES',
|
||||
array(
|
||||
'modal' => true,
|
||||
'autoOpen' => false,
|
||||
'buttons' => array(
|
||||
'L_YES' => "function() { changeFormAction('.dbForm', '" . $dropDatabaseUrl . "');$('#dbForm').submit();}",
|
||||
'L_CANCEL' => 'function(){$(this).dialog("close"); return false;}',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$truncateDatabaseUrl = $this->url(array('controller' => 'sql', 'action' => 'truncate.database'));
|
||||
$this->popUpMessage()->addMessage(
|
||||
'confirmTruncateDb',
|
||||
'L_TRUNCATE_DATABASE',
|
||||
'L_CONFIRM_TRUNCATE_DATABASES',
|
||||
array(
|
||||
'modal' => true,
|
||||
'autoOpen' => false,
|
||||
'buttons' => array(
|
||||
'L_YES' => "function() { changeFormAction('.dbForm', '" . $truncateDatabaseUrl . "');$('#dbForm').submit();}",
|
||||
'L_CANCEL' => 'function(){$(this).dialog("close"); return false;}',
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->jQuery()->onLoadCaptureStart();
|
||||
?>
|
||||
$('.dbCheckbox').change(function() {
|
||||
checkButtonState();
|
||||
});
|
||||
<?php
|
||||
$this->jQuery()->onLoadCaptureEnd();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function checkButtonState() {
|
||||
var objs = ['#buttonTruncate', '#buttonDrop'];
|
||||
if ($('.dbCheckbox:checked').size() > 0) {
|
||||
objs_enable(objs);
|
||||
} else {
|
||||
objs_disable(objs);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Laden …
Tabelle hinzufügen
Einen Link hinzufügen
In neuem Issue referenzieren