/** * Callback function for replacing [doc@anchor] links in bb code. * * @param array $found Array of preg matches * * @return string Replaced string */ function PMA_replaceDocLink($found) { $anchor = $found[1]; if (strncmp('faq', $anchor, 3) == 0) { $page = 'faq'; } else { if (strncmp('cfg', $anchor, 3) == 0) { $page = 'cfg'; } else { /* Guess */ $page = 'setup'; } } $link = PMA\libraries\Util::getDocuLink($page, $anchor); return '<a href="' . $link . '" target="documentation">'; }
PMA_printListItem(__('Show PHP information'), 'li_phpinfo', 'phpinfo.php' . $common_url_query, null, '_blank'); } echo ' </ul>'; echo ' </div>'; } echo '<div class="group pmagroup">'; echo '<h2>phpMyAdmin</h2>'; echo '<ul>'; $class = null; // We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks // support here and does not allow request to http once using https. if ($GLOBALS['cfg']['VersionCheck'] && (!$GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')) { $class = 'jsversioncheck'; } PMA_printListItem(__('Version information:') . ' <span class="version">' . PMA_VERSION . '</span>', 'li_pma_version', null, null, null, null, $class); PMA_printListItem(__('Documentation'), 'li_pma_docs', PMA\libraries\Util::getDocuLink('index'), null, '_blank'); PMA_printListItem(__('Wiki'), 'li_pma_wiki', PMA_linkURL('http://wiki.phpmyadmin.net/'), null, '_blank'); // does not work if no target specified, don't know why PMA_printListItem(__('Official Homepage'), 'li_pma_homepage', PMA_linkURL('http://www.phpMyAdmin.net/'), null, '_blank'); PMA_printListItem(__('Contribute'), 'li_pma_contribute', PMA_linkURL('https://www.phpmyadmin.net/contribute/'), null, '_blank'); PMA_printListItem(__('Get support'), 'li_pma_support', PMA_linkURL('https://www.phpmyadmin.net/support/'), null, '_blank'); PMA_printListItem(__('List of changes'), 'li_pma_changes', 'changelog.php' . PMA_URL_getCommon(), null, '_blank'); PMA_printListItem(__('License'), 'li_pma_license', 'license.php' . PMA_URL_getCommon(), null, '_blank'); echo ' </ul>'; echo ' </div>'; echo '</div>'; echo '</div>'; /** * As we try to handle charsets by ourself, mbstring overloads just * break it, see bug 1063821. */
/** * prints out one diagnostic message for a configuration parameter * * @param string $parameter config parameter name to display * @param boolean $relationParameterSet whether this parameter is set * @param array $messages utility messages * @param string $docAnchor anchor in documentation * * @return string */ function PMA_getDiagMessageForParameter($parameter, $relationParameterSet, $messages, $docAnchor) { $retval = '<tr><th class="left">'; $retval .= '$cfg[\'Servers\'][$i][\'' . $parameter . '\'] ... '; $retval .= '</th><td class="right">'; if ($relationParameterSet) { $retval .= $messages['ok']; } else { $retval .= sprintf($messages['error'], PMA\libraries\Util::getDocuLink('config', 'cfg_Servers_' . $docAnchor)); } $retval .= '</td></tr>' . "\n"; return $retval; }
} if (defined('TESTSUITE')) { /** * For testsuite we use dummy driver which can fake some queries. */ include_once './libraries/dbi/DBIDummy.php'; $extension = new DBIDummy(); } else { /** * First check for the mysqli extension, as it's the one recommended * for the MySQL server's version that we support * (if PHP 7+, it's the only one supported) */ $extension = 'mysqli'; if (!DatabaseInterface::checkDbExtension($extension)) { $docurl = PMA\libraries\Util::getDocuLink('faq', 'faqmysql'); $doclink = sprintf(__('See %sour documentation%s for more information.'), '[a@' . $docurl . '@documentation]', '[/a]'); if (PMA_PHP_INT_VERSION < 70000) { $extension = 'mysql'; if (!PMA\libraries\DatabaseInterface::checkDbExtension($extension)) { // warn about both extensions missing and exit PMA_warnMissingExtension('mysqli|mysql', true, $doclink); } elseif (empty($_SESSION['mysqlwarning'])) { trigger_error(__('You are using the mysql extension which is deprecated in ' . 'phpMyAdmin. Please consider installing the mysqli ' . 'extension.') . ' ' . $doclink, E_USER_WARNING); // tell the user just once per session $_SESSION['mysqlwarning'] = true; } } else { // mysql extension is not part of PHP 7+, so warn and exit PMA_warnMissingExtension('mysqli', true, $doclink); }
/** * Prints Html For Export Options * * @param String $export_type Selected Export Type * * @return string */ function PMA_getHtmlForExportOptionsOutputFormat($export_type) { $html = '<li>'; $html .= '<label for="filename_template" class="desc">'; $html .= __('File name template:'); $trans = new Message(); $trans->addText(__('@SERVER@ will become the server name')); if ($export_type == 'database' || $export_type == 'table') { $trans->addText(__(', @DATABASE@ will become the database name')); if ($export_type == 'table') { $trans->addText(__(', @TABLE@ will become the table name')); } } $msg = new Message(__('This value is interpreted using %1$sstrftime%2$s, ' . 'so you can use time formatting strings. ' . 'Additionally the following transformations will happen: %3$s. ' . 'Other text will be kept as is. See the %4$sFAQ%5$s for details.')); $msg->addParamHtml('<a href="' . PMA_linkURL(PMA_getPHPDocLink('function.strftime.php')) . '" target="documentation" title="' . __('Documentation') . '">'); $msg->addParamHtml('</a>'); $msg->addParam($trans); $doc_url = PMA\libraries\Util::getDocuLink('faq', 'faq6-27'); $msg->addParamHtml('<a href="' . $doc_url . '" target="documentation">'); $msg->addParamHtml('</a>'); $html .= PMA\libraries\Util::showHint($msg); $html .= '</label>'; $html .= '<input type="text" name="filename_template" id="filename_template" '; $html .= ' value="'; if (isset($_GET['filename_template'])) { $html .= htmlspecialchars($_GET['filename_template']); } else { if ($export_type == 'database') { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_db_filename_template', $GLOBALS['cfg']['Export']['file_template_database'])); } elseif ($export_type == 'table') { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_table_filename_template', $GLOBALS['cfg']['Export']['file_template_table'])); } else { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_server_filename_template', $GLOBALS['cfg']['Export']['file_template_server'])); } } $html .= '"'; $html .= '/>'; $html .= '<input type="checkbox" name="remember_template" '; $html .= 'id="checkbox_remember_template" '; $html .= PMA_exportCheckboxCheck('remember_file_template'); $html .= '/>'; $html .= '<label for="checkbox_remember_template">'; $html .= __('use this for future exports'); $html .= '</label>'; $html .= '</li>'; return $html; }