Changeset 12098 for trunk/wp-admin/includes/media.php
- Timestamp:
- 10/24/2009 11:43:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r12081 r12098 167 167 /* ]]> */ 168 168 </script> 169 169 <?php 170 170 exit; 171 171 } … … 482 482 483 483 if ( !empty($_POST['insertonlybutton']) ) { 484 $src = $_POST['insertonly']['src']; 485 if ( !empty($src) && !strpos($src, '://') ) 486 $src = "http://$src"; 487 $alt = esc_attr($_POST['insertonly']['alt']); 488 if ( isset($_POST['insertonly']['align']) ) { 489 $align = esc_attr($_POST['insertonly']['align']); 490 $class = " class='align$align'"; 484 $alt = $align = ''; 485 if ( !empty($_POST['insertonly']['embed-src']) ) { 486 $src = $_POST['insertonly']['embed-src']; 487 if ( !strpos($src, '://') ) 488 $src = "http://$src"; 489 $html = '[embed]' . $src . '[/embed]'; 490 } else { 491 $src = $_POST['insertonly']['src']; 492 if ( !empty($src) && !strpos($src, '://') ) 493 $src = "http://$src"; 494 $alt = esc_attr($_POST['insertonly']['alt']); 495 if ( isset($_POST['insertonly']['align']) ) { 496 $align = esc_attr($_POST['insertonly']['align']); 497 $class = " class='align$align'"; 498 } 499 if ( !empty($src) ) 500 $html = "<img src='$src' alt='$alt'$class />"; 491 501 } 492 if ( !empty($src) ) 493 $html = "<img src='$src' alt='$alt'$class />"; 502 494 503 $html = apply_filters('image_send_to_editor_url', $html, $src, $alt, $align); 495 504 return media_send_to_editor($html); … … 587 596 if ( !empty($href) && !strpos($href, '://') ) 588 597 $href = "http://$href"; 589 $title = esc_attr($_POST['insertonly']['title']); 590 if ( empty($title) ) 591 $title = basename($href); 592 if ( !empty($title) && !empty($href) ) 593 $html = "<a href='$href' >$title</a>"; 594 $html = apply_filters('audio_send_to_editor_url', $html, $href, $title); 598 599 $html = '[embed]' . $href . '[/embed]'; 600 $html = apply_filters('audio_send_to_editor_url', $html, $href); 595 601 return media_send_to_editor($html); 596 602 } … … 641 647 if ( !empty($href) && !strpos($href, '://') ) 642 648 $href = "http://$href"; 643 $title = esc_attr($_POST['insertonly']['title']); 644 if ( empty($title) ) 645 $title = basename($href); 646 if ( !empty($title) && !empty($href) ) 647 $html = "<a href='$href' >$title</a>"; 648 $html = apply_filters('video_send_to_editor_url', $html, $href, $title); 649 650 $html = '[embed]' . $href . '[/embed]'; 651 $html = apply_filters('video_send_to_editor_url', $html, $href); 649 652 return media_send_to_editor($html); 650 653 } … … 695 698 if ( !empty($href) && !strpos($href, '://') ) 696 699 $href = "http://$href"; 700 697 701 $title = esc_attr($_POST['insertonly']['title']); 698 702 if ( empty($title) ) … … 1514 1518 var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = ''; 1515 1519 1516 if ( '' == f.src.value || '' == t.width ) return false; 1520 if ( '' != document.getElementById('embed-src').value ) 1521 return true; 1522 1523 if ( '' == f.src.value || '' == t.width ) 1524 return false; 1517 1525 1518 1526 if ( f.title.value ) { … … 1541 1549 var win = window.dialogArguments || opener || parent || top; 1542 1550 win.send_to_editor(html); 1551 return false; 1543 1552 }, 1544 1553 … … 1549 1558 document.getElementById('go_button').style.color = '#bbb'; 1550 1559 if ( ! document.forms[0].src.value ) 1551 document.getElementById('status_img'). src = 'images/required.gif';1552 else document.getElementById('status_img'). src = 'images/no.png';1560 document.getElementById('status_img').innerHTML = '*'; 1561 else document.getElementById('status_img').innerHTML = '<img src="images/no.png" alt="" />'; 1553 1562 }, 1554 1563 … … 1559 1568 t.height = t.preloadImg.height; 1560 1569 document.getElementById('go_button').style.color = '#333'; 1561 document.getElementById('status_img'). src = 'images/yes.png';1570 document.getElementById('status_img').innerHTML = '<img src="images/yes.png" alt="" />'; 1562 1571 }, 1563 1572 … … 1569 1578 return false; 1570 1579 } 1571 document.getElementById('status_img'). src = 'images/wpspin_light.gif';1580 document.getElementById('status_img').innerHTML = '<img src="images/wpspin_light.gif" alt="" />'; 1572 1581 t.preloadImg = new Image(); 1573 1582 t.preloadImg.onload = t.updateImageData; … … 1921 1930 1922 1931 return ' 1932 <h4 class="media-sub-title">' . __('Embed a picture from a web site that supports oEmbed') . '</h4> 1923 1933 <table class="describe"><tbody> 1924 1934 <tr> 1925 <th valign="top" scope="row" class="label" style="width:120px;"> 1935 <th valign="top" scope="row" class="label" style="width:130px;"> 1936 <span class="alignleft"><label for="embed-src">' . __('Embed image') . '</label></span> 1937 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 1938 </th> 1939 <td class="field"><input id="embed-src" name="insertonly[embed-src]" value="" type="text" /></td> 1940 </tr> 1941 1942 <tr> 1943 <td></td> 1944 <td> 1945 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Embed') . '" /> 1946 </td> 1947 </tr> 1948 </tbody></table> 1949 1950 <h4 class="media-sub-title">' . __('Insert an image from another web site') . '</h4> 1951 <table class="describe"><tbody> 1952 <tr> 1953 <th valign="top" scope="row" class="label" style="width:130px;"> 1926 1954 <span class="alignleft"><label for="src">' . __('Image URL') . '</label></span> 1927 <span class="alignright">< img id="status_img" src="images/required.gif" title="required" alt="required" /></span>1955 <span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span> 1928 1956 </th> 1929 1957 <td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td> … … 1999 2027 <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td> 2000 2028 </tr> 2001 <tr> 2002 <th valign="top" scope="row" class="label"> 2003 <span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span> 2004 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 2005 </th> 2006 <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td> 2007 </tr> 2008 <tr><td></td><td class="help">' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . '</td></tr> 2029 2009 2030 <tr> 2010 2031 <td></td> … … 2034 2055 <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td> 2035 2056 </tr> 2036 <tr> 2037 <th valign="top" scope="row" class="label"> 2038 <span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span> 2039 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 2040 </th> 2041 <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td> 2042 </tr> 2043 <tr><td></td><td class="help">' . __('Link text, e.g. “Lucy on YouTube”') . '</td></tr> 2057 2044 2058 <tr> 2045 2059 <td></td>
Note: See TracChangeset
for help on using the changeset viewer.