'; $closeLink = ''; if ($bigIcon) { $html = $openLink . Generator::getImage('b_sqlhelp', __('Documentation')) . $closeLink; } elseif ($text !== null) { $html = $openLink . $text . $closeLink; } else { $html = Generator::showDocumentationLink($url, 'mysql_doc'); } return $html; } /** * Displays a link to the phpMyAdmin documentation * * @param string $page Page in documentation * @param string $anchor Optional anchor in page * @param bool $bbcode Optional flag indicating whether to output bbcode * * @return string the html link */ public static function showDocumentation($page, $anchor = '', $bbcode = false): string { return Generator::showDocumentationLink(self::getDocumentationLink($page, $anchor), 'documentation', $bbcode); } /** * Returns link to documentation. * * @param string $page Page in documentation * @param string $anchor Optional anchor in page * @param string $pathPrefix Optional path in case it is called in a folder (e.g. setup) * * @return string URL */ public static function getDocumentationLink($page, $anchor = '', string $pathPrefix = './'): string { /* Construct base URL */ $url = $page . '.html'; if (! empty($anchor)) { $url .= '#' . $anchor; } /** * Check if we have built local documentation, however * provide consistent URL for testsuite */ if (! defined('TESTSUITE') && @file_exists(ROOT_PATH . 'doc/html/index.html')) { return $pathPrefix . 'doc/html/' . $url; } return Core::linkURL('https://docs.phpmyadmin.net/en/latest/' . $url); } }