setProperties();
}
/**
* Initialize the local variables that are used for export PDF
*
* @return void
*/
protected function initSpecificVariables()
{
global $table, $tables;
$this->_setTable($table);
$this->_setTables($tables);
}
/**
* Sets the export XML properties
*
* @return void
*/
protected function setProperties()
{
$props = 'libraries/properties/';
include_once "$props/plugins/ExportPluginProperties.class.php";
include_once "$props/options/groups/OptionsPropertyRootGroup.class.php";
include_once "$props/options/groups/OptionsPropertyMainGroup.class.php";
include_once "$props/options/items/HiddenPropertyItem.class.php";
include_once "$props/options/items/BoolPropertyItem.class.php";
// create the export plugin property item
$exportPluginProperties = new ExportPluginProperties();
$exportPluginProperties->setText('XML');
$exportPluginProperties->setExtension('xml');
$exportPluginProperties->setMimeType('text/xml');
$exportPluginProperties->setOptionsText(__('Options'));
// create the root group that will be the options field for
// $exportPluginProperties
// this will be shown as "Format specific options"
$exportSpecificOptions = new OptionsPropertyRootGroup();
$exportSpecificOptions->setName("Format Specific Options");
// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
// create primary items and add them to the group
$leaf = new HiddenPropertyItem();
$leaf->setName("structure_or_data");
$generalOptions->addProperty($leaf);
// add the main group to the root group
$exportSpecificOptions->addProperty($generalOptions);
// export structure main group
$structure = new OptionsPropertyMainGroup();
$structure->setName("structure");
$structure->setText(__('Object creation options (all are recommended)'));
// create primary items and add them to the group
if (! PMA_DRIZZLE) {
$leaf = new BoolPropertyItem();
$leaf->setName("export_functions");
$leaf->setText(__('Functions'));
$structure->addProperty($leaf);
$leaf = new BoolPropertyItem();
$leaf->setName("export_procedures");
$leaf->setText(__('Procedures'));
$structure->addProperty($leaf);
}
$leaf = new BoolPropertyItem();
$leaf->setName("export_tables");
$leaf->setText(__('Tables'));
$structure->addProperty($leaf);
if (! PMA_DRIZZLE) {
$leaf = new BoolPropertyItem();
$leaf->setName("export_triggers");
$leaf->setText(__('Triggers'));
$structure->addProperty($leaf);
$leaf = new BoolPropertyItem();
$leaf->setName("export_views");
$leaf->setText(__('Views'));
$structure->addProperty($leaf);
}
$exportSpecificOptions->addProperty($structure);
// data main group
$data = new OptionsPropertyMainGroup();
$data->setName("data");
$data->setText(__('Data dump options'));
// create primary items and add them to the group
$leaf = new BoolPropertyItem();
$leaf->setName("export_contents");
$leaf->setText(__('Export contents'));
$data->addProperty($leaf);
$exportSpecificOptions->addProperty($data);
// set the options for the export plugin property item
$exportPluginProperties->setOptions($exportSpecificOptions);
$this->properties = $exportPluginProperties;
}
/**
* This method is called when any PluginManager to which the observer
* is attached calls PluginManager::notify()
*
* @param SplSubject $subject The PluginManager notifying the observer
* of an update.
*
* @return void
*/
public function update (SplSubject $subject)
{
}
/**
* Outputs export header. It is the first method to be called, so all
* the required variables are initialized here.
*
* @return bool Whether it succeeded
*/
public function exportHeader ()
{
$this->initSpecificVariables();
global $crlf, $cfg, $db;
$table = $this->_getTable();
$tables = $this->_getTables();
$export_struct = isset($GLOBALS['xml_export_functions'])
|| isset($GLOBALS['xml_export_procedures'])
|| isset($GLOBALS['xml_export_tables'])
|| isset($GLOBALS['xml_export_triggers'])
|| isset($GLOBALS['xml_export_views']);
$export_data = isset($GLOBALS['xml_export_contents']) ? true : false;
if ($GLOBALS['output_charset_conversion']) {
$charset = $GLOBALS['charset_of_file'];
} else {
$charset = 'utf-8';
}
$head = '' . $crlf
. '' . $crlf . $crlf;
$head .= '