Пример #1
0
 /**
  * Test for PMA_getHtmlForEditOrDeletePages()
  *
  * @return void
  */
 public function testGetHtmlForEditOrDeletePages()
 {
     $db = 'db';
     $operation = 'edit';
     $this->_mockDatabaseInteraction($db);
     $result = PMA_getHtmlForEditOrDeletePages($db, $operation);
     $this->assertContains('<input type="hidden" name="operation" value="' . $operation . '" />', $result);
     $this->assertContains('<select name="selected_page" id="selected_page">', $result);
     $this->assertContains('<option value="0">', $result);
     $this->assertContains('<option value="1">page1</option>', $result);
     $this->assertContains('<option value="2">page2</option>', $result);
 }
Пример #2
0
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin designer general code
 *
 * @package PhpMyAdmin-Designer
 */
require_once 'libraries/common.inc.php';
require_once 'libraries/pmd_common.php';
require_once 'libraries/db_designer.lib.php';
$response = PMA\libraries\Response::getInstance();
if (isset($_REQUEST['dialog'])) {
    if ($_REQUEST['dialog'] == 'edit') {
        $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage');
    } else {
        if ($_REQUEST['dialog'] == 'delete') {
            $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage');
        } else {
            if ($_REQUEST['dialog'] == 'save_as') {
                $html = PMA_getHtmlForPageSaveAs($GLOBALS['db']);
            } else {
                if ($_REQUEST['dialog'] == 'export') {
                    include_once 'libraries/plugin_interface.lib.php';
                    $html = PMA_getHtmlForSchemaExport($GLOBALS['db'], $_REQUEST['selected_page']);
                }
            }
        }
    }
    if (!empty($html)) {
        $response->addHTML($html);
    }
    return;