<!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>[12955] trunk/wp-admin/includes: Merge mu_media_buttons()
  into media_buttons().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12955">12955</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-02-04 20:28:52 +0000 (Thu, 04 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge mu_media_buttons() into media_buttons(). see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (12954 => 12955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2010-02-04 20:00:18 UTC (rev 12954)
+++ trunk/wp-admin/includes/media.php        2010-02-04 20:28:52 UTC (rev 12955)
</span><span class="lines">@@ -361,14 +361,27 @@
</span><span class="cx">         $video_title = __('Add Video');
</span><span class="cx">         $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', &quot;$media_upload_iframe_src&amp;amp;type=audio&quot;);
</span><span class="cx">         $audio_title = __('Add Audio');
</span><del>-        $out = &lt;&lt;&lt;EOF
</del><span class="cx"> 
</span><del>-        &lt;a href=&quot;{$image_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_image&quot; class=&quot;thickbox&quot; title='$image_title' onclick=&quot;return false;&quot;&gt;&lt;img src='images/media-button-image.gif' alt='$image_title' /&gt;&lt;/a&gt;
-        &lt;a href=&quot;{$video_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_video&quot; class=&quot;thickbox&quot; title='$video_title' onclick=&quot;return false;&quot;&gt;&lt;img src='images/media-button-video.gif' alt='$video_title' /&gt;&lt;/a&gt;
-        &lt;a href=&quot;{$audio_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_audio&quot; class=&quot;thickbox&quot; title='$audio_title' onclick=&quot;return false;&quot;&gt;&lt;img src='images/media-button-music.gif' alt='$audio_title' /&gt;&lt;/a&gt;
-        &lt;a href=&quot;{$media_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_media&quot; class=&quot;thickbox&quot; title='$media_title' onclick=&quot;return false;&quot;&gt;&lt;img src='images/media-button-other.gif' alt='$media_title' /&gt;&lt;/a&gt;
</del><ins>+        $do_image = $do_audio = $do_video = true;
+        if ( is_multisite() ) {
+                $media_buttons = get_site_option( 'mu_media_buttons' );
+                if ( empty($media_buttons['image']) )
+                        $do_image = false;
+                if ( empty($media_buttons['audio']) )
+                        $do_audio = false;
+                if ( empty($media_buttons['video']) )
+                        $do_video = false;
+        }
+        $out = '';
</ins><span class="cx"> 
</span><del>-EOF;
</del><ins>+        if ( $do_image )
+                $out .= '&lt;a href=&quot;{$image_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_image&quot; class=&quot;thickbox&quot; title=&quot;$image_title&quot; onclick=&quot;return false;&quot;&gt;&lt;img src=&quot;images/media-button-image.gif&quot; alt=&quot;$image_title&quot; /&gt;&lt;/a&gt;';
+        if ( $do_video )
+                $out .= '&lt;a href=&quot;{$video_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_video&quot; class=&quot;thickbox&quot; title=&quot;$video_title&quot; onclick=&quot;return false;&quot;&gt;&lt;img src=&quot;images/media-button-video.gif&quot; alt=&quot;$video_title&quot; /&gt;&lt;/a&gt;';
+        if ( $do_audio )
+                $out .= '&lt;a href=&quot;{$audio_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_audio&quot; class=&quot;thickbox&quot; title=&quot;$audio_title&quot; onclick=&quot;return false;&quot;&gt;&lt;img src=&quot;images/media-button-music.gif&quot; alt=&quot;$audio_title&quot; /&gt;&lt;/a&gt;';
+        $out .= '&lt;a href=&quot;{$media_upload_iframe_src}&amp;amp;TB_iframe=true&quot; id=&quot;add_media&quot; class=&quot;thickbox&quot; title=&quot;$media_title&quot; onclick=&quot;return false;&quot;&gt;&lt;img src=&quot;images/media-button-other.gif&quot; alt=&quot;$media_title&quot; /&gt;&lt;/a&gt;';
+
</ins><span class="cx">         printf($context, $out);
</span><span class="cx"> }
</span><span class="cx"> add_action( 'media_buttons', 'media_buttons' );
</span></span></pre></div>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (12954 => 12955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-02-04 20:00:18 UTC (rev 12954)
+++ trunk/wp-admin/includes/ms.php        2010-02-04 20:28:52 UTC (rev 12955)
</span><span class="lines">@@ -594,36 +594,6 @@
</span><span class="cx">         echo implode(&quot;\n\t&quot;, $output);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Only show &quot;Media&quot; upload icon
-function mu_media_buttons() {
-        global $post_ID, $temp_ID;
-        $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
-        $context = apply_filters('media_buttons_context', __('Add media: %s'));
-        $media_upload_iframe_src = &quot;media-upload.php?post_id=$uploading_iframe_ID&quot;;
-        $media_title = __('Add Media');
-        $mu_media_buttons = get_site_option( 'mu_media_buttons' );
-        $out = '';
-        if ( $mu_media_buttons[ 'image' ] ) {
-                $image_upload_iframe_src = apply_filters('image_upload_iframe_src', &quot;$media_upload_iframe_src&amp;amp;type=image&quot;);
-                $image_title = __('Add an Image');
-                $out .= &quot;&lt;a href='{$image_upload_iframe_src}&amp;amp;TB_iframe=true' id='add_image' class='thickbox' title='$image_title'&gt;&lt;img src='images/media-button-image.gif' alt='$image_title' /&gt;&lt;/a&gt;&quot;;
-        }
-        if ( $mu_media_buttons[ 'video' ] ) {
-                $video_upload_iframe_src = apply_filters('video_upload_iframe_src', &quot;$media_upload_iframe_src&amp;amp;type=video&quot;);
-                $video_title = __('Add Video');
-                $out .= &quot;&lt;a href='{$video_upload_iframe_src}&amp;amp;TB_iframe=true' id='add_video' class='thickbox' title='$video_title'&gt;&lt;img src='images/media-button-video.gif' alt='$video_title' /&gt;&lt;/a&gt;&quot;;
-        }
-        if ( $mu_media_buttons[ 'audio' ] ) {
-                $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', &quot;$media_upload_iframe_src&amp;amp;type=audio&quot;);
-                $audio_title = __('Add Audio');
-                $out .= &quot;&lt;a href='{$audio_upload_iframe_src}&amp;amp;TB_iframe=true' id='add_audio' class='thickbox' title='$audio_title'&gt;&lt;img src='images/media-button-music.gif' alt='$audio_title' /&gt;&lt;/a&gt;&quot;;
-        }
-        $out .= &quot;&lt;a href='{$media_upload_iframe_src}&amp;amp;TB_iframe=true&amp;amp;height=500&amp;amp;width=640' class='thickbox' title='$media_title'&gt;&lt;img src='images/media-button-other.gif' alt='$media_title' /&gt;&lt;/a&gt;&quot;;
-        printf($context, $out);
-}
-add_action( 'media_buttons', 'mu_media_buttons' );
-remove_action( 'media_buttons', 'media_buttons' );
-
</del><span class="cx"> /* Warn the admin if SECRET SALT information is missing from wp-config.php */
</span><span class="cx"> function secret_salt_warning() {
</span><span class="cx">         if ( !is_super_admin() )
</span></span></pre>
</div>
</div>

</body>
</html>