195e35ccf1e69860b34b7aeec0467d95880ca2d1
[autoinstalls/wordpress.git] / wp-admin / bookmarklet.php
1 <?php
2 $mode = 'bookmarklet';
3 require_once('admin.php');
4
5 if ( ! current_user_can('edit_posts') )
6         die ("Cheatin' uh?");
7
8 if ('b' == $a):
9 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
10 <html xmlns="http://www.w3.org/1999/xhtml">
11 <head>
12 <script type="text/javascript">
13 <!--
14 window.close()
15 -->
16 </script>
17 </head>
18 <body></body>
19 </html>
20 <?php
21 exit;
22 endif;
23
24 $post = get_default_post_to_edit();
25
26 $popuptitle = wp_specialchars(stripslashes($popuptitle));
27 $text       = wp_specialchars(stripslashes(urldecode($text)));
28         
29 $popuptitle = funky_javascript_fix($popuptitle);
30 $text       = funky_javascript_fix($text);
31         
32 $post_title = wp_specialchars($_REQUEST['post_title']);
33 if (!empty($post_title))
34         $post->post_title =  stripslashes($post_title);
35 else
36         $post->post_title = $popuptitle;
37         
38   
39 $content  = wp_specialchars($_REQUEST['content']);
40 $popupurl = wp_specialchars($_REQUEST['popupurl']);
41     if ( !empty($content) ) {
42         $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
43     } else {
44         $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
45     }
46
47     /* /big funky fixes */
48
49 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
50 <html xmlns="http://www.w3.org/1999/xhtml">
51 <head>
52 <title><?php bloginfo('name') ?> &rsaquo; Bookmarklet &#8212; WordPress</title>
53 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
54 <link rel="stylesheet" href="wp-admin.css" type="text/css" />
55
56 <style type="text/css">
57 <!--
58
59 #wpbookmarklet textarea,input,select {
60         border-width: 1px;
61         border-color: #cccccc;
62         border-style: solid;
63         padding: 2px;
64         margin: 1px;
65 }
66
67 #wpbookmarklet .checkbox {
68         background-color: #ffffff;
69         border-width: 0px;
70         padding: 0px;
71         margin: 0px;
72 }
73
74 #wpbookmarklet textarea {
75         font-family: Verdana, Geneva, Arial, Helvetica;
76         font-size: 0.9em;
77 }
78
79 #wpbookmarklet .wrap {
80     border: 0px;
81 }
82
83 #wpbookmarklet #postdiv {
84     margin-bottom: 0.5em;
85 }
86
87 #wpbookmarklet #titlediv {
88     margin-bottom: 1em;
89 }
90
91 -->
92 </style>
93 </head>
94 <body id="wpbookmarklet">
95 <div id="wphead">
96 <h1><?php bloginfo('name') ?></h1>
97 </div>
98
99 <?php require('edit-form.php'); ?>
100
101 <?php do_action('admin_footer', ''); ?>
102
103 </body>
104 </html>