diff --git a/libraries/Template.class.php b/libraries/Template.class.php index ba4ca61c8d..49c60d48c7 100644 --- a/libraries/Template.class.php +++ b/libraries/Template.class.php @@ -8,7 +8,7 @@ if (! defined('PHPMYADMIN')) { /** * Class Template * - * Handle template using + * Handle front end templating * * @package PMA */ @@ -41,6 +41,20 @@ class Template return new Template($name); } + /** + * Remove whitespaces between tags and innerHTML + * + * @param string $content HTML to perform the trim method + * + * @return string + */ + public static function trim($content) + { + $regexp = '/(<[^\/][^>]+>)\s+|\s+(<\/)/'; + + return preg_replace($regexp, "$1$2", $content); + } + /** * Render template * @@ -48,9 +62,9 @@ class Template * * @return string */ - public function render($data = array()) + public function render($data = array(), $trim = true) { - $template = static::BASE_PATH . $this->name . '.php'; + $template = static::BASE_PATH . $this->name . '.phtml'; try { extract($data); ob_start(); @@ -61,11 +75,16 @@ class Template 'The template "' . $template . '" not found.' ); } - $content = ob_get_clean(); + if ($trim) { + $content = Template::trim(ob_get_clean()); + } else { + $content = ob_get_clean(); + } + return $content; } catch (\LogicException $e) { ob_end_clean(); throw new \LogicException($e->getMessage()); } } -} \ No newline at end of file +} diff --git a/libraries/browse_foreigners.lib.php b/libraries/browse_foreigners.lib.php index c47ca23bbd..1de6a01f23 100644 --- a/libraries/browse_foreigners.lib.php +++ b/libraries/browse_foreigners.lib.php @@ -9,20 +9,108 @@ if (! defined('PHPMYADMIN')) { exit; } +/** + * Function to get html for one relational key + * + * @param integer $horizontal_count the current horizontal count + * @param string $header table header + * @param boolean $odd_row for the row background color + * @param array $keys all the keys + * @param integer $indexByKeyname index by keyname + * @param array $descriptions descriptions + * @param integer $indexByDescription index by description + * @param string $current_value current value on the edit form + * + * @return string $html the generated html + */ +function PMA_getHtmlForOneKey($horizontal_count, $header, $odd_row, $keys, + $indexByKeyname, $descriptions, $indexByDescription, $current_value +) { + $horizontal_count++; + $output = ''; + + // whether the key name corresponds to the selected value in the form + $rightKeynameIsSelected = false; + $leftKeynameIsSelected = false; + + if ($GLOBALS['cfg']['RepeatCells'] > 0 + && $horizontal_count > $GLOBALS['cfg']['RepeatCells'] + ) { + $output .= $header; + $horizontal_count = 0; + $odd_row = true; + } + + // key names and descriptions for the left section, + // sorted by key names + $leftKeyname = $keys[$indexByKeyname]; + list( + $leftDescription, + $leftDescriptionTitle + ) = PMA_getDescriptionAndTitle($descriptions[$indexByKeyname]); + + // key names and descriptions for the right section, + // sorted by descriptions + $rightKeyname = $keys[$indexByDescription]; + list( + $rightDescription, + $rightDescriptionTitle + ) = PMA_getDescriptionAndTitle($descriptions[$indexByDescription]); + + $indexByDescription++; + + if (! empty($current_value)) { + $rightKeynameIsSelected = $rightKeyname == $current_value; + $leftKeynameIsSelected = $leftKeyname == $current_value; + } + + $output .= ''; + $odd_row = ! $odd_row; + + $output .= PMA_getHtmlForColumnElement( + 'class="nowrap"', $leftKeynameIsSelected, + $leftKeyname, $leftDescription, + $leftDescriptionTitle + ); + + $output .= PMA_getHtmlForColumnElement( + '', $leftKeynameIsSelected, $leftKeyname, + $leftDescription, $leftDescriptionTitle + ); + + $output .= '' + . ''; + + $output .= PMA_getHtmlForColumnElement( + '', $rightKeynameIsSelected, $rightKeyname, + $rightDescription, $rightDescriptionTitle + ); + + $output .= PMA_getHtmlForColumnElement( + 'class="nowrap"', $rightKeynameIsSelected, + $rightKeyname, $rightDescription, + $rightDescriptionTitle + ); + $output .= ''; + + return array($output, $horizontal_count, $odd_row, $indexByDescription); +} + /** * Function to get html for relational field selection * - * @param string $db current database - * @param string $table current table - * @param string $field field - * @param array $foreignData foreign column data - * @param string $fieldkey field key - * @param array $data data + * @param string $db current database + * @param string $table current table + * @param string $field field + * @param array $foreignData foreign column data + * @param string $fieldkey field key + * @param string $current_value current columns's value * * @return string */ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignData, - $fieldkey, $data + $fieldkey, $current_value ) { $gotopage = PMA_getHtmlForGotoPage($foreignData); $showall = PMA_getHtmlForShowAll($foreignData); @@ -93,78 +181,23 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat asort($keys); - $hcount = 0; + $horizontal_count = 0; $odd_row = true; $indexByDescription = 0; - // whether the key name corresponds to the selected value in the form - $rightKeynameIsSelected = false; - $leftKeynameIsSelected = false; - foreach ($keys as $indexByKeyname => $value) { - $hcount++; - - if ($GLOBALS['cfg']['RepeatCells'] > 0 - && $hcount > $GLOBALS['cfg']['RepeatCells'] - ) { - $output .= $header; - $hcount = 0; - $odd_row = true; - } - - // key names and descriptions for the left section, - // sorted by key names - $leftKeyname = $keys[$indexByKeyname]; list( - $leftDescription, - $leftDescriptionTitle - ) = PMA_getDescriptionAndTitle($descriptions[$indexByKeyname]); - - // key names and descriptions for the right section, - // sorted by descriptions - $rightKeyname = $keys[$indexByDescription]; - list( - $rightDescription, - $rightDescriptionTitle - ) = PMA_getDescriptionAndTitle($descriptions[$indexByDescription]); - - $indexByDescription++; - - if (! empty($data)) { - $rightKeynameIsSelected = $rightKeyname == $data; - $leftKeynameIsSelected = $leftKeyname == $data; - } - - $output .= ''; - $odd_row = ! $odd_row; - - $output .= PMA_getHtmlForColumnElement( - 'class="nowrap"', $leftKeynameIsSelected, - $leftKeyname, $leftDescription, - $leftDescriptionTitle + $html, + $horizontal_count, + $odd_row, + $indexByDescription + ) = PMA_getHtmlForOneKey( + $horizontal_count, $header, $odd_row, $keys, $indexByKeyname, + $descriptions, $indexByDescription, $current_value ); + $output .= $html; + } - $output .= PMA_getHtmlForColumnElement( - '', $leftKeynameIsSelected, $leftKeyname, - $leftDescription, $leftDescriptionTitle - ); - - $output .= '' - . ''; - - $output .= PMA_getHtmlForColumnElement( - '', $rightKeynameIsSelected, $rightKeyname, - $rightDescription, $rightDescriptionTitle - ); - - $output .= PMA_getHtmlForColumnElement( - 'class="nowrap"', $rightKeynameIsSelected, - $rightKeyname, $rightDescription, - $rightDescriptionTitle - ); - $output .= ''; - } // end while $output .= '' . ''; diff --git a/libraries/db_designer.lib.php b/libraries/db_designer.lib.php index 7b2fcca10d..2fdee51b61 100644 --- a/libraries/db_designer.lib.php +++ b/libraries/db_designer.lib.php @@ -10,6 +10,7 @@ if (! defined('PHPMYADMIN')) { } require_once 'libraries/relation.lib.php'; +require_once 'libraries/Template.class.php'; /** * Function to get html to display a page selector @@ -21,17 +22,10 @@ require_once 'libraries/relation.lib.php'; */ function PMA_getHtmlForPageSelector($cfgRelation, $db) { - $html = ''; - return $html; + return PMA\Template::get('designer/page_selector')->render(array( + 'db' => $db, + 'cfgRelation' => $cfgRelation + )); } /** @@ -44,23 +38,10 @@ function PMA_getHtmlForPageSelector($cfgRelation, $db) */ function PMA_getHtmlForEditOrDeletePages($db, $operation) { - $cfgRelation = PMA_getRelationsParam(); - $html = '
'; - $html .= PMA_URL_getHiddenInputs($db); - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= PMA_getHtmlForPageSelector($cfgRelation, $db); - $html .= '
'; - $html .= '
'; - return $html; + return PMA\Template::get('designer/edit_delete_pages')->render(array( + 'db' => $db, + 'operation' => $operation + )); } /** @@ -72,43 +53,9 @@ function PMA_getHtmlForEditOrDeletePages($db, $operation) */ function PMA_getHtmlForPageSaveAs($db) { - $cfgRelation = PMA_getRelationsParam(); - $choices = array( - 'same' => __('Save to selected page'), - 'new' => __('Create a page and save to it') - ); - - $html = '
'; - $html .= PMA_URL_getHiddenInputs($db); - $html .= '
'; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= ''; - - $html .= '
'; - $html .= ''; - $html .= PMA_getHtmlForPageSelector($cfgRelation, $db); - $html .= '
'; - $html .= PMA_Util::getRadioFields('save_page', $choices, 'same', true); - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= '
'; - - return $html; + return PMA\Template::get('designer/page_save_as')->render(array( + 'db' => $db + )); } /** @@ -161,22 +108,11 @@ function PMA_getHtmlForSchemaExport($db, $page) )->getDisplay(); } - $htmlString = '
'; - $htmlString .= '
'; - $htmlString .= PMA_URL_getHiddenInputs($db); - $htmlString .= '
'; - $htmlString .= PMA_pluginGetChoice( - 'Schema', 'export_type', $export_list, 'format' - ); - $htmlString .= ''; - $htmlString .= PMA_pluginGetOptions('Schema', $export_list); - $htmlString .= '
'; - $htmlString .= '
'; - - return $htmlString; + return PMA\Template::get('designer/schema_export')->render(array( + 'db' => $db, + 'page' => $page, + 'export_list' => $export_list + )); } /** @@ -192,34 +128,12 @@ function PMA_getHtmlForSchemaExport($db, $page) function PMA_getHtmlForJSFields( $script_tables, $script_contr, $script_display_field, $display_page ) { - $cfgRelation = PMA_getRelationsParam(); - - $html = '
'; - $html .= htmlspecialchars($GLOBALS['server']); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars($_GET['db']); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars($_GET['token']); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars(json_encode($script_tables)); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars(json_encode($script_contr)); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars(json_encode($script_display_field)); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars($display_page); - $html .= '
'; - $html .= '
'; - $html .= htmlspecialchars($cfgRelation['pdfwork']); - $html .= '
'; - - return $html; + return PMA\Template::get('designer/js_fields')->render(array( + 'script_tables' => $script_tables, + 'script_contr' => $script_contr, + 'script_display_field' => $script_display_field, + 'display_page' => $display_page + )); } /** @@ -232,207 +146,10 @@ function PMA_getHtmlForJSFields( */ function PMA_getDesignerPageMenu($visualBuilder, $selected_page) { - $iconClass = ''; - $textClass = 'hidable hide'; - - $html = ''; - - if (!$visualBuilder) { - $html .= '
'; - $html .= ''; - $html .= ($selected_page == null - ? __("Untitled") - : htmlspecialchars($selected_page)); - $html .= ''; - $html .= ''; - $html .= ($selected_page == null ? '*' : '') . ''; - $html .= '
'; - } - - $html .= '
'; - - $html .= ''; - $html .= 'v'; - $html .= '' . __('Show/Hide tables list') - . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' - . __('View in fullscreen') . ''; - $html .= ''; - - if (! $visualBuilder) { - - $html .= ''; - $html .= ''; - $html .= '' . __('New page') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Open page') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Save page') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Save page as') - . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Delete pages') - . ''; - $html .= ''; - } - - $html .= ''; - $html .= ''; - $html .= '' . __('Create table') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Create relation') - . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' - . __('Choose column to display') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Reload') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Help') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' - . __('Angular links') . ' / ' . __('Direct links') . ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= '' . __('Snap to grid') . ''; - $html .= ''; - - $html .= ''; - $html .= 'v'; - $html .= '' . __('Small/Big All') . ''; - $html .= ''; - - $html .= ''; - $html .= 'key'; - $html .= '' . __('Toggle small/big') . ''; - $html .= ''; - - $html .= ''; - $html .= 'key'; - $html .= '' . __('Toggle relation lines') - . ''; - $html .= ''; - - if (! $visualBuilder) { - - $html .= ''; - $html .= 'key'; - $html .= '' . __('Export schema') . ''; - $html .= ''; - - } else { - $html .= ''; - $html .= 'key'; - $html .= '' . __('Build Query') . ''; - $html .= ''; - } - - $html .= ''; - $html .= '>'; - $html .= '' . __('Move Menu') . ''; - $html .= ''; - - $html .= ''; - $html .= '>'; - $html .= '' . __('Pin text') . ''; - $html .= ''; - - $html .= '
'; - - return $html; + return PMA\Template::get('designer/side_menu')->render(array( + 'visualBuilder' => $visualBuilder, + 'selected_page' => $selected_page + )); } /** @@ -442,12 +159,7 @@ function PMA_getDesignerPageMenu($visualBuilder, $selected_page) */ function PMA_getHTMLCanvas() { - $html = '
'; - $html .= 'render(); } /** @@ -460,88 +172,10 @@ function PMA_getHTMLCanvas() */ function PMA_getHTMLTableList($tab_pos, $display_page) { - $html = ''; // end layer_menu - - return $html; + return PMA\Template::get('designer/table_list')->render(array( + 'tab_pos' => $tab_pos, + 'display_page' => $display_page + )); } /** @@ -558,223 +192,13 @@ function PMA_getHTMLTableList($tab_pos, $display_page) function PMA_getDatabaseTables( $tab_pos, $display_page, $tab_column, $tables_all_keys, $tables_pk_or_unique_keys ) { - $html = ''; - $number_of_tables = count($GLOBALS['PMD']["TABLE_NAME"]); - for ($i = 0; $i < $number_of_tables; $i++) { - $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i]; - $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; - - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - - $html .= ''; - $html .= ''; - } - - $html .= ''; - - $html .= ''; - } - - $html .= '\n"; - - if (isset($_REQUEST['query'])) { - $html .= ' '; - } - $html .= ""; - } - $html .= ""; - $html .= "
getImgPath('pmd/exec_small.png') - . '" />'; - $html .= ''; - $html .= '
'; - - if (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]])) { - - $html .= '*'; - } else { - - $image = 'pmd/Field_small'; - if (strstr($tab_column[$t_n]["TYPE"][$j], 'char') - || strstr($tab_column[$t_n]["TYPE"][$j], 'text') - ) { - $image .= '_char'; - } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int') - || strstr($tab_column[$t_n]["TYPE"][$j], 'float') - || strstr($tab_column[$t_n]["TYPE"][$j], 'double') - || strstr($tab_column[$t_n]["TYPE"][$j], 'decimal') - ) { - $image .= '_int'; - } elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date') - || strstr($tab_column[$t_n]["TYPE"][$j], 'time') - || strstr($tab_column[$t_n]["TYPE"][$j], 'year') - ) { - $image .= '_date'; - } - $image .= '.png'; - - $html .= '*'; - } - - $html .= htmlspecialchars( - $tab_column[$t_n]["COLUMN_NAME"][$j] . " : " - . $tab_column[$t_n]["TYPE"][$j], - ENT_QUOTES - ); - $html .= "
\n
'; - $html .= '
"; - } - - return $html; + return PMA\Template::get('designer/database_tables')->render(array( + 'tab_pos' => $tab_pos, + 'display_page' => $display_page, + 'tab_column' => $tab_column, + 'tables_all_keys' => $tables_all_keys, + 'tables_pk_or_unique_keys' => $tables_pk_or_unique_keys + )); } /** @@ -784,79 +208,7 @@ function PMA_getDatabaseTables( */ function PMA_getNewRelationPanel() { - $html = ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - - return $html; + return PMA\Template::get('designer/aggregate_query_panel')->render(); } /** @@ -1280,75 +268,7 @@ function PMA_getAggregateQueryPanel() */ function PMA_getWhereQueryPanel() { - $html = ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - - return $html; + return PMA\Template::get('designer/where_query_panel')->render(); } /** @@ -1358,26 +278,6 @@ function PMA_getWhereQueryPanel() */ function PMA_getQueryDetails() { - $html = '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '' . __('Active options') . ''; - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ' '; - $html .= ' '; - $html .= PMA_URL_getHiddenInputs($_GET['db']); - $html .= '

