When selecting from navigation, show only the procedures of corresponding type
This commit is contained in:
parent
3465535883
commit
673e503d7c
@ -27,9 +27,11 @@ class Node_Function_Container extends Node
|
||||
$this->icon = PMA_Util::getImage('b_routines.png');
|
||||
$this->links = array(
|
||||
'text' => 'db_routines.php?server=' . $GLOBALS['server']
|
||||
. '&db=%1$s&token=' . $GLOBALS['token'],
|
||||
. '&db=%1$s&token=' . $GLOBALS['token']
|
||||
. '&type=FUNCTION',
|
||||
'icon' => 'db_routines.php?server=' . $GLOBALS['server']
|
||||
. '&db=%1$s&token=' . $GLOBALS['token'],
|
||||
. '&db=%1$s&token=' . $GLOBALS['token']
|
||||
. '&type=FUNCTION',
|
||||
);
|
||||
$this->real_name = 'functions';
|
||||
|
||||
|
||||
@ -27,9 +27,11 @@ class Node_Procedure_Container extends Node
|
||||
$this->icon = PMA_Util::getImage('b_routines.png');
|
||||
$this->links = array(
|
||||
'text' => 'db_routines.php?server=' . $GLOBALS['server']
|
||||
. '&db=%1$s&token=' . $GLOBALS['token'],
|
||||
. '&db=%1$s&token=' . $GLOBALS['token']
|
||||
. '&type=PROCEDURE',
|
||||
'icon' => 'db_routines.php?server=' . $GLOBALS['server']
|
||||
. '&db=%1$s&token=' . $GLOBALS['token'],
|
||||
. '&db=%1$s&token=' . $GLOBALS['token']
|
||||
. '&type=PROCEDURE',
|
||||
);
|
||||
$this->real_name = 'procedures';
|
||||
|
||||
|
||||
@ -79,7 +79,11 @@ $errors = array();
|
||||
*/
|
||||
switch ($_PMA_RTE) {
|
||||
case 'RTN':
|
||||
PMA_RTN_main();
|
||||
$type = null;
|
||||
if (isset($_REQUEST['type'])) {
|
||||
$type = $_REQUEST['type'];
|
||||
}
|
||||
PMA_RTN_main($type);
|
||||
break;
|
||||
case 'TRI':
|
||||
PMA_TRI_main();
|
||||
|
||||
@ -33,9 +33,13 @@ function PMA_RTN_setGlobals()
|
||||
/**
|
||||
* Main function for the routines functionality
|
||||
*
|
||||
* @param string $type 'FUNCTION' for functions,
|
||||
* 'PROCEDURE' for procedures,
|
||||
* null for both
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_RTN_main()
|
||||
function PMA_RTN_main($type)
|
||||
{
|
||||
global $db;
|
||||
|
||||
@ -52,6 +56,9 @@ function PMA_RTN_main()
|
||||
$columns = "`SPECIFIC_NAME`, `ROUTINE_NAME`, `ROUTINE_TYPE`, ";
|
||||
$columns .= "`DTD_IDENTIFIER`, `ROUTINE_DEFINITION`";
|
||||
$where = "ROUTINE_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "'";
|
||||
if (PMA_isValid($type, array('FUNCTION','PROCEDURE'))) {
|
||||
$where .= " AND `ROUTINE_TYPE`='" . $type . "'";
|
||||
}
|
||||
$items = $GLOBALS['dbi']->fetchResult(
|
||||
"SELECT $columns FROM `INFORMATION_SCHEMA`.`ROUTINES` WHERE $where;"
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user