Merge remote-tracking branch 'upstream/master'
@ -3298,9 +3298,9 @@ RewriteRule .* - [F]
|
||||
<a href="#cfg_ThemeDefault" class="configrule">$cfg['ThemeDefault']</a>.<br />
|
||||
<br />
|
||||
Under <a href="#cfg_ThemePath" class="configrule">$cfg['ThemePath']</a>, you
|
||||
should not delete the directory "original" or its underlying
|
||||
should not delete the directory "pmahomme" or its underlying
|
||||
structure, because this is the system theme used by phpMyAdmin.
|
||||
"original" contains all images and styles, for backwards
|
||||
"pmahomme" contains all images and styles, for backwards
|
||||
compatibility and for all themes that would not include images or css-files.
|
||||
<br /><br />
|
||||
|
||||
@ -3313,7 +3313,7 @@ RewriteRule .* - [F]
|
||||
<ul><li>make a new subdirectory (for example "your_theme_name") under
|
||||
<a href="#cfg_ThemePath" class="configrule">$cfg['ThemePath']</a>
|
||||
(by default <code>themes</code>)</li>
|
||||
<li>copy the files and directories from "original" to
|
||||
<li>copy the files and directories from "pmahomme" to
|
||||
"your_theme_name"</li>
|
||||
<li>edit the css-files in "your_theme_name/css"</li>
|
||||
<li>put your new images in "your_theme_name/img"</li>
|
||||
@ -3333,7 +3333,7 @@ RewriteRule .* - [F]
|
||||
|
||||
<p> If you do not want to use your own symbols and buttons, remove the
|
||||
directory "img" in "your_theme_name". phpMyAdmin will
|
||||
use the default icons and buttons (from the system-theme "original").
|
||||
use the default icons and buttons (from the system-theme "pmahomme").
|
||||
</p>
|
||||
|
||||
<h4 id="faqmissingparameters">
|
||||
@ -4433,7 +4433,7 @@ chmod o+rwx tmp
|
||||
<a href="#faq6_31">6.31 How do I create a relation in designer?</a></h4>
|
||||
|
||||
<p>To select relation, click:<br />
|
||||
<img src="themes/original/img/pmd/help_relation.png" width="100" height="100" alt="[relation icon]" /><br />
|
||||
<img src="themes/pmahomme/img/pmd/help_relation.png" width="100" height="100" alt="[relation icon]" /><br />
|
||||
The display column is shown in pink. To set/unset a column as the display column, click the "Choose column to display" icon, then click on the appropriate column name.</p>
|
||||
|
||||
<h4 id="faq6_32">
|
||||
|
||||
@ -148,22 +148,30 @@ class PMA_Theme
|
||||
*/
|
||||
public function checkImgPath()
|
||||
{
|
||||
// try current theme first
|
||||
if (is_dir($this->getPath() . '/img/')) {
|
||||
$this->setImgPath($this->getPath() . '/img/');
|
||||
return true;
|
||||
} elseif (is_dir($GLOBALS['cfg']['ThemePath'] . '/' . PMA_Theme_Manager::FALLBACK_THEME . '/img/')) {
|
||||
$this->setImgPath($GLOBALS['cfg']['ThemePath'] . '/' . PMA_Theme_Manager::FALLBACK_THEME . '/img/');
|
||||
return true;
|
||||
} else {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
__('No valid image path for theme %s found!'),
|
||||
$this->getName()
|
||||
),
|
||||
E_USER_ERROR
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
// try fallback theme
|
||||
$fallback = $GLOBALS['cfg']['ThemePath'] . '/'
|
||||
. PMA_Theme_Manager::FALLBACK_THEME
|
||||
. '/img/';
|
||||
if (is_dir($fallback)) {
|
||||
$this->setImgPath($fallback);
|
||||
return true;
|
||||
}
|
||||
|
||||
// we failed
|
||||
trigger_error(
|
||||
sprintf(
|
||||
__('No valid image path for theme %s found!'),
|
||||
$this->getName()
|
||||
),
|
||||
E_USER_ERROR
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,14 +309,27 @@ class PMA_Theme
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to images for the theme
|
||||
* Returns the path to image for the theme.
|
||||
* If filename is given, it possibly fallbacks to fallback
|
||||
* theme for it if image does not exist.
|
||||
*
|
||||
* @param string $file file name for image
|
||||
*
|
||||
* @access public
|
||||
* @return string image path for this theme
|
||||
*/
|
||||
public function getImgPath()
|
||||
public function getImgPath($file = null)
|
||||
{
|
||||
return $this->img_path;
|
||||
if (is_null($file)) {
|
||||
return $this->img_path;
|
||||
} else {
|
||||
if (is_readable($this->img_path . $file)) {
|
||||
return $this->img_path . $file;
|
||||
} else {
|
||||
return $GLOBALS['cfg']['ThemePath'] . '/'
|
||||
. PMA_Theme_Manager::FALLBACK_THEME . '/img/' . $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -324,7 +345,7 @@ class PMA_Theme
|
||||
*
|
||||
* @see PMA_SQP_buildCssData()
|
||||
*/
|
||||
public function SQP_buildCssRule($classname, $property, $value)
|
||||
public function buildSQPCssRule($classname, $property, $value)
|
||||
{
|
||||
$str = '.' . $classname . ' {';
|
||||
if ($value != '') {
|
||||
@ -347,17 +368,17 @@ class PMA_Theme
|
||||
*
|
||||
* @see PMA_SQP_buildCssRule()
|
||||
*/
|
||||
public function SQP_buildCssData()
|
||||
public function buildSQPCssData()
|
||||
{
|
||||
global $cfg;
|
||||
|
||||
$css_string = '';
|
||||
foreach ($cfg['SQP']['fmtColor'] AS $key => $col) {
|
||||
$css_string .= $this->SQP_buildCssRule('syntax_' . $key, 'color', $col);
|
||||
$css_string .= $this->buildSQPCssRule('syntax_' . $key, 'color', $col);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 8; $i++) {
|
||||
$css_string .= $this->SQP_buildCssRule(
|
||||
$css_string .= $this->buildSQPCssRule(
|
||||
'syntax_indent' . $i, 'margin-left',
|
||||
($i * $cfg['SQP']['fmtInd']) . $cfg['SQP']['fmtIndUnit']
|
||||
);
|
||||
@ -376,7 +397,7 @@ class PMA_Theme
|
||||
{
|
||||
$success = true;
|
||||
|
||||
echo $this->SQP_buildCssData();
|
||||
echo $this->buildSQPCssData();
|
||||
|
||||
if ($GLOBALS['text_dir'] === 'ltr') {
|
||||
$right = 'right';
|
||||
@ -388,7 +409,8 @@ class PMA_Theme
|
||||
|
||||
foreach ($this->_cssFiles as $file) {
|
||||
$path = $this->getPath() . "/css/$file.css.php";
|
||||
$fallback = "./themes/" . PMA_Theme_Manager::FALLBACK_THEME . "/css/$file.css.php";
|
||||
$fallback = "./themes/"
|
||||
. PMA_Theme_Manager::FALLBACK_THEME . "/css/$file.css.php";
|
||||
|
||||
if (is_readable($path)) {
|
||||
echo "\n/* FILE: $file.css.php */\n";
|
||||
@ -481,21 +503,33 @@ class PMA_Theme
|
||||
{
|
||||
$result = array();
|
||||
// Opera 9.5+, IE 9
|
||||
$result[] = 'background-image: url(./themes/svg_gradient.php?from=' . $start_color . '&to=' . $end_color . ');';
|
||||
$result[] = 'background-image: url(./themes/svg_gradient.php?from='
|
||||
. $start_color . '&to=' . $end_color . ');';
|
||||
$result[] = 'background-size: 100% 100%;';
|
||||
// Safari 4-5, Chrome 1-9
|
||||
$result[] = 'background: -webkit-gradient(linear, left top, left bottom, from(#' . $start_color . '), to(#' . $end_color . '));';
|
||||
$result[] = 'background: '
|
||||
. '-webkit-gradient(linear, left top, left bottom, from(#'
|
||||
. $start_color . '), to(#' . $end_color . '));';
|
||||
// Safari 5.1, Chrome 10+
|
||||
$result[] = 'background: -webkit-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
|
||||
$result[] = 'background: -webkit-linear-gradient(top, #'
|
||||
. $start_color . ', #' . $end_color . ');';
|
||||
// Firefox 3.6+
|
||||
$result[] = 'background: -moz-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
|
||||
$result[] = 'background: -moz-linear-gradient(top, #'
|
||||
. $start_color . ', #' . $end_color . ');';
|
||||
// IE 10
|
||||
$result[] = 'background: -ms-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
|
||||
$result[] = 'background: -ms-linear-gradient(top, #'
|
||||
. $start_color . ', #' . $end_color . ');';
|
||||
// Opera 11.10
|
||||
$result[] = 'background: -o-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
|
||||
$result[] = 'background: -o-linear-gradient(top, #'
|
||||
. $start_color . ', #' . $end_color . ');';
|
||||
// IE 6-8
|
||||
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8) {
|
||||
$result[] = 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#' . $start_color . '", endColorstr="#' . $end_color . '");';
|
||||
if (PMA_USR_BROWSER_AGENT == 'IE'
|
||||
&& PMA_USR_BROWSER_VER >= 6
|
||||
&& PMA_USR_BROWSER_VER <= 8
|
||||
) {
|
||||
$result[] = 'filter: '
|
||||
. 'progid:DXImageTransform.Microsoft.gradient(startColorstr="#'
|
||||
. $start_color . '", endColorstr="#' . $end_color . '");';
|
||||
}
|
||||
return implode("\n", $result);
|
||||
}
|
||||
@ -512,37 +546,48 @@ class PMA_Theme
|
||||
}
|
||||
|
||||
$result[] = 'span.cm-keyword, span.cm-statement-verb {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-variable {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-comment {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['comment'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['comment'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-mysql-string {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['quote'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['quote'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-operator {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-mysql-word {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-builtin {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-variable-2 {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-variable-3 {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-separator {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';';
|
||||
$result[] = '}';
|
||||
$result[] = 'span.cm-number {';
|
||||
$result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer'] . ';';
|
||||
$result[] = ' color: '
|
||||
. $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer'] . ';';
|
||||
$result[] = '}';
|
||||
|
||||
return implode("\n", $result);
|
||||
|
||||
@ -571,7 +571,7 @@ $GLOBALS['js_include'][] = 'update-location.js';
|
||||
|
||||
/**
|
||||
* holds an array of javascript code snippets to be included in the HTML header
|
||||
* Can be used with PMA_AddJSCode() to pass on js variables to the browser.
|
||||
* Can be used with PMA_addJSCode() to pass on js variables to the browser.
|
||||
* @global array $js_script
|
||||
*/
|
||||
$GLOBALS['js_script'] = array();
|
||||
|
||||
@ -361,7 +361,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
|
||||
return $formatted_sql;
|
||||
}
|
||||
|
||||
$formatted_sql = '';
|
||||
$formatted_sql = '';
|
||||
|
||||
switch ($cfg['SQP']['fmtType']) {
|
||||
case 'none':
|
||||
@ -683,10 +683,10 @@ function PMA_mysqlDie(
|
||||
// modified to show the help on error-returns
|
||||
// (now error-messages-server)
|
||||
$error_msg .= '<p>' . "\n"
|
||||
. ' <strong>' . __('MySQL said: ') . '</strong>'
|
||||
. PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server')
|
||||
. "\n"
|
||||
. '</p>' . "\n";
|
||||
. ' <strong>' . __('MySQL said: ') . '</strong>'
|
||||
. PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server')
|
||||
. "\n"
|
||||
. '</p>' . "\n";
|
||||
|
||||
// The error message will be displayed within a CODE segment.
|
||||
// To preserve original formatting, but allow wordwrapping,
|
||||
@ -812,7 +812,8 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0,
|
||||
$group_name_full = '';
|
||||
$parts_cnt = count($parts) - 1;
|
||||
while ($i < $parts_cnt
|
||||
&& $i < $GLOBALS['cfg']['LeftFrameTableLevel']) {
|
||||
&& $i < $GLOBALS['cfg']['LeftFrameTableLevel']
|
||||
) {
|
||||
$group_name = $parts[$i] . $sep;
|
||||
$group_name_full .= $group_name;
|
||||
|
||||
@ -1349,7 +1350,7 @@ function PMA_getMessage(
|
||||
}
|
||||
|
||||
return $retval;
|
||||
|
||||
|
||||
} // end of the 'PMA_getMessage()' function
|
||||
|
||||
/**
|
||||
@ -1977,17 +1978,17 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
|
||||
function PMA_splitURLQuery($url)
|
||||
{
|
||||
// decode encoded url separators
|
||||
$separator = PMA_get_arg_separator();
|
||||
$separator = PMA_get_arg_separator();
|
||||
// on most places separator is still hard coded ...
|
||||
if ($separator !== '&') {
|
||||
// ... so always replace & with $separator
|
||||
$url = str_replace(htmlentities('&'), $separator, $url);
|
||||
$url = str_replace('&', $separator, $url);
|
||||
$url = str_replace(htmlentities('&'), $separator, $url);
|
||||
$url = str_replace('&', $separator, $url);
|
||||
}
|
||||
$url = str_replace(htmlentities($separator), $separator, $url);
|
||||
$url = str_replace(htmlentities($separator), $separator, $url);
|
||||
// end decode
|
||||
|
||||
$url_parts = parse_url($url);
|
||||
$url_parts = parse_url($url);
|
||||
return explode($separator, $url_parts['query']);
|
||||
}
|
||||
|
||||
@ -2653,9 +2654,9 @@ function PMA_getCheckbox($html_field_name, $label, $checked, $onclick)
|
||||
function PMA_getRadioFields($html_field_name, $choices, $checked_choice = '',
|
||||
$line_break = true, $escape_label = true, $class=''
|
||||
) {
|
||||
|
||||
|
||||
$radio_html = '';
|
||||
|
||||
|
||||
foreach ($choices as $choice_value => $choice_label) {
|
||||
if (! empty($class)) {
|
||||
$radio_html .= '<div class="' . $class . '">';
|
||||
@ -2681,9 +2682,9 @@ function PMA_getRadioFields($html_field_name, $choices, $checked_choice = '',
|
||||
}
|
||||
$radio_html .= "\n";
|
||||
}
|
||||
|
||||
|
||||
return $radio_html;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2723,9 +2724,9 @@ function PMA_getDropdown($select_name, $choices, $active_choice, $id)
|
||||
*
|
||||
* @param string $id the id of the <div> on which to apply the effect
|
||||
* @param string $message the message to show as a link
|
||||
*
|
||||
*
|
||||
* @return string html div element
|
||||
*
|
||||
*
|
||||
*/
|
||||
function PMA_getDivForSliderEffect($id, $message)
|
||||
{
|
||||
@ -2740,7 +2741,7 @@ function PMA_getDivForSliderEffect($id, $message)
|
||||
* method maybe by using an additional param, the id of the div to
|
||||
* append to
|
||||
*/
|
||||
|
||||
|
||||
return '<div id="' . $id . '"'
|
||||
. (($GLOBALS['cfg']['InitialSlidersState'] == 'closed')
|
||||
? ' style="display: none; overflow:auto;"'
|
||||
@ -3162,7 +3163,7 @@ function PMA_duplicateFirstNewline($string)
|
||||
{
|
||||
$first_occurence = strpos($string, "\r\n");
|
||||
if ($first_occurence === 0) {
|
||||
$string = "\n".$string;
|
||||
$string = "\n" . $string;
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
@ -3547,7 +3548,6 @@ function PMA_getGISDatatypes($upper_case = false)
|
||||
$gis_data_types[$i] = strtoupper($gis_data_types[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
return $gis_data_types;
|
||||
}
|
||||
|
||||
@ -3560,7 +3560,7 @@ function PMA_getGISDatatypes($upper_case = false)
|
||||
*/
|
||||
function PMA_createGISData($gis_string)
|
||||
{
|
||||
$gis_string = trim($gis_string);
|
||||
$gis_string = trim($gis_string);
|
||||
$geom_types = '(POINT|MULTIPOINT|LINESTRING|MULTILINESTRING|'
|
||||
. 'POLYGON|MULTIPOLYGON|GEOMETRYCOLLECTION)';
|
||||
if (preg_match("/^'" . $geom_types . "\(.*\)',[0-9]*$/i", $gis_string)) {
|
||||
@ -3838,15 +3838,15 @@ function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
|
||||
$query = "SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`%s` "
|
||||
. "WHERE GRANTEE='%s' AND PRIVILEGE_TYPE='%s'";
|
||||
// Check global privileges first.
|
||||
if (PMA_DBI_fetch_value(
|
||||
$user_privileges = PMA_DBI_fetch_value(
|
||||
sprintf(
|
||||
$query,
|
||||
'USER_PRIVILEGES',
|
||||
$username,
|
||||
$priv
|
||||
)
|
||||
)
|
||||
) {
|
||||
);
|
||||
if ($user_privileges) {
|
||||
return true;
|
||||
}
|
||||
// If a database name was provided and user does not have the
|
||||
@ -3855,7 +3855,7 @@ function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
|
||||
// need to escape wildcards in db and table names, see bug #3518484
|
||||
$db = str_replace(array('%', '_'), array('\%', '\_'), $db);
|
||||
$query .= " AND TABLE_SCHEMA='%s'";
|
||||
if (PMA_DBI_fetch_value(
|
||||
$schema_privileges = PMA_DBI_fetch_value(
|
||||
sprintf(
|
||||
$query,
|
||||
'SCHEMA_PRIVILEGES',
|
||||
@ -3863,8 +3863,8 @@ function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
|
||||
$priv,
|
||||
PMA_sqlAddSlashes($db)
|
||||
)
|
||||
)
|
||||
) {
|
||||
);
|
||||
if ($schema_privileges) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@ -3878,7 +3878,7 @@ function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
|
||||
// need to escape wildcards in db and table names, see bug #3518484
|
||||
$tbl = str_replace(array('%', '_'), array('\%', '\_'), $tbl);
|
||||
$query .= " AND TABLE_NAME='%s'";
|
||||
if (PMA_DBI_fetch_value(
|
||||
$table_privileges = PMA_DBI_fetch_value(
|
||||
sprintf(
|
||||
$query,
|
||||
'TABLE_PRIVILEGES',
|
||||
@ -3887,8 +3887,8 @@ function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
|
||||
PMA_sqlAddSlashes($db),
|
||||
PMA_sqlAddSlashes($tbl)
|
||||
)
|
||||
)
|
||||
) {
|
||||
);
|
||||
if ($table_privileges) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -518,9 +518,9 @@ $cfg['Servers'][$i]['tracking_add_drop_table'] = true;
|
||||
$cfg['Servers'][$i]['tracking_add_drop_database'] = true;
|
||||
|
||||
/**
|
||||
* Enables caching of TABLE STATUS outputs for specific databases on this server
|
||||
* (in some cases TABLE STATUS can be very slow, so you may want to cache it).
|
||||
* APC is used (if the PHP extension is available, if not, this setting is ignored
|
||||
* Enables caching of TABLE STATUS outputs for specific databases on this server
|
||||
* (in some cases TABLE STATUS can be very slow, so you may want to cache it).
|
||||
* APC is used (if the PHP extension is available, if not, this setting is ignored
|
||||
* silently). You have to provide StatusCacheLifetime.
|
||||
* Takes effect only if DisableIS is true.
|
||||
*
|
||||
|
||||
@ -781,7 +781,7 @@ function PMA_includeJS($url, $ie_conditional = false)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_AddJSCode($str)
|
||||
function PMA_addJSCode($str)
|
||||
{
|
||||
$GLOBALS['js_script'][] = $str;
|
||||
}
|
||||
@ -796,9 +796,9 @@ function PMA_AddJSCode($str)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_AddJSVar($key, $value, $escape = true)
|
||||
function PMA_addJSVar($key, $value, $escape = true)
|
||||
{
|
||||
PMA_AddJsCode(PMA_getJsValue($key, $value, $escape));
|
||||
PMA_addJSCode(PMA_getJsValue($key, $value, $escape));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -26,10 +26,11 @@ if (! defined('PHPMYADMIN')) {
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
|
||||
&$uncommon_source_tables) {
|
||||
for ($k=0; $k< sizeof($src_tables); $k++) {
|
||||
&$uncommon_source_tables
|
||||
) {
|
||||
for ($k=0; $k< count($src_tables); $k++) {
|
||||
$present_in_target = false;
|
||||
for ($l=0; $l < sizeof($trg_tables); $l++) {
|
||||
for ($l=0; $l < count($trg_tables); $l++) {
|
||||
if ($src_tables[$k] === $trg_tables[$l]) {
|
||||
$present_in_target = true;
|
||||
$matching_tables[] = $src_tables[$k];
|
||||
@ -54,10 +55,11 @@ function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables,
|
||||
&$uncommon_target_tables) {
|
||||
for ($c=0; $c<sizeof($trg_tables); $c++) {
|
||||
&$uncommon_target_tables
|
||||
) {
|
||||
for ($c=0; $c<count($trg_tables); $c++) {
|
||||
$match = false;
|
||||
for ($d=0; $d < sizeof($matching_tables); $d++) {
|
||||
for ($d=0; $d < count($matching_tables); $d++) {
|
||||
if ($trg_tables[$c] === $matching_tables[$d]) {
|
||||
$match=true;
|
||||
}
|
||||
@ -123,13 +125,13 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
}
|
||||
$matching_tables_fields[$matching_table_index] = $fld;
|
||||
$fields_num[$matching_table_index] = sizeof($fld);
|
||||
$fields_num[$matching_table_index] = count($fld);
|
||||
$matching_tables_keys[$matching_table_index] = $is_key;
|
||||
|
||||
$source_result_set = PMA_getColumnValues(
|
||||
$src_db, $matching_table[$matching_table_index], $is_key, $src_link
|
||||
);
|
||||
$source_size = sizeof($source_result_set);
|
||||
$source_size = count($source_result_set);
|
||||
|
||||
$trg_fld_results = PMA_DBI_get_columns(
|
||||
$trg_db, $matching_table[$matching_table_index], null, true, $trg_link
|
||||
@ -158,57 +160,72 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
|
||||
// Query the target server to see which rows already exist
|
||||
$trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
|
||||
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
|
||||
. PMA_backquote($matching_table[$matching_table_index])
|
||||
. " WHERE ";
|
||||
|
||||
if (sizeof($is_key) == 1) {
|
||||
$trg_select_query .= PMA_backquote($is_key[0]). "='" . $source_result_set[$j] . "'";
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($k=0; $k < sizeof($is_key); $k++) {
|
||||
if (count($is_key) == 1) {
|
||||
$trg_select_query .= PMA_backquote($is_key[0])
|
||||
. "='" . $source_result_set[$j] . "'";
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($k=0; $k < count($is_key); $k++) {
|
||||
$trg_select_query .= PMA_backquote($is_key[$k])
|
||||
. "='" . $source_result_set[$j][$is_key[$k]] . "'";
|
||||
if ($k < (sizeof($is_key)-1)) {
|
||||
if ($k < (count($is_key)-1)) {
|
||||
$trg_select_query .= " AND ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$target_result_set = PMA_DBI_fetch_result($trg_select_query, null, null, $trg_link);
|
||||
$target_result_set = PMA_DBI_fetch_result(
|
||||
$trg_select_query,
|
||||
null,
|
||||
null,
|
||||
$trg_link
|
||||
);
|
||||
if ($target_result_set) {
|
||||
|
||||
// Fetch the row from the source server to do a comparison
|
||||
$src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
|
||||
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
|
||||
$src_select_query = "SELECT * FROM "
|
||||
. PMA_backquote($src_db) . "."
|
||||
. PMA_backquote($matching_table[$matching_table_index])
|
||||
. " WHERE ";
|
||||
|
||||
if (sizeof($is_key) == 1) {
|
||||
if (count($is_key) == 1) {
|
||||
$src_select_query .= PMA_backquote($is_key[0])
|
||||
. "='" . $source_result_set[$j] . "'";
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($k=0; $k< sizeof($is_key); $k++) {
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($k=0; $k< count($is_key); $k++) {
|
||||
$src_select_query .= PMA_backquote($is_key[$k])
|
||||
. "='" . $source_result_set[$j][$is_key[$k]] . "'";
|
||||
if ($k < (sizeof($is_key) - 1)) {
|
||||
if ($k < (count($is_key) - 1)) {
|
||||
$src_select_query .= " AND ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$src_result_set = PMA_DBI_fetch_result($src_select_query, null, null, $src_link);
|
||||
$src_result_set = PMA_DBI_fetch_result(
|
||||
$src_select_query,
|
||||
null,
|
||||
null,
|
||||
$src_link
|
||||
);
|
||||
|
||||
/**
|
||||
* Comparing each corresponding field of the source and target matching rows.
|
||||
* Placing the primary key, value of primary key, field to be updated, and the
|
||||
* new value of field to be updated in each row of the update array.
|
||||
* Comparing each corresponding field of the source and target
|
||||
* matching rows. Placing the primary key, value of primary
|
||||
* key, field to be updated, and the new value of field to
|
||||
* be updated in each row of the update array.
|
||||
*/
|
||||
for ($m = 0; ($m < $fields_num[$matching_table_index]) && ($starting_index == 0) ; $m++) {
|
||||
if (isset($src_result_set[0][$fld[$m]])) {
|
||||
if (isset($target_result_set[0][$fld[$m]])) {
|
||||
if (($src_result_set[0][$fld[$m]] != $target_result_set[0][$fld[$m]]) && (! (in_array($fld[$m], $is_key)))) {
|
||||
if (sizeof($is_key) == 1) {
|
||||
if (count($is_key) == 1) {
|
||||
if ($source_result_set[$j]) {
|
||||
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
|
||||
}
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($n=0; $n < sizeof($is_key); $n++) {
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($n=0; $n < count($is_key); $n++) {
|
||||
if (isset($src_result_set[0][$is_key[$n]])) {
|
||||
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
|
||||
}
|
||||
@ -226,12 +243,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
$update_row++;
|
||||
}
|
||||
} else {
|
||||
if (sizeof($is_key) == 1) {
|
||||
if (count($is_key) == 1) {
|
||||
if ($source_result_set[$j]) {
|
||||
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
|
||||
}
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($n = 0; $n < sizeof($is_key); $n++) {
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($n = 0; $n < count($is_key); $n++) {
|
||||
if (isset($src_result_set[0][$is_key[$n]])) {
|
||||
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
|
||||
}
|
||||
@ -277,14 +294,15 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
|
||||
* Placing the primary key, and the value of primary key of the
|
||||
* row that is to be inserted in the target table
|
||||
*/
|
||||
if (sizeof($is_key) == 1) {
|
||||
if (count($is_key) == 1) {
|
||||
if (isset($source_result_set[$j])) {
|
||||
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
|
||||
}
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($l = 0; $l < sizeof($is_key); $l++) {
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($l = 0; $l < count($is_key); $l++) {
|
||||
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
|
||||
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
|
||||
}
|
||||
@ -294,15 +312,17 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
|
||||
* This condition is met when there is an additional column in the source table
|
||||
* Placing the primary key, and the value of primary key of the
|
||||
* row that is to be inserted in the target table. This
|
||||
* condition is met when there is an additional column in the
|
||||
* source table
|
||||
*/
|
||||
if (sizeof($is_key) == 1) {
|
||||
if (count($is_key) == 1) {
|
||||
if (isset($source_result_set[$j])) {
|
||||
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
|
||||
}
|
||||
} elseif (sizeof($is_key) > 1) {
|
||||
for ($l = 0; $l < sizeof($is_key); $l++) {
|
||||
} elseif (count($is_key) > 1) {
|
||||
for ($l = 0; $l < count($is_key); $l++) {
|
||||
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
|
||||
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
|
||||
}
|
||||
@ -339,7 +359,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
|
||||
$source_key_values = PMA_getColumnValues($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);
|
||||
}
|
||||
$all_keys_match = 1;
|
||||
for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {
|
||||
for ($a = 0; $a < count($trg_keys[$matching_table_index]); $a++) {
|
||||
if (isset($trg_keys[$matching_table_index][$a])) {
|
||||
if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {
|
||||
$all_keys_match = 0;
|
||||
@ -352,24 +372,24 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
|
||||
}
|
||||
}
|
||||
if (isset($trg_keys[$matching_table_index])) {
|
||||
if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
|
||||
if ((count($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
|
||||
$row = 0;
|
||||
if (isset($target_key_values)) {
|
||||
for ($i = 0; $i < sizeof($target_key_values); $i++) {
|
||||
for ($i = 0; $i < count($target_key_values); $i++) {
|
||||
if (! (in_array($target_key_values[$i], $source_key_values))) {
|
||||
$delete_array[$matching_table_index][$row] = $target_key_values[$i];
|
||||
$row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ((sizeof($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
|
||||
} elseif ((count($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
|
||||
$row = 0;
|
||||
if (isset($target_key_values)) {
|
||||
for ($i = 0; $i < sizeof($target_key_values); $i++) {
|
||||
for ($i = 0; $i < count($target_key_values); $i++) {
|
||||
$is_present = false;
|
||||
for ($j = 0; $j < sizeof($source_key_values) && ($is_present == false) ; $j++) {
|
||||
for ($j = 0; $j < count($source_key_values) && ($is_present == false) ; $j++) {
|
||||
$check = true;
|
||||
for ($k = 0; $k < sizeof($trg_keys[$matching_table_index]); $k++) {
|
||||
for ($k = 0; $k < count($trg_keys[$matching_table_index]); $k++) {
|
||||
if ($target_key_values[$i][$trg_keys[$matching_table_index][$k]] != $source_key_values[$j][$trg_keys[$matching_table_index][$k]]) {
|
||||
$check = false;
|
||||
}
|
||||
@ -379,7 +399,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
|
||||
}
|
||||
}
|
||||
if (! ($is_present)) {
|
||||
for ($l = 0; $l < sizeof($trg_keys[$matching_table_index]); $l++) {
|
||||
for ($l = 0; $l < count($trg_keys[$matching_table_index]); $l++) {
|
||||
$delete_array[$matching_table_index][$row][$trg_keys[$matching_table_index][$l]] = $target_key_values[$i][$trg_keys[$matching_table_index][$l]];
|
||||
}
|
||||
$row++;
|
||||
@ -405,7 +425,8 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
|
||||
*/
|
||||
function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_link, $index, &$row_count)
|
||||
{
|
||||
$query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
|
||||
$query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "."
|
||||
. PMA_backquote($source_tables_uncommon[$index]);
|
||||
$rows = PMA_DBI_fetch_result($query, null, null, $src_link);
|
||||
$row_count[$index] = $rows[0];
|
||||
}
|
||||
@ -414,17 +435,17 @@ function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_lin
|
||||
* PMA_updateTargetTables() sets the updated field values to
|
||||
* target table rows using $update_array[$matching_table_index]
|
||||
*
|
||||
* @param array $table Matching tables' names
|
||||
* @param array $update_array A three dimensional array containing field
|
||||
* value updates required for each matching
|
||||
* table
|
||||
* @param string $src_db Name of source database
|
||||
* @param string $trg_db Name of target database
|
||||
* @param mixed $trg_link Connection established with target server
|
||||
* @param int $matching_table_index index of matching table in
|
||||
* matching_table_array
|
||||
* @param array $matching_table_keys matching keys for table
|
||||
* @param bool $display whether to display query
|
||||
* @param array $table Matching tables' names
|
||||
* @param array $update_array A three dimensional array containing field
|
||||
* value updates required for each matching
|
||||
* table
|
||||
* @param string $src_db Name of source database
|
||||
* @param string $trg_db Name of target database
|
||||
* @param mixed $trg_link Connection established with target server
|
||||
* @param int $matching_table_index index of matching table in
|
||||
* matching_table_array
|
||||
* @param array $matching_table_keys matching keys for table
|
||||
* @param bool $display whether to display query
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
@ -433,12 +454,12 @@ function PMA_updateTargetTables(
|
||||
$trg_link, $matching_table_index, $matching_table_keys, $display
|
||||
) {
|
||||
if (isset($update_array[$matching_table_index])) {
|
||||
if (sizeof($update_array[$matching_table_index])) {
|
||||
if (count($update_array[$matching_table_index])) {
|
||||
|
||||
for ($update_row = 0; $update_row < sizeof($update_array[$matching_table_index]); $update_row++) {
|
||||
for ($update_row = 0; $update_row < count($update_array[$matching_table_index]); $update_row++) {
|
||||
|
||||
if (isset($update_array[$matching_table_index][$update_row])) {
|
||||
$update_fields_num = sizeof($update_array[$matching_table_index][$update_row])-sizeof($matching_table_keys[$matching_table_index]);
|
||||
$update_fields_num = count($update_array[$matching_table_index][$update_row])-count($matching_table_keys[$matching_table_index]);
|
||||
if ($update_fields_num > 0) {
|
||||
$query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
|
||||
|
||||
@ -452,11 +473,11 @@ function PMA_updateTargetTables(
|
||||
}
|
||||
$query .= " WHERE ";
|
||||
if (isset($matching_table_keys[$matching_table_index])) {
|
||||
for ($key = 0; $key < sizeof($matching_table_keys[$matching_table_index]); $key++) {
|
||||
for ($key = 0; $key < count($matching_table_keys[$matching_table_index]); $key++) {
|
||||
if (isset($matching_table_keys[$matching_table_index][$key])) {
|
||||
$query .= PMA_backquote($matching_table_keys[$matching_table_index][$key]) . "='" . $update_array[$matching_table_index][$update_row][$matching_table_keys[$matching_table_index][$key]] . "'";
|
||||
}
|
||||
if ($key < (sizeof($matching_table_keys[$matching_table_index]) - 1)) {
|
||||
if ($key < (count($matching_table_keys[$matching_table_index]) - 1)) {
|
||||
$query .= " AND ";
|
||||
}
|
||||
}
|
||||
@ -488,20 +509,32 @@ function PMA_updateTargetTables(
|
||||
* @param mixed $trg_link connection established with target server
|
||||
* @param array $table_fields field names of a table
|
||||
* @param array &$array_insert
|
||||
* @param int $matching_table_index index of matching table in matching_table_array
|
||||
* @param array $matching_tables_keys field names that are keys in the matching table
|
||||
* @param int $matching_table_index index of matching table in
|
||||
* matching_table_array
|
||||
* @param array $matching_tables_keys field names that are keys in the matching
|
||||
* table
|
||||
* @param array $source_columns source column information
|
||||
* @param array &$add_column_array column names that are to be added in target table
|
||||
* @param array $criteria criteria like type, null, collation, default etc
|
||||
* @param array $target_tables_keys field names that are keys in the target table
|
||||
* @param array $uncommon_tables table names that are present in source db but not in targt db
|
||||
* @param array &$add_column_array column names that are to be added in
|
||||
* target table
|
||||
* @param array $criteria criteria like type, null, collation,
|
||||
* default etc
|
||||
* @param array $target_tables_keys field names that are keys in the target
|
||||
* table
|
||||
* @param array $uncommon_tables table names that are present in source db
|
||||
* but not in targt db
|
||||
* @param array &$uncommon_tables_fields field names of the uncommon tables
|
||||
* @param array $uncommon_cols column names that are present in target table and not in source table
|
||||
* @param array $uncommon_cols column names that are present in target
|
||||
* table and not in source table
|
||||
* @param array &$alter_str_array column names that are to be altered
|
||||
* @param array &$source_indexes column names on which indexes are made in source table
|
||||
* @param array &$target_indexes column names on which indexes are made in target table
|
||||
* @param array &$add_indexes_array column names on which index is to be added in target table
|
||||
* @param array &$alter_indexes_array column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
|
||||
* @param array &$source_indexes column names on which indexes are made
|
||||
* in source table
|
||||
* @param array &$target_indexes column names on which indexes are made
|
||||
* in target table
|
||||
* @param array &$add_indexes_array column names on which index is to be
|
||||
* added in target table
|
||||
* @param array &$alter_indexes_array column names whose indexes are to be
|
||||
* altered. Only index name and uniqueness
|
||||
* of an index can be changed
|
||||
* @param array &$delete_array rows that are to be deleted
|
||||
* @param array &$update_array rows that are to be updated in target
|
||||
* @param bool $display whether to display query
|
||||
@ -516,16 +549,16 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
&$alter_indexes_array, &$delete_array, &$update_array, $display
|
||||
) {
|
||||
if (isset($array_insert[$matching_table_index])) {
|
||||
if (sizeof($array_insert[$matching_table_index])) {
|
||||
for ($insert_row = 0; $insert_row< sizeof($array_insert[$matching_table_index]); $insert_row++) {
|
||||
if (count($array_insert[$matching_table_index])) {
|
||||
for ($insert_row = 0; $insert_row< count($array_insert[$matching_table_index]); $insert_row++) {
|
||||
if (isset($array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][0]])) {
|
||||
|
||||
$select_query = "SELECT * FROM " . PMA_backquote($src_db) . "." . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
|
||||
for ($i = 0; $i < sizeof($matching_tables_keys[$matching_table_index]); $i++) {
|
||||
for ($i = 0; $i < count($matching_tables_keys[$matching_table_index]); $i++) {
|
||||
$select_query .= $matching_tables_keys[$matching_table_index][$i] . "='";
|
||||
$select_query .= $array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][$i]] . "'" ;
|
||||
|
||||
if ($i < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
if ($i < (count($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
$select_query.= " AND ";
|
||||
}
|
||||
}
|
||||
@ -533,7 +566,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
$result = PMA_DBI_fetch_result($select_query, null, null, $src_link);
|
||||
$insert_query = "INSERT INTO " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_table[$matching_table_index]) ." (";
|
||||
|
||||
for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++) {
|
||||
for ($field_index = 0; $field_index < count($table_fields[$matching_table_index]); $field_index++) {
|
||||
$insert_query .= PMA_backquote($table_fields[$matching_table_index][$field_index]);
|
||||
|
||||
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
|
||||
@ -541,35 +574,52 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
$table_fields[$matching_table_index][$field_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
|
||||
|
||||
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $trg_link);
|
||||
if (sizeof($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < sizeof($is_fk_result); $j++) {
|
||||
if (count($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < count($is_fk_result); $j++) {
|
||||
$table_index = array_keys($matching_table, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
|
||||
|
||||
if (isset($alter_str_array[$table_index[0]])) {
|
||||
PMA_alterTargetTableStructure(
|
||||
$trg_db, $trg_link, $matching_tables, $source_columns, $alter_str_array, $matching_tables_fields,
|
||||
$criteria, $matching_tables_keys, $target_tables_keys, $table_index[0], $display
|
||||
$trg_db, $trg_link, $matching_tables,
|
||||
$source_columns, $alter_str_array,
|
||||
$matching_tables_fields,
|
||||
$criteria, $matching_tables_keys,
|
||||
$target_tables_keys, $table_index[0],
|
||||
$display
|
||||
);
|
||||
unset($alter_str_array[$table_index[0]]);
|
||||
}
|
||||
if (isset($uncommon_columns[$table_index[0]])) {
|
||||
PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_index[0], $display);
|
||||
PMA_removeColumnsFromTargetTable(
|
||||
$trg_db, $trg_link, $matching_tables,
|
||||
$uncommon_columns, $table_index[0], $display
|
||||
);
|
||||
unset($uncommon_columns[$table_index[0]]);
|
||||
}
|
||||
if (isset($add_column_array[$table_index[0]])) {
|
||||
PMA_findDeleteRowsFromTargetTables(
|
||||
$delete_array, $matching_tables, $table_index[0], $target_tables_keys,
|
||||
$matching_tables_keys, $trg_db, $trg_link, $src_db, $src_link
|
||||
$delete_array, $matching_tables,
|
||||
$table_index[0], $target_tables_keys,
|
||||
$matching_tables_keys, $trg_db,
|
||||
$trg_link, $src_db, $src_link
|
||||
);
|
||||
|
||||
if (isset($delete_array[$table_index[0]])) {
|
||||
PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index[0], $target_tables_keys, $delete_array, $display);
|
||||
PMA_deleteFromTargetTable(
|
||||
$trg_db, $trg_link, $matching_tables,
|
||||
$table_index[0], $target_tables_keys,
|
||||
$delete_array, $display
|
||||
);
|
||||
unset($delete_array[$table_index[0]]);
|
||||
}
|
||||
PMA_addColumnsInTargetTable(
|
||||
$src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
|
||||
$matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,
|
||||
$uncommon_tables_fields, $table_index[0], $uncommon_cols, $display
|
||||
$src_db, $trg_db, $src_link, $trg_link,
|
||||
$matching_tables, $source_columns,
|
||||
$add_column_array, $matching_tables_fields,
|
||||
$criteria, $matching_tables_keys,
|
||||
$target_tables_keys, $uncommon_tables,
|
||||
$uncommon_tables_fields, $table_index[0],
|
||||
$uncommon_cols, $display
|
||||
);
|
||||
unset($add_column_array[$table_index[0]]);
|
||||
}
|
||||
@ -578,8 +628,11 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
|| isset($alter_indexes_array[$table_index[0]])
|
||||
) {
|
||||
PMA_applyIndexesDiff(
|
||||
$trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array,
|
||||
$alter_indexes_array, $remove_indexes_array, $table_index[0], $display
|
||||
$trg_db, $trg_link, $matching_tables,
|
||||
$source_indexes, $target_indexes,
|
||||
$add_indexes_array, $alter_indexes_array,
|
||||
$remove_indexes_array, $table_index[0],
|
||||
$display
|
||||
);
|
||||
|
||||
unset($add_indexes_array[$table_index[0]]);
|
||||
@ -588,37 +641,46 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
}
|
||||
if (isset($update_array[$table_index[0]])) {
|
||||
PMA_updateTargetTables(
|
||||
$matching_tables, $update_array, $src_db, $trg_db, $trg_link,
|
||||
$table_index[0], $matching_table_keys, $display
|
||||
$matching_tables, $update_array,
|
||||
$src_db, $trg_db, $trg_link,
|
||||
$table_index[0], $matching_table_keys,
|
||||
$display
|
||||
);
|
||||
unset($update_array[$table_index[0]]);
|
||||
}
|
||||
if (isset($array_insert[$table_index[0]])) {
|
||||
PMA_insertIntoTargetTable(
|
||||
$matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, $array_insert, $table_index[0],
|
||||
$matching_tables_keys, $source_columns, $add_column_array, $criteria, $target_tables_keys, $uncommon_tables,
|
||||
$uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
|
||||
$alter_indexes_array, $delete_array, $update_array, $display
|
||||
$matching_table, $src_db, $trg_db,
|
||||
$src_link, $trg_link, $table_fields,
|
||||
$array_insert, $table_index[0],
|
||||
$matching_tables_keys, $source_columns,
|
||||
$add_column_array, $criteria,
|
||||
$target_tables_keys, $uncommon_tables,
|
||||
$uncommon_tables_fields, $uncommon_cols,
|
||||
$alter_str_array, $source_indexes,
|
||||
$target_indexes, $add_indexes_array,
|
||||
$alter_indexes_array, $delete_array,
|
||||
$update_array, $display
|
||||
);
|
||||
unset($array_insert[$table_index[0]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($field_index < sizeof($table_fields[$matching_table_index])-1) {
|
||||
if ($field_index < count($table_fields[$matching_table_index])-1) {
|
||||
$insert_query .= ", ";
|
||||
}
|
||||
}
|
||||
$insert_query .= ") VALUES(";
|
||||
if (sizeof($table_fields[$matching_table_index]) == 1) {
|
||||
if (count($table_fields[$matching_table_index]) == 1) {
|
||||
$insert_query .= "'" . PMA_sqlAddSlashes($result[0]) . "'";
|
||||
} else {
|
||||
for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++) {
|
||||
for ($field_index = 0; $field_index < count($table_fields[$matching_table_index]); $field_index++) {
|
||||
if (isset($result[0][$table_fields[$matching_table_index][$field_index]])) {
|
||||
$insert_query .= "'" . PMA_sqlAddSlashes($result[0][$table_fields[$matching_table_index][$field_index]]) . "'";
|
||||
} else {
|
||||
$insert_query .= "'NULL'";
|
||||
}
|
||||
if ($field_index < (sizeof($table_fields[$matching_table_index])) - 1) {
|
||||
if ($field_index < (count($table_fields[$matching_table_index])) - 1) {
|
||||
$insert_query .= " ," ;
|
||||
}
|
||||
}
|
||||
@ -654,7 +716,13 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
&$uncommon_tables, $table_index, &$uncommon_tables_fields, $display
|
||||
) {
|
||||
if (isset($uncommon_tables[$table_index])) {
|
||||
$fields_result = PMA_DBI_get_columns($src_db, $uncommon_tables[$table_index], null, true, $src_link);
|
||||
$fields_result = PMA_DBI_get_columns(
|
||||
$src_db,
|
||||
$uncommon_tables[$table_index],
|
||||
null,
|
||||
true,
|
||||
$src_link
|
||||
);
|
||||
$fields = array();
|
||||
foreach ($fields_result as $each_field) {
|
||||
$field_name = $each_field['Field'];
|
||||
@ -662,7 +730,13 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
$uncommon_tables_fields[$table_index] = $fields;
|
||||
|
||||
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
|
||||
$Create_Query = PMA_DBI_fetch_value(
|
||||
"SHOW CREATE TABLE " . PMA_backquote($src_db) . '.'
|
||||
. PMA_backquote($uncommon_tables[$table_index]),
|
||||
0,
|
||||
1,
|
||||
$src_link
|
||||
);
|
||||
|
||||
// Replace the src table name with a `dbname`.`tablename`
|
||||
$Create_Table_Query = preg_replace(
|
||||
@ -676,8 +750,8 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
AND TABLE_NAME = '" . $uncommon_tables[$table_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
|
||||
|
||||
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
|
||||
if (sizeof($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < sizeof($is_fk_result); $j++) {
|
||||
if (count($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < count($is_fk_result); $j++) {
|
||||
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
|
||||
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
|
||||
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
|
||||
@ -713,10 +787,17 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
$uncommon_tables, $table_index, $uncommon_tables_fields, $display
|
||||
) {
|
||||
$display = false; // todo: maybe display some of the queries if they are not too numerous
|
||||
$unbuffered_result = PMA_DBI_try_query('SELECT * FROM ' . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), $src_link, PMA_DBI_QUERY_UNBUFFERED);
|
||||
// @todo: maybe display some of the queries if they are not too numerous
|
||||
$display = false;
|
||||
$unbuffered_result = PMA_DBI_try_query(
|
||||
'SELECT * FROM ' . PMA_backquote($src_db) . '.'
|
||||
. PMA_backquote($uncommon_tables[$table_index]),
|
||||
$src_link,
|
||||
PMA_DBI_QUERY_UNBUFFERED
|
||||
);
|
||||
if (false !== $unbuffered_result) {
|
||||
$insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
|
||||
$insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.'
|
||||
. PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
|
||||
while ($one_row = PMA_DBI_fetch_row($unbuffered_result)) {
|
||||
$insert_query .= '(';
|
||||
$key_of_last_value = count($one_row) - 1;
|
||||
@ -750,21 +831,21 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index,
|
||||
$target_tables_keys, $delete_array, $display
|
||||
function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables,
|
||||
$table_index, $target_tables_keys, $delete_array, $display
|
||||
) {
|
||||
for ($i = 0; $i < sizeof($delete_array[$table_index]); $i++) {
|
||||
for ($i = 0; $i < count($delete_array[$table_index]); $i++) {
|
||||
if (isset($target_tables_keys[$table_index])) {
|
||||
$delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
|
||||
for ($y = 0; $y < sizeof($target_tables_keys[$table_index]); $y++) {
|
||||
for ($y = 0; $y < count($target_tables_keys[$table_index]); $y++) {
|
||||
$delete_query .= PMA_backquote($target_tables_keys[$table_index][$y]) . " = '";
|
||||
|
||||
if (sizeof($target_tables_keys[$table_index]) == 1) {
|
||||
if (count($target_tables_keys[$table_index]) == 1) {
|
||||
$delete_query .= $delete_array[$table_index][$i] . "'";
|
||||
} elseif (sizeof($target_tables_keys[$table_index]) > 1) {
|
||||
} elseif (count($target_tables_keys[$table_index]) > 1) {
|
||||
$delete_query .= $delete_array[$table_index][$i][$target_tables_keys[$table_index][$y]] . "'";
|
||||
}
|
||||
if ($y < (sizeof($target_tables_keys[$table_index]) - 1)) {
|
||||
if ($y < (count($target_tables_keys[$table_index]) - 1)) {
|
||||
$delete_query .= ' AND ';
|
||||
}
|
||||
$pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
|
||||
@ -772,11 +853,17 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
|
||||
. $target_tables_keys[$table_index][$y] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
|
||||
|
||||
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
|
||||
$result_size = sizeof($pk_query_result);
|
||||
$result_size = count($pk_query_result);
|
||||
|
||||
if ($result_size > 0) {
|
||||
for ($b = 0; $b < $result_size; $b++) {
|
||||
$drop_pk_query = "DELETE FROM " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . " WHERE " . PMA_backquote($pk_query_result[$b]['COLUMN_NAME']) . " = " . $target_tables_keys[$table_index][$y] . ";";
|
||||
$drop_pk_query = "DELETE FROM "
|
||||
. PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA'])
|
||||
. "."
|
||||
. PMA_backquote($pk_query_result[$b]['TABLE_NAME'])
|
||||
. " WHERE "
|
||||
. PMA_backquote($pk_query_result[$b]['COLUMN_NAME'])
|
||||
. " = " . $target_tables_keys[$table_index][$y] . ";";
|
||||
PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
|
||||
}
|
||||
}
|
||||
@ -829,6 +916,8 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
|
||||
* target table
|
||||
* @param array &$target_tables_keys field names which is key in the target table
|
||||
* @param int $matching_table_index number of the matching table
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
$matching_tables, &$source_columns, &$target_columns, &$alter_str_array,
|
||||
@ -836,12 +925,23 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
$matching_table_index
|
||||
) {
|
||||
//Gets column information for source and target table
|
||||
$source_columns[$matching_table_index] = PMA_DBI_get_columns_full($src_db, $matching_tables[$matching_table_index], null, $src_link);
|
||||
$target_columns[$matching_table_index] = PMA_DBI_get_columns_full($trg_db, $matching_tables[$matching_table_index], null, $trg_link);
|
||||
$source_columns[$matching_table_index] = PMA_DBI_get_columns_full(
|
||||
$src_db,
|
||||
$matching_tables[$matching_table_index],
|
||||
null,
|
||||
$src_link
|
||||
);
|
||||
$target_columns[$matching_table_index] = PMA_DBI_get_columns_full(
|
||||
$trg_db,
|
||||
$matching_tables[$matching_table_index],
|
||||
null,
|
||||
$trg_link
|
||||
);
|
||||
foreach ($source_columns[$matching_table_index] as $column_name => $each_column) {
|
||||
if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {
|
||||
//If column exists in target table then matches criteria like type, null, collation, key, default, comment of the column
|
||||
for ($i = 0; $i < sizeof($criteria); $i++) {
|
||||
//If column exists in target table then matches criteria like type,
|
||||
// null, collation, key, default, comment of the column
|
||||
for ($i = 0; $i < count($criteria); $i++) {
|
||||
if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {
|
||||
if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {
|
||||
$alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
|
||||
@ -907,7 +1007,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
|
||||
$criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,
|
||||
&$uncommon_tables_fields, $table_counter, $uncommon_cols, $display
|
||||
) {
|
||||
for ($i = 0; $i < sizeof($matching_tables_fields[$table_counter]); $i++) {
|
||||
for ($i = 0; $i < count($matching_tables_fields[$table_counter]); $i++) {
|
||||
if (isset($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]])) {
|
||||
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$table_counter]). " ADD COLUMN " .
|
||||
PMA_backquote($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]]) . " " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Type'];
|
||||
@ -927,7 +1027,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
|
||||
$query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
|
||||
}
|
||||
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
|
||||
$trg_key_size = sizeof($target_tables_keys[$table_counter]);
|
||||
$trg_key_size = count($target_tables_keys[$table_counter]);
|
||||
if ($trg_key_size) {
|
||||
$check = true;
|
||||
for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
|
||||
@ -940,9 +1040,9 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
}
|
||||
$query .= " , ADD PRIMARY KEY (";
|
||||
for ($t = 0; $t < sizeof($matching_tables_keys[$table_counter]); $t++) {
|
||||
for ($t = 0; $t < count($matching_tables_keys[$table_counter]); $t++) {
|
||||
$query .= PMA_backquote($matching_tables_keys[$table_counter][$t]);
|
||||
if ($t < (sizeof($matching_tables_keys[$table_counter]) - 1)) {
|
||||
if ($t < (count($matching_tables_keys[$table_counter]) - 1)) {
|
||||
$query .= " , " ;
|
||||
}
|
||||
}
|
||||
@ -955,15 +1055,16 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
PMA_DBI_try_query($query, $trg_link, 0);
|
||||
|
||||
//Checks if column to be added is a foreign key or not
|
||||
// Checks if column to be added is a foreign key or not
|
||||
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
|
||||
. $matching_tables[$table_counter] . "' AND COLUMN_NAME ='" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] .
|
||||
"' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
|
||||
|
||||
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
|
||||
|
||||
//If column is a foreign key then it is checked that referenced table exist in target db. If referenced table does not exist in target db then
|
||||
//it is created first.
|
||||
// If column is a foreign key then it is checked that referenced table
|
||||
// exist in target db. If referenced table does not exist in target
|
||||
// db then it is created first.
|
||||
if (isset($is_fk_result)) {
|
||||
if (in_array($is_fk_result[0]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
|
||||
$table_index = array_keys($uncommon_tables, $is_fk_result[0]['REFERENCED_TABLE_NAME']);
|
||||
@ -1004,8 +1105,8 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link,
|
||||
AND TABLE_NAME = '" . $referenced_table . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
|
||||
|
||||
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
|
||||
if (sizeof($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < sizeof($is_fk_result); $j++) {
|
||||
if (count($is_fk_result) > 0) {
|
||||
for ($j = 0; $j < count($is_fk_result); $j++) {
|
||||
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
|
||||
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
|
||||
PMA_checkForeignKeys(
|
||||
@ -1029,8 +1130,10 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link,
|
||||
* altered for the targert table
|
||||
* @param array $matching_tables_fields name of the fields for the matching table
|
||||
* @param array $criteria criteria
|
||||
* @param array &$matching_tables_keys field names which is key in the source table
|
||||
* @param array &$target_tables_keys field names which is key in the target table
|
||||
* @param array &$matching_tables_keys field names which is key in the source
|
||||
* table
|
||||
* @param array &$target_tables_keys field names which is key in the target
|
||||
* table
|
||||
* @param int $matching_table_index number of the matching table
|
||||
* @param bool $display whether to display query
|
||||
*
|
||||
@ -1045,7 +1148,7 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
|
||||
$found = false;
|
||||
|
||||
//Checks if the criteria to be altered is primary key
|
||||
for ($v = 0; $v < sizeof($matching_tables_fields[$matching_table_index]); $v++) {
|
||||
for ($v = 0; $v < count($matching_tables_fields[$matching_table_index]); $v++) {
|
||||
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$v]]['Key'])) {
|
||||
if ($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$v]]['Key'] == 'PRI' ) {
|
||||
$check = false;
|
||||
@ -1056,13 +1159,13 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
|
||||
$pri_query = null;
|
||||
if (! $check) {
|
||||
$pri_query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]);
|
||||
if (sizeof($target_tables_keys[$matching_table_index]) > 0) {
|
||||
if (count($target_tables_keys[$matching_table_index]) > 0) {
|
||||
$pri_query .= " DROP PRIMARY KEY ," ;
|
||||
}
|
||||
$pri_query .= " ADD PRIMARY KEY (";
|
||||
for ($z = 0; $z < sizeof($matching_tables_keys[$matching_table_index]); $z++) {
|
||||
for ($z = 0; $z < count($matching_tables_keys[$matching_table_index]); $z++) {
|
||||
$pri_query .= PMA_backquote($matching_tables_keys[$matching_table_index][$z]);
|
||||
if ($z < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
if ($z < (count($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
$pri_query .= " , " ;
|
||||
}
|
||||
}
|
||||
@ -1075,12 +1178,12 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
|
||||
}
|
||||
PMA_DBI_try_query($pri_query, $trg_link, 0);
|
||||
}
|
||||
for ($t = 0; $t < sizeof($matching_tables_fields[$matching_table_index]); $t++) {
|
||||
if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (sizeof($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
|
||||
for ($t = 0; $t < count($matching_tables_fields[$matching_table_index]); $t++) {
|
||||
if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (count($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
|
||||
PMA_backquote($matching_tables_fields[$matching_table_index][$t]) . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
|
||||
$found = false;
|
||||
for ($i = 0; $i < sizeof($criteria); $i++) {
|
||||
for ($i = 0; $i < count($criteria); $i++) {
|
||||
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]]) && $criteria[$i] != 'Key') {
|
||||
$found = true;
|
||||
if (($criteria[$i] == 'Type') && (! isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i+1]]))) {
|
||||
@ -1137,13 +1240,14 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
|
||||
}
|
||||
}
|
||||
$check = false;
|
||||
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]);
|
||||
for ($p = 0; $p < sizeof($matching_tables_keys[$matching_table_index]); $p++) {
|
||||
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.'
|
||||
. PMA_backquote($matching_tables[$matching_table_index]);
|
||||
for ($p = 0; $p < count($matching_tables_keys[$matching_table_index]); $p++) {
|
||||
if ((isset($alter_str_array[$matching_table_index][$matching_tables_keys[$matching_table_index][$p]]['Key']))) {
|
||||
$check = true;
|
||||
$query .= ' MODIFY ' . PMA_backquote($matching_tables_keys[$matching_table_index][$p]) . ' '
|
||||
. $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$p]]['Type'] . ' Not Null ';
|
||||
if ($p < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
if ($p < (count($matching_tables_keys[$matching_table_index]) - 1)) {
|
||||
$query .= ', ';
|
||||
}
|
||||
}
|
||||
@ -1163,8 +1267,10 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
|
||||
* @param string $trg_db name of target database
|
||||
* @param mixed $trg_link connection established with target server
|
||||
* @param array $matching_tables names of matching tables
|
||||
* @param array $uncommon_columns array containing the names of the column which are to be dropped from the target table
|
||||
* @param int $table_counter index of the matching table as in $matchiing_tables array
|
||||
* @param array $uncommon_columns array containing the names of the column which
|
||||
* are to be dropped from the target table
|
||||
* @param int $table_counter index of the matching table as in
|
||||
* $matchiing_tables array
|
||||
* @param bool $display whether to display query
|
||||
*
|
||||
* @return nothing
|
||||
@ -1173,15 +1279,16 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
|
||||
$uncommon_columns, $table_counter, $display
|
||||
) {
|
||||
if (isset($uncommon_columns[$table_counter])) {
|
||||
$drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
|
||||
for ($a = 0; $a < sizeof($uncommon_columns[$table_counter]); $a++) {
|
||||
$drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "."
|
||||
. PMA_backquote($matching_tables[$table_counter]);
|
||||
for ($a = 0; $a < count($uncommon_columns[$table_counter]); $a++) {
|
||||
//Checks if column to be removed is a foreign key in any table
|
||||
$pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
|
||||
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_counter]."' AND REFERENCED_COLUMN_NAME = '"
|
||||
. $uncommon_columns[$table_counter][$a] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
|
||||
|
||||
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
|
||||
$result_size = sizeof($pk_query_result);
|
||||
$result_size = count($pk_query_result);
|
||||
|
||||
if ($result_size > 0) {
|
||||
for ($b = 0; $b < $result_size; $b++) {
|
||||
@ -1196,11 +1303,11 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
|
||||
|
||||
$result = PMA_DBI_fetch_result($query, null, null, $trg_link);
|
||||
|
||||
if (sizeof($result) > 0) {
|
||||
if (count($result) > 0) {
|
||||
$drop_query .= " DROP FOREIGN KEY " . PMA_backquote($result[0]['CONSTRAINT_NAME']) . ",";
|
||||
}
|
||||
$drop_query .= " DROP COLUMN " . PMA_backquote($uncommon_columns[$table_counter][$a]);
|
||||
if ($a < (sizeof($uncommon_columns[$table_counter]) - 1)) {
|
||||
if ($a < (count($uncommon_columns[$table_counter]) - 1)) {
|
||||
$drop_query .= " , " ;
|
||||
}
|
||||
}
|
||||
@ -1214,9 +1321,11 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
|
||||
}
|
||||
|
||||
/**
|
||||
* PMA_indexesDiffInTables() compares the source table indexes with target table indexes and keep the indexes to be added in target table in $add_indexes_array
|
||||
* indexes to be altered in $alter_indexes_array and indexes to be removed from target table in $remove_indexes_array.
|
||||
* Only keyname and uniqueness characteristic of the indexes are altered.
|
||||
* PMA_indexesDiffInTables() compares the source table indexes with target
|
||||
* table indexes and keep the indexes to be added in target table in
|
||||
* $add_indexes_array indexes to be altered in $alter_indexes_array and indexes
|
||||
* to be removed from target table in $remove_indexes_array. Only keyname and
|
||||
* uniqueness characteristic of the indexes are altered.
|
||||
*
|
||||
* @param string $src_db name of source database
|
||||
* @param string $trg_db name of target database
|
||||
@ -1241,14 +1350,14 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
//Gets indexes information for source and target table
|
||||
$source_indexes[$table_counter] = PMA_DBI_get_table_indexes($src_db, $matching_tables[$table_counter], $src_link);
|
||||
$target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter], $trg_link);
|
||||
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
|
||||
for ($a = 0; $a < count($source_indexes[$table_counter]); $a++) {
|
||||
$found = false;
|
||||
$z = 0;
|
||||
//Compares key name and non_unique characteristic of source indexes with target indexes
|
||||
/*
|
||||
* @todo compare the length of each sub part
|
||||
*/
|
||||
while (($z <= sizeof($target_indexes[$table_counter])) && ($found == false)) {
|
||||
while (($z <= count($target_indexes[$table_counter])) && ($found == false)) {
|
||||
if (isset($source_indexes[$table_counter][$a]) && isset($target_indexes[$table_counter][$z]) && $source_indexes[$table_counter][$a]['Key_name'] == $target_indexes[$table_counter][$z]['Key_name']) {
|
||||
$found = true;
|
||||
if (($source_indexes[$table_counter][$a]['Column_name'] != $target_indexes[$table_counter][$z]['Column_name']) || ($source_indexes[$table_counter][$a]['Non_unique'] != $target_indexes[$table_counter][$z]['Non_unique'])) {
|
||||
@ -1267,10 +1376,10 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
}
|
||||
|
||||
//Finds indexes that exist on target table but not on source table
|
||||
for ($b = 0; $b < sizeof($target_indexes[$table_counter]); $b++) {
|
||||
for ($b = 0; $b < count($target_indexes[$table_counter]); $b++) {
|
||||
$found = false;
|
||||
$c = 0;
|
||||
while (($c <= sizeof($source_indexes[$table_counter])) && ($found == false)) {
|
||||
while (($c <= count($source_indexes[$table_counter])) && ($found == false)) {
|
||||
if ($target_indexes[$table_counter][$b]['Column_name'] == $source_indexes[$table_counter][$c]['Column_name']) {
|
||||
$found = true;
|
||||
}
|
||||
@ -1290,9 +1399,12 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
|
||||
* @param array $matching_tables matching tables name
|
||||
* @param array $source_indexes indexes of the source table
|
||||
* @param array $target_indexes indexes of the target table
|
||||
* @param array $add_indexes_array column names on which indexes are to be created in target table
|
||||
* @param array $alter_indexes_array column names for which indexes are to be altered
|
||||
* @param array $remove_indexes_array key name of the indexes which are to be removed from the target table
|
||||
* @param array $add_indexes_array column names on which indexes are to be
|
||||
* created in target table
|
||||
* @param array $alter_indexes_array column names for which indexes are to be
|
||||
* altered
|
||||
* @param array $remove_indexes_array key name of the indexes which are to be
|
||||
* removed from the target table
|
||||
* @param int $table_counter number of the matching table
|
||||
* @param bool $display whether to display query
|
||||
*
|
||||
@ -1305,9 +1417,9 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
|
||||
//Adds indexes on target table
|
||||
if (isset($add_indexes_array[$table_counter])) {
|
||||
$sql = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]) . " ADD" ;
|
||||
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
|
||||
for ($a = 0; $a < count($source_indexes[$table_counter]); $a++) {
|
||||
if (isset($add_indexes_array[$table_counter][$a])) {
|
||||
for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
|
||||
for ($b = 0; $b < count($source_indexes[$table_counter]); $b++) {
|
||||
if ($source_indexes[$table_counter][$b]['Column_name'] == $add_indexes_array[$table_counter][$a]) {
|
||||
if ($source_indexes[$table_counter][$b]['Non_unique'] == '0') {
|
||||
$sql .= " UNIQUE ";
|
||||
@ -1326,11 +1438,11 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
|
||||
|
||||
if (isset($alter_indexes_array[$table_counter])) {
|
||||
$query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
|
||||
for ($a = 0; $a < sizeof($alter_indexes_array[$table_counter]); $a++) {
|
||||
for ($a = 0; $a < count($alter_indexes_array[$table_counter]); $a++) {
|
||||
if (isset($alter_indexes_array[$table_counter][$a])) {
|
||||
$query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
|
||||
$got_first_index_column = false;
|
||||
for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
|
||||
for ($z = 0; $z < count($source_indexes[$table_counter]); $z++) {
|
||||
if ($source_indexes[$table_counter][$z]['Key_name'] == $alter_indexes_array[$table_counter][$a]) {
|
||||
if (! $got_first_index_column) {
|
||||
if ($source_indexes[$table_counter][$z]['Non_unique'] == '0') {
|
||||
@ -1356,11 +1468,11 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
|
||||
//Removes indexes from target table
|
||||
if (isset($remove_indexes_array[$table_counter])) {
|
||||
$drop_index_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
|
||||
for ($a = 0; $a < sizeof($target_indexes[$table_counter]); $a++) {
|
||||
for ($a = 0; $a < count($target_indexes[$table_counter]); $a++) {
|
||||
if (isset($remove_indexes_array[$table_counter][$a])) {
|
||||
$drop_index_query .= " DROP INDEX " . PMA_backquote($remove_indexes_array[$table_counter][$a]);
|
||||
}
|
||||
if ($a < (sizeof($remove_indexes_array[$table_counter]) - 1)) {
|
||||
if ($a < (count($remove_indexes_array[$table_counter]) - 1)) {
|
||||
$drop_index_query .= " , " ;
|
||||
}
|
||||
}
|
||||
@ -1402,19 +1514,23 @@ function PMA_syncDisplayHeaderCompare($src_db, $trg_db)
|
||||
|
||||
echo '<table class="data">';
|
||||
echo '<tr>';
|
||||
echo '<th>' . __('Source database') . ': ' . htmlspecialchars($src_db) . '<br />(';
|
||||
echo '<th>' . __('Source database') . ': '
|
||||
. htmlspecialchars($src_db) . '<br />(';
|
||||
if ('cur' == $_SESSION['src_type']) {
|
||||
echo __('Current server');
|
||||
} else {
|
||||
echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['src_server']['host']);
|
||||
echo __('Remote server') . ' '
|
||||
. htmlspecialchars($_SESSION['src_server']['host']);
|
||||
}
|
||||
echo ')</th>';
|
||||
echo '<th>' . __('Difference') . '</th>';
|
||||
echo '<th>' . __('Target database') . ': '. htmlspecialchars($trg_db) . '<br />(';
|
||||
echo '<th>' . __('Target database') . ': '
|
||||
. htmlspecialchars($trg_db) . '<br />(';
|
||||
if ('cur' == $_SESSION['trg_type']) {
|
||||
echo __('Current server');
|
||||
} else {
|
||||
echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['trg_server']['host']);
|
||||
echo __('Remote server') . ' '
|
||||
. htmlspecialchars($_SESSION['trg_server']['host']);
|
||||
}
|
||||
echo ')</th>';
|
||||
echo '</tr>';
|
||||
@ -1479,9 +1595,9 @@ function PMA_syncDisplayDataCompare($rows)
|
||||
function PMA_getColumnValues($database, $table, $column, $link = null)
|
||||
{
|
||||
$query = 'SELECT ';
|
||||
for ($i=0; $i< sizeof($column); $i++) {
|
||||
for ($i = 0; $i < count($column); $i++) {
|
||||
$query.= PMA_backquote($column[$i]);
|
||||
if ($i < (sizeof($column)-1)) {
|
||||
if ($i < (count($column)-1)) {
|
||||
$query.= ', ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -639,16 +639,12 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
. '"></option>';
|
||||
if (is_array($available_mime['transformation'])) {
|
||||
foreach ($available_mime['transformation'] as $mimekey => $transform) {
|
||||
$match = preg_match(
|
||||
'@' . preg_quote(
|
||||
$available_mime['transformation_file'][$mimekey]
|
||||
)
|
||||
. '3?@i',
|
||||
$mime_map[$row['Field']]['transformation']
|
||||
);
|
||||
$checked = isset($row['Field'])
|
||||
&& isset($mime_map[$row['Field']]['transformation'])
|
||||
&& $match
|
||||
&& preg_match(
|
||||
'@' . preg_quote($available_mime['transformation_file'][$mimekey]) . '3?@i',
|
||||
$mime_map[$row['Field']]['transformation']
|
||||
)
|
||||
? 'selected '
|
||||
: '';
|
||||
$tooltip = PMA_getTransformationDescription(
|
||||
|
||||
2
main.php
@ -19,7 +19,7 @@ if ($GLOBALS['PMA_Config']->isGitRevision()) {
|
||||
if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
|
||||
PMA_printGitRevision();
|
||||
}
|
||||
PMA_AddJSVar('is_git_revision', true);
|
||||
PMA_addJSVar('is_git_revision', true);
|
||||
}
|
||||
|
||||
// Handles some variables that may have been sent by the calling script
|
||||
|
||||
@ -79,64 +79,64 @@ echo $script_tabs . $script_contr . $script_display_field;
|
||||
<a href="#"
|
||||
onclick="Show_left_menu(document.getElementById('key_Show_left_menu')); return false" class="M_butt first" target="_self">
|
||||
<img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>"
|
||||
alt="v" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow2_m.png" /></a>
|
||||
alt="v" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" /></a>
|
||||
<a href="#" onclick="Save2(); return false"
|
||||
class="M_butt" target="_self"
|
||||
><img title="<?php echo __('Save position') ?>"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/save.png" alt=""
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" alt=""
|
||||
/></a><a href="#" onclick="Start_table_new(); return false"
|
||||
class="M_butt" target="_self"
|
||||
><img title="<?php echo __('Create table')?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/table.png" alt=""
|
||||
><img title="<?php echo __('Create table')?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" alt=""
|
||||
/></a><a href="#" onclick="Start_relation(); return false"
|
||||
class="M_butt" id="rel_button" target="_self"
|
||||
><img title="<?php echo __('Create relation') ?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/relation.png" alt=""
|
||||
><img title="<?php echo __('Create relation') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" alt=""
|
||||
/></a><a href="#" onclick="Start_display_field(); return false"
|
||||
class="M_butt" id="display_field_button" target="_self"
|
||||
><img title="<?php echo __('Choose column to display') ?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/display_field.png" alt=""
|
||||
><img title="<?php echo __('Choose column to display') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" alt=""
|
||||
/></a><a href="#" onclick="location.reload(); return false"
|
||||
class="M_butt" target="_self"
|
||||
><img title="<?php echo __('Reload'); ?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/reload.png" alt=""
|
||||
><img title="<?php echo __('Reload'); ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" alt=""
|
||||
/></a><a href="Documentation.html#faq6_31" target="documentation"
|
||||
class="M_butt" target="_self"
|
||||
><img title="<?php echo __('Help'); ?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/help.png" alt=""
|
||||
/></a><img class="M_bord" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt=""
|
||||
><img title="<?php echo __('Help'); ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" alt=""
|
||||
/></a><img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt=""
|
||||
/><a href="#" onclick="Angular_direct(); return false"
|
||||
class="M_butt" id="angular_direct_button" target="_self"
|
||||
><img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/ang_direct.png" alt=""
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" alt=""
|
||||
/></a><a href="#" onclick="Grid(); return false"
|
||||
class="M_butt" id="grid_button" target="_self"
|
||||
><img title="<?php echo __('Snap to grid') ?>" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/grid.png" alt=""
|
||||
/></a><img class="M_bord" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt=""
|
||||
><img title="<?php echo __('Snap to grid') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt=""
|
||||
/></a><img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt=""
|
||||
/><a href="#"
|
||||
onclick="Small_tab_all(document.getElementById('key_SB_all')); return false" class="M_butt" target="_self"
|
||||
><img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow1.png"
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>"
|
||||
/></a>
|
||||
<a href="#" onclick="Small_tab_invert(); return false" class="M_butt" target="_self" >
|
||||
<img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bottom.png" />
|
||||
<img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
|
||||
</a>
|
||||
<a href="#" onclick="Relation_lines_invert(); return false" class="M_butt" target="_self" >
|
||||
<img title="<?php echo __('Toggle relation lines'); ?>" alt="key" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/toggle_lines.png" />
|
||||
<img title="<?php echo __('Toggle relation lines'); ?>" alt="key" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
|
||||
</a>
|
||||
<img class="M_bord" src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/bord.png" alt="" />
|
||||
<img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
|
||||
<a href="#" onclick="PDF_save(); return false"
|
||||
class="M_butt" target="_self"
|
||||
><img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/pdf.png" alt="key" width="20" height="20"
|
||||
><img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt="key" width="20" height="20"
|
||||
title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a
|
||||
>
|
||||
<?php
|
||||
if (isset($_REQUEST['query'])) {
|
||||
echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
|
||||
class="M_butt" target="_self">';
|
||||
echo '<img src="'. $GLOBALS['pmaThemeImage'] . 'pmd/query_builder.png" alt="key" width="20" height="20" title="';
|
||||
echo '<img src="'. $_SESSION['PMA_Theme']->getImgPath('pmd/query_builder.png') . '" alt="key" width="20" height="20" title="';
|
||||
echo __('Build Query');
|
||||
echo '"/></a>';
|
||||
}
|
||||
?>
|
||||
<a href="#"
|
||||
onclick="Top_menu_right(document.getElementById('key_Left_Right')); return false" class="M_butt last" target="_self">
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/2rightarrow_m.png" id="key_Left_Right" alt=">"
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>" id="key_Left_Right" alt=">"
|
||||
title="<?php echo __('Move Menu'); ?>" /></a>
|
||||
</div>
|
||||
|
||||
@ -149,11 +149,11 @@ if (isset($_REQUEST['query'])) {
|
||||
<a href="#"
|
||||
onclick="Hide_tab_all(document.getElementById('key_HS_all')); return false" class="M_butt" target="_self">
|
||||
<img title="<?php echo __('Hide/Show all'); ?>" alt="v"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow1.png" id='key_HS_all' /></a>
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" id='key_HS_all' /></a>
|
||||
<a href="#"
|
||||
onclick="No_have_constr(document.getElementById('key_HS')); return false" class="M_butt" target="_self">
|
||||
<img title="<?php echo __('Hide/Show Tables with no relation'); ?>" alt="v"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/downarrow2.png" id='key_HS' /></a>
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>" id='key_HS' /></a>
|
||||
</div>
|
||||
|
||||
<div id="id_scroll_tab" class="scroll_tab">
|
||||
@ -166,7 +166,7 @@ for ($i = 0; $i < $name_cnt; $i++) {
|
||||
onmouseover="this.className='L_butt2_2'"
|
||||
onmouseout="this.className='L_butt2_1'">
|
||||
<img onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"
|
||||
src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/exec.png" alt="" /></td>
|
||||
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png'); ?>" alt="" /></td>
|
||||
<td width="1px">
|
||||
<input onclick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')"
|
||||
title="<?php echo __('Hide'); ?>"
|
||||
@ -247,7 +247,7 @@ if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
|
||||
<td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
|
||||
onmouseout="this.className='small_tab_pref';"
|
||||
onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/exec_small.png" alt="" /></td>
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" alt="" /></td>
|
||||
<td id="id_zag_<?php echo $t_n_url ?>" class="tab_zag nowrap"
|
||||
onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
|
||||
onmouseover="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
|
||||
@ -349,7 +349,7 @@ for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
|
||||
echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
|
||||
echo 'onmouseout="this.className=\'small_tab_pref\';"';
|
||||
echo 'onclick="Click_option(\'pmd_optionse\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\',\''.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
|
||||
echo '<img src="' . $GLOBALS['pmaThemeImage'] . 'pmd/exec_small.png" title="options" alt="" /></td> ';
|
||||
echo '<img src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png') . '" title="options" alt="" /></td> ';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
@ -852,10 +852,10 @@ if (! empty($_REQUEST['query'])) {
|
||||
|
||||
|
||||
<!-- cache images -->
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/2leftarrow_m.png" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/rightarrow1.png" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/rightarrow2.png" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $GLOBALS['pmaThemeImage'] ?>pmd/uparrow2_m.png" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2leftarrow_m.png'); ?>" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png'); ?>" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png'); ?>" width="0" height="0" alt="" />
|
||||
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png'); ?>" width="0" height="0" alt="" />
|
||||
<div id="PMA_disable_floating_menubar"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -732,36 +732,36 @@ $server_db_isLocal = strtolower($cfg['Server']['host']) == 'localhost'
|
||||
|| $cfg['Server']['host'] == '127.0.0.1'
|
||||
|| $cfg['Server']['host'] == '::1';
|
||||
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'pma_token',
|
||||
$_SESSION[' PMA_token ']
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'url_query',
|
||||
str_replace('&', '&', PMA_generate_common_url($db))
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'server_time_diff',
|
||||
'new Date().getTime() - ' . (microtime(true) * 1000),
|
||||
false
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'server_os',
|
||||
PHP_OS
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'is_superuser',
|
||||
PMA_isSuperuser()
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'server_db_isLocal',
|
||||
$server_db_isLocal
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'profiling_docu',
|
||||
PMA_showMySQLDocu('general-thread-states', 'general-thread-states')
|
||||
);
|
||||
PMA_AddJSVar(
|
||||
PMA_addJSVar(
|
||||
'explain_docu',
|
||||
PMA_showMySQLDocu('explain-output', 'explain-output')
|
||||
);
|
||||
|
||||
@ -9,9 +9,9 @@ require_once 'libraries/common.inc.php';
|
||||
|
||||
$GLOBALS['js_include'][] = 'server_variables.js';
|
||||
|
||||
PMA_AddJSVar('pma_token', $_SESSION[' PMA_token ']);
|
||||
PMA_AddJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db)));
|
||||
PMA_AddJSVar('is_superuser', PMA_isSuperuser() ? true : false);
|
||||
PMA_addJSVar('pma_token', $_SESSION[' PMA_token ']);
|
||||
PMA_addJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db)));
|
||||
PMA_addJSVar('is_superuser', PMA_isSuperuser() ? true : false);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Print view for table
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
@ -68,7 +69,8 @@ if ($multi_tables) {
|
||||
$tbl_list .= (empty($tbl_list) ? '' : ', ')
|
||||
. PMA_backquote($table);
|
||||
}
|
||||
echo '<strong>'. __('Showing tables') . ': ' . htmlspecialchars($tbl_list) . '</strong>' . "\n";
|
||||
echo '<strong>'. __('Showing tables') . ': '
|
||||
. htmlspecialchars($tbl_list) . '</strong>' . "\n";
|
||||
echo '<hr />' . "\n";
|
||||
} // end if
|
||||
|
||||
@ -121,7 +123,8 @@ foreach ($the_tables as $key => $table) {
|
||||
* Displays the comments of the table if MySQL >= 3.23
|
||||
*/
|
||||
if (!empty($show_comment)) {
|
||||
echo __('Table comments') . ': ' . htmlspecialchars($show_comment) . '<br /><br />';
|
||||
echo __('Table comments') . ': '
|
||||
. htmlspecialchars($show_comment) . '<br /><br />';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,7 +176,10 @@ foreach ($the_tables as $key => $table) {
|
||||
* but based on SHOW CREATE TABLE because information_schema
|
||||
* cannot be trusted in this case (MySQL bug)
|
||||
*/
|
||||
if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']) {
|
||||
if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type'])
|
||||
&& $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP'
|
||||
&& $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']
|
||||
) {
|
||||
$row['Null'] = '';
|
||||
}
|
||||
|
||||
@ -187,19 +193,21 @@ foreach ($the_tables as $key => $table) {
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||
<td><?php
|
||||
echo (($row['Null'] == '' || $row['Null'] == 'NO')
|
||||
? __('No')
|
||||
: __('Yes')); ?> </td>
|
||||
<td><?php
|
||||
echo (($row['Null'] == '' || $row['Null'] == 'NO')
|
||||
? __('No')
|
||||
: __('Yes')); ?> </td>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($row['Default'])) {
|
||||
echo $row['Default'];
|
||||
} ?> </td>
|
||||
}
|
||||
?> </td>
|
||||
<?php
|
||||
if ($have_rel) {
|
||||
echo ' <td>';
|
||||
if (isset($res_rel[$field_name])) {
|
||||
echo htmlspecialchars($res_rel[$field_name]['foreign_table']
|
||||
echo htmlspecialchars($res_rel[$field_name]['foreign_table']
|
||||
. ' -> ' . $res_rel[$field_name]['foreign_field']);
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
@ -215,7 +223,7 @@ foreach ($the_tables as $key => $table) {
|
||||
|
||||
echo ' <td>';
|
||||
if (isset($mime_map[$field_name])) {
|
||||
echo htmlspecialchars(str_replace('_', '/',
|
||||
echo htmlspecialchars(str_replace('_', '/',
|
||||
$mime_map[$field_name]['mimetype']));
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
@ -240,7 +248,7 @@ foreach ($the_tables as $key => $table) {
|
||||
*/
|
||||
if ($cfg['ShowStats']) {
|
||||
$nonisam = false;
|
||||
if (isset($showtable['Type'])
|
||||
if (isset($showtable['Type'])
|
||||
&& !preg_match('@ISAM|HEAP@i', $showtable['Type'])) {
|
||||
$nonisam = true;
|
||||
}
|
||||
@ -249,34 +257,34 @@ foreach ($the_tables as $key => $table) {
|
||||
|
||||
$mergetable = PMA_Table::isMerge($db, $table);
|
||||
|
||||
list($data_size, $data_unit)
|
||||
list($data_size, $data_unit)
|
||||
= PMA_formatByteDown($showtable['Data_length']);
|
||||
if ($mergetable == false) {
|
||||
list($index_size, $index_unit)
|
||||
list($index_size, $index_unit)
|
||||
= PMA_formatByteDown($showtable['Index_length']);
|
||||
}
|
||||
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
|
||||
list($free_size, $free_unit)
|
||||
list($free_size, $free_unit)
|
||||
= PMA_formatByteDown($showtable['Data_free']);
|
||||
list($effect_size, $effect_unit)
|
||||
list($effect_size, $effect_unit)
|
||||
= PMA_formatByteDown(
|
||||
$showtable['Data_length']
|
||||
+ $showtable['Index_length']
|
||||
$showtable['Data_length']
|
||||
+ $showtable['Index_length']
|
||||
- $showtable['Data_free']);
|
||||
} else {
|
||||
unset($free_size);
|
||||
unset($free_unit);
|
||||
list($effect_size, $effect_unit)
|
||||
= PMA_formatByteDown($showtable['Data_length']
|
||||
list($effect_size, $effect_unit)
|
||||
= PMA_formatByteDown($showtable['Data_length']
|
||||
+ $showtable['Index_length']);
|
||||
}
|
||||
list($tot_size, $tot_unit)
|
||||
= PMA_formatByteDown($showtable['Data_length']
|
||||
list($tot_size, $tot_unit)
|
||||
= PMA_formatByteDown($showtable['Data_length']
|
||||
+ $showtable['Index_length']);
|
||||
if ($num_rows > 0) {
|
||||
list($avg_size, $avg_unit)
|
||||
= PMA_formatByteDown(($showtable['Data_length']
|
||||
+ $showtable['Index_length'])
|
||||
list($avg_size, $avg_unit)
|
||||
= PMA_formatByteDown(($showtable['Data_length']
|
||||
+ $showtable['Index_length'])
|
||||
/ $showtable['Rows'], 6, 1);
|
||||
}
|
||||
|
||||
@ -380,21 +388,23 @@ foreach ($the_tables as $key => $table) {
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (isset($showtable['Avg_row_length'])
|
||||
&& $showtable['Avg_row_length'] > 0) {
|
||||
if (isset($showtable['Avg_row_length'])
|
||||
&& $showtable['Avg_row_length'] > 0
|
||||
) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo __('Row length'); ?> ø</td>
|
||||
<td>
|
||||
<?php echo PMA_formatNumber($showtable['Avg_row_length'], 0)
|
||||
<?php echo PMA_formatNumber($showtable['Avg_row_length'], 0)
|
||||
. "\n"; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (isset($showtable['Data_length'])
|
||||
if (isset($showtable['Data_length'])
|
||||
&& $showtable['Rows'] > 0
|
||||
&& $mergetable == false) {
|
||||
&& $mergetable == false
|
||||
) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo __('Row size'); ?> ø</td>
|
||||
@ -409,8 +419,9 @@ foreach ($the_tables as $key => $table) {
|
||||
<tr>
|
||||
<td><?php echo __('Next autoindex'); ?></td>
|
||||
<td class="right">
|
||||
<?php echo PMA_formatNumber($showtable['Auto_increment'], 0)
|
||||
. "\n"; ?>
|
||||
<?php
|
||||
echo PMA_formatNumber($showtable['Auto_increment'], 0);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@ -420,8 +431,9 @@ foreach ($the_tables as $key => $table) {
|
||||
<tr>
|
||||
<td><?php echo __('Creation'); ?></td>
|
||||
<td class="right">
|
||||
<?php echo PMA_localisedDate(strtotime(
|
||||
$showtable['Create_time'])) . "\n"; ?>
|
||||
<?php
|
||||
echo PMA_localisedDate(strtotime($showtable['Create_time']));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@ -431,8 +443,9 @@ foreach ($the_tables as $key => $table) {
|
||||
<tr>
|
||||
<td><?php echo __('Last update'); ?></td>
|
||||
<td class="right">
|
||||
<?php echo PMA_localisedDate(strtotime(
|
||||
$showtable['Update_time'])) . "\n"; ?>
|
||||
<?php
|
||||
echo PMA_localisedDate(strtotime($showtable['Update_time']));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@ -442,8 +455,9 @@ foreach ($the_tables as $key => $table) {
|
||||
<tr>
|
||||
<td><?php echo __('Last check'); ?></td>
|
||||
<td class="right">
|
||||
<?php echo PMA_localisedDate(strtotime(
|
||||
$showtable['Check_time'])) . "\n"; ?>
|
||||
<?php
|
||||
echo PMA_localisedDate(strtotime($showtable['Check_time']));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
|
Before Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 702 B |
|
Before Width: | Height: | Size: 666 B |
|
Before Width: | Height: | Size: 737 B |
|
Before Width: | Height: | Size: 699 B |
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 98 B |
|
Before Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 275 B |
|
Before Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 145 B |
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 108 B |
|
Before Width: | Height: | Size: 792 B |
|
Before Width: | Height: | Size: 679 B |
|
Before Width: | Height: | Size: 87 B |
|
Before Width: | Height: | Size: 734 B |
|
Before Width: | Height: | Size: 670 B |
|
Before Width: | Height: | Size: 685 B |
|
Before Width: | Height: | Size: 758 B |
|
Before Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 711 B |
|
Before Width: | Height: | Size: 796 B |
|
Before Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 688 B |
|
Before Width: | Height: | Size: 714 B |
|
Before Width: | Height: | Size: 920 B |
|
Before Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 1004 B |
|
Before Width: | Height: | Size: 611 B |
|
Before Width: | Height: | Size: 905 B |
|
Before Width: | Height: | Size: 969 B |
|
Before Width: | Height: | Size: 685 B |
|
Before Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 746 B |
|
Before Width: | Height: | Size: 757 B |
|
Before Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 163 B |
|
Before Width: | Height: | Size: 630 B |
|
Before Width: | Height: | Size: 173 B |
|
Before Width: | Height: | Size: 729 B |
@ -44,7 +44,7 @@ canvas.pmd * {
|
||||
}
|
||||
|
||||
.tab_zag {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header.png'); ?>);
|
||||
background-repeat: repeat-x;
|
||||
text-align: center;
|
||||
cursor: move;
|
||||
@ -53,7 +53,7 @@ canvas.pmd * {
|
||||
}
|
||||
|
||||
.tab_zag_2 {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header_Linked.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header_Linked.png'); ?>);
|
||||
background-repeat: repeat-x;
|
||||
text-align: center;
|
||||
cursor: move;
|
||||
@ -108,7 +108,7 @@ canvas.pmd * {
|
||||
margin-left: 2px;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/left_panel_butt.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/left_panel_butt.png'); ?>);
|
||||
border: #ccc solid 1px;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ canvas.pmd * {
|
||||
cursor: default;
|
||||
width: 1px;
|
||||
color: #000;
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header.png'); ?>);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ canvas.pmd * {
|
||||
vertical-align: top;
|
||||
background-color: #0064ea;
|
||||
color: #fff;
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/small_tab.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/small_tab.png'); ?>);
|
||||
cursor: default;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
@ -174,7 +174,7 @@ canvas.pmd * {
|
||||
}
|
||||
|
||||
.small_tab_pref {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header.png'); ?>);
|
||||
background-repeat: repeat-x;
|
||||
text-align: center;
|
||||
width: 1px;
|
||||
@ -226,35 +226,35 @@ canvas.pmd * {
|
||||
}
|
||||
|
||||
.frams1 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/1.png) no-repeat right bottom;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/1.png'); ?>) no-repeat right bottom;
|
||||
}
|
||||
|
||||
.frams2 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/2.png) no-repeat left bottom;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2.png'); ?>) no-repeat left bottom;
|
||||
}
|
||||
|
||||
.frams3 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/3.png) no-repeat left top;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/3.png'); ?>) no-repeat left top;
|
||||
}
|
||||
|
||||
.frams4 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/4.png) no-repeat right top;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/4.png'); ?>) no-repeat right top;
|
||||
}
|
||||
|
||||
.frams5 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/5.png) repeat-x center bottom;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/5.png'); ?>) repeat-x center bottom;
|
||||
}
|
||||
|
||||
.frams6 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/6.png) repeat-y left;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/6.png'); ?>) repeat-y left;
|
||||
}
|
||||
|
||||
.frams7 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/7.png) repeat-x top;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/7.png'); ?>) repeat-x top;
|
||||
}
|
||||
|
||||
.frams8 {
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/8.png) repeat-y right;
|
||||
background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/8.png'); ?>) repeat-y right;
|
||||
}
|
||||
|
||||
#osn_tab {
|
||||
@ -270,7 +270,7 @@ canvas.pmd * {
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/top_panel.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/top_panel.png'); ?>);
|
||||
background-position: top;
|
||||
background-repeat: repeat-x;
|
||||
border-right: #999 solid 1px;
|
||||
@ -349,7 +349,7 @@ a.M_butt:hover {
|
||||
}
|
||||
|
||||
#layer_menu_sizer {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/resize.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/resize.png'); ?>);
|
||||
cursor: nw-resize;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
@ -375,7 +375,7 @@ a.trigger {
|
||||
top: 60px; right: 0;
|
||||
color: #fff;
|
||||
padding: 10px 40px 10px 15px;
|
||||
background: #333 url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/plus.png) 85% 55% no-repeat;
|
||||
background: #333 url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/plus.png'); ?>) 85% 55% no-repeat;
|
||||
border: 1px solid #444;
|
||||
display: block;
|
||||
}
|
||||
@ -386,18 +386,18 @@ a.trigger:hover {
|
||||
top: 60px; right: 0;
|
||||
color: #080808;
|
||||
padding: 10px 40px 10px 15px;
|
||||
background: #fff696 url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/plus.png) 85% 55% no-repeat;
|
||||
background: #fff696 url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/plus.png'); ?>) 85% 55% no-repeat;
|
||||
border: 1px solid #999;
|
||||
display: block;
|
||||
}
|
||||
|
||||
a.active.trigger {
|
||||
background: #222 url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/minus.png) 85% 55% no-repeat;
|
||||
background: #222 url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/minus.png'); ?>) 85% 55% no-repeat;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
a.active.trigger:hover {
|
||||
background: #fff696 url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/minus.png) 85% 55% no-repeat;
|
||||
background: #fff696 url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/minus.png'); ?>) 85% 55% no-repeat;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ h2.tiger {
|
||||
}
|
||||
|
||||
h2.tiger a {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header.png'); ?>);
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color : #333;
|
||||
@ -423,11 +423,11 @@ h2.tiger a {
|
||||
|
||||
h2.tiger a:hover {
|
||||
color: #000;
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header_Linked.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header_Linked.png'); ?>);
|
||||
}
|
||||
|
||||
h2.active {
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Header.png);
|
||||
background-image: url(<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/Header.png'); ?>);
|
||||
background-repeat: repeat-x;
|
||||
padding: 1px;
|
||||
background-position: left bottom;
|
||||
|
||||