_isEnabled = true; } /** * Whether we are servicing an ajax request. * We can't simply use $GLOBALS['is_ajax_request'] * here since it may have not been initialised yet. * * @access private * @var bool */ private $_isAjax; /** * Set the ajax flag to indicate whether * we are servicing an ajax request * * @param bool $isAjax Whether we are servicing an ajax request * * @return void */ public function setAjax($isAjax) { $this->_isAjax = (boolean) $isAjax; } /** * Disables the rendering of the footer * * @return void */ public function disable() { $this->_isEnabled = false; } /** * Renders the bookmark content * * @access public * @return string */ public static function getBookmarkContent() { $output = ''; $cfgBookmark = PMA_Bookmark_getParams(); if ($cfgBookmark) { $tpl_bookmark_actions = '' . __('Collapse') . ' ' . ' ' . '' . __('Requery') . ' ' . '' . __('Edit') . ' ' . '' . __('Delete') . ' ' . '' . __('Database') . ': %s'; $bookmarks = PMA_Bookmark_getList(); $output .= '
'; foreach ($bookmarks as $val) { $output .= ' '; } } return $output; } /** * Returns the list of JS scripts required by console * * @return array list of scripts */ public function getScripts() { return array('console.js'); } /** * Gets the history * * @param string $tpl_query_actions the template for query actions * * @return string $output the generated HTML for history * * @access private * */ private function _getHistory($tpl_query_actions) { $output = ''; $_sql_history = PMA_getHistory($GLOBALS['cfg']['Server']['user']); if (! empty($_sql_history)) { foreach (array_reverse($_sql_history) as $record) { $isSelect = preg_match( '@^SELECT[[:space:]]+@i', $record['sqlquery'] ); $output .= ' '; } } return $output; } /** * Renders the console * * @access public * @return string */ public function getDisplay() { $output = ''; if ((! $this->_isAjax) && $this->_isEnabled) { $cfgBookmark = PMA_Bookmark_getParams(); $output .= '