'; - $html .= '
'; - - return $html; + return PMA\Template::get('designer/query_details')->render(); } - -?> +?> \ No newline at end of file diff --git a/scripts/update-po b/scripts/update-po index 7e8d1de077..b2646e301e 100755 --- a/scripts/update-po +++ b/scripts/update-po @@ -18,7 +18,7 @@ xgettext \ --from-code=utf-8 \ --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \ --copyright-holder="phpMyAdmin devel team" \ - `find . -name '*.php' -not -path './test/*' -not -path './po/*' -not -path './release/*' | sort` + `find -regex '.*\.\(php\|phtml\)$' -not -path './test/*' -not -path './po/*' -not -path './release/*' | sort` # Generate PHP code for advisor rules php ./scripts/advisor2po >> po/phpmyadmin.pot diff --git a/templates/designer/aggregate_query_panel.phtml b/templates/designer/aggregate_query_panel.phtml new file mode 100755 index 0000000000..d099ec2274 --- /dev/null +++ b/templates/designer/aggregate_query_panel.phtml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/canvas.phtml b/templates/designer/canvas.phtml new file mode 100755 index 0000000000..5110ccc0a7 --- /dev/null +++ b/templates/designer/canvas.phtml @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/templates/designer/database_tables.phtml b/templates/designer/database_tables.phtml new file mode 100755 index 0000000000..ad5c548568 --- /dev/null +++ b/templates/designer/database_tables.phtml @@ -0,0 +1,140 @@ + + + + + + + px; top:px; display:; z-index: 1;"> + + + + + + + + + + + + + + "> + + ." + + onmouseover="old_class = this.className; this.className = 'tab_field_2';" + onmouseout="this.className = old_class;" + click_field_param=""> + + + + + + + + + + +
+ + + " + onmouseover="this.className='small_tab_pref2 small_tab_pref_1';" + onmouseout="this.className='small_tab_pref small_tab_pref_1';" > + + + + + + + +
+ " + type="checkbox" + id="select_._" + style="margin: 0px;" + title="select_" + store_column_param=",,"> + "> +
+ + * + + * + + +
+
+ +
+ \ No newline at end of file diff --git a/templates/designer/delete_relation_panel.phtml b/templates/designer/delete_relation_panel.phtml new file mode 100755 index 0000000000..6394251c0b --- /dev/null +++ b/templates/designer/delete_relation_panel.phtml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/edit_delete_pages.phtml b/templates/designer/edit_delete_pages.phtml new file mode 100755 index 0000000000..7560b15abd --- /dev/null +++ b/templates/designer/edit_delete_pages.phtml @@ -0,0 +1,11 @@ + +
+ +
+ + + +
+
\ No newline at end of file diff --git a/templates/designer/having_query_panel.phtml b/templates/designer/having_query_panel.phtml new file mode 100755 index 0000000000..a478680f7c --- /dev/null +++ b/templates/designer/having_query_panel.phtml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/js_fields.phtml b/templates/designer/js_fields.phtml new file mode 100755 index 0000000000..7187ff8187 --- /dev/null +++ b/templates/designer/js_fields.phtml @@ -0,0 +1,10 @@ + + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/templates/designer/new_relation_panel.phtml b/templates/designer/new_relation_panel.phtml new file mode 100755 index 0000000000..59672f74c2 --- /dev/null +++ b/templates/designer/new_relation_panel.phtml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/options_panel.phtml b/templates/designer/options_panel.phtml new file mode 100755 index 0000000000..67f9778311 --- /dev/null +++ b/templates/designer/options_panel.phtml @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/page_save_as.phtml b/templates/designer/page_save_as.phtml new file mode 100755 index 0000000000..8394915d24 --- /dev/null +++ b/templates/designer/page_save_as.phtml @@ -0,0 +1,33 @@ + __('Save to selected page'), + 'new' => __('Create a page and save to it') +); +?> +
+ +
+ + + + + + + + + + + + +
+ + +
+ +
+ + +
+
+
\ No newline at end of file diff --git a/templates/designer/page_selector.phtml b/templates/designer/page_selector.phtml new file mode 100755 index 0000000000..6195f87941 --- /dev/null +++ b/templates/designer/page_selector.phtml @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/templates/designer/query_details.phtml b/templates/designer/query_details.phtml new file mode 100755 index 0000000000..7fbf6a928d --- /dev/null +++ b/templates/designer/query_details.phtml @@ -0,0 +1,27 @@ +
+
+
+
+
+
+
+
+ + + +
+
+
+ + +
+ +
+ + + +
+

+
+
\ No newline at end of file diff --git a/templates/designer/rename_to_panel.phtml b/templates/designer/rename_to_panel.phtml new file mode 100755 index 0000000000..41d7c059f7 --- /dev/null +++ b/templates/designer/rename_to_panel.phtml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/designer/schema_export.phtml b/templates/designer/schema_export.phtml new file mode 100755 index 0000000000..395503b6a4 --- /dev/null +++ b/templates/designer/schema_export.phtml @@ -0,0 +1,11 @@ +
+
+ +
+ + + +
+
'; \ No newline at end of file diff --git a/templates/designer/side_menu.phtml b/templates/designer/side_menu.phtml new file mode 100755 index 0000000000..dee4508aa9 --- /dev/null +++ b/templates/designer/side_menu.phtml @@ -0,0 +1,189 @@ +getImgPath($path); +} +?> + +
+ + + + + + +
+ + \ No newline at end of file diff --git a/templates/designer/table_list.phtml b/templates/designer/table_list.phtml new file mode 100755 index 0000000000..ebbc6cac47 --- /dev/null +++ b/templates/designer/table_list.phtml @@ -0,0 +1,69 @@ + + \ No newline at end of file diff --git a/templates/designer/where_query_panel.phtml b/templates/designer/where_query_panel.phtml new file mode 100755 index 0000000000..f719af3078 --- /dev/null +++ b/templates/designer/where_query_panel.phtml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/tbl_chart.php b/templates/tbl_chart.phtml similarity index 100% rename from templates/tbl_chart.php rename to templates/tbl_chart.phtml diff --git a/templates/test/echo.phtml b/templates/test/echo.phtml new file mode 100644 index 0000000000..44da4ed410 --- /dev/null +++ b/templates/test/echo.phtml @@ -0,0 +1,2 @@ + value value \ No newline at end of file diff --git a/test/classes/PMA_Template_test.php b/test/classes/PMA_Template_test.php new file mode 100644 index 0000000000..a8edd7b2e5 --- /dev/null +++ b/test/classes/PMA_Template_test.php @@ -0,0 +1,45 @@ +assertEquals( + 'static content', + PMA\Template::get('test/static')->render() + ); + } + + public function testDynamicRender() + { + $this->assertEquals( + 'value', + PMA\Template::get('test/echo')->render(array( + 'variable' => 'value' + )) + ); + } + + public function testTrim() + { + $html = file_get_contents(PMA\Template::BASE_PATH.'test/trim.phtml'); + + $this->assertEquals( + 'outer value value', + PMA\Template::trim($html) + ); + } +} diff --git a/test/libraries/PMA_browse_foreigners_test.php b/test/libraries/PMA_browse_foreigners_test.php index 029f6119f6..4011ef2b28 100644 --- a/test/libraries/PMA_browse_foreigners_test.php +++ b/test/libraries/PMA_browse_foreigners_test.php @@ -248,11 +248,11 @@ class PMA_BrowseForeignersTest extends PHPUnit_Framework_TestCase $foreignData = array(); $foreignData['disp_row'] = ''; $fieldkey = 'bar'; - $data = array(); + $current_value = ''; $_REQUEST['rownumber'] = 1; $_REQUEST['foreign_filter'] = '5'; $result = PMA_getHtmlForRelationalFieldSelection( - $db, $table, $field, $foreignData, $fieldkey, $data + $db, $table, $field, $foreignData, $fieldkey, $current_value ); $this->assertContains( @@ -319,7 +319,7 @@ class PMA_BrowseForeignersTest extends PHPUnit_Framework_TestCase $foreignData['the_total'] = 5; $GLOBALS['cfg']['ShowAll'] = false; $result = PMA_getHtmlForRelationalFieldSelection( - $db, $table, $field, $foreignData, $fieldkey, $data + $db, $table, $field, $foreignData, $fieldkey, $current_value ); $this->assertContains( diff --git a/themes/pmahomme/css/pmd.css.php b/themes/pmahomme/css/pmd.css.php index 12e7b0d265..749b4ce6c2 100644 --- a/themes/pmahomme/css/pmd.css.php +++ b/themes/pmahomme/css/pmd.css.php @@ -571,6 +571,7 @@ h2.active { .side-menu.right { float: right; + right: 0; } .side-menu .hide {