Пример #1
0
 /**
  * Test for PMA_getPageName()
  *
  * @return void
  */
 public function testGetPageName()
 {
     $pg = 1;
     $pageName = 'pageName';
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->at(0))->method('fetchResult')->with("SELECT `page_descr` FROM `pmadb`.`pdf_pages`" . " WHERE `page_nr` = " . $pg, null, null, 2, PMA_DatabaseInterface::QUERY_STORE)->will($this->returnValue(array($pageName)));
     $GLOBALS['dbi'] = $dbi;
     $result = PMA_getPageName($pg);
     $this->assertEquals($pageName, $result);
 }
Пример #2
0
$tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys();
$tables_all_keys = PMA_getAllKeys();
$classes_side_menu = PMA_returnClassNamesFromMenuButtons();
$display_page = -1;
$selected_page = null;
if (isset($_REQUEST['query'])) {
    $display_page = PMA_getDefaultPage($_REQUEST['db']);
} else {
    if (!empty($_REQUEST['page'])) {
        $display_page = $_REQUEST['page'];
    } else {
        $display_page = PMA_getLoadingPage($_REQUEST['db']);
    }
}
if ($display_page != -1) {
    $selected_page = PMA_getPageName($display_page);
}
$tab_pos = PMA_getTablePositions($display_page);
$script_contr = PMA_getScriptContr();
$params = array('lang' => $GLOBALS['lang']);
if (isset($_GET['db'])) {
    $params['db'] = $_GET['db'];
}
$response = PMA\libraries\Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('pmd_body');
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.fullscreen.js');
$scripts->addFile('pmd/designer_db.js');
$scripts->addFile('pmd/designer_objects.js');