/** * Get HTML snippet for change database charset * * @param string $db database name * @param string $table table name * * @return string $html_output */ function PMA_getHtmlForChangeDatabaseCharset($db, $table) { $html_output = '<div class="operations_half_width">' . '<form id="change_db_charset_form" '; $html_output .= 'class="ajax" '; $html_output .= 'method="post" action="db_operations.php">'; $html_output .= PMA_URL_getHiddenInputs($db, $table); $html_output .= '<fieldset>' . "\n" . ' <legend>'; if (PMA\libraries\Util::showIcons('ActionLinksMode')) { $html_output .= PMA\libraries\Util::getImage('s_asci.png') . ' '; } $html_output .= '<label for="select_db_collation">' . __('Collation') . '</label>' . "\n" . '</legend>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', isset($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : '', false) . '</fieldset>' . '<fieldset class="tblFooters">' . '<input type="submit" name="submitcollation"' . ' value="' . __('Go') . '" />' . "\n" . '</fieldset>' . "\n" . '</form></div>' . "\n"; return $html_output; }
/** * Get a navigation button * * @param string $caption iconic caption for button * @param string $title text for button * @param integer $pos position for next query * @param string $html_sql_query query ready for display * @param boolean $back whether 'begin' or 'previous' * @param string $onsubmit optional onsubmit clause * @param string $input_for_real_end optional hidden field for special treatment * @param string $onclick optional onclick clause * * @return string html content * * @access private * * @see _getMoveBackwardButtonsForTableNavigation(), * _getMoveForwardButtonsForTableNavigation() */ private function _getTableNavigationButton($caption, $title, $pos, $html_sql_query, $back, $onsubmit = '', $input_for_real_end = '', $onclick = '') { $caption_output = ''; if ($back) { if (Util::showIcons('TableNavigationLinksMode')) { $caption_output .= $caption; } if (Util::showText('TableNavigationLinksMode')) { $caption_output .= ' ' . $title; } } else { if (Util::showText('TableNavigationLinksMode')) { $caption_output .= $title; } if (Util::showIcons('TableNavigationLinksMode')) { $caption_output .= ' ' . $caption; } } $title_output = ' title="' . $title . '"'; return '<td>' . '<form action="sql.php" method="post" ' . $onsubmit . '>' . PMA_URL_getHiddenInputs($this->__get('db'), $this->__get('table')) . '<input type="hidden" name="sql_query" value="' . $html_sql_query . '" />' . '<input type="hidden" name="pos" value="' . $pos . '" />' . '<input type="hidden" name="is_browse_distinct" value="' . $this->__get('is_browse_distinct') . '" />' . '<input type="hidden" name="goto" value="' . $this->__get('goto') . '" />' . $input_for_real_end . '<input type="submit" name="navig"' . ' class="ajax" ' . 'value="' . $caption_output . '" ' . $title_output . $onclick . ' />' . '</form>' . '</td>'; }
/** * Renders the link to open a new page * * @param string $url The url of the page * * @return string */ private function _getSelfLink($url) { $retval = ''; $retval .= '<div id="selflink" class="print_ignore">'; $retval .= '<a href="' . $url . '"' . ' title="' . __('Open new phpMyAdmin window') . '" target="_blank">'; if (Util::showIcons('TabsMode')) { $retval .= Util::getImage('window-new.png', __('Open new phpMyAdmin window')); } else { $retval .= __('Open new phpMyAdmin window'); } $retval .= '</a>'; $retval .= '</div>'; return $retval; }
/** * Returns the html for Navigation Row. * * @param Array $url_params Links parameters * @param int $pos Position to display * @param int $num_rows Number of results row * @param bool $dontlimitchars Whether limit chars * * @return string */ function PMA_getNavigationRow($url_params, $pos, $num_rows, $dontlimitchars) { $html = ""; // we do not know how much rows are in the binlog // so we can just force 'NEXT' button if ($pos > 0) { $this_url_params = $url_params; if ($pos > $GLOBALS['cfg']['MaxRows']) { $this_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxRows']; } $html .= '<a href="server_binlog.php' . PMA_URL_getCommon($this_url_params) . '"'; if (Util::showIcons('TableNavigationLinksMode')) { $html .= ' title="' . _pgettext('Previous page', 'Previous') . '">'; } else { $html .= '>' . _pgettext('Previous page', 'Previous'); } // end if... else... $html .= ' < </a> - '; } $this_url_params = $url_params; if ($pos > 0) { $this_url_params['pos'] = $pos; } if ($dontlimitchars) { unset($this_url_params['dontlimitchars']); $tempTitle = __('Truncate Shown Queries'); $tempImgMode = 'partial'; } else { $this_url_params['dontlimitchars'] = 1; $tempTitle = __('Show Full Queries'); $tempImgMode = 'full'; } $html .= '<a href="server_binlog.php' . PMA_URL_getCommon($this_url_params) . '" title="' . $tempTitle . '">' . '<img src="' . $GLOBALS['pmaThemeImage'] . 's_' . $tempImgMode . 'text.png" alt="' . $tempTitle . '" /></a>'; // we do not now how much rows are in the binlog // so we can just force 'NEXT' button if ($num_rows >= $GLOBALS['cfg']['MaxRows']) { $this_url_params = $url_params; $this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows']; $html .= ' - <a href="server_binlog.php' . PMA_URL_getCommon($this_url_params) . '"'; if (Util::showIcons('TableNavigationLinksMode')) { $html .= ' title="' . _pgettext('Next page', 'Next') . '">'; } else { $html .= '>' . _pgettext('Next page', 'Next'); } // end if... else... $html .= ' > </a>'; } return $html; }
/** * Returns the breadcrumbs as HTML * * @return string HTML formatted breadcrumbs */ private function _getBreadcrumbs() { $retval = ''; $tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)->isView(); if (empty($GLOBALS['cfg']['Server']['host'])) { $GLOBALS['cfg']['Server']['host'] = ''; } $server_info = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host']; $server_info .= empty($GLOBALS['cfg']['Server']['port']) ? '' : ':' . $GLOBALS['cfg']['Server']['port']; $separator = "<span class='separator item'> »</span>"; $item = '<a href="%1$s%2$s" class="item">'; if (Util::showText('TabsMode')) { $item .= '%4$s: '; } $item .= '%3$s</a>'; $retval .= "<div id='floating_menubar'></div>"; $retval .= "<div id='serverinfo'>"; if (Util::showIcons('TabsMode')) { $retval .= Util::getImage('s_host.png', '', array('class' => 'item')); } $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabServer'], 'server'), URL::getCommon(), htmlspecialchars($server_info), __('Server')); if (strlen($this->_db) > 0) { $retval .= $separator; if (Util::showIcons('TabsMode')) { $retval .= Util::getImage('s_db.png', '', array('class' => 'item')); } $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), URL::getCommon(array('db' => $this->_db)), htmlspecialchars($this->_db), __('Database')); // if the table is being dropped, $_REQUEST['purge'] is set to '1' // so do not display the table name in upper div if (strlen($this->_table) > 0 && !(isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) { include './libraries/tbl_info.inc.php'; $retval .= $separator; if (Util::showIcons('TabsMode')) { $icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png'; $retval .= Util::getImage($icon, '', array('class' => 'item')); } $retval .= sprintf($item, Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'), URL::getCommon(array('db' => $this->_db, 'table' => $this->_table)), str_replace(' ', ' ', htmlspecialchars($this->_table)), $tbl_is_view ? __('View') : __('Table')); /** * Displays table comment */ if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) { if (mb_strstr($show_comment, '; InnoDB free')) { $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment); } $retval .= '<span class="table_comment"'; $retval .= ' id="span_table_comment">"'; $retval .= htmlspecialchars($show_comment); $retval .= '"</span>'; } // end if } else { // no table selected, display database comment if present $cfgRelation = PMA_getRelationsParam(); // Get additional information about tables for tooltip is done // in Util::getDbInfo() only once if ($cfgRelation['commwork']) { $comment = PMA_getDbComment($this->_db); /** * Displays table comment */ if (!empty($comment)) { $retval .= '<span class="table_comment"' . ' id="span_table_comment">"' . htmlspecialchars($comment) . '"</span>'; } // end if } } } $retval .= '<div class="clearfloat"></div>'; $retval .= '</div>'; return $retval; }