Make WordPress Core


Ignore:
Timestamp:
01/03/2004 12:13:11 AM (21 years ago)
Author:
michelvaldrighi
Message:

edit-form.php now included in bookmarklet.php, added #postdiv selector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/bookmarklet.php

    r628 r694  
    33
    44// accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King
    5 
    6 function selected($selected, $current) {
    7     if ($selected == $current) echo ' selected="selected"';
    8 }
    95
    106$mode = 'bookmarklet';
     
    3127} else {
    3228
     29    $popuptitle = stripslashes($popuptitle);
     30    $text = stripslashes($text);
     31   
     32    /* big funky fixes for browsers' javascript bugs */
     33   
     34    if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
     35        $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
     36        $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
     37    }
     38   
     39    if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
     40        $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
     41        $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
     42    }
     43   
     44    if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
     45        $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
     46        $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
     47    }
     48   
     49    $post_title = $_REQUEST['post_title'];
     50    if (!empty($post_title)) {
     51        $post_title =  stripslashes($post_title);
     52    } else {
     53        $post_title = $popuptitle;
     54    }
     55   
     56    $content = $_REQUEST['content'];
     57    if (!empty($content)) {
     58        $content =  stripslashes($content);
     59    } else {
     60        $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
     61    }
     62   
     63    /* /big funky fixes */
     64
    3365?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3466<html xmlns="http://www.w3.org/1999/xhtml">
     
    3668<title>WordPress > Bookmarklet</title>
    3769<link rel="stylesheet" href="wp-admin.css" type="text/css" />
     70<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $admin_area_charset ?>" />
    3871<script type="text/javascript" language="javascript">
    3972<!--
     
    4679<style type="text/css">
    4780<!--
    48 body {
    49 }
    5081
    51 textarea,input,select {
    52     background-color: transparent;
    53     background-color: #cccccc;
    54     filter: alpha(opacity:80);
    55     -moz-opacity: .8;
     82#wpbookmarklet textarea,input,select {
    5683    border-width: 1px;
    5784    border-color: #cccccc;
     
    6188}
    6289
    63 .checkbox {
     90#wpbookmarklet .checkbox {
    6491    background-color: #ffffff;
    6592    border-width: 0px;
     
    6895}
    6996
    70 textarea {
     97#wpbookmarklet textarea {
    7198    font-family: Verdana, Geneva, Arial, Helvetica;
    7299    font-size: 0.9em;
    73100}
     101
     102#wpbookmarklet .wrap {
     103    border: 0px;
     104}
     105
     106#wpbookmarklet #postdiv {
     107    margin-bottom: 0.5em;
     108}
     109
     110#wpbookmarklet #titlediv {
     111    margin-bottom: 1em;
     112}
     113
    74114-->
    75115</style>
    76116</head>
    77 <body>
    78 <form name="post" action="post.php" method="POST">
    79 <input type="hidden" name="action" value="post" />
    80 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
    81 <input type="hidden" name="mode" value="bookmarklet" />
     117<body id="wpbookmarklet">
     118<h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
    82119
    83 <div align="right">
    84 <?php
    85 
    86 $popuptitle = stripslashes($popuptitle);
    87 $text = stripslashes($text);
    88 
    89 
    90 /* big funky fixes for browsers' javascript bugs */
    91 
    92 if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
    93     $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
    94     $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
    95 }
    96 
    97 if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
    98     $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
    99     $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
    100 }
    101 
    102 if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
    103     $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
    104     $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
    105 }
    106 
    107 $post_title = $_REQUEST['post_title'];
    108 if (!empty($post_title)) {
    109     $post_title =  stripslashes($post_title);
    110 } else {
    111     $post_title = $popuptitle;
    112 }
    113 
    114 $content = $_REQUEST['content'];
    115 if (!empty($content)) {
    116     $content =  stripslashes($content);
    117 } else {
    118     $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
    119 }
    120 
    121 /* /big funky fixes */
    122 
    123 
    124 ?>
    125 <table width="100%" cellpadding="8" cellspacing="0" width="415">
    126   <tr>
    127     <td width="40">&nbsp;</td>
    128     <td align="left" width="415">
    129       <table cellspacing="0" cellpadding="0">
    130         <td height="50" width="250" align="left" valign="bottom"><label>Title<br />
    131           <input type="text" name="post_title" size="20" tabindex="1" style="width: 215px;" value="<?php echo $post_title; ?>" /></label></td>
    132         <td width="165" align="left" valign="bottom"><b>Category</b><br /><?php dropdown_categories(); ?></td>
    133       </table>
    134     </td>
    135   </tr>
    136 
    137   <tr height="40">
    138     <td width="40">&nbsp;</td>
    139     <td align="left" width="415">
    140       <table cellspacing="0" cellpadding="0">
    141         <td height="50" width="150" align="left" valign="bottom">
    142           <label for="post_status">Post Status:</label>&nbsp;<br />
    143           <select name="post_status" id="post_status">
    144             <option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
    145                 <option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
    146                 <option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
    147             </select>
    148         </td>
    149         <td height="50" width="250" align="left" valign="bottom">
    150           <label for="comment_status">Comments:</label>&nbsp;<br />
    151           <select name="comment_status" id="comment_status">
    152             <option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
    153                 <option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
    154             </select>
    155         </td>
    156       </table>
    157     </td>
    158   </tr>
    159 
    160   <tr height="40">
    161     <td width="40">&nbsp;</td>
    162     <td align="left" width="415">
    163       <table cellspacing="0" cellpadding="0">
    164         <td height="50" width="100" align="left" valign="bottom">
    165           <label for="ping_status">Pings:</label><br />
    166           <select name="ping_status" id="ping_status">
    167             <option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
    168                 <option value="closed"<?php selected($ping_status, 'open'); ?>>Closed</option>
    169             </select>
    170         </td>
    171         <td height="50" width="250" align="left" valign="bottom">
    172           <label for="post_password">Post Password:</label><br />
    173           <input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
    174         </td>
    175       </table>
    176     </td>
    177     </tr>
    178 
    179   <tr height="40">
    180     <td width="40">&nbsp;</td>
    181     <td width="415" align="left" height="40">
    182       <table width="415" cellpadding="0" cellspacing="0">
    183         <td align="left" valign="bottom"><b>Post</b></td>
    184         <td align="right" valign="bottom"><?php if ($use_quicktags) include("quicktags.php"); ?></td>
    185       </table>
    186 <?php
    187 if ((preg_match("/Nav/",$HTTP_USER_AGENT)) || (preg_match("/Mozilla\/4\.7/",$HTTP_USER_AGENT))) {
    188     $rows="6";
    189 } else {
    190     $rows="8";
    191 } ?>
    192 <?php
    193 // stuff to fix textism.com's WEIRD characters conflict with javascript on IE5Mac
    194 preg_match("/\%u[1-9A-F][1-9A-F][1-9A-F][1-9A-F]/is", $text, $stufftofix);
    195 // ... and so on. currently coding the fix
    196 ?>
    197       <textarea rows="<?php echo $rows ?>" cols="48" style="width:415px;" name="content" id="content" tabindex="2" class="postform"><?php echo $content ?></textarea><br />
    198 <?php
    199 if ($use_quicktags) {
    200 ?>
    201 <script language="JavaScript">
    202 <!--
    203 edCanvas = document.getElementById('content');
    204 //-->
    205 </script>
    206 <?php
    207 }
    208 ?>
    209       <table cellpadding="0" cellspacing="0">
    210         <td align="left" width="90"></td>
    211 <?php if ($pingback) { ?>
    212         <td align="left">
    213           <input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack</label>
    214         </td>
    215 <?php } ?>
    216       </table>
    217 
    218 <?php if (0 /*$use_preview*/) { ?>
    219       <input type="button" value="preview" onClick="preview(this.form);" class="search" tabindex="8" />
    220 <?php } ?>
    221 
    222       <input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
    223 
    224 
    225 <?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
    226       <input type="button" value="upload a file" onClick="launchupload();" class="search" />
    227 <?php } ?>
    228 
    229       <script language="JavaScript" type="text/javascript">
    230       <!--
    231           window.focus();
    232           //document.blog.post_content.focus();
    233       //-->
    234       </script>
    235     </td>
    236   </tr>
    237 <?php if ($trackback) { ?>
    238   <tr>
    239     <td width="40">&nbsp;</td>
    240     <td width="415" align="left" height="40">
    241       <label for="trackback"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym>:</label> (Separate multiple URLs with commas.)<br />
    242       <input type="text" name="trackback" style="width: 415px" />
    243     </td>
    244   </tr>
    245 <?php } ?>
    246 </table>
    247 
    248 </div>
    249 
    250 </form>
    251 
    252 </div>
     120<?php require('edit-form.php'); ?>
    253121
    254122</body>
Note: See TracChangeset for help on using the changeset viewer.