The branch, master has been updated via f80b603a5499ce2d2ba219525cccce17cfdcdf8c (commit) via a3e0bc02239f029a30822906a3b15a601213405c (commit) via 215fe10af1cfa2f8d4af59e114d7b806443a7ad4 (commit) from 3a3f6d5141c58a31924d915c43b1b7968792303b (commit)
- Log ----------------------------------------------------------------- commit f80b603a5499ce2d2ba219525cccce17cfdcdf8c Author: Marc Delisle marc@infomarc.info Date: Wed Feb 2 12:53:20 2011 -0500
Conditional Ajax for password change
commit a3e0bc02239f029a30822906a3b15a601213405c Author: Marc Delisle marc@infomarc.info Date: Wed Feb 2 12:42:46 2011 -0500
Conditional Ajax for create db
commit 215fe10af1cfa2f8d4af59e114d7b806443a7ad4 Author: Marc Delisle marc@infomarc.info Date: Wed Feb 2 12:35:06 2011 -0500
Add comment about conditional Ajax
-----------------------------------------------------------------------
Summary of changes: js/db_search.js | 1 + js/functions.js | 7 +++++-- libraries/display_create_database.lib.php | 2 +- main.php | 14 ++++++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/js/db_search.js b/js/db_search.js index 41ea5e6..0a82a8f 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -51,6 +51,7 @@ $(document).ready(function() { * (see $GLOBALS['cfg']['AjaxEnable']) * * @uses PMA_ajaxShowMessage() + * @see $GLOBALS['cfg']['AjaxEnable'] */ $("#db_search_form.ajax").live('submit', function(event) { event.preventDefault(); diff --git a/js/functions.js b/js/functions.js index 24dc0a3..12831a1 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1900,6 +1900,7 @@ $(document).ready(function() { * @uses PMA_ajaxShowMessage() * @uses window.parent.refreshNavigation() * @uses window.parent.refreshMain() + * @see $cfg['AjaxEnable'] */ $(document).ready(function() { $("#drop_db_anchor").live('click', function(event) { @@ -1928,10 +1929,11 @@ $(document).ready(function() { * display_create_database.lib.php is used, ie main.php and server_databases.php * * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] */ $(document).ready(function() {
- $('#create_database_form').live('submit', function(event) { + $('#create_database_form.ajax').live('submit', function(event) { event.preventDefault();
$form = $(this); @@ -1977,8 +1979,9 @@ $(document).ready(function() {
/** * Attach Ajax event handler on the change password anchor + * @see $cfg['AjaxEnable'] */ - $('#change_password_anchor').live('click', function(event) { + $('#change_password_anchor.ajax').live('click', function(event) { event.preventDefault();
/** diff --git a/libraries/display_create_database.lib.php b/libraries/display_create_database.lib.php index 17ebfae..07db1f7 100644 --- a/libraries/display_create_database.lib.php +++ b/libraries/display_create_database.lib.php @@ -17,7 +17,7 @@ require_once './libraries/check_user_privileges.lib.php'; if ($is_create_db_priv) { // The user is allowed to create a db ?> - <form method="post" action="db_create.php" id="create_database_form" ><strong> + <form method="post" action="db_create.php" id="create_database_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax" ' : ''); ?>><strong> <?php echo '<label for="text_create_db">' . __('Create new database') . '</label> ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br /> <?php echo PMA_generate_common_hidden_inputs('', '', 5); ?> <input type="hidden" name="reload" value="1" /> diff --git a/main.php b/main.php index 62fbc04..8818033 100644 --- a/main.php +++ b/main.php @@ -88,8 +88,13 @@ if ($server > 0 // Logout for advanced authentication if ($cfg['Server']['auth_type'] != 'config') { if ($cfg['ShowChgPassword']) { + if ($GLOBALS['cfg']['AjaxEnable']) { + $conditional_class = 'ajax'; + } else { + $conditional_class = null; + } PMA_printListItem(__('Change password'), 'li_change_password', - './user_password.php?' . $common_url_query, null, null, 'change_password_anchor'); + './user_password.php?' . $common_url_query, null, null, 'change_password_anchor', null, $conditional_class); } } // end if if (PMA_MYSQL_MAJOR_VERSION < 2009) { @@ -360,8 +365,10 @@ if ($cfg['SuhosinDisableWarning'] == false && @ini_get('suhosin.request.max_valu * @param string $mysql_help_page display a link to MySQL's manual * @param string $target special target for $url * @param string $a_id id for the anchor, used for jQuery to hook in functions + * @param string $class class for the li element + * @param string $a_class class for the anchor element */ -function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null, $a_id = null, $class = null) +function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null, $a_id = null, $class = null, $a_class = null) { echo '<li id="' . $id . '"'; if (null !== $class) { @@ -376,6 +383,9 @@ function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = nu if (null != $a_id) { echo ' id="' . $a_id .'"'; } + if (null != $a_class) { + echo ' class="' . $a_class .'"'; + } echo '>'; }
hooks/post-receive