diff --git a/htdocs/sql/libraries/header.inc.php b/htdocs/sql/libraries/header.inc.php new file mode 100755 --- /dev/null +++ b/htdocs/sql/libraries/header.inc.php @@ -0,0 +1,293 @@ + + + + + + + // js form validation stuff + var jsHostEmpty = ''; + var jsUserEmpty = ''; + var jsPasswordEmpty = ''; + var jsPasswordNotSame = ''; + // ]]> + + + + // js form validation stuff + var jsHostEmpty = ''; + var jsUserEmpty = ''; + var jsPasswordEmpty = ''; + var jsPasswordNotSame = ''; + // ]]> + + + + + // js index validation stuff + var errorMsg0 = ''; + var errorMsg1 = ''; + // ]]> + + + + // ]]> + + + + // ]]> + + + + + + + + + +
+ ' . $GLOBALS['strCookiesRequired'] . '' . "\n"; + } + + if (!defined('PMA_DISPLAY_HEADING')) { + define('PMA_DISPLAY_HEADING', 1); + } + + /** + * Display heading if needed. Design can be set in css file. + */ + + if (PMA_DISPLAY_HEADING) { + $server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) + ? $GLOBALS['cfg']['Server']['verbose'] + : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port']) + ? '' + : ':' . $GLOBALS['cfg']['Server']['port'] + ) + ); + $item = ''; + if ($GLOBALS['cfg']['NavigationBarIconic']) { + $separator = ' -' . "\n"; + $item .= ' ' . "\n"; + } else { + $separator = ' - ' . "\n"; + } + + if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) { + $item .= '%4$s: '; + } + $item .= '%3$s' . "\n"; + + echo '
' . "\n"; + printf($item, + $GLOBALS['cfg']['DefaultTabServer'], + PMA_generate_common_url(), + htmlspecialchars($server_info), + $GLOBALS['strServer'], + 's_host.png'); + + if (strlen($GLOBALS['db'])) { + + echo $separator; + printf($item, + $GLOBALS['cfg']['DefaultTabDatabase'], + PMA_generate_common_url($GLOBALS['db']), + htmlspecialchars($GLOBALS['db']), + $GLOBALS['strDatabase'], + 's_db.png'); + + if (strlen($GLOBALS['table'])) { + require_once './libraries/tbl_info.inc.php'; + + echo $separator; + printf($item, + $GLOBALS['cfg']['DefaultTabTable'], + PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']), + str_replace(' ', ' ', htmlspecialchars($GLOBALS['table'])), + (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']), + (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png'); + + /** + * Displays table comment + * @uses $show_comment from libraries/tbl_info.inc.php + * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php + */ + if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) { + if (strstr($show_comment, '; InnoDB free')) { + $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment); + } + echo '' + .'"' . htmlspecialchars($show_comment) + .'"' . "\n"; + } // end if + } else { + // no table selected, display database comment if present + /** + * Settings for relations stuff + */ + require_once './libraries/relation.lib.php'; + $cfgRelation = PMA_getRelationsParam(); + + // Get additional information about tables for tooltip is done + // in libraries/db_info.inc.php only once + if ($cfgRelation['commwork']) { + $comment = PMA_getComments($GLOBALS['db']); + + /** + * Displays table comment + */ + if (is_array($comment) && ! empty($comment)) { + echo '"' + .htmlspecialchars(implode(' ', $comment)) + .'"' . "\n"; + } // end if + } + } + } + echo '
'; + + } + /** + * Sets a variable to remember headers have been sent + */ + $GLOBALS['is_header_sent'] = true; +} +?>