';
-
- return $html;
+ return PMA\Template::get('columns_definitions/column_indexes')->render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'columnMeta' => $columnMeta
+ ));
}
/**
@@ -1003,12 +665,11 @@ function PMA_getHtmlForIndexTypeOption($columnNumber, $columnMeta, $type, $key)
*/
function PMA_getHtmlForColumnAdjustPrivileges($columnNumber, $ci, $ci_offset)
{
- $html = ' ';
-
- return $html;
+ return PMA\Template::get('columns_definitions/column_adjust_privileges')->render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset
+ ));
}
/**
@@ -1023,18 +684,12 @@ function PMA_getHtmlForColumnAdjustPrivileges($columnNumber, $ci, $ci_offset)
*/
function PMA_getHtmlForColumnNull($columnNumber, $ci, $ci_offset, $columnMeta)
{
- $html = ' render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'columnMeta' => $columnMeta
+ ));
}
/**
@@ -1049,17 +704,12 @@ function PMA_getHtmlForColumnNull($columnNumber, $ci, $ci_offset, $columnMeta)
*/
function PMA_getHtmlForColumnExtra($columnNumber, $ci, $ci_offset, $columnMeta)
{
- $html = ' render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'columnMeta' => $columnMeta
+ ));
}
/**
@@ -1078,10 +728,6 @@ function PMA_getHtmlForColumnExtra($columnNumber, $ci, $ci_offset, $columnMeta)
function PMA_getHtmlForColumnAttribute($columnNumber, $ci, $ci_offset,
$extracted_columnspec, $columnMeta, $submit_attribute, $analyzed_sql
) {
- $html = '';
-
$attribute = '';
if (isset($extracted_columnspec['attribute'])) {
$attribute = $extracted_columnspec['attribute'];
@@ -1116,18 +762,15 @@ function PMA_getHtmlForColumnAttribute($columnNumber, $ci, $ci_offset,
$attribute_types = $GLOBALS['PMA_Types']->getAttributes();
$cnt_attribute_types = count($attribute_types);
- for ($j = 0; $j < $cnt_attribute_types; $j++) {
- $html .= ' ';
- }
- $html .= ' ';
-
- return $html;
+ return PMA\Template::get('columns_definitions/column_attribute')->render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'attribute_types' => $attribute_types,
+ 'cnt_attribute_types' => $cnt_attribute_types,
+ 'attribute' => $attribute
+ ));
}
/**
@@ -1166,21 +809,13 @@ function PMA_getHtmlForColumnCollation($columnNumber, $ci, $ci_offset, $columnMe
function PMA_getHtmlForColumnLength($columnNumber, $ci, $ci_offset,
$length_values_input_size, $length_to_display
) {
- $html = ' '
- . '';
- $html .= ' '
- . __('Edit ENUM/SET values') . ' '
- . '
';
-
- return $html;
+ return PMA\Template::get('columns_definitions/column_length')->render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'length_values_input_size' => $length_values_input_size,
+ 'length_to_display' => $length_to_display
+ ));
}
/**
@@ -1222,39 +857,18 @@ function PMA_getHtmlForColumnDefault($columnNumber, $ci, $ci_offset, $type_upper
$columnMeta['DefaultValue'] = bin2hex($columnMeta['DefaultValue']);
}
- $html = '';
- foreach ($default_options as $key => $value) {
- $html .= '';
- }
- $html .= ' ';
- $html .= ' ';
-
- $value = isset($columnMeta['DefaultValue'])
+ $default_value = isset($columnMeta['DefaultValue'])
? htmlspecialchars($columnMeta['DefaultValue'])
: '';
- if ($GLOBALS['cfg']['CharEditing'] == 'textarea') {
- $html .= '';
- } else {
- $html .= ' ';
- }
- return $html;
+ return PMA\Template::get('columns_definitions/column_default')->render(array(
+ 'columnNumber' => $columnNumber,
+ 'ci' => $ci,
+ 'ci_offset' => $ci_offset,
+ 'default_value' => $default_value,
+ 'default_options' => $default_options,
+ 'column_meta' => $columnMeta
+ ));
}
/**
diff --git a/libraries/tbl_gis_visualization.lib.php b/libraries/tbl_gis_visualization.lib.php
index 7f25e11dfd..b3c3f4f68c 100644
--- a/libraries/tbl_gis_visualization.lib.php
+++ b/libraries/tbl_gis_visualization.lib.php
@@ -10,6 +10,7 @@ if (!defined('PHPMYADMIN')) {
}
require_once 'libraries/sql.lib.php';
+require_once 'libraries/Template.class.php';
/**
* Returns a modified sql query with only the label column
@@ -126,81 +127,6 @@ function PMA_GIS_saveToFile($data, $visualizationSettings, $format, $fileName)
}
}
-/**
- * Function to get html for the label column and spatial column
- *
- * @param string $column the column type. i.e either "labelColumn"
- * or "spatialColumn"
- * @param array $columnCandidates the list of select options
- * @param array $visualizationSettings visualization settings
- *
- * @return string $html
- */
-function PMA_getHtmlForSelect($column, $columnCandidates, $visualizationSettings)
-{
- $html = '';
- $html .= ($column=="labelColumn") ? __("Label column") : __("Spatial column");
- $html .= ' ';
-
- $html .= '';
-
- if ($column == "labelColumn") {
- $html .= '' . __("-- None --") . ' ';
- }
-
- $html .= PMA_getHtmlForOptionsList(
- $columnCandidates, array($visualizationSettings[$column])
- );
-
- $html .= ' ';
-
- return $html;
-}
-
-/**
- * Function to get HTML for the option of using open street maps
- *
- * @param boolean $isSelected the default value
- *
- * @return string HTML string
- */
-function PMA_getHtmlForUseOpenStreetMaps($isSelected)
-{
- $html = '';
- $html .= ' ';
- $html .= '' . $label . ' ';
- $html .= '';
-
- return $html;
-}
-
/**
* Function to generate HTML for the GIS visualization page
*
@@ -219,74 +145,20 @@ function PMA_getHtmlForGisVisualization(
$url_params, $labelCandidates, $spatialCandidates, $visualizationSettings,
$sql_query, $visualization, $svg_support, $data
) {
- $html = '';
- $html .= '
';
- $html .= '' . __('Display GIS Visualization') . ' ';
-
- $html .= '';
- $html .= '
';
-
- $html .= '
';
- $html .= '
';
- $html .= '
';
- $html .= PMA_Util::getImage('b_saveimage', __('Save'));
- $html .= ' ';
-
$url_params['sql_query'] = $sql_query;
$url_params['saveToFile'] = 'download';
$url = 'tbl_gis_visualization.php' . PMA_URL_getCommon($url_params);
- $html .= '
';
- $html .= PMA_getHtmlForGisDownloadLink($url, 'png', 'PNG');
- $html .= PMA_getHtmlForGisDownloadLink($url, 'pdf', 'PDF');
- if ($svg_support) {
- $html .= PMA_getHtmlForGisDownloadLink($url, 'svg', 'SVG');
- }
- $html .= ' ';
- $html .= '
';
-
- $html .= '
';
-
- $html .= '
';
-
- $html .= '';
- $html .= $visualization;
- $html .= '
';
-
- $html .= '
';
- $html .= ' ';
- $html .= '';
- $html .= ' ';
- $html .= '
';
-
- return $html;
+ return PMA\Template::get('gis_visualization/gis_visualization')->render(array(
+ 'url_params' => $url_params,
+ 'url' => $url,
+ 'labelCandidates' => $labelCandidates,
+ 'spatialCandidates' => $spatialCandidates,
+ 'visualizationSettings' => $visualizationSettings,
+ 'sql_query' => $sql_query,
+ 'visualization' => $visualization,
+ 'svg_support' => $svg_support,
+ 'data' => $data
+ ));
}
?>
diff --git a/libraries/tbl_indexes.lib.php b/libraries/tbl_indexes.lib.php
index 595c1d5711..5f59a961a5 100644
--- a/libraries/tbl_indexes.lib.php
+++ b/libraries/tbl_indexes.lib.php
@@ -9,6 +9,8 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/Template.class.php';
+
/**
* Function to get the name and type of the columns of a table
*
@@ -263,218 +265,11 @@ function PMA_getFormParameters($db, $table)
*/
function PMA_getHtmlForIndexForm($fields, $index, $form_params, $add_fields)
{
- $html = "";
- $html .= '';
-
- return $html;
+ return PMA\Template::get('index_form')->render(array(
+ 'fields' => $fields,
+ 'index' => $index,
+ 'form_params' => $form_params,
+ 'add_fields' => $add_fields
+ ));
}
?>
diff --git a/libraries/tbl_printview.lib.php b/libraries/tbl_printview.lib.php
index 52d44d114d..86b3452cc1 100644
--- a/libraries/tbl_printview.lib.php
+++ b/libraries/tbl_printview.lib.php
@@ -9,6 +9,8 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/Template.class.php';
+
/**
* return html for tables' info
*
@@ -18,21 +20,10 @@ if (! defined('PHPMYADMIN')) {
*/
function PMA_getHtmlForTablesInfo($the_tables)
{
- $html = '';
- $multi_tables = (count($the_tables) > 1);
-
- if ($multi_tables) {
- $tbl_list = '';
- foreach ($the_tables as $table) {
- $tbl_list .= (empty($tbl_list) ? '' : ', ')
- . PMA_Util::backquote($table);
- }
- $html .= '' . __('Showing tables:') . ' '
- . htmlspecialchars($tbl_list) . ' ' . "\n";
- $html .= ' ' . "\n";
- } // end if
-
- return $html;
+ return PMA\Template::get('printview/tables_info')
+ ->render(array(
+ 'tables' => $the_tables
+ ));
}
@@ -43,10 +34,7 @@ function PMA_getHtmlForTablesInfo($the_tables)
*/
function PMA_getHtmlForPrintViewFooter()
{
- $html = PMA_Util::getButton();
- $html .= "\n";
-
- return $html;
+ return PMA\Template::get('printview/footer')->render();
}
/**
@@ -67,93 +55,16 @@ function PMA_getHtmlForPrintViewColumns(
$tbl_is_view, $columns, $analyzed_sql, $have_rel,
$res_rel, $db, $table, $cfgRelation
) {
- $html = '';
- $primary = PMA_Index::getPrimary($table, $db);
- foreach ($columns as $row) {
- $extracted_columnspec = PMA_Util::extractColumnSpec($row['Type']);
- $type = $extracted_columnspec['print_type'];
-
- if (! isset($row['Default'])) {
- if ($row['Null'] != '' && $row['Null'] != 'NO') {
- $row['Default'] = 'NULL ';
- }
- } else {
- $row['Default'] = htmlspecialchars($row['Default']);
- }
- $field_name = htmlspecialchars($row['Field']);
-
- if (! $tbl_is_view) {
- // here, we have a TIMESTAMP that SHOW FULL COLUMNS reports as having
- // the NULL attribute, but SHOW CREATE TABLE says the contrary.
- // Believe the latter.
- /**
- * @todo merge this logic with the one in tbl_structure.php
- * or move it in a function similar to $GLOBALS['dbi']->getColumnsFull()
- * but based on SHOW CREATE TABLE because information_schema
- * cannot be trusted in this case (MySQL bug)
- */
- $analyzed_for_field
- = $analyzed_sql[0]['create_table_fields'][$field_name];
- if (! empty($analyzed_for_field['type'])
- && $analyzed_for_field['type'] == 'TIMESTAMP'
- && $analyzed_for_field['timestamp_not_null']
- ) {
- $row['Null'] = '';
- }
- }
-
- $html .= "\n";
- $html .= ' ';
-
- $html .= ' ' . $field_name . "\n";
- if ($primary && $primary->hasColumn($field_name)) {
- $html .= ' (' . __('Primary') . ') ';
- }
- $html .= "\n";
- $html .= ' ';
- $html .= '' . htmlspecialchars($type) . ' ';
- $html .= '';
- $html .= (($row['Null'] == '' || $row['Null'] == 'NO')
- ? __('No')
- : __('Yes'));
- $html .= ' ';
- $html .= '';
- if (isset($row['Default'])) {
- $html .= $row['Default'];
- }
- $html .= ' ';
- if ($have_rel) {
- $html .= ' ';
- $foreigner = PMA_searchColumnInForeigners($res_rel, $field_name);
- if ($foreigner) {
- $html .= htmlspecialchars(
- $foreigner['foreign_table']
- . ' -> ' . $foreigner['foreign_field']
- );
- }
- $html .= ' ' . "\n";
- }
- $html .= ' ';
- $comments = PMA_getComments($db, $table);
- if (isset($comments[$field_name])) {
- $html .= htmlspecialchars($comments[$field_name]);
- }
- $html .= ' ' . "\n";
- if ($cfgRelation['mimework']) {
- $mime_map = PMA_getMIME($db, $table, true);
-
- $html .= ' ';
- if (isset($mime_map[$field_name])) {
- $html .= htmlspecialchars(
- str_replace('_', '/', $mime_map[$field_name]['mimetype'])
- );
- }
- $html .= ' ' . "\n";
- }
- $html .= ' ';
- } // end foreach
-
- return $html;
+ return PMA\Template::get('printview/columns')->render(array(
+ 'tbl_is_view' => $tbl_is_view,
+ 'columns' => $columns,
+ 'analyzed_sql' => $analyzed_sql,
+ 'have_rel' => $have_rel,
+ 'res_rel' => $res_rel,
+ 'db' => $db,
+ 'table' => $table,
+ 'cfgRelation' => $cfgRelation
+ ));
}
/**
@@ -170,108 +81,14 @@ function PMA_getHtmlForPrintViewColumns(
function PMA_getHtmlForRowStatistics(
$showtable, $cell_align_left, $avg_size, $avg_unit, $mergetable
) {
- $html = ' ';
-
- // Rows Statistic
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Row Statistics:') . ' ';
- $html .= '';
- if (isset($showtable['Row_format'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Format') . ' ';
- $html .= '';
- if ($showtable['Row_format'] == 'Fixed') {
- $html .= __('static');
- } elseif ($showtable['Row_format'] == 'Dynamic') {
- $html .= __('dynamic');
- } else {
- $html .= $showtable['Row_format'];
- }
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Rows'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Rows') . ' ';
- $html .= '';
- $html .= PMA_Util::formatNumber($showtable['Rows'], 0);
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Avg_row_length'])
- && $showtable['Avg_row_length'] > 0
- ) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Row length') . ' ø ';
- $html .= '';
- $html .= PMA_Util::formatNumber(
- $showtable['Avg_row_length'], 0
- );
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Data_length'])
- && $showtable['Rows'] > 0
- && $mergetable == false
- ) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Row size') . ' ø ';
- $html .= '';
- $html .= $avg_size . ' ' . $avg_unit;
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Auto_increment'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Next autoindex') . ' ';
- $html .= '';
- $html .= PMA_Util::formatNumber(
- $showtable['Auto_increment'], 0
- );
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Create_time'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Creation') . ' ';
- $html .= '';
- $html .= PMA_Util::localisedDate(
- strtotime($showtable['Create_time'])
- );
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Update_time'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Last update') . ' ';
- $html .= '';
- $html .= PMA_Util::localisedDate(
- strtotime($showtable['Update_time'])
- );
- $html .= ' ';
- $html .= ' ';
- }
- if (isset($showtable['Check_time'])) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Last check') . ' ';
- $html .= '';
- $html .= PMA_Util::localisedDate(
- strtotime($showtable['Check_time'])
- );
- $html .= ' ';
- $html .= ' ';
- }
-
- return $html;
+ return PMA\Template::get('printview/row_statistics')
+ ->render(array(
+ 'showtable' => $showtable,
+ 'cell_align_left' => $cell_align_left,
+ 'avg_size' => $avg_size,
+ 'avg_unit' => $avg_unit,
+ 'mergetable' => $mergetable
+ ));
}
/**
@@ -296,56 +113,20 @@ function PMA_getHtmlForSpaceUsage(
$free_size, $free_unit, $effect_size, $effect_unit,
$tot_size, $tot_unit, $mergetable
) {
- $html = '';
- $html .= "\n";
- $html .= '';
-
- // Space usage
- $html .= '';
- $html .= '' . __('Space usage:') . ' ';
- $html .= '';
- $html .= '';
- $html .= '' . __('Data') . ' ';
- $html .= '' . $data_size . ' ';
- $html .= '' . $data_unit . ' ';
- $html .= ' ';
- if (isset($index_size)) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Index') . ' ';
- $html .= '' . $index_size . ' ';
- $html .= '' . $index_unit . ' ';
- $html .= ' ';
- }
- if (isset($free_size)) {
- $html .= "\n";
- $html .= '';
- $html .= '';
- $html .= __('Overhead');
- $html .= ' ';
- $html .= '' . $free_size . ' ';
- $html .= '' . $free_unit . ' ';
- $html .= ' ';
- $html .= '';
- $html .= '';
- $html .= __('Effective');
- $html .= ' ';
- $html .= '' . $effect_size . ' ';
- $html .= '' . $effect_unit . ' ';
- $html .= ' ';
- }
- if (isset($tot_size) && $mergetable == false) {
- $html .= "\n";
- $html .= '';
- $html .= '' . __('Total') . ' ';
- $html .= '' . $tot_size . ' ';
- $html .= '' . $tot_unit . ' ';
- $html .= ' ';
- }
- $html .= "\n";
- $html .= '
';
-
- return $html;
+ return PMA\Template::get('printview/space_usage')
+ ->render(array(
+ 'data_size' => $data_size,
+ 'data_unit' => $data_unit,
+ 'index_size' => $index_size,
+ 'index_unit' => $index_unit,
+ 'free_size' => $free_size,
+ 'free_unit' => $free_unit,
+ 'effect_size' => $effect_size,
+ 'effect_unit' => $effect_unit,
+ 'tot_size' => $tot_size,
+ 'tot_unit' => $tot_unit,
+ 'mergetable' => $mergetable
+ ));
}
/**
* return html for Space Usage And Row Statistic
@@ -360,7 +141,6 @@ function PMA_getHtmlForSpaceUsage(
function PMA_getHtmlForSpaceUsageAndRowStatistics(
$showtable, $db, $table, $cell_align_left
) {
- $html = '';
$nonisam = false;
if (isset($showtable['Type'])
&& ! preg_match('@ISAM|HEAP@i', $showtable['Type'])
@@ -376,73 +156,57 @@ function PMA_getHtmlForSpaceUsageAndRowStatistics(
$showtable['Data_length']
);
if ($mergetable == false) {
- list($index_size, $index_unit)
- = PMA_Util::formatByteDown(
- $showtable['Index_length']
- );
+ list($index_size, $index_unit) = PMA_Util::formatByteDown(
+ $showtable['Index_length']
+ );
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
- list($free_size, $free_unit)
- = PMA_Util::formatByteDown(
- $showtable['Data_free']
- );
- list($effect_size, $effect_unit)
- = PMA_Util::formatByteDown(
- $showtable['Data_length'] + $showtable['Index_length']
- - $showtable['Data_free']
- );
+ list($free_size, $free_unit) = PMA_Util::formatByteDown(
+ $showtable['Data_free']
+ );
+ list($effect_size, $effect_unit) = PMA_Util::formatByteDown(
+ $showtable['Data_length'] + $showtable['Index_length']
+ - $showtable['Data_free']
+ );
} else {
unset($free_size);
unset($free_unit);
- list($effect_size, $effect_unit)
- = PMA_Util::formatByteDown(
- $showtable['Data_length'] + $showtable['Index_length']
- );
+ list($effect_size, $effect_unit) = PMA_Util::formatByteDown(
+ $showtable['Data_length'] + $showtable['Index_length']
+ );
}
list($tot_size, $tot_unit) = PMA_Util::formatByteDown(
$showtable['Data_length'] + $showtable['Index_length']
);
- $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
+ $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
if ($num_rows > 0) {
- list($avg_size, $avg_unit)
- = PMA_Util::formatByteDown(
- ($showtable['Data_length'] + $showtable['Index_length'])
- / $showtable['Rows'],
- 6,
- 1
- );
+ list($avg_size, $avg_unit) = PMA_Util::formatByteDown(
+ ($showtable['Data_length'] + $showtable['Index_length'])
+ / $showtable['Rows'],
+ 6, 1
+ );
}
- // Displays them
- $html .= ' ';
- $html .= PMA_getHtmlForSpaceUsage(
- $data_size, $data_unit,
- isset($index_size)? $index_size : null,
- isset($index_unit)? $index_unit : null,
- isset($free_size)? $free_size : null,
- isset($free_unit)? $free_unit : null,
- isset($effect_size)? $effect_size : null,
- isset($effect_unit)? $effect_unit : null,
- isset($tot_size)? $tot_size : null,
- isset($tot_unit)? $tot_unit : null,
- $mergetable
- );
-
- $html .= ' ';
- $html .= PMA_getHtmlForRowStatistics(
- $showtable, $cell_align_left,
- isset($avg_size)? $avg_size: 0,
- isset($avg_unit)? $avg_unit: 0,
- $mergetable
- );
- $html .= "\n";
- $html .= '
';
- $html .= '';
- $html .= '';
- $html .= '
';
- } // end if ($nonisam == false)
-
- return $html;
+ return PMA\Template::get(
+ 'printview/space_usage_and_row_statistics'
+ )->render(array(
+ 'data_size' => $data_size,
+ 'data_unit' => $data_unit,
+ 'index_size' => $index_size,
+ 'index_unit' => $index_unit,
+ 'free_size' => $free_size,
+ 'free_unit' => $free_unit,
+ 'effect_size' => $effect_size,
+ 'effect_unit' => $effect_unit,
+ 'tot_size' => $tot_size,
+ 'tot_unit' => $tot_unit,
+ 'mergetable' => $mergetable,
+ 'showtable' => $showtable,
+ 'cell_align_left' => $cell_align_left,
+ 'avg_size' => $avg_size,
+ 'avg_unit' => $avg_unit
+ ));
+ }
}
/**
@@ -467,50 +231,20 @@ function PMA_getHtmlForTableStructure(
$res_rel, $db, $table, $cfgRelation,
$cfg, $showtable, $cell_align_left
) {
- /**
- * Displays the table structure
- */
- $html = '';
- $html .= '';
- $html .= '';
- $html .= '' . __('Column') . ' ';
- $html .= '' . __('Type') . ' ';
- $html .= '' . __('Null') . ' ';
- $html .= '' . __('Default') . ' ';
- if ($have_rel) {
- $html .= '' . __('Links to') . ' ' . "\n";
- }
- $html .= ' ' . __('Comments') . ' ' . "\n";
- if ($cfgRelation['mimework']) {
- $html .= ' MIME ' . "\n";
- }
- $html .= ' ';
- $html .= ' ';
- $html .= '';
- $html .= PMA_getHtmlForPrintViewColumns(
- $tbl_is_view, $columns, $analyzed_sql, $have_rel,
- $res_rel, $db, $table, $cfgRelation
- );
- $html .= ' ';
- $html .= '
';
- if (! $tbl_is_view && !$GLOBALS['dbi']->isSystemSchema($db)) {
- /**
- * Displays indexes
- */
- $html .= PMA_Index::getHtmlForIndexes($table, $db, true);
-
- /**
- * Displays Space usage and row statistics
- *
- */
- if ($cfg['ShowStats']) {
- $html .= PMA_getHtmlForSpaceUsageAndRowStatistics(
- $showtable, $db, $table, $cell_align_left
- );
- } // end if ($cfg['ShowStats'])
- }
-
- return $html;
+ return PMA\Template::get('printview/tables_structure')
+ ->render(array(
+ 'have_rel' => $have_rel,
+ 'tbl_is_view' => $tbl_is_view,
+ 'columns' => $columns,
+ 'analyzed_sql' => $analyzed_sql,
+ 'res_rel' => $res_rel,
+ 'db' => $db,
+ 'table' => $table,
+ 'cfgRelation' => $cfgRelation,
+ 'cfg' => $cfg,
+ 'showtable' => $showtable,
+ 'cell_align_left' => $cell_align_left
+ ));
}
/**
@@ -527,20 +261,13 @@ function PMA_getHtmlForTableStructure(
function PMA_getHtmlForTablesDetail(
$the_tables, $db, $cfg, $cfgRelation, $cell_align_left
) {
- $html = '';
$tables_cnt = count($the_tables);
$multi_tables = (count($the_tables) > 1);
$counter = 0;
+ $html = '';
+ $template = PMA\Template::get('printview/tables_detail');
foreach ($the_tables as $table) {
- if ($counter + 1 >= $tables_cnt) {
- $breakstyle = '';
- } else {
- $breakstyle = ' style="page-break-after: always;"';
- }
- $counter++;
- $html .= '' . "\n";
- $html .= '
' . htmlspecialchars($table) . ' ' . "\n";
/**
* Gets table informations
@@ -574,29 +301,28 @@ function PMA_getHtmlForTablesDetail(
$res_rel = PMA_getForeigners($db, $table);
$have_rel = (bool) count($res_rel);
- /**
- * Displays the comments of the table if MySQL >= 3.23
- */
- if (!empty($show_comment)) {
- $html .= __('Table comments:') . ' '
- . htmlspecialchars($show_comment) . ' ';
- }
-
- $html .= PMA_getHtmlForTableStructure(
- $have_rel, $tbl_is_view, $columns, $analyzed_sql,
- $res_rel, $db, $table, $cfgRelation,
- $cfg, $showtable, $cell_align_left
- );
+ $html .= $template->render(array(
+ 'counter' => $counter,
+ 'tables_cnt' => $tables_cnt,
+ 'table' => $table,
+ 'show_comment' => $show_comment,
+ 'have_rel' => $have_rel,
+ 'tbl_is_view' => $tbl_is_view,
+ 'columns' => $columns,
+ 'analyzed_sql' => $analyzed_sql,
+ 'res_rel' => $res_rel,
+ 'db' => $db,
+ 'cfgRelation' => $cfgRelation,
+ 'cfg' => $cfg,
+ 'showtable' => $showtable,
+ 'cell_align_left' => $cell_align_left,
+ 'multi_tables' => $multi_tables
+ ));
if ($multi_tables) {
unset($num_rows, $show_comment);
- $html .= ' ' . "\n";
- } // end if
- $html .= '' . "\n";
-
+ }
} // end while
-
return $html;
}
-
?>
diff --git a/libraries/tbl_relation.lib.php b/libraries/tbl_relation.lib.php
index 329ae0a00e..7a6283c3f2 100644
--- a/libraries/tbl_relation.lib.php
+++ b/libraries/tbl_relation.lib.php
@@ -6,6 +6,8 @@
* @package PhpMyAdmin
*/
+require_once 'libraries/Template.class.php';
+
/**
* Generate dropdown choices
*
@@ -21,20 +23,12 @@
function PMA_generateDropdown(
$dropdown_question, $select_name, $choices, $selected_value
) {
- $html_output = (! empty($dropdown_question) ?
- htmlspecialchars($dropdown_question) . ' ' : '')
- . '' . "\n";
-
- foreach ($choices as $one_value => $one_label) {
- $html_output .= '' . "\n";
- }
- $html_output .= ' ' . "\n";
-
- return $html_output;
+ return PMA\Template::get('tbl_relation/dropdown_generate')->render(array(
+ 'dropdown_question' => $dropdown_question,
+ 'select_name' => $select_name,
+ 'choices' => $choices,
+ 'selected_value' => $selected_value
+ ));
}
/**
@@ -143,25 +137,12 @@ function PMA_getSQLToCreateForeignKey($table, $field, $foreignDb, $foreignTable,
function PMA_generateRelationalDropdown(
$name, $values = array(), $foreign = false, $title = ''
) {
- $html_output = '';
- $html_output .= ' ';
-
- $seen_key = false;
- foreach ($values as $value) {
- $html_output .= '';
- }
-
- if (is_string($foreign) && ! $seen_key) {
- $html_output .= ' ' . htmlspecialchars($foreign) . ' ';
- }
- $html_output .= ' ';
- return $html_output;
+ return PMA\Template::get('tbl_relation/relational_dropdown')->render(array(
+ 'name' => $name,
+ 'title' => $title,
+ 'values' => $values,
+ 'foreign' => $foreign
+ ));
}
/**
@@ -181,80 +162,16 @@ function PMA_generateRelationalDropdown(
function PMA_getHtmlForCommonForm($db, $table, $columns, $cfgRelation,
$tbl_storage_engine, $existrel, $existrel_foreign, $options_array
) {
- $html_output = PMA_getHtmlForCommonFormHeader($db, $table);
-
- if ($cfgRelation['relwork']) {
- $html_output .= PMA_getHtmlForInternalRelationForm(
- $columns, $tbl_storage_engine, $existrel, $db
- );
- }
-
- if (PMA_Util::isForeignKeySupported($tbl_storage_engine)) {
- $html_output .= PMA_getHtmlForForeignKeyForm(
- $columns, $existrel_foreign,
- $db, $tbl_storage_engine, $options_array
- );
- } // end if (InnoDB)
-
- if ($cfgRelation['displaywork']) {
- $html_output .= PMA_getHtmlForDisplayFieldInfos(
- $db, $table,
- array_values($columns)
- );
- }
-
- $html_output .= PMA_getHtmlForCommonFormFooter();
-
- return $html_output;
-}
-
-/**
- * Function to get html for Internal relations form
- *
- * @param array $columns columns
- * @param string $tbl_storage_engine table storage engine
- * @param array $existrel db, table, column
- * @param string $db current database
- *
- * @return string
- */
-function PMA_getHtmlForInternalRelationForm($columns, $tbl_storage_engine,
- $existrel, $db
-) {
- $save_row = array_values($columns);
- $saved_row_cnt = count($save_row);
-
- $html_output = ''
- . '' . __('Internal relations') . ' '
- . '';
-
- $html_output .= '' . __('Column') . ' ';
-
- $html_output .= '' . __('Internal relation');
- if (PMA_Util::isForeignKeySupported($tbl_storage_engine)) {
- $html_output .= PMA_Util::showHint(
- __(
- 'An internal relation is not necessary when a corresponding'
- . ' FOREIGN KEY relation exists.'
- )
- );
- }
-
- $html_output .= ' ';
-
- $odd_row = true;
- for ($i = 0; $i < $saved_row_cnt; $i++) {
- $html_output .= PMA_getHtmlForInternalRelationRow(
- $save_row, $i, $odd_row,
- $existrel, $db
- );
- $odd_row = ! $odd_row;
- }
-
- $html_output .= '
';
- $html_output .= ' ';
-
- return $html_output;
+ return PMA\Template::get('tbl_relation/common_form')->render(array(
+ 'db' => $db,
+ 'table' => $table,
+ 'columns' => $columns,
+ 'cfgRelation' => $cfgRelation,
+ 'tbl_storage_engine' => $tbl_storage_engine,
+ 'existrel' => $existrel,
+ 'existrel_foreign' => $existrel_foreign,
+ 'options_array' => $options_array
+ ));
}
/**
@@ -277,15 +194,6 @@ function PMA_getHtmlForInternalRelationRow($save_row, $i, $odd_row,
$myfield_md5 = md5($myfield);
$myfield_html = htmlspecialchars($myfield);
- $html_output = ' '
- . ''
- . '' . $myfield_html . ' '
- . ' '
- . ' ';
-
- $html_output .= '';
-
$foreign_table = false;
$foreign_column = false;
@@ -295,13 +203,6 @@ function PMA_getHtmlForInternalRelationRow($save_row, $i, $odd_row,
} else {
$foreign_db = $db;
}
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_db[' . $myfield_md5 . ']',
- $GLOBALS['pma']->databases,
- $foreign_db,
- __('Database')
- );
- // end of database dropdown
// table dropdown
$tables = array();
@@ -318,13 +219,6 @@ function PMA_getHtmlForInternalRelationRow($save_row, $i, $odd_row,
$tables[] = $row[0];
}
}
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_table[' . $myfield_md5 . ']',
- $tables,
- $foreign_table,
- __('Table')
- );
- // end of table dropdown
// column dropdown
$columns = array();
@@ -335,77 +229,17 @@ function PMA_getHtmlForInternalRelationRow($save_row, $i, $odd_row,
$table_obj = new PMA_Table($foreign_table, $foreign_db);
$columns = $table_obj->getUniqueColumns(false, false);
}
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_column[' . $myfield_md5 . ']',
- $columns,
- $foreign_column,
- __('Column')
- );
- // end of column dropdown
- $html_output .= ' ';
- $html_output .= ' ';
-
- return $html_output;
-}
-
-/**
- * Function to get html for Foreign key form
- *
- * @param array $columns columns
- * @param array $existrel_foreign db, table, column
- * @param string $db current database
- * @param string $tbl_storage_engine table storage engine
- * @param array $options_array options array
- *
- * @return string
- */
-function PMA_getHtmlForForeignKeyForm($columns, $existrel_foreign, $db,
- $tbl_storage_engine, $options_array
-) {
- $html_output = ''
- . '' . __('Foreign key constraints') . ' '
- . '';
-
- $html_output .= '' . __('Actions') . ' ';
- $html_output .= '' . __('Constraint properties') . ' '
- . ''
- . __('Column')
- . PMA_Util::showHint(
- __(
- 'Only columns with index will be displayed. You can define an'
- . ' index below.'
- )
- )
- . ' ';
- $html_output .= '' . __('Foreign key constraint')
- . ' (' . $tbl_storage_engine . ')';
- $html_output .= ' ';
-
- $odd_row = true;
- $i = 0;
- foreach ($existrel_foreign as $key => $one_key) {
- $html_output .= PMA_getHtmlForForeignKeyRow(
- $one_key, $odd_row, $columns, $i++, $options_array, $tbl_storage_engine,
- $db
- );
- $odd_row = ! $odd_row;
- }
- $html_output .= PMA_getHtmlForForeignKeyRow(
- array(), $odd_row, $columns, $i++, $options_array, $tbl_storage_engine,
- $db
- );
-
- $html_output .= ''
- . ''
- . __('+ Add constraint')
- . ' ';
- $html_output .= ' ';
- $html_output .= '
'
- . ' ';
-
- return $html_output;
+ return PMA\Template::get('tbl_relation/internal_relational_row')->render(array(
+ 'myfield_md5' => $myfield_md5,
+ 'myfield_html' => $myfield_html,
+ 'odd_row' => $odd_row,
+ 'foreign_db' => $foreign_db,
+ 'foreign_table' => $foreign_table,
+ 'tables' => $tables,
+ 'foreign_column' => $foreign_column,
+ 'columns' => $columns
+ ));
}
/**
@@ -424,9 +258,8 @@ function PMA_getHtmlForForeignKeyForm($columns, $existrel_foreign, $db,
function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i,
$options_array, $tbl_storage_engine, $db
) {
- $html_output = '';
- // Drop key anchor.
- $html_output .= '';
+ $js_msg = '';
+ $this_params = null;
if (isset($one_key['constraint'])) {
$drop_fk_query = 'ALTER TABLE ' . PMA_Util::backquote($GLOBALS['table'])
. ' DROP FOREIGN KEY '
@@ -444,51 +277,15 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i,
. ' DROP FOREIGN KEY '
. $one_key['constraint'] . ';'
);
-
- $html_output .= ' ';
- $html_output .= ' '
- . PMA_Util::getIcon('b_drop.png', __('Drop')) . ' ';
}
- $html_output .= ' ';
- $html_output .= '';
- $html_output .= '';
- $constraint_name = isset($one_key['constraint'])
- ? $one_key['constraint'] : '';
- $html_output .= ' ';
- $html_output .= ' ' . "\n";
- $html_output .= '';
- $html_output .= '';
// For ON DELETE and ON UPDATE, the default action
// is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE
// won't display the clause if it's set as RESTRICT.
$on_delete = isset($one_key['on_delete'])
? $one_key['on_delete'] : 'RESTRICT';
- $html_output .= PMA_generateDropdown(
- 'ON DELETE',
- 'on_delete[' . $i . ']',
- $options_array,
- $on_delete
- );
- $html_output .= ' ' . "\n";
-
- $html_output .= '' . "\n";
$on_update = isset($one_key['on_update'])
? $one_key['on_update'] : 'RESTRICT';
- $html_output .= PMA_generateDropdown(
- 'ON UPDATE',
- 'on_update[' . $i . ']',
- $options_array,
- $on_update
- );
- $html_output .= ' ';
- $html_output .= '
';
$column_array = array();
$column_array[''] = '';
@@ -498,52 +295,10 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i,
}
}
- $html_output .= '' . "\n";
- $html_output .= ' ';
- $html_output .= '';
- if (isset($one_key['index_list'])) {
- foreach ($one_key['index_list'] as $key => $column) {
- $html_output .= '';
- $html_output .= PMA_generateDropdown(
- '',
- 'foreign_key_fields_name[' . $i . '][]',
- $column_array,
- $column
- );
- $html_output .= ' ';
- }
- } else {
- $html_output .= '';
- $html_output .= PMA_generateDropdown(
- '',
- 'foreign_key_fields_name[' . $i . '][]',
- $column_array,
- ''
- );
- $html_output .= ' ';
- }
-
- $html_output .= ''
- . __('+ Add column')
- . ' ';
- $html_output .= ' ';
- $html_output .= '';
$foreign_table = false;
-
// foreign database dropdown
$foreign_db = (isset($one_key['ref_db_name'])) ? $one_key['ref_db_name'] : $db;
- $html_output .= '';
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_foreign_db[' . $i . ']',
- $GLOBALS['pma']->databases,
- $foreign_db,
- __('Database')
- );
- // end of foreign database dropdown
- $html_output .= ' ';
- $html_output .= '';
- // foreign table dropdown
+
$tables = array();
if ($foreign_db) {
$foreign_table = isset($one_key['ref_table_name'])
@@ -585,108 +340,21 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i,
}
}
}
- $html_output .= '';
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_foreign_table[' . $i . ']',
- $tables,
- $foreign_table,
- __('Table')
- );
- $html_output .= ' ';
- // end of foreign table dropdown
- $html_output .= ' ';
- $html_output .= '';
- // foreign column dropdown
- if ($foreign_db && $foreign_table) {
- foreach ($one_key['ref_index_list'] as $foreign_column) {
- $table_obj = new PMA_Table($foreign_table, $foreign_db);
- $columns = $table_obj->getUniqueColumns(false, false);
- $html_output .= '';
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_foreign_column[' . $i . '][]',
- $columns,
- $foreign_column,
- __('Column')
- );
- $html_output .= ' ';
- }
- } else {
- $html_output .= '';
- $html_output .= PMA_generateRelationalDropdown(
- 'destination_foreign_column[' . $i . '][]',
- array(),
- '',
- __('Column')
- );
- $html_output .= ' ';
- }
- // end of foreign column dropdown
- $html_output .= ' ';
- $html_output .= ' ';
- return $html_output;
-}
-
-/**
- * Function to get html for the common form header
- *
- * @param string $db current database
- * @param string $table current table
- *
- * @return string
- */
-function PMA_getHtmlForCommonFormHeader($db, $table)
-{
- return '';
-}
-
-/**
- * Function to get html for display field infos
- *
- * @param string $db current database
- * @param string $table current table
- * @param array $save_row save row
- *
- * @return string
- */
-function PMA_getHtmlForDisplayFieldInfos($db, $table, $save_row)
-{
- $disp = PMA_getDisplayField($db, $table);
- $html_output = ''
- . '' . __('Choose column to display:') . ' '
- . ''
- . '--- ';
-
- foreach ($save_row as $row) {
- $html_output .= '' . "\n";
- } // end while
-
- $html_output .= ' '
- . ' ';
-
- return $html_output;
+ return PMA\Template::get('tbl_relation/foreign_key_row')->render(array(
+ 'odd_row' => $odd_row,
+ 'js_msg' => $js_msg,
+ 'one_key' => $one_key,
+ 'this_params' => $this_params,
+ 'on_delete' => $on_delete,
+ 'on_update' => $on_update,
+ 'column_array' => $column_array,
+ 'foreign_db' => $foreign_db,
+ 'foreign_table' => $foreign_table,
+ 'tables' => $tables,
+ 'i' => $i,
+ 'options_array' => $options_array
+ ));
}
/**
diff --git a/templates/columns_definitions/column_adjust_privileges.phtml b/templates/columns_definitions/column_adjust_privileges.phtml
new file mode 100644
index 0000000000..80e62efa05
--- /dev/null
+++ b/templates/columns_definitions/column_adjust_privileges.phtml
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_attribute.phtml b/templates/columns_definitions/column_attribute.phtml
new file mode 100644
index 0000000000..dd041dadb8
--- /dev/null
+++ b/templates/columns_definitions/column_attribute.phtml
@@ -0,0 +1,12 @@
+
+
+
+ selected="selected"
+ >
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_auto_increment.phtml b/templates/columns_definitions/column_auto_increment.phtml
new file mode 100644
index 0000000000..f4d0b80aa2
--- /dev/null
+++ b/templates/columns_definitions/column_auto_increment.phtml
@@ -0,0 +1,8 @@
+
+ checked="checked"
+
+ type="checkbox"
+ value="AUTO_INCREMENT" />
\ No newline at end of file
diff --git a/templates/columns_definitions/column_comment.phtml b/templates/columns_definitions/column_comment.phtml
new file mode 100644
index 0000000000..e04768cef8
--- /dev/null
+++ b/templates/columns_definitions/column_comment.phtml
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_default.phtml b/templates/columns_definitions/column_default.phtml
new file mode 100644
index 0000000000..3e63ea0ba9
--- /dev/null
+++ b/templates/columns_definitions/column_default.phtml
@@ -0,0 +1,27 @@
+
+ $value): ?>
+
+ selected="selected"
+ >
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_definitions_form.phtml b/templates/columns_definitions/column_definitions_form.phtml
new file mode 100644
index 0000000000..0ec3f9a3c6
--- /dev/null
+++ b/templates/columns_definitions/column_definitions_form.phtml
@@ -0,0 +1,167 @@
+
+
diff --git a/templates/columns_definitions/column_extra.phtml b/templates/columns_definitions/column_extra.phtml
new file mode 100644
index 0000000000..8c8a2907d7
--- /dev/null
+++ b/templates/columns_definitions/column_extra.phtml
@@ -0,0 +1,7 @@
+
+ checked="checked"
+
+ type="checkbox"
+ value="auto_increment" />
\ No newline at end of file
diff --git a/templates/columns_definitions/column_indexes.phtml b/templates/columns_definitions/column_indexes.phtml
new file mode 100644
index 0000000000..fd456b10cf
--- /dev/null
+++ b/templates/columns_definitions/column_indexes.phtml
@@ -0,0 +1,27 @@
+
+ ---
+ "
+ >
+ PRIMARY
+
+ "
+ >
+ UNIQUE
+
+ "
+ >
+ INDEX
+
+
+ "
+ >
+ FULLTEXT
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_length.phtml b/templates/columns_definitions/column_length.phtml
new file mode 100644
index 0000000000..aa237293a1
--- /dev/null
+++ b/templates/columns_definitions/column_length.phtml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/column_null.phtml b/templates/columns_definitions/column_null.phtml
new file mode 100644
index 0000000000..5902f13ff0
--- /dev/null
+++ b/templates/columns_definitions/column_null.phtml
@@ -0,0 +1,8 @@
+
+ checked="checked"
+
+ type="checkbox"
+ value="NULL"
+ class="allow_null"/>
\ No newline at end of file
diff --git a/templates/columns_definitions/column_type.phtml b/templates/columns_definitions/column_type.phtml
new file mode 100644
index 0000000000..08edb3568a
--- /dev/null
+++ b/templates/columns_definitions/column_type.phtml
@@ -0,0 +1,7 @@
+>
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/mime_type.phtml b/templates/columns_definitions/mime_type.phtml
new file mode 100644
index 0000000000..211a3b3307
--- /dev/null
+++ b/templates/columns_definitions/mime_type.phtml
@@ -0,0 +1,17 @@
+
+
+
+
+
+ >
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/move_column.phtml b/templates/columns_definitions/move_column.phtml
new file mode 100644
index 0000000000..70d49d9291
--- /dev/null
+++ b/templates/columns_definitions/move_column.phtml
@@ -0,0 +1,15 @@
+
+
+ >
+
+
+
+ >
+ name))); ?>
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/table_fields_definitions.phtml b/templates/columns_definitions/table_fields_definitions.phtml
new file mode 100644
index 0000000000..067189c938
--- /dev/null
+++ b/templates/columns_definitions/table_fields_definitions.phtml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/transformation.phtml b/templates/columns_definitions/transformation.phtml
new file mode 100644
index 0000000000..91f7e6cc9c
--- /dev/null
+++ b/templates/columns_definitions/transformation.phtml
@@ -0,0 +1,26 @@
+
+
+
+ $transform): ?>
+
+
+ title="">
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/columns_definitions/transformation_option.phtml b/templates/columns_definitions/transformation_option.phtml
new file mode 100644
index 0000000000..f354dbf6f7
--- /dev/null
+++ b/templates/columns_definitions/transformation_option.phtml
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/templates/gis_visualization/gis_visualization.phtml b/templates/gis_visualization/gis_visualization.phtml
new file mode 100644
index 0000000000..8f138ff0f3
--- /dev/null
+++ b/templates/gis_visualization/gis_visualization.phtml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+ isHttps()): ?>
+
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/index_form.phtml b/templates/index_form.phtml
new file mode 100644
index 0000000000..05fb346218
--- /dev/null
+++ b/templates/index_form.phtml
@@ -0,0 +1,240 @@
+
+
+
+
+
+
+
+
+
+
+ must be the name of and only of a primary key!'
+ )
+ )
+ ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateIndexChoiceSelector(isset($_REQUEST['create_edit_table'])); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateIndexTypeSelector(); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/printview/columns.phtml b/templates/printview/columns.phtml
new file mode 100644
index 0000000000..90d4b5eeb9
--- /dev/null
+++ b/templates/printview/columns.phtml
@@ -0,0 +1,91 @@
+NULL';
+ }
+ } else {
+ $row['Default'] = htmlspecialchars($row['Default']);
+ }
+ $field_name = htmlspecialchars($row['Field']);
+
+ if (! $tbl_is_view) {
+ // here, we have a TIMESTAMP that SHOW FULL COLUMNS reports as having
+ // the NULL attribute, but SHOW CREATE TABLE says the contrary.
+ // Believe the latter.
+ /**
+ * @todo merge this logic with the one in tbl_structure.php
+ * or move it in a function similar to $GLOBALS['dbi']->getColumnsFull()
+ * but based on SHOW CREATE TABLE because information_schema
+ * cannot be trusted in this case (MySQL bug)
+ */
+ $analyzed_for_field
+ = $analyzed_sql[0]['create_table_fields'][$field_name];
+ if (! empty($analyzed_for_field['type'])
+ && $analyzed_for_field['type'] == 'TIMESTAMP'
+ && $analyzed_for_field['timestamp_not_null']
+ ) {
+ $row['Null'] = '';
+ }
+ } ?>
+
+
+ hasColumn($field_name)): ?>
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' . $foreigner['foreign_field']
+ );
+ } ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/printview/footer.phtml b/templates/printview/footer.phtml
new file mode 100644
index 0000000000..d70d8e6f3f
--- /dev/null
+++ b/templates/printview/footer.phtml
@@ -0,0 +1,2 @@
+
+
diff --git a/templates/printview/row_statistics.phtml b/templates/printview/row_statistics.phtml
new file mode 100644
index 0000000000..7eaa706c2e
--- /dev/null
+++ b/templates/printview/row_statistics.phtml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ ): ?>
+
+ ø
+
+
+
+
+ 0
+ && $mergetable == false
+ ): ?>
+
+ ø
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/printview/space_usage.phtml b/templates/printview/space_usage.phtml
new file mode 100644
index 0000000000..72aba1f305
--- /dev/null
+++ b/templates/printview/space_usage.phtml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ endif;
+ if (isset($free_size)): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ endif;
+ if (isset($tot_size) && $mergetable == false): ?>
+
+
+
+
+
+
+
diff --git a/templates/printview/space_usage_and_row_statistics.phtml b/templates/printview/space_usage_and_row_statistics.phtml
new file mode 100644
index 0000000000..22483748fd
--- /dev/null
+++ b/templates/printview/space_usage_and_row_statistics.phtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/printview/tables_detail.phtml b/templates/printview/tables_detail.phtml
new file mode 100644
index 0000000000..521126595c
--- /dev/null
+++ b/templates/printview/tables_detail.phtml
@@ -0,0 +1,20 @@
+>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/printview/tables_info.phtml b/templates/printview/tables_info.phtml
new file mode 100644
index 0000000000..90f6f04adf
--- /dev/null
+++ b/templates/printview/tables_info.phtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/templates/printview/tables_structure.phtml b/templates/printview/tables_structure.phtml
new file mode 100644
index 0000000000..f286190952
--- /dev/null
+++ b/templates/printview/tables_structure.phtml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ MIME
+
+
+
+
+
+
+
+isSystemSchema($db)): ?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/column_comparison_operators.phtml b/templates/table/column_comparison_operators.phtml
new file mode 100644
index 0000000000..fceff0cd55
--- /dev/null
+++ b/templates/table/column_comparison_operators.phtml
@@ -0,0 +1,7 @@
+
+ getTypeOperatorsHtml(
+ preg_replace('@\(.*@s', '', $columnTypes[$column_index]),
+ $columnNullFlags[$column_index], $selected_operator
+ ); ?>
+
\ No newline at end of file
diff --git a/templates/table/fields_table.phtml b/templates/table/fields_table.phtml
new file mode 100644
index 0000000000..e9c8bbec84
--- /dev/null
+++ b/templates/table/fields_table.phtml
@@ -0,0 +1,24 @@
+>
+ render(array(
+ 'geomColumnFlag' => $geomColumnFlag
+ )); ?>
+
+
+ render(array(
+ 'self' => $self,
+ 'columnNames' => $columnNames
+ )); ?>
+
+ render(array(
+ 'self' => $self,
+ 'geomColumnFlag' => $geomColumnFlag,
+ 'columnNames' => $columnNames,
+ 'columnTypes' => $columnTypes,
+ 'columnCollations' => $columnCollations
+ )); ?>
+
+
+
diff --git a/templates/table/form_tag.phtml b/templates/table/form_tag.phtml
new file mode 100644
index 0000000000..aec6af50f2
--- /dev/null
+++ b/templates/table/form_tag.phtml
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/templates/table/geom_func.phtml b/templates/table/geom_func.phtml
new file mode 100644
index 0000000000..c94244828a
--- /dev/null
+++ b/templates/table/geom_func.phtml
@@ -0,0 +1,39 @@
+
+
+
+
+ _columnTypes[$column_index], $geom_types)): ?>
+
+
+ _columnTypes[$column_index], true, true
+ );
+ ?>
+
+ $func): ?>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/input_box.phtml b/templates/table/input_box.phtml
new file mode 100644
index 0000000000..e9e09b9914
--- /dev/null
+++ b/templates/table/input_box.phtml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+ value=""
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dropdown
+ * Enum in search mode --> multiselect
+ * Set in edit mode --> multiselect
+ * Set in search mode --> input (skipped here, so the 'else'
+ * section would handle it)
+ */
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value=""
+ />
+
+
\ No newline at end of file
diff --git a/templates/table/options.phtml b/templates/table/options.phtml
new file mode 100644
index 0000000000..45b79b240c
--- /dev/null
+++ b/templates/table/options.phtml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DISTINCT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ __('Ascending'),
+ 'DESC' => __('Descending')
+ ), 'ASC', false, true, "formelement"
+ ); ?>
+
+
+
\ No newline at end of file
diff --git a/templates/table/options_zoom.phtml b/templates/table/options_zoom.phtml
new file mode 100644
index 0000000000..bee78bdbf8
--- /dev/null
+++ b/templates/table/options_zoom.phtml
@@ -0,0 +1,48 @@
+
\ No newline at end of file
diff --git a/templates/table/replace_preview.phtml b/templates/table/replace_preview.phtml
new file mode 100644
index 0000000000..2fa1badb29
--- /dev/null
+++ b/templates/table/replace_preview.phtml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/rows_normal.phtml b/templates/table/rows_normal.phtml
new file mode 100644
index 0000000000..4c0cc11f72
--- /dev/null
+++ b/templates/table/rows_normal.phtml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ render(array(
+ 'column_index' => $column_index
+ )); ?>
+
+
+
+
+
+ getColumnProperties($column_index, $column_index); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/rows_zoom.phtml b/templates/table/rows_zoom.phtml
new file mode 100644
index 0000000000..be6832c642
--- /dev/null
+++ b/templates/table/rows_zoom.phtml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getColumnProperties($i, $key);
+ $type[$i] = $properties['type'];
+ $collation[$i] = $properties['collation'];
+ $func[$i] = $properties['func'];
+ $value[$i] = $properties['value'];
+ } ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value=""
+ />
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/search_and_replace.phtml b/templates/table/search_and_replace.phtml
new file mode 100644
index 0000000000..6d5f8b5a50
--- /dev/null
+++ b/templates/table/search_and_replace.phtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+ getTypeClass($type) == 'CHAR'): ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/table/secondary_tabs.phtml b/templates/table/secondary_tabs.phtml
new file mode 100644
index 0000000000..166a1d9ce3
--- /dev/null
+++ b/templates/table/secondary_tabs.phtml
@@ -0,0 +1,6 @@
+
+
diff --git a/templates/table/selection_form.phtml b/templates/table/selection_form.phtml
new file mode 100644
index 0000000000..9fbd295e53
--- /dev/null
+++ b/templates/table/selection_form.phtml
@@ -0,0 +1,78 @@
+render(array(
+ 'searchType' => $searchType,
+ 'db' => $db,
+ 'table' => $table,
+ 'goto' => $goto
+ )) ?>
+
+
+
+
+
+
+ render(array(
+ 'self' => $self,
+ 'searchType' => $searchType,
+ 'geomColumnFlag' => $geomColumnFlag,
+ 'columnNames' => $columnNames,
+ 'columnTypes' => $columnTypes,
+ 'columnCollations' => $columnCollations
+ ));
+ echo PMA\Template::get('table/options_zoom')
+ ->render(array(
+ 'dataLabel' => $dataLabel,
+ 'columnNames' => $columnNames
+ )); ?>
+
+
+
+
+
+
+
+
+ render(array(
+ 'self' => $self,
+ 'searchType' => $searchType,
+ 'geomColumnFlag' => $geomColumnFlag,
+ 'columnNames' => $columnNames,
+ 'columnTypes' => $columnTypes,
+ 'columnCollations' => $columnCollations
+ )); ?>
+
+
+
+
+ render(array(
+ 'columnNames' => $columnNames
+ )); ?>
+
+
+
+
+
+
+
+ render(array(
+ 'columnNames' => $columnNames,
+ 'columnTypes' => $columnTypes
+ )); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/table_header.phtml b/templates/table/table_header.phtml
new file mode 100644
index 0000000000..58cdf1775a
--- /dev/null
+++ b/templates/table/table_header.phtml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/table/zoom_result_form.phtml b/templates/table/zoom_result_form.phtml
new file mode 100644
index 0000000000..0617334adf
--- /dev/null
+++ b/templates/table/zoom_result_form.phtml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ render(array(
+ 'str' => '',
+ 'column_type' => $_columnTypes[$column_index],
+ 'column_id' => ($_columnTypes[$column_index]) ? 'edit_fieldID_' : 'fieldID_',
+ 'in_zoom_search_edit' => true,
+ '_foreigners' => $_foreigners,
+ 'column_name' => $fieldpopup,
+ 'foreignData' => $foreignData,
+ 'table' => $_table,
+ 'column_index' => $column_index,
+ 'foreignMaxLimit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'],
+ 'criteriaValues' => '',
+ 'db' => $_db,
+ 'titles' => $titles,
+ 'in_fbs' => false
+ ));?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/tbl_chart.phtml b/templates/tbl_chart.phtml
index 149a3a57af..c91429e27e 100644
--- a/templates/tbl_chart.phtml
+++ b/templates/tbl_chart.phtml
@@ -1,9 +1,4 @@
-
+