From 9f4dc046919871544b5fa4503d78d11c04049d23 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 5 Nov 2010 06:30:21 -0400 Subject: [PATCH] no need to have a separate file for this --- db_structure.php | 2 +- libraries/build_action_titles.inc.php | 25 ------------------------- libraries/common.lib.php | 23 +++++++++++++++++++++++ tbl_create.php | 2 +- 4 files changed, 25 insertions(+), 27 deletions(-) delete mode 100644 libraries/build_action_titles.inc.php diff --git a/db_structure.php b/db_structure.php index c4a55179d..d5c960de8 100644 --- a/db_structure.php +++ b/db_structure.php @@ -52,7 +52,7 @@ $db_collation = PMA_getDbCollation($db); // in a separate file to avoid redeclaration of functions in some code paths require_once './libraries/db_structure.lib.php'; -require_once './libraries/build_action_titles.inc.php'; +$titles = PMA_buildActionTitles(); // 1. No tables if ($num_tables == 0) { diff --git a/libraries/build_action_titles.inc.php b/libraries/build_action_titles.inc.php deleted file mode 100644 index fe9dd5ffa..000000000 --- a/libraries/build_action_titles.inc.php +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/libraries/common.lib.php b/libraries/common.lib.php index e91eab163..ec5100f45 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2990,4 +2990,27 @@ function PMA_selectUploadFile($import_list, $uploaddir) { echo 'There are no files to upload'; } } + +/** + * Build titles and icons for action links + * + * @return array the action titles + * @uses PMA_getIcon() + */ +function PMA_buildActionTitles() { + $titles = array(); + + $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'), true); + $titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'), true); + $titles['Search'] = PMA_getIcon('b_select.png', __('Search'), true); + $titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'), true); + $titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'), true); + $titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'), true); + $titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'), true); + $titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true); + $titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'), true); + $titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'), true); + $titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'), true); + return $titles; +} ?> diff --git a/tbl_create.php b/tbl_create.php index 807755018..4ba641e41 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -38,7 +38,7 @@ require_once './libraries/common.inc.php'; $action = 'tbl_create.php'; require_once './libraries/header.inc.php'; -require_once './libraries/build_action_titles.inc.php'; +$titles = PMA_buildActionTitles(); // Check parameters PMA_checkParameters(array('db'));