diff options
author | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-17 16:17:02 +0000 |
---|---|---|
committer | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-22 10:39:41 +0000 |
commit | 28fd7cd5c4f08ada01b178d6246767044676e460 (patch) | |
tree | 32328371c43832c43e71eaec1a2740a508adb795 | |
parent | 0a65e361debfc9812759365ffb5e753bf1c90e42 (diff) |
Give environnments vars to the navlink hook
Helpful to decide when to add a navlink or not depending on the context
-rw-r--r-- | aggregates.php | 4 | ||||
-rw-r--r-- | all_db.php | 2 | ||||
-rw-r--r-- | classes/Misc.php | 28 | ||||
-rw-r--r-- | colproperties.php | 2 | ||||
-rw-r--r-- | constraints.php | 2 | ||||
-rw-r--r-- | display.php | 2 | ||||
-rw-r--r-- | fulltext.php | 6 | ||||
-rw-r--r-- | functions.php | 4 | ||||
-rw-r--r-- | groups.php | 4 | ||||
-rw-r--r-- | history.php | 2 | ||||
-rw-r--r-- | indexes.php | 2 | ||||
-rw-r--r-- | privileges.php | 2 | ||||
-rw-r--r-- | roles.php | 6 | ||||
-rw-r--r-- | rules.php | 2 | ||||
-rwxr-xr-x | schemas.php | 2 | ||||
-rw-r--r-- | sequences.php | 4 | ||||
-rw-r--r-- | sql.php | 2 | ||||
-rw-r--r-- | tables.php | 2 | ||||
-rwxr-xr-x | tablespaces.php | 2 | ||||
-rw-r--r-- | tblproperties.php | 5 | ||||
-rw-r--r-- | triggers.php | 2 | ||||
-rw-r--r-- | types.php | 4 | ||||
-rw-r--r-- | users.php | 4 | ||||
-rwxr-xr-x | viewproperties.php | 4 | ||||
-rw-r--r-- | views.php | 2 |
25 files changed, 53 insertions, 48 deletions
diff --git a/aggregates.php b/aggregates.php index de61e728..5356e02c 100644 --- a/aggregates.php +++ b/aggregates.php @@ -297,7 +297,7 @@ 'content' => $lang['strdrop'] ); - $misc->printNavLinks($navlinks, 'aggregates-properties'); + $misc->printNavLinks($navlinks, 'aggregates-properties', get_defined_vars()); } @@ -390,7 +390,7 @@ 'content' => $lang['strcreateaggregate'] ) ); - $misc->printNavLinks($navlinks, 'aggregates-aggregates'); + $misc->printNavLinks($navlinks, 'aggregates-aggregates', get_defined_vars()); } /** @@ -461,7 +461,7 @@ 'content' => $lang['strcreatedatabase'] ) ); - $misc->printNavLinks($navlinks, 'all_db-databases'); + $misc->printNavLinks($navlinks, 'all_db-databases', get_defined_vars()); } function doTree() { diff --git a/classes/Misc.php b/classes/Misc.php index 504e7f26..af77676e 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -50,7 +50,6 @@ } function getSubjectParams($subject) { - $vars = array(); switch($subject) { @@ -172,16 +171,16 @@ 'column' => $_REQUEST['column'] )); break; - // case 'plugin': - // $vars = array('params' => array( - // 'server' => $_REQUEST['server'], - // 'subject' => 'plugin', - // 'plugin' => $_REQUEST['plugin'], - // 'database' => $_REQUEST['database'], - // 'schema' => $_REQUEST['schema'], - // 'action' => $_REQUEST['action'] - // )); - // break; + // case 'plugin': + // $vars = array('params' => array( + // 'server' => $_REQUEST['server'], + // 'subject' => 'plugin', + // 'plugin' => $_REQUEST['plugin'], + // 'database' => $_REQUEST['database'], + // 'schema' => $_REQUEST['schema'], + // 'action' => $_REQUEST['action'] + // )); + // break; default: return false; } @@ -1601,15 +1600,18 @@ * * @param $navlinks - An array with the the attributes and values that will be shown. See printLinksList for array format. * @param $place - Place where the $navlinks are displayed. Like 'display-browse', where 'display' is the file (display.php) + * @param $env - Associative array of defined variables in the scope of the caller. + * Allows to give some environnement details to plugins. * and 'browse' is the place inside that code (doBrowse). */ - function printNavLinks($navlinks=array(), $place) { + function printNavLinks($navlinks, $place, $env = array()) { global $plugin_manager; // Navlinks hook's place $plugin_functions_parameters = array( 'navlinks' => &$navlinks, - 'place' => $place + 'place' => $place, + 'env' => $env ); $plugin_manager->do_hook('navlinks', $plugin_functions_parameters); diff --git a/colproperties.php b/colproperties.php index a0927d7d..2bf137b8 100644 --- a/colproperties.php +++ b/colproperties.php @@ -321,7 +321,7 @@ ); } - $misc->printNavLinks($navlinks, 'colproperties-colproperties'); + $misc->printNavLinks($navlinks, 'colproperties-colproperties', get_defined_vars()); } } diff --git a/constraints.php b/constraints.php index 307601d1..cc1591c9 100644 --- a/constraints.php +++ b/constraints.php @@ -543,7 +543,7 @@ 'content' => $lang['straddfk'] ) ); - $misc->printNavLinks($navlinks, 'constraints-constraints'); + $misc->printNavLinks($navlinks, 'constraints-constraints', get_defined_vars()); } function doTree() { diff --git a/display.php b/display.php index a3e9b498..74efb6e1 100644 --- a/display.php +++ b/display.php @@ -800,7 +800,7 @@ 'content' => $lang['strrefresh'] ); - $misc->printNavLinks($navlinks, 'display-browse'); + $misc->printNavLinks($navlinks, 'display-browse', get_defined_vars()); } diff --git a/fulltext.php b/fulltext.php index 00e6e9c5..da8b92b0 100644 --- a/fulltext.php +++ b/fulltext.php @@ -89,7 +89,7 @@ ) ); - $misc->printNavLinks($navlinks, 'fulltext-fulltext'); + $misc->printNavLinks($navlinks, 'fulltext-fulltext', get_defined_vars()); } function doDropConfig($confirm) { @@ -454,7 +454,7 @@ ) ); - $misc->printNavLinks($navlinks, 'fulltext-viewdicts'); + $misc->printNavLinks($navlinks, 'fulltext-viewdicts', get_defined_vars()); } @@ -549,7 +549,7 @@ ) ); - $misc->printNavLinks($navlinks, 'fulltext-viewconfig'); + $misc->printNavLinks($navlinks, 'fulltext-viewconfig', get_defined_vars()); } /** diff --git a/functions.php b/functions.php index 67e7b660..5aa853c7 100644 --- a/functions.php +++ b/functions.php @@ -373,7 +373,7 @@ ) ); - $misc->printNavLinks($navlinks, 'functions-properties'); + $misc->printNavLinks($navlinks, 'functions-properties', get_defined_vars()); } /** @@ -937,7 +937,7 @@ ) ); - $misc->printNavLinks($navlinks, 'functions-functions'); + $misc->printNavLinks($navlinks, 'functions-functions', get_defined_vars()); } /** @@ -129,7 +129,7 @@ ) ), 'content' => $lang['strshowallgroups'] - )), 'groups-properties'); + )), 'groups-properties', get_defined_vars()); } /** @@ -279,7 +279,7 @@ ) ), 'content' => $lang['strcreategroup'] - )), 'groups-groups'); + )), 'groups-groups', get_defined_vars()); } diff --git a/history.php b/history.php index 3f540797..1dab1db8 100644 --- a/history.php +++ b/history.php @@ -130,7 +130,7 @@ ); } - $misc->printNavLinks($navlinks, 'history-history'); + $misc->printNavLinks($navlinks, 'history-history', get_defined_vars()); } function doDelHistory($qid, $confirm) { diff --git a/indexes.php b/indexes.php index ce9a7955..5c6ebdbf 100644 --- a/indexes.php +++ b/indexes.php @@ -351,7 +351,7 @@ ), 'content' => $lang['strcreateindex'] ) - ), 'indexes-indexes'); + ), 'indexes-indexes', get_defined_vars()); } function doTree() { diff --git a/privileges.php b/privileges.php index 72ef3716..23fb4d96 100644 --- a/privileges.php +++ b/privileges.php @@ -326,7 +326,7 @@ ); } - $misc->printNavLinks($navlinks, 'privileges-privileges'); + $misc->printNavLinks($navlinks, 'privileges-privileges', get_defined_vars()); } $misc->printHeader($lang['strprivileges']); @@ -465,7 +465,7 @@ ) ); - $misc->printNavLinks($navlinks, 'roles-properties'); + $misc->printNavLinks($navlinks, 'roles-properties', get_defined_vars()); } /** @@ -525,7 +525,7 @@ ) ), 'content' => $lang['strchangepassword'] - )), 'roles-account'); + )), 'roles-account', get_defined_vars()); } /** @@ -693,7 +693,7 @@ 'content' => $lang['strcreaterole'] ) ); - $misc->printNavLinks($navlinks, 'roles-roles'); + $misc->printNavLinks($navlinks, 'roles-roles', get_defined_vars()); } $misc->printHeader($lang['strroles']); @@ -182,7 +182,7 @@ ) ), 'content' => $lang['strcreaterule'] - )), 'rules-rules'); + )), 'rules-rules', get_defined_vars()); } function doTree() { diff --git a/schemas.php b/schemas.php index ecb569cb..ad733747 100755 --- a/schemas.php +++ b/schemas.php @@ -106,7 +106,7 @@ ) ), 'content' => $lang['strcreateschema'] - )), 'schemas-schemas'); + )), 'schemas-schemas', get_defined_vars()); } /** diff --git a/sequences.php b/sequences.php index 57893e8a..454b9d97 100644 --- a/sequences.php +++ b/sequences.php @@ -106,7 +106,7 @@ ) ), 'content' => $lang['strcreatesequence'] - )), 'sequences-sequences'); + )), 'sequences-sequences', get_defined_vars()); } /** @@ -281,7 +281,7 @@ if (! $data->hasAlterSequenceStart()) unset($navlinks['restart']); - $misc->printNavLinks($navlinks, 'sequences-properties'); + $misc->printNavLinks($navlinks, 'sequences-properties', get_defined_vars()); } else echo "<p>{$lang['strnodata']}</p>\n"; } @@ -258,7 +258,7 @@ ); } - $misc->printNavLinks($navlinks, 'sql-form'); + $misc->printNavLinks($navlinks, 'sql-form', get_defined_vars()); $misc->printFooter(); ?> @@ -924,7 +924,7 @@ ); } - $misc->printNavLinks($navlinks, 'tables-tables'); + $misc->printNavLinks($navlinks, 'tables-tables', get_defined_vars()); } require('./admin.php'); diff --git a/tablespaces.php b/tablespaces.php index 2ac84ed2..3c6f8beb 100755 --- a/tablespaces.php +++ b/tablespaces.php @@ -288,7 +288,7 @@ ) ), 'content' => $lang['strcreatetablespace'] - )), 'tablespaces-tablespaces'); + )), 'tablespaces-tablespaces', get_defined_vars()); } $misc->printHeader($lang['strtablespaces']); diff --git a/tblproperties.php b/tblproperties.php index e229e890..e2a5d2e2 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -732,7 +732,10 @@ 'content' => $lang['stralter'] ) ); - $misc->printNavLinks($navlinks, 'tblproperties-tblproperties'); + $misc->printNavLinks($navlinks, + 'tblproperties-tblproperties' + , get_defined_vars() + ); } diff --git a/triggers.php b/triggers.php index 64c665ec..339e4ae4 100644 --- a/triggers.php +++ b/triggers.php @@ -377,7 +377,7 @@ ) ), 'content' => $lang['strcreatetrigger'] - )), 'triggers-triggers'); + )), 'triggers-triggers', get_defined_vars()); } function doTree() { @@ -97,7 +97,7 @@ ) ), 'content' => $lang['strshowalltypes'] - )), 'types-properties'); + )), 'types-properties', get_defined_vars()); } else doDefault($lang['strinvalidparam']); } @@ -643,7 +643,7 @@ unset($navlinks['enum']); } - $misc->printNavLinks($navlinks, 'types-types'); + $misc->printNavLinks($navlinks, 'types-types', get_defined_vars()); } /** @@ -58,7 +58,7 @@ ) ), 'content' => $lang['strchangepassword'] - )), 'users-account'); + )), 'users-account', get_defined_vars()); } /** @@ -366,7 +366,7 @@ ) ), 'content' => $lang['strcreateuser'] - )), 'users-users'); + )), 'users-users', get_defined_vars()); } diff --git a/viewproperties.php b/viewproperties.php index 4000b491..950789b5 100755 --- a/viewproperties.php +++ b/viewproperties.php @@ -164,7 +164,7 @@ ) ), 'content' => $lang['stralter'] - )), 'viewproperties-definition'); + )), 'viewproperties-definition', get_defined_vars()); } /** @@ -516,7 +516,7 @@ ) ); - $misc->printNavLinks($navlinks, 'viewproperties-viewproperties'); + $misc->printNavLinks($navlinks, 'viewproperties-viewproperties', get_defined_vars()); } $misc->printHeader($lang['strviews'] . ' - ' . $_REQUEST['view']); @@ -677,7 +677,7 @@ 'content' => $lang['strcreateviewwiz'] ) ); - $misc->printNavLinks($navlinks, 'views-views'); + $misc->printNavLinks($navlinks, 'views-views', get_defined_vars()); } |