The branch, master has been updated via 5b900ead54f457e75398ba22910b58663e922aac (commit) from 916126d0347901cd2a99f02c166bc10bf6b559e9 (commit)
- Log ----------------------------------------------------------------- commit 5b900ead54f457e75398ba22910b58663e922aac Author: Marc Delisle marc@infomarc.info Date: Thu Jan 27 13:08:33 2011 -0500
Conditional Ajax on table Structure
-----------------------------------------------------------------------
Summary of changes: js/tbl_structure.js | 3 +++ libraries/Index.class.php | 6 +++++- tbl_structure.php | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 40397c1..6a7c773 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -24,6 +24,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * (see $GLOBALS['cfg']['AjaxEnable']) */ $(".drop_column_anchor").live('click', function(event) { event.preventDefault(); @@ -66,6 +67,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * (see $GLOBALS['cfg']['AjaxEnable']) */ $(".action_primary a").live('click', function(event) { event.preventDefault(); @@ -107,6 +109,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * (see $GLOBALS['cfg']['AjaxEnable']) */ $('.drop_primary_key_index_anchor').live('click', function(event) { event.preventDefault(); diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 285f578..53ea62d 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -477,7 +477,11 @@ class PMA_Index }
$r .= '<td ' . $row_span . '>' - . ' <a class="drop_primary_key_index_anchor" href="sql.php' . PMA_generate_common_url($this_params) + . ' <a '; + if ($GLOBALS['cfg']['AjaxEnable']) { + $r .= 'class="drop_primary_key_index_anchor" '; + } + $r .= ' href="sql.php' . PMA_generate_common_url($this_params) . '" >' . PMA_getIcon('b_drop.png', __('Drop')) . '</a>' . '</td>' . "\n"; diff --git a/tbl_structure.php b/tbl_structure.php index 17c2e73..66cfb53 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -394,7 +394,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { <?php echo $titles['Change']; ?></a> </td> <td align="center" class="drop"> - <a class="drop_column_anchor" href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&dropped_column=<?php echo urlencode($row['Field']); ?>&message_to_show=<?php echo urlencode(sprintf(__('Column %s has been dropped'), htmlspecialchars($row['Field']))); ?>" > + <a <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="drop_column_anchor"' : ''); ?> href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&dropped_column=<?php echo urlencode($row['Field']); ?>&message_to_show=<?php echo urlencode(sprintf(__('Column %s has been dropped'), htmlspecialchars($row['Field']))); ?>" > <?php echo $titles['Drop']; ?></a> </td> <td align="center" class="primary"> @@ -476,7 +476,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { <?php echo $hidden_titles['BrowseDistinctValues']; ?> </a> </div> - <div class="action_primary"> + <div <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="action_primary"' : ''); ?>> <?php if(isset($primary_enabled)) { if($primary_enabled) { ?>
hooks/post-receive