Exemplo n.º 1
0
 /**
  * Returns the menu as HTML
  *
  * @return string HTML formatted menubar
  */
 private function _getMenu()
 {
     $url_params = array('db' => $this->_db);
     if (mb_strlen($this->_table)) {
         $tabs = $this->_getTableTabs();
         $url_params['table'] = $this->_table;
         $level = 'table';
     } else {
         if (mb_strlen($this->_db)) {
             $tabs = $this->_getDbTabs();
             $level = 'db';
         } else {
             $tabs = $this->_getServerTabs();
             $level = 'server';
         }
     }
     $allowedTabs = $this->_getAllowedTabs($level);
     foreach ($tabs as $key => $value) {
         if (!array_key_exists($key, $allowedTabs)) {
             unset($tabs[$key]);
         }
     }
     return PMA_Util::getHtmlTabs($tabs, $url_params, 'topmenu', true);
 }
Exemplo n.º 2
0
$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('bodyquerywindow');
$scripts = $header->getScripts();
$scripts->addFile('common.js');
$scripts->addFile('querywindow.js');
if (PMA_isValid($_REQUEST['auto_commit'], 'identical', 'true')) {
    $scripts->addEvent('load', 'PMA_queryAutoCommit');
}
// always set focus to the textarea
if ($querydisplay_tab == 'sql' || $querydisplay_tab == 'full') {
    $scripts->addEvent('load', 'PMA_querywindowSetFocus');
}
echo '<div id="querywindowcontainer">';
if ($tabs) {
    echo PMA_Util::getHtmlTabs($tabs, array(), 'topmenu', true);
    unset($tabs);
}
echo PMA_getHtmlForSqlQueryForm($query_to_display, $querydisplay_tab);
// Hidden forms and query frame interaction stuff
$_sql_history = PMA_getHistory($GLOBALS['cfg']['Server']['user']);
if (!empty($_sql_history) && ($querydisplay_tab == 'history' || $querydisplay_tab == 'full')) {
    $tab = $querydisplay_tab != 'full' ? 'sql' : 'full';
    echo __('SQL history:') . '<br />' . '<ul>';
    foreach ($_sql_history as $query) {
        echo '<li>' . "\n";
        // edit link
        $url_params = array('querydisplay_tab' => $tab, 'sql_query' => $query['sqlquery'], 'db' => $query['db'], 'table' => $query['table']);
        echo '<a href="querywindow.php' . PMA_URL_getCommon($url_params) . '">' . $titles['Change'] . '</a>';
        // execute link
        $url_params['auto_commit'] = 'true';
Exemplo n.º 3
0
 /**
  * Returns the menu as HTML
  *
  * @return string HTML formatted menubar
  */
 private function _getMenu()
 {
     $tabs = array();
     $url_params = array('db' => $this->_db);
     if (strlen($this->_table)) {
         $tabs = $this->_getTableTabs();
         $url_params['table'] = $this->_table;
     } else {
         if (strlen($this->_db)) {
             $tabs = $this->_getDbTabs();
         } else {
             $tabs = $this->_getServerTabs();
         }
     }
     return PMA_Util::getHtmlTabs($tabs, $url_params, 'topmenu', true);
 }
Exemplo n.º 4
0
if (PMA_isValid($_REQUEST['auto_commit'], 'identical', 'true')) {
    $scripts->addEvent('load', 'PMA_queryAutoCommit');
}
if (PMA_isValid($_REQUEST['init'])) {
    $scripts->addEvent('load', 'PMA_querywindowResize');
}
// always set focus to the textarea
if ($querydisplay_tab == 'sql' || $querydisplay_tab == 'full') {
    $scripts->addEvent('load', 'PMA_querywindowSetFocus');
}

echo '<div id="querywindowcontainer">';

if ($tabs) {
    echo PMA_Util::getHtmlTabs($tabs, array());
    unset($tabs);
}

PMA_sqlQueryForm($query_to_display, $querydisplay_tab);

// Hidden forms and query frame interaction stuff

$_sql_history = PMA_getHistory($GLOBALS['cfg']['Server']['user']);
if (! empty($_sql_history)
    && ($querydisplay_tab == 'history' || $querydisplay_tab == 'full')
) {
    $tab = $querydisplay_tab != 'full' ? 'sql' : 'full';
    echo __('SQL history') . ':<br />'
        . '<ul>';
    foreach ($_sql_history as $query) {