Replication support - tomas_zahra branch merged

This commit is contained in:
Tomas Srnka
2009-08-30 14:54:36 +00:00
parent e354f4ea98
commit feb562e77b
11 changed files with 1210 additions and 156 deletions

View File

@@ -14,6 +14,7 @@ require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'functions.js';
require './libraries/server_common.inc.php';
require './libraries/replication.inc.php';
/**
* avoids 'undefined index' errors
@@ -34,7 +35,7 @@ if (isset($_REQUEST['sort_order'])
$dbstats = empty($_REQUEST['dbstats']) ? 0 : 1;
$pos = empty($_REQUEST['pos']) ? 0 : (int) $_REQUEST['pos'];
/**
* Drops multiple databases
*/
@@ -187,6 +188,17 @@ if ($databases_count > 0) {
.' </a></th>' . "\n";
}
}
foreach ($replication_types as $type)
{
if ($type=="master")
$name = "strReplicationMaster";
elseif($type == "slave")
$name = "strReplicationSlave";
if (${"server_{$type}_status"})
echo ' <th>'.$GLOBALS[$name].'</th>' . "\n";
}
if ($is_superuser) {
echo ' <th>' . ($cfg['PropertiesIconic'] ? '' : $strAction) . "\n"
. ' </th>' . "\n";
@@ -247,7 +259,25 @@ if ($databases_count > 0) {
}
}
}
foreach ($replication_types as $type) {
if (${"server_{$type}_status"}) {
echo '<td class="tool" style="text-align: center;">' . "\n";
if (strlen(array_search($current["SCHEMA_NAME"], ${"server_{$type}_Ignore_DB"}))>0) {
echo '<img class="icon" src="' . $pmaThemeImage . 's_cancel.png" width="16" height="16" alt="REPLICATED" />' . "\n";
} else {
$key = array_search($current["SCHEMA_NAME"], ${"server_{$type}_Do_DB"});
if (strlen($key)>0 || (${"server_{$type}_Do_DB"}[0]=="" && count(${"server_{$type}_Do_DB"})==1)) // if ($key != null) did not work for index "0"
echo '<img class="icon" src="' . $pmaThemeImage . 's_success.png" width="16" height="16" alt="REPLICATED" />' . "\n";
else
echo '';
}
echo '</td>';
}
}
if ($is_superuser) {
echo ' <td class="tool">' . "\n"
. ' <a onclick="'
@@ -294,6 +324,13 @@ if ($databases_count > 0) {
}
}
}
foreach ($replication_types as $type)
{
if (${"server_{$type}_status"})
echo ' <th></th>' . "\n";
}
if ($is_superuser) {
echo ' <th></th>' . "\n";
}