From 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 27 Jul 2020 10:05:23 +0200 Subject: Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my familly --- srcs/phpmyadmin/libraries/classes/Console.php | 158 -------------------------- 1 file changed, 158 deletions(-) delete mode 100644 srcs/phpmyadmin/libraries/classes/Console.php (limited to 'srcs/phpmyadmin/libraries/classes/Console.php') diff --git a/srcs/phpmyadmin/libraries/classes/Console.php b/srcs/phpmyadmin/libraries/classes/Console.php deleted file mode 100644 index 50ac77a..0000000 --- a/srcs/phpmyadmin/libraries/classes/Console.php +++ /dev/null @@ -1,158 +0,0 @@ -_isEnabled = true; - $this->relation = new Relation($GLOBALS['dbi']); - $this->template = new Template(); - } - - /** - * 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(bool $isAjax): void - { - $this->_isAjax = $isAjax; - } - - /** - * Disables the rendering of the footer - * - * @return void - */ - public function disable(): void - { - $this->_isEnabled = false; - } - - /** - * Renders the bookmark content - * - * @access public - * @return string - */ - public static function getBookmarkContent(): string - { - $template = new Template(); - $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); - if ($cfgBookmark) { - $bookmarks = Bookmark::getList( - $GLOBALS['dbi'], - $GLOBALS['cfg']['Server']['user'] - ); - $count_bookmarks = count($bookmarks); - if ($count_bookmarks > 0) { - $welcomeMessage = sprintf( - _ngettext( - 'Showing %1$d bookmark (both private and shared)', - 'Showing %1$d bookmarks (both private and shared)', - $count_bookmarks - ), - $count_bookmarks - ); - } else { - $welcomeMessage = __('No bookmarks'); - } - unset($count_bookmarks, $private_message, $shared_message); - return $template->render('console/bookmark_content', [ - 'welcome_message' => $welcomeMessage, - 'bookmarks' => $bookmarks, - ]); - } - return ''; - } - - /** - * Returns the list of JS scripts required by console - * - * @return array list of scripts - */ - public function getScripts(): array - { - return ['console.js']; - } - - /** - * Renders the console - * - * @access public - * @return string - */ - public function getDisplay(): string - { - if ((! $this->_isAjax) && $this->_isEnabled) { - $cfgBookmark = Bookmark::getParams( - $GLOBALS['cfg']['Server']['user'] - ); - - $image = Util::getImage('console', __('SQL Query Console')); - $_sql_history = $this->relation->getHistory( - $GLOBALS['cfg']['Server']['user'] - ); - $bookmarkContent = static::getBookmarkContent(); - - return $this->template->render('console/display', [ - 'cfg_bookmark' => $cfgBookmark, - 'image' => $image, - 'sql_history' => $_sql_history, - 'bookmark_content' => $bookmarkContent, - ]); - } - return ''; - } -} -- cgit