]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/bookmarklet.php
8618458dafce76272581918ad116d203d85b1b5c
[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         wp_die(__('Cheatin&#8217; 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 = clean_url($_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_option('blog_charset'); ?>" />
54 <?php
55 wp_admin_css( 'css/global' );
56 wp_admin_css();
57 ?>
58
59 <style type="text/css">
60 <!--
61
62 #wpbookmarklet textarea,input,select {
63         border-width: 1px;
64         border-color: #cccccc;
65         border-style: solid;
66         padding: 2px;
67         margin: 1px;
68 }
69
70 #wpbookmarklet .checkbox {
71         background-color: #ffffff;
72         border-width: 0px;
73         padding: 0px;
74         margin: 0px;
75 }
76
77 #wpbookmarklet textarea {
78         font-family: Verdana, Geneva, Arial, Helvetica;
79         font-size: 0.9em;
80 }
81
82 #wpbookmarklet .wrap {
83         border: 0px;
84 }
85
86 #wpbookmarklet #postdiv {
87         margin-bottom: 0.5em;
88 }
89
90 #wpbookmarklet #titlediv {
91         margin-bottom: 1em;
92 }
93
94 -->
95 </style>
96 </head>
97 <body id="wpbookmarklet">
98 <div id="wphead">
99 <h1><?php bloginfo('name') ?></h1>
100 </div>
101
102 <?php require('edit-form.php'); ?>
103
104 <?php do_action('admin_footer', ''); ?>
105
106 </body>
107 </html>