<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [1688] trunk:
Added global action confirmation JS for use on delete links,
or any sensitive action links.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>1688</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-08-24 20:45:17 +0000 (Mon, 24 Aug 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added global action confirmation JS for use on delete links, or any sensitive action links. Use class="confirm" in your html anchor tags.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcorecssjsphp">trunk/bp-core/bp-core-cssjs.php</a></li>
<li><a href="#trunkbpforumsbpforumsbbpressphp">trunk/bp-forums/bp-forums-bbpress.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpforumsphp">trunk/bp-forums.php</a></li>
<li><a href="#trunkbpthemesbpsnframeworkmessagesindexphp">trunk/bp-themes/bp-sn-framework/messages/index.php</a></li>
<li><a href="#trunkbpthemesbpsnframeworkmessagesnoticesphp">trunk/bp-themes/bp-sn-framework/messages/notices.php</a></li>
<li><a href="#trunkbpthemesbpsnframeworkmessagessentboxphp">trunk/bp-themes/bp-sn-framework/messages/sentbox.php</a></li>
<li><a href="#trunkbpwirebpwiretemplatetagsphp">trunk/bp-wire/bp-wire-templatetags.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcorecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-cssjs.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-cssjs.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-core/bp-core-cssjs.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -55,13 +55,20 @@
</span><span class="cx">         global $bp;
</span><span class="cx"> ?>
</span><span class="cx">         <style type="text/css">
</span><del>-                ul#adminmenu li.toplevel_page_bp-core .wp-menu-image a { background-image: url( <?php echo $bp->core->image_base . '/admin_menu_icon.png' ?> ) !important; background-position: -1px -32px; }
</del><ins>+                ul#adminmenu li.toplevel_page_bp-core .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . '/bp-core/images/admin_menu_icon.png' ?> ) !important; background-position: -1px -32px; }
</ins><span class="cx">                 ul#adminmenu li.toplevel_page_bp-core:hover .wp-menu-image a { background-position: -1px 0; }
</span><span class="cx">                 ul#adminmenu li.toplevel_page_bp-core .wp-menu-image a img { display: none; }
</span><span class="cx">         </style>
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_head', 'bp_core_admin_menu_icon_css' );
</span><ins>+        
+function bp_core_confirmation_js() {
+?>
+        <script type="text/javascript"> jQuery(document).ready( function() { jQuery("a.confirm").click( function() { if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) return true; else return false; }); });</script>
+<?php
+}
+add_action( 'wp_head', 'bp_core_confirmation_js', 100 );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * bp_core_add_jquery_cropper()
</span></span></pre></div>
<a id="trunkbpforumsbpforumsbbpressphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-bbpress.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-bbpress.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-forums/bp-forums-bbpress.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -117,9 +117,7 @@
</span><span class="cx">                 // Set the site URI
</span><span class="cx">                 bb_update_option( 'uri', BB_URL );
</span><span class="cx">         }
</span><del>-        
-        add_action( 'wp_head', 'bp_forums_add_js' );
-        
</del><ins>+
</ins><span class="cx">         register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'bbpress_init', 'bp_forums_load_bbpress' );
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-forums/bp-forums-templatetags.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx">                 else
</span><span class="cx">                         $links .= '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . '/close', 'bp_forums_close_topic' ) . '">' . __( 'Close', 'buddypress' ) . '</a> ' . $seperator . ' ';
</span><span class="cx">
</span><del>-                $links .= '<a id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . '/delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
</del><ins>+                $links .= '<a class="confirm" id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . '/delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
</ins><span class="cx">
</span><span class="cx">                 return $links;
</span><span class="cx">         }
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx">                 extract( $r, EXTR_SKIP );
</span><span class="cx">
</span><span class="cx">                 $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . '/post/' . $topic_template->post->post_id . '/edit/', 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' ';
</span><del>-                $links .= '<a id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . '/post/' . $topic_template->post->post_id . '/delete/', 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
</del><ins>+                $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . '/post/' . $topic_template->post->post_id . '/delete/', 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
</ins><span class="cx">
</span><span class="cx">                 return $links;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-forums.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -8,7 +8,6 @@
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-classes.php' );
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-templatetags.php' );
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-filters.php' );
</span><del>-require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-cssjs.php' );
</del><span class="cx">
</span><span class="cx"> function bp_forums_setup() {
</span><span class="cx">         global $bp;
</span></span></pre></div>
<a id="trunkbpthemesbpsnframeworkmessagesindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-framework/messages/index.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-framework/messages/index.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-themes/bp-sn-framework/messages/index.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">                                                         <?php do_action( 'bp_messages_inbox_list_item' ) ?>
</span><span class="cx">                                                         
</span><span class="cx">                                                         <td width="10%">
</span><del>-                                                                <a href="<?php bp_message_thread_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>" class="delete"><?php _e("Delete", "buddypress"); ?></a> &nbsp;
</del><ins>+                                                                <a href="<?php bp_message_thread_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>" class="delete confirm"><?php _e("Delete", "buddypress"); ?></a> &nbsp;
</ins><span class="cx">                                                                 <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id() ?>" />
</span><span class="cx">                                                         </td>
</span><span class="cx">                                                 </tr>
</span></span></pre></div>
<a id="trunkbpthemesbpsnframeworkmessagesnoticesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-framework/messages/notices.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-framework/messages/notices.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-themes/bp-sn-framework/messages/notices.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx">                                                 <?php do_action( 'bp_messages_notices_list_item' ) ?>
</span><span class="cx">
</span><span class="cx">                                                 <td width="4%">
</span><del>-                                                        <a href="<?php bp_message_activate_deactivate_link() ?>"><?php bp_message_activate_deactivate_text() ?></a>
-                                                        <a href="<?php bp_message_notice_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>"><?php _e("Delete", "buddypress"); ?></a>
</del><ins>+                                                        <a href="<?php bp_message_activate_deactivate_link() ?>" class="confirm"><?php bp_message_activate_deactivate_text() ?></a>
+                                                        <a href="<?php bp_message_notice_delete_link() ?>" class="confirm" title="<?php _e("Delete Message", "buddypress"); ?>"><?php _e("Delete", "buddypress"); ?></a>
</ins><span class="cx">                                                 </td>
</span><span class="cx">                                         </tr>
</span><span class="cx">                                         
</span></span></pre></div>
<a id="trunkbpthemesbpsnframeworkmessagessentboxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-framework/messages/sentbox.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-framework/messages/sentbox.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-themes/bp-sn-framework/messages/sentbox.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">                                                 <?php do_action( 'bp_messages_sentbox_list' ) ?>
</span><span class="cx">
</span><span class="cx">                                                 <td width="10%">
</span><del>-                                                        <a href="<?php bp_message_thread_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>" class="delete"><?php _e("Delete", "buddypress"); ?></a> &nbsp;
</del><ins>+                                                        <a href="<?php bp_message_thread_delete_link() ?>" title="<?php _e("Delete Message", "buddypress"); ?>" class="delete confirm"><?php _e("Delete", "buddypress"); ?></a> &nbsp;
</ins><span class="cx">                                                         <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id() ?>" />
</span><span class="cx">                                                 </td>
</span><span class="cx">                                         </tr>
</span></span></pre></div>
<a id="trunkbpwirebpwiretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire/bp-wire-templatetags.php (1687 => 1688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire/bp-wire-templatetags.php        2009-08-24 20:25:50 UTC (rev 1687)
+++ trunk/bp-wire/bp-wire-templatetags.php        2009-08-24 20:45:17 UTC (rev 1688)
</span><span class="lines">@@ -363,9 +363,9 @@
</span><span class="cx">
</span><span class="cx">                 if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) {
</span><span class="cx">                         if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) {
</span><del>-                                return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
</del><ins>+                                return apply_filters( 'bp_get_wire_delete_link', '<a class="confirm" href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
</ins><span class="cx">                         } else {
</span><del>-                                return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
</del><ins>+                                return apply_filters( 'bp_get_wire_delete_link', '<a class="confirm" href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre>
</div>
</div>
</body>
</html>