Server IP : 127.0.0.2 / Your IP : 3.145.177.28 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpmyadmin/libraries/plugins/schema/ |
Upload File : |
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * PDF schema export code * * @package PhpMyAdmin-Schema * @subpackage PDF */ if (! defined('PHPMYADMIN')) { exit; } /* Get the schema export interface */ require_once 'libraries/plugins/SchemaPlugin.class.php'; require_once 'libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php'; /** * Handles the schema export for the PDF format * * @package PhpMyAdmin-Schema * @subpackage PDF */ class SchemaPdf extends SchemaPlugin { /** * Constructor */ public function __construct() { $this->setProperties(); } /** * Sets the schema export PDF properties * * @return void */ protected function setProperties() { $props = 'libraries/properties/'; include_once "$props/plugins/SchemaPluginProperties.class.php"; include_once "$props/options/groups/OptionsPropertyRootGroup.class.php"; include_once "$props/options/groups/OptionsPropertyMainGroup.class.php"; include_once "$props/options/items/BoolPropertyItem.class.php"; include_once "$props/options/items/SelectPropertyItem.class.php"; $schemaPluginProperties = new SchemaPluginProperties(); $schemaPluginProperties->setText('PDF'); $schemaPluginProperties->setExtension('pdf'); $schemaPluginProperties->setMimeType('application/pdf'); // create the root group that will be the options field for // $schemaPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup(); $exportSpecificOptions->setName("Format Specific Options"); // specific options main group $specificOptions = new OptionsPropertyMainGroup(); $specificOptions->setName("general_opts"); // add options common to all plugins $this->addCommonOptions($specificOptions); // create leaf items and add them to the group $leaf = new BoolPropertyItem(); $leaf->setName('all_tables_same_width'); $leaf->setText(__('Same width for all tables')); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem(); $leaf->setName("orientation"); $leaf->setText(__('Orientation')); $leaf->setValues( array( 'L' => __('Landscape'), 'P' => __('Portrait'), ) ); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem(); $leaf->setName("paper"); $leaf->setText(__('Paper size')); $leaf->setValues($this->_getPaperSizeArray()); $specificOptions->addProperty($leaf); $leaf = new BoolPropertyItem(); $leaf->setName('show_grid'); $leaf->setText(__('Show grid')); $specificOptions->addProperty($leaf); $leaf = new BoolPropertyItem(); $leaf->setName('with_doc'); $leaf->setText(__('Data dictionary')); $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem(); $leaf->setName("table_order"); $leaf->setText(__('Order of the tables')); $leaf->setValues( array( '' => __('None'), 'name_asc' => __('Name (Ascending)'), 'name_desc' => __('Name (Descending)'), ) ); $specificOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($specificOptions); // set the options for the schema export plugin property item $schemaPluginProperties->setOptions($exportSpecificOptions); $this->properties = $schemaPluginProperties; } /** * Returns the array of paper sizes * * @return array array of paper sizes */ private function _getPaperSizeArray() { $ret = array(); foreach ($GLOBALS['cfg']['PDFPageSizes'] as $val) { $ret[$val] = $val; } return $ret; } /** * Exports the schema into PDF format. * * @param string $db database name * * @return bool Whether it succeeded */ public function exportSchema($db) { $export = new PMA_Pdf_Relation_Schema($db); $export->showOutput(); } }