<!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=&quot;confirm&quot; 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"> ?&gt;
</span><span class="cx">         &lt;style type=&quot;text/css&quot;&gt;
</span><del>-                ul#adminmenu li.toplevel_page_bp-core .wp-menu-image a { background-image: url( &lt;?php echo $bp-&gt;core-&gt;image_base . '/admin_menu_icon.png' ?&gt; ) !important; background-position: -1px -32px; }
</del><ins>+                ul#adminmenu li.toplevel_page_bp-core .wp-menu-image a { background-image: url( &lt;?php echo BP_PLUGIN_URL . '/bp-core/images/admin_menu_icon.png' ?&gt; ) !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">         &lt;/style&gt;
</span><span class="cx"> &lt;?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() {
+?&gt;
+        &lt;script type=&quot;text/javascript&quot;&gt; jQuery(document).ready( function() { jQuery(&quot;a.confirm&quot;).click( function() { if ( confirm( '&lt;?php _e( 'Are you sure?', 'buddypress' ) ?&gt;' ) ) return true; else return false; }); });&lt;/script&gt;
+&lt;?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(&quot;bb_shutdown&quot;);' ) );
</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 .= '&lt;a href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . '/close', 'bp_forums_close_topic' ) . '&quot;&gt;' . __( 'Close', 'buddypress' ) . '&lt;/a&gt; ' . $seperator . ' ';
</span><span class="cx"> 
</span><del>-                $links .= '&lt;a id=&quot;topic-delete-link&quot; href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . '/delete', 'bp_forums_delete_topic' ) . '&quot;&gt;' . __( 'Delete', 'buddypress' ) . '&lt;/a&gt;';
</del><ins>+                $links .= '&lt;a class=&quot;confirm&quot; id=&quot;topic-delete-link&quot; href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . '/delete', 'bp_forums_delete_topic' ) . '&quot;&gt;' . __( 'Delete', 'buddypress' ) . '&lt;/a&gt;';
</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  = '&lt;a href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template-&gt;post-&gt;id . '/post/' . $topic_template-&gt;post-&gt;post_id . '/edit/', 'bp_forums_edit_post' ) . '&quot;&gt;' . __( 'Edit', 'buddypress' ) . '&lt;/a&gt; ' . $seperator . ' ';
</span><del>-                $links .= '&lt;a id=&quot;post-delete-link&quot; href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . '/post/' . $topic_template-&gt;post-&gt;post_id . '/delete/', 'bp_forums_delete_post' ) . '&quot;&gt;' . __( 'Delete', 'buddypress' ) . '&lt;/a&gt;';
</del><ins>+                $links .= '&lt;a class=&quot;confirm&quot; id=&quot;post-delete-link&quot; href=&quot;' . wp_nonce_url( bp_get_the_topic_permalink() . '/post/' . $topic_template-&gt;post-&gt;post_id . '/delete/', 'bp_forums_delete_post' ) . '&quot;&gt;' . __( 'Delete', 'buddypress' ) . '&lt;/a&gt;';
</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">                                                         &lt;?php do_action( 'bp_messages_inbox_list_item' ) ?&gt;
</span><span class="cx">                                                         
</span><span class="cx">                                                         &lt;td width=&quot;10%&quot;&gt;
</span><del>-                                                                &lt;a href=&quot;&lt;?php bp_message_thread_delete_link() ?&gt;&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot; class=&quot;delete&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; &amp;nbsp; 
</del><ins>+                                                                &lt;a href=&quot;&lt;?php bp_message_thread_delete_link() ?&gt;&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot; class=&quot;delete confirm&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; &amp;nbsp; 
</ins><span class="cx">                                                                 &lt;input type=&quot;checkbox&quot; name=&quot;message_ids[]&quot; value=&quot;&lt;?php bp_message_thread_id() ?&gt;&quot; /&gt;
</span><span class="cx">                                                         &lt;/td&gt;
</span><span class="cx">                                                 &lt;/tr&gt;
</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">                                                 &lt;?php do_action( 'bp_messages_notices_list_item' ) ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;td width=&quot;4%&quot;&gt;
</span><del>-                                                        &lt;a href=&quot;&lt;?php bp_message_activate_deactivate_link() ?&gt;&quot;&gt;&lt;?php bp_message_activate_deactivate_text() ?&gt;&lt;/a&gt; 
-                                                        &lt;a href=&quot;&lt;?php bp_message_notice_delete_link() ?&gt;&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; 
</del><ins>+                                                        &lt;a href=&quot;&lt;?php bp_message_activate_deactivate_link() ?&gt;&quot; class=&quot;confirm&quot;&gt;&lt;?php bp_message_activate_deactivate_text() ?&gt;&lt;/a&gt; 
+                                                        &lt;a href=&quot;&lt;?php bp_message_notice_delete_link() ?&gt;&quot; class=&quot;confirm&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; 
</ins><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx">                                         &lt;/tr&gt;
</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">                                                 &lt;?php do_action( 'bp_messages_sentbox_list' ) ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;td width=&quot;10%&quot;&gt;
</span><del>-                                                        &lt;a href=&quot;&lt;?php bp_message_thread_delete_link() ?&gt;&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot; class=&quot;delete&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; &amp;nbsp;  
</del><ins>+                                                        &lt;a href=&quot;&lt;?php bp_message_thread_delete_link() ?&gt;&quot; title=&quot;&lt;?php _e(&quot;Delete Message&quot;, &quot;buddypress&quot;); ?&gt;&quot; class=&quot;delete confirm&quot;&gt;&lt;?php _e(&quot;Delete&quot;, &quot;buddypress&quot;); ?&gt;&lt;/a&gt; &amp;nbsp;  
</ins><span class="cx">                                                         &lt;input type=&quot;checkbox&quot; name=&quot;message_ids[]&quot; value=&quot;&lt;?php bp_message_thread_id() ?&gt;&quot; /&gt;
</span><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx">                                         &lt;/tr&gt;
</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-&gt;wire_post-&gt;user_id == $bp-&gt;loggedin_user-&gt;id ) || $bp-&gt;is_item_admin || is_site_admin() ) {
</span><span class="cx">                         if ( $bp-&gt;wire-&gt;slug == $bp-&gt;current_component || $bp-&gt;profile-&gt;slug == $bp-&gt;current_component ) {
</span><del>-                                return apply_filters( 'bp_get_wire_delete_link', '&lt;a href=&quot;' . wp_nonce_url( $bp-&gt;displayed_user-&gt;domain . $bp-&gt;wire-&gt;slug . '/delete/' . $wire_posts_template-&gt;wire_post-&gt;id, 'bp_wire_delete_link' ) . '&quot;&gt;[' . __('Delete', 'buddypress') . ']&lt;/a&gt;' );
</del><ins>+                                return apply_filters( 'bp_get_wire_delete_link', '&lt;a class=&quot;confirm&quot; href=&quot;' . wp_nonce_url( $bp-&gt;displayed_user-&gt;domain . $bp-&gt;wire-&gt;slug . '/delete/' . $wire_posts_template-&gt;wire_post-&gt;id, 'bp_wire_delete_link' ) . '&quot;&gt;[' . __('Delete', 'buddypress') . ']&lt;/a&gt;' );
</ins><span class="cx">                         } else {
</span><del>-                                return apply_filters( 'bp_get_wire_delete_link', '&lt;a href=&quot;' . wp_nonce_url( site_url( $bp-&gt;{$bp-&gt;current_component}-&gt;slug . '/' . $uri . '/wire/delete/' . $wire_posts_template-&gt;wire_post-&gt;id ), 'bp_wire_delete_link' ) . '&quot;&gt;[' . __('Delete', 'buddypress') . ']&lt;/a&gt;' );
</del><ins>+                                return apply_filters( 'bp_get_wire_delete_link', '&lt;a class=&quot;confirm&quot; href=&quot;' . wp_nonce_url( site_url( $bp-&gt;{$bp-&gt;current_component}-&gt;slug . '/' . $uri . '/wire/delete/' . $wire_posts_template-&gt;wire_post-&gt;id ), 'bp_wire_delete_link' ) . '&quot;&gt;[' . __('Delete', 'buddypress') . ']&lt;/a&gt;' );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>