diff --git a/ChangeLog b/ChangeLog index c511a4d068..3b3f4c4c42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,7 @@ phpMyAdmin - ChangeLog + rfe #1668 Procedures window shift-click should select multiple rows + rfe #1669 Designer: "Sticky" menu option + rfe #1671 Directly show table comments in structure view ++ rfe #1559 Page-related settings 4.4.8.0 (not yet released) - bug Allow accessing visual query builder when pmadb is not configured @@ -197,7 +198,7 @@ phpMyAdmin - ChangeLog + rfe Change tracking activation status from db level tracking page + rfe #1207 Export users associated with a specific schema/database + rfe #1575 "Disable database expansion" : unclear directive name and -explanation +explanation + rfe #1607 Tool tip for lock icon when making changes to a page + rfe #1327 Hide 'Add user' link if user does not have privileges + rfe #501 Support for SSL GRANT option @@ -285,7 +286,7 @@ explanation - bug #4717 Database navigation menu broken when resolution/screen is changing - bug #4727 Collation column missing in database list when DisableIS is true - bug Undefined index central_columnswork -- bug Undefined index favorite_tables +- bug Undefined index favorite_tables 4.3.7.0 (2015-01-15) - bug #4694 js error on marking table as favorite in Safari (in private mode) diff --git a/db_export.php b/db_export.php index 475e78cc74..40831f4ba0 100644 --- a/db_export.php +++ b/db_export.php @@ -10,6 +10,9 @@ * Gets some core libraries */ require_once 'libraries/common.inc.php'; +require_once 'libraries/config/page_settings.class.php'; + +PMA_PageSettings::showGroup('Export'); $response = PMA_Response::getInstance(); $header = $response->getHeader(); diff --git a/db_import.php b/db_import.php index 9fa69253c1..e2ccb6b4fe 100644 --- a/db_import.php +++ b/db_import.php @@ -7,6 +7,9 @@ */ require_once 'libraries/common.inc.php'; +require_once 'libraries/config/page_settings.class.php'; + +PMA_PageSettings::showGroup('Import'); $response = PMA_Response::getInstance(); $header = $response->getHeader(); diff --git a/db_sql.php b/db_sql.php index 93f095cacb..fc140a8ef0 100644 --- a/db_sql.php +++ b/db_sql.php @@ -10,6 +10,9 @@ * */ require_once 'libraries/common.inc.php'; +require_once 'libraries/config/page_settings.class.php'; + +PMA_PageSettings::showGroup('Sql_queries'); /** * Runs common work diff --git a/db_structure.php b/db_structure.php index 9921ab7943..bb23e6ab8a 100644 --- a/db_structure.php +++ b/db_structure.php @@ -10,6 +10,9 @@ * */ require_once 'libraries/common.inc.php'; +require_once 'libraries/config/page_settings.class.php'; + +PMA_PageSettings::showGroup('DbStructure'); /** * Function implementations for this script diff --git a/js/ajax.js b/js/ajax.js index eb38f7bafb..a5027d2a36 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -341,6 +341,7 @@ var AJAX = { .not('#floating_menubar') .not('#goto_pagetop') .not('#lock_page_icon') + .not('#page_settings_icon') .not('#page_content') .not('#selflink') .not('#session_debug') diff --git a/js/config.js b/js/config.js index d029782852..f79fd33845 100644 --- a/js/config.js +++ b/js/config.js @@ -299,7 +299,7 @@ function validateField(id, type, onKeyUp, params) function getFieldValidators(field_id, onKeyUpOnly) { // look for field bound validator - var name = field_id.match(/[^-]+$/)[0]; + var name = field_id && field_id.match(/[^-]+$/)[0]; if (typeof validators._field[name] != 'undefined') { return [[validators._field[name], null]]; } @@ -478,6 +478,9 @@ function setRestoreDefaultBtn(field, display) } AJAX.registerOnload('config.js', function () { + if (typeof configInlineParams === 'function') { + configInlineParams(); + } // register validators and mark custom values var $elements = $('input[id], select[id], textarea[id]'); $('input[id], select[id], textarea[id]').each(function () { diff --git a/js/messages.php b/js/messages.php index f91ad72b0a..e101c4c3b4 100644 --- a/js/messages.php +++ b/js/messages.php @@ -266,6 +266,10 @@ $js_messages['strFormatting'] = __('Formatting SQL...'); $js_messages['strGo'] = __('Go'); $js_messages['strCancel'] = __('Cancel'); +/* For page-related settings */ +$js_messages['strPageSettings'] = _('Page-related settings'); +$js_messages['strApply'] = _('Apply'); + /* For Ajax Notifications */ $js_messages['strLoading'] = __('Loading…'); $js_messages['strAbortedRequest'] = __('Request Aborted!!'); diff --git a/js/page_settings.js b/js/page_settings.js new file mode 100644 index 0000000000..4926c1fb97 --- /dev/null +++ b/js/page_settings.js @@ -0,0 +1,42 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview function used for page-related settings + * @name Page-related settings + * + * @requires jQuery + * @requires jQueryUI + * @required js/functions.js + */ + +function show_settings() { + var buttons = {}; + buttons[PMA_messages.strApply] = function() { + $('.config-form').submit(); + }; + + buttons[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + + $('.page_settings_modal') + .dialog({ + title: PMA_messages.strPageSettings, + width: 700, + minHeight: 250, + modal: true, + open: function() { + $(this).dialog('option', 'maxHeight', $(window).height() - $(this).offset().top); + }, + buttons: buttons + }); +} + +AJAX.registerTeardown('page_settings.js', function () { + $('#page_settings_icon').css('display', 'none'); + $('#page_settings_icon').unbind('click'); +}); + +AJAX.registerOnload('page_settings.js', function () { + $('#page_settings_icon').css('display', 'inline'); + $('#page_settings_icon').bind('click', show_settings); +}); diff --git a/libraries/Header.class.php b/libraries/Header.class.php index 4fba67cc55..4eeb29fef6 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -444,6 +444,12 @@ class PMA_Header if ($this->_menuEnabled && $GLOBALS['server'] > 0) { $retval .= $this->_menu->getDisplay(); $retval .= ''; + $retval .= '' + . PMA_Util::getImage( + 's_cog.png', + __('Page-related settings') + ) + . ''; $retval .= sprintf( '%s', PMA_Util::getImage( diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index cf72fb3bf4..d50fb80c25 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -212,11 +212,12 @@ class FormDisplay * @param array &$js_default stores JavaScript code * to be displayed * @param array &$js will be updated with javascript code + * @param bool $show_buttons whether show submit and reset button * * @return string $htmlOutput */ private function _displayForms( - $show_restore_default, array &$js_default, array &$js + $show_restore_default, array &$js_default, array &$js, $show_buttons ) { $htmlOutput = ''; $validators = PMA_Validator::getValidators($this->_configFile); @@ -259,7 +260,7 @@ class FormDisplay PMA_addJsValidate($translated_path, $validators[$path], $js); } } - $htmlOutput .= PMA_displayFieldsetBottom(); + $htmlOutput .= PMA_displayFieldsetBottom($show_buttons); } return $htmlOutput; } @@ -267,23 +268,30 @@ class FormDisplay /** * Outputs HTML for forms * - * @param bool $tabbed_form if true, use a form with tabs - * @param bool $show_restore_default whether show "restore default" button - * besides the input field + * @param bool $tabbed_form if true, use a form with tabs + * @param bool $show_restore_default whether show "restore default" button + * besides the input field + * @param bool $show_buttons whether show submit and reset button + * @param string $form_action action attribute for the form + * @param array $hidden_fields array of form hidden fields (key: field name) * * @return string HTML for forms */ - public function getDisplay($tabbed_form = false, $show_restore_default = false) - { + public function getDisplay( + $tabbed_form = false, + $show_restore_default = false, + $show_buttons = true, + $form_action = null, + $hidden_fields = null + ) { static $js_lang_sent = false; $htmlOutput = ''; $js = array(); $js_default = array(); - $tabbed_form = $tabbed_form && (count($this->_forms) > 1); - $htmlOutput .= PMA_displayFormTop(); + $htmlOutput .= PMA_displayFormTop($form_action, 'post', $hidden_fields); if ($tabbed_form) { $tabs = array(); @@ -311,7 +319,7 @@ class FormDisplay // display forms $htmlOutput .= $this->_displayForms( - $show_restore_default, $js_default, $js + $show_restore_default, $js_default, $js, $show_buttons ); if ($tabbed_form) { diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index d4f0f06141..5099a7ff7c 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -384,22 +384,27 @@ function PMA_displayGroupFooter() /** * Displays bottom part of a fieldset * + * @param bool $show_buttons whether show submit and reset button + * * @return string */ -function PMA_displayFieldsetBottom() +function PMA_displayFieldsetBottom($show_buttons = true) { $colspan = 2; if (defined('PMA_SETUP')) { $colspan++; } - $htmlOutput = '