diff options
author | Rouslan Placella <rouslan@placella.com> | 2012-08-02 21:02:14 +0400 |
---|---|---|
committer | Rouslan Placella <rouslan@placella.com> | 2012-08-02 21:02:14 +0400 |
commit | 2428a6f4c2082395c2c7605b0fdb0373dd3a39cc (patch) | |
tree | 31c2fcd417d7a2819106a6bc661d4a7fcc854355 /libraries/Menu.class.php | |
parent | ba7a49e81c38a0d403553190a116c9fc5804013a (diff) |
Dropped pointless lazy getter (if the menu is instanciated, we'll have to get a reference to the common functions anyway)
Diffstat (limited to 'libraries/Menu.class.php')
-rw-r--r-- | libraries/Menu.class.php | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index 6c694bc256..1a1160cee9 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -37,21 +37,10 @@ class PMA_Menu * @var string */ private $_table; - - private $_common_functions; - /** - * Get CommmonFunctions - * - * @return CommonFunctions object + * @var object A reference to the common functions object */ - public function getCommonFunctions() - { - if (is_null($this->_common_functions)) { - $this->_common_functions = PMA_CommonFunctions::getInstance(); - } - return $this->_common_functions; - } + private $_commonFunctions; /** * Creates a new instance of PMA_Menu @@ -67,6 +56,7 @@ class PMA_Menu $this->_server = $server; $this->_db = $db; $this->_table = $table; + $this->_commonFunctions = PMA_commonFunctions::getInstance(); } /** @@ -92,7 +82,7 @@ class PMA_Menu if (isset($GLOBALS['buffer_message'])) { $buffer_message = $GLOBALS['buffer_message']; } - $retval .= $this->getCommonFunctions()->getMessage($GLOBALS['message']); + $retval .= $this->_commonFunctions->getMessage($GLOBALS['message']); unset($GLOBALS['message']); if (isset($buffer_message)) { $GLOBALS['buffer_message'] = $buffer_message; @@ -118,7 +108,7 @@ class PMA_Menu } else { $tabs = $this->_getServerTabs(); } - return $this->getCommonFunctions()->getHtmlTabs($tabs, $url_params); + return $this->_commonFunctions->getHtmlTabs($tabs, $url_params); } /** @@ -147,7 +137,7 @@ class PMA_Menu $retval .= "<div id='floating_menubar'></div>"; $retval .= "<div id='serverinfo'>"; if ($GLOBALS['cfg']['NavigationBarIconic']) { - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( 's_host.png', '', array('class' => 'item') @@ -164,7 +154,7 @@ class PMA_Menu if (strlen($this->_db)) { $retval .= $separator; if ($GLOBALS['cfg']['NavigationBarIconic']) { - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( 's_db.png', '', array('class' => 'item') @@ -187,7 +177,7 @@ class PMA_Menu $retval .= $separator; if ($GLOBALS['cfg']['NavigationBarIconic']) { $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png'; - $retval .= $this->getCommonFunctions()->getImage( + $retval .= $this->_commonFunctions->getImage( $icon, '', array('class' => 'item') @@ -309,7 +299,7 @@ class PMA_Menu } if (! $db_is_information_schema && ! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('TRIGGER', $this->_db, $this->_table) + && $this->_commonFunctions->currentUserHasPrivilege('TRIGGER', $this->_db, $this->_table) && ! $tbl_is_view ) { $tabs['triggers']['link'] = 'tbl_triggers.php'; @@ -405,14 +395,14 @@ class PMA_Menu } if (PMA_MYSQL_INT_VERSION >= 50106 && ! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('EVENT', $this->_db) + && $this->_commonFunctions->currentUserHasPrivilege('EVENT', $this->_db) ) { $tabs['events']['link'] = 'db_events.php'; $tabs['events']['text'] = __('Events'); $tabs['events']['icon'] = 'b_events.png'; } if (! PMA_DRIZZLE - && $this->getCommonFunctions()->currentUserHasPrivilege('TRIGGER', $this->_db) + && $this->_commonFunctions->currentUserHasPrivilege('TRIGGER', $this->_db) ) { $tabs['triggers']['link'] = 'db_triggers.php'; $tabs['triggers']['text'] = __('Triggers'); |