PluginProbe
WPIDE – File Manager & Code Editor / 2.0.12
WPIDE – File Manager & Code Editor v2.0.12
3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 3.4 All 54 releases
wpide / WPide.php

WPide.php in WPIDE – File Manager & Code Editor 2.0.12, at WPide.php

673 lines 24.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: WPide
4 Plugin URI: https://github.com/WPsites/WPide
5 Description: WordPress code editor with auto completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup.
6 Version: 2.0.12
7 Author: Simon Dunton
8 Author URI: http://www.wpsites.co.uk
9 */
10
11 // Exit if accessed directly
12 if ( !defined( 'ABSPATH' ) ) exit;
13
14
15 if ( !class_exists( 'wpide' ) ) :
16 class wpide
17
18 {
19
20 public $site_url, $plugin_url;
21
22 /**
23 * The main WPide loader (PHP4 compatable)
24 *
25 * @uses wpide::__construct() Setup the globals needed
26 */
27 public function wpide() {
28 $this->__construct();
29 }
30
31 function __construct() {
32
33 //add WPide to the menu
34 add_action( 'admin_menu', array( $this, 'add_my_menu_page' ) );
35
36 //hook for processing incoming image saves
37 if ( isset($_GET['wpide_save_image']) ){
38
39 //force local file method for testing - you could force other methods 'direct', 'ssh', 'ftpext' or 'ftpsockets'
40 $this->override_fs_method('direct');
41
42 add_action('admin_init', array( $this, 'wpide_save_image') );
43
44 }
45
46
47 //only include this plugin if on theme editor, plugin editor or an ajax call
48 if ( (isset($_GET['page']) && $_GET['page'] === 'wpide') ||
49 preg_match('#admin-ajax\.php$#', $_SERVER['PHP_SELF']) ){
50
51
52 //force local file method for testing - you could force other methods 'direct', 'ssh', 'ftpext' or 'ftpsockets'
53 $this->override_fs_method('direct');
54
55 // Uncomment any of these calls to add the functionality that you need.
56 add_action('admin_init', array( $this, 'add_admin_js' ) );
57 add_action('admin_init', array( $this, 'add_admin_styles' ) );
58
59 //setup jqueryFiletree list callback
60 add_action('wp_ajax_jqueryFileTree', array( $this, 'jqueryFileTree_get_list' ) );
61 //setup ajax function to get file contents for editing
62 add_action('wp_ajax_wpide_get_file', array( $this, 'wpide_get_file' ) );
63 //setup ajax function to save file contents and do automatic backup if needed
64 add_action('wp_ajax_wpide_save_file', array( $this, 'wpide_save_file' ) );
65 //setup ajax function to create new item (folder, file etc)
66 add_action('wp_ajax_wpide_create_new', array( $this, 'wpide_create_new' ) );
67
68 //setup ajax function to create new item (folder, file etc)
69 add_action('wp_ajax_wpide_image_edit_key', array( $this, 'wpide_image_edit_key' ) );
70
71 //setup ajax function for startup to get some debug info, checking permissions etc
72 add_action('wp_ajax_wpide_startup_check', array( $this, 'wpide_startup_check' ) );
73
74
75 }
76
77
78
79
80
81 $WPide->site_url = get_bloginfo('url');
82
83
84 }
85
86
87 public function override_fs_method($method = 'direct'){
88
89
90 if ( defined('FS_METHOD') ){
91
92 define('WPIDE_FS_METHOD_FORCED_ELSEWHERE', FS_METHOD); //make a note of the forced method
93
94 }else{
95
96 define('FS_METHOD', $method); //force direct
97
98 }
99
100 }
101
102 public static function add_admin_head()
103 {
104
105 }
106
107
108
109
110
111
112 public static function add_admin_js(){
113
114 $plugin_path = plugin_dir_url( __FILE__ );
115 //include file tree
116 wp_enqueue_script('jquery-file-tree', plugins_url("jqueryFileTree.js", __FILE__ ) );
117 //include ace
118 wp_enqueue_script('ace', plugins_url("ace-0.2.0/src/ace.js", __FILE__ ) );
119 //include ace modes for css, javascript & php
120 wp_enqueue_script('ace-mode-css', $plugin_path . 'ace-0.2.0/src/mode-css.js');
121 wp_enqueue_script('ace-mode-javascript', $plugin_path . 'ace-0.2.0/src/mode-javascript.js');
122 wp_enqueue_script('ace-mode-php', $plugin_path . 'ace-0.2.0/src/mode-php.js');
123 //include ace theme
124 wp_enqueue_script('ace-theme', plugins_url("ace-0.2.0/src/theme-dawn.js", __FILE__ ) );//monokai is nice
125 // wordpress-completion tags
126 wp_enqueue_script('wpide-wordpress-completion', plugins_url("js/autocomplete.wordpress.js", __FILE__ ) );
127 // php-completion tags
128 wp_enqueue_script('wpide-php-completion', plugins_url("js/autocomplete.php.js", __FILE__ ) );
129 // load editor
130 wp_enqueue_script('wpide-load-editor', plugins_url("js/load-editor.js", __FILE__ ) );
131 // load autocomplete dropdown
132 wp_enqueue_script('wpide-dd', plugins_url("js/jquery.dd.js", __FILE__ ) );
133
134 // load jquery ui
135 wp_enqueue_script('jquery-ui', plugins_url("js/jquery-ui-1.8.20.custom.min.js", __FILE__ ), array('jquery'), '1.8.20');
136
137
138
139
140 }
141
142 public static function add_admin_styles(){
143
144 //main wpide styles
145 wp_register_style( 'wpide_style', plugins_url('wpide.css', __FILE__) );
146 wp_enqueue_style( 'wpide_style' );
147 //filetree styles
148 wp_register_style( 'wpide_filetree_style', plugins_url('jqueryFileTree.css', __FILE__) );
149 wp_enqueue_style( 'wpide_filetree_style' );
150 //autocomplete dropdown styles
151 wp_register_style( 'wpide_dd_style', plugins_url('dd.css', __FILE__) );
152 wp_enqueue_style( 'wpide_dd_style' );
153
154 //jquery ui styles
155 wp_register_style( 'wpide_jqueryui_style', plugins_url('css/flick/jquery-ui-1.8.20.custom.css', __FILE__) );
156 wp_enqueue_style( 'wpide_jqueryui_style' );
157
158
159 }
160
161
162
163 public static function jqueryFileTree_get_list() {
164 //check the user has the permissions
165 check_admin_referer('plugin-name-action_wpidenonce');
166 if ( !current_user_can('edit_themes') )
167 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
168
169 //setup wp_filesystem api
170 global $wp_filesystem;
171 if ( ! WP_Filesystem($creds) )
172 return false;
173
174 $_POST['dir'] = urldecode($_POST['dir']);
175 $root = WP_CONTENT_DIR;
176
177 if( $wp_filesystem->exists($root . $_POST['dir']) ) {
178 //$files = scandir($root . $_POST['dir']);
179 //print_r($files);
180 $files = $wp_filesystem->dirlist($root . $_POST['dir']);
181 //print_r($files);
182
183 echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
184 if( count($files) > 0 ) {
185
186 // All dirs
187 foreach( $files as $file => $file_info ) {
188 if( $file != '.' && $file != '..' && $file_info['type']=='d' ) {
189 echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
190 }
191 }
192 // All files
193 foreach( $files as $file => $file_info ) {
194 if( $file != '.' && $file != '..' && $file_info['type']!='d') {
195 $ext = preg_replace('/^.*\./', '', $file);
196 echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
197 }
198 }
199 }
200 //output toolbar for creating new file, folder etc
201 echo "<li class=\"create_new\"><a class='new_directory' title='Create a new directory here.' href=\"#\" rel=\"{type: 'directory', path: '" . htmlentities($_POST['dir']) . "'}\"></a> <a class='new_file' title='Create a new file here.' href=\"#\" rel=\"{type: 'file', path: '" . htmlentities($_POST['dir']) . "'}\"></a><br style='clear:both;' /></li>";
202 echo "</ul>";
203 }
204
205 die(); // this is required to return a proper result
206 }
207
208
209 public static function wpide_get_file() {
210 //check the user has the permissions
211 check_admin_referer('plugin-name-action_wpidenonce');
212 if ( !current_user_can('edit_themes') )
213 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
214
215 //setup wp_filesystem api
216 global $wp_filesystem;
217 if ( ! WP_Filesystem($creds) )
218 return false;
219
220
221 $root = WP_CONTENT_DIR;
222 $file_name = $root . stripslashes($_POST['filename']);
223 echo $wp_filesystem->get_contents($file_name);
224 die(); // this is required to return a proper result
225 }
226
227
228
229 public static function wpide_image_edit_key() {
230
231 //check the user has the permissions
232 check_admin_referer('plugin-name-action_wpidenonce');
233 if ( !current_user_can('edit_themes') )
234 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
235
236 //create a nonce based on the image path
237 echo wp_create_nonce( 'wpide_image_edit' . $_POST['file'] );
238
239 }
240
241 public static function wpide_create_new() {
242 //check the user has the permissions
243 check_admin_referer('plugin-name-action_wpidenonce');
244 if ( !current_user_can('edit_themes') )
245 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
246
247 //setup wp_filesystem api
248 global $wp_filesystem;
249 if ( ! WP_Filesystem($creds) )
250 return false;
251
252 $root = WP_CONTENT_DIR;
253
254 //check all required vars are passed
255 if (strlen($_POST['path'])>0 && strlen($_POST['type'])>0 && strlen($_POST['file'])>0){
256
257
258 $filename = sanitize_file_name( $_POST['file'] );
259 $path = $_POST['path'];
260
261 if ($_POST['type'] == "directory"){
262
263 $write_result = $wp_filesystem->mkdir($root . $path . $filename, FS_CHMOD_DIR);
264
265 if ($write_result){
266 die("1"); //created
267 }else{
268 echo "Problem creating directory" . $root . $path . $filename;
269 }
270
271 }else if ($_POST['type'] == "file"){
272
273 //write the file
274 $write_result = $wp_filesystem->put_contents(
275 $root . $path . $filename,
276 '',
277 FS_CHMOD_FILE // predefined mode settings for WP files
278 );
279
280 if ($write_result){
281 die("1"); //created
282 }else{
283 echo "Problem creating file " . $root . $path . $filename;
284 }
285
286 }
287
288
289 //print_r($_POST);
290
291
292 }
293 echo "0";
294 die(); // this is required to return a proper result
295 }
296
297 public static function wpide_save_file() {
298 //check the user has the permissions
299 check_admin_referer('plugin-name-action_wpidenonce');
300 if ( !current_user_can('edit_themes') )
301 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
302
303 //setup wp_filesystem api
304 global $wp_filesystem;
305 if ( ! WP_Filesystem($creds) )
306 echo "Cannot initialise the WP file system API";
307
308 //save a copy of the file and create a backup just in case
309 $root = WP_CONTENT_DIR;
310 $file_name = $root . stripslashes($_POST['filename']);
311
312 //set backup filename
313 $backup_path = ABSPATH .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/backups/' . str_replace( str_replace('\\', "/", ABSPATH), '', $file_name) .'.'.date("YmdH");
314 //create backup directory if not there
315 $new_file_info = pathinfo($backup_path);
316 if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
317
318 //do backup
319 $wp_filesystem->copy( $file_name, $backup_path );
320
321 //save file
322 if( $wp_filesystem->put_contents( $file_name, stripslashes($_POST['content'])) ) {
323 $result = "success";
324 }
325
326 die($result); // this is required to return a proper result
327 }
328
329 public static function wpide_save_image() {
330
331 $filennonce = split("::", $_POST["opt"]); //file::nonce
332
333 //check the user has a valid nonce
334 //we are checking two variations of the nonce, one as-is and another that we have removed a trailing zero from
335 //this is to get around some sort of bug where a nonce generated on another page has a trailing zero and a nonce generated/checked here doesn't have the zero
336 if (! wp_verify_nonce( $filennonce[1], 'wpide_image_edit' . $filennonce[0]) &&
337 ! wp_verify_nonce( rtrim($filennonce[1], "0") , 'wpide_image_edit' . $filennonce[0])) {
338 die('Security check'); //die because both checks failed
339 }
340 //check the user has the permissions
341 if ( !current_user_can('edit_themes') )
342 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
343
344
345 $_POST['content'] = base64_decode($_POST["data"]); //image content
346 $_POST['filename'] = $filennonce[0]; //filename
347
348 //setup wp_filesystem api
349 global $wp_filesystem;
350
351 if ( ! WP_Filesystem($creds) )
352 echo "Cannot initialise the WP file system API";
353
354 //save a copy of the file and create a backup just in case
355 $root = WP_CONTENT_DIR;
356 $file_name = $root . stripslashes($_POST['filename']);
357
358 //set backup filename
359 $backup_path = ABSPATH .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/backups/' . str_replace( str_replace('\\', "/", ABSPATH), '', $file_name) .'.'.date("YmdH");
360 //create backup directory if not there
361 $new_file_info = pathinfo($backup_path);
362 if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
363
364 //do backup
365 $wp_filesystem->move( $file_name, $backup_path );
366
367
368 //save file
369 if( $wp_filesystem->put_contents( $file_name, $_POST['content']) ) {
370 $result = "success";
371 }
372
373 if ($result == "success"){
374 wp_die('<p>'.__('<strong>Image saved.</strong> <br />You may <a href="JavaScript:window.close();">close this window / tab</a>.').'</p>');
375 }else{
376 wp_die('<p>'.__('<strong>Problem saving image.</strong> <br /><a href="JavaScript:window.close();">Close this window / tab</a> and try editing the image again.').'</p>');
377 }
378 //print_r($_POST);
379
380
381 //return;
382 }
383
384
385 public static function wpide_startup_check() {
386 global $wp_filesystem, $wp_version;
387
388 echo "\n\n\n\nWPIDE STARUP CHECKS \n";
389 echo "___________________ \n\n";
390
391 //WordPress version
392 if ($wp_version > 3){
393 echo "WordPress version = " . $wp_version . "\n\n";
394 }else{
395 echo "WordPress version = " . $wp_version . " (which is too old to run WPide) \n\n";
396 }
397
398 //check the user has the permissions
399 check_admin_referer('plugin-name-action_wpidenonce');
400 if ( !current_user_can('edit_themes') )
401 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
402
403 if ( defined( 'WPIDE_FS_METHOD_FORCED_ELSEWHERE' ) ){
404 echo "WordPress filesystem API has been forced to use the " . WPIDE_FS_METHOD_FORCED . " method by another plugin/WordPress. \n\n";
405 }
406
407 //setup wp_filesystem api
408 $wpide_filesystem_before = $wp_filesystem;
409 if ( ! WP_Filesystem($creds) ) {
410
411 echo "There has been a problem initialising the filesystem API \n\n";
412 echo "Filesystem API before this plugin ran: \n\n" . print_r($wpide_filesystem_before, true);
413 echo "Filesystem API now: \n\n" . print_r($wp_filesystem, true);
414
415 }
416 unset($wpide_filesystem_before);
417
418
419 $root = WP_CONTENT_DIR;
420
421
422 //Running webservers user and group
423 echo "Web server user/group = " . getenv('APACHE_RUN_USER') . ":" . getenv('APACHE_RUN_GROUP') . "\n";
424 //wp-content user and group
425 echo "wp-content owner/group = " . $wp_filesystem->owner( $root ) . ":" . $wp_filesystem->group( $root ) . "\n\n";
426
427
428 //check we can list wp-content files
429 if( $wp_filesystem->exists( $root ) ){
430
431 $files = $wp_filesystem->dirlist( $root );
432 if ( count($files) > 0){
433 echo "wp-content folder exists and contains ". count($files) ." files \n";
434 }else{
435 echo "wp-content folder exists but we cannot read it's contents \n";
436 }
437 }
438
439 // $wp_filesystem->owner() $wp_filesystem->group() $wp_filesystem->is_writable() $wp_filesystem->is_readable()
440 echo "\nUsing the ".$wp_filesystem->method." method of the WP filesystem API\n";
441
442 //wp-content editable?
443 echo "The wp-content folder ". ( $wp_filesystem->is_readable( $root )==1 ? "IS":"IS NOT" ) ." readable and ". ( $wp_filesystem->is_writable( $root )==1 ? "IS":"IS NOT" ) ." writable by this method \n";
444
445
446 //plugins folder editable
447 echo "The wp-content/plugins folder ". ( $wp_filesystem->is_readable( $root."/plugins" )==1 ? "IS":"IS NOT" ) ." readable and ". ( $wp_filesystem->is_writable( $root."/plugins" )==1 ? "IS":"IS NOT" ) ." writable by this method \n";
448
449
450 //themes folder editable
451 echo "The wp-content/themes folder ". ( $wp_filesystem->is_readable( $root."/themes" )==1 ? "IS":"IS NOT" ) ." readable and ". ( $wp_filesystem->is_writable( $root."/themes" )==1 ? "IS":"IS NOT" ) ." writable by this method \n";
452
453
454
455 echo "___________________ \n\n\n\n";
456
457 echo " If the file tree to the right is empty there is a possibility that your server permissions are not compatible with this plugin. \n The startup information above may shed some light on things. \n Paste that information into the support forum for further assistance.";
458
459
460 die();
461
462 //set backup filename
463 $backup_path = ABSPATH .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/backups/' . str_replace( str_replace('\\', "/", ABSPATH), '', $file_name) .'.'.date("YmdH");
464 //create backup directory if not there
465 $new_file_info = pathinfo($backup_path);
466 if (!$wp_filesystem->is_dir($new_file_info['dirname'])) wp_mkdir_p( $new_file_info['dirname'] ); //should use the filesytem api here but there isn't a comparable command right now
467
468 //do backup
469 $wp_filesystem->move( $file_name, $backup_path );
470
471
472 //save file
473 if( $wp_filesystem->put_contents( $file_name, $_POST['content']) ) {
474 $result = "success";
475 }
476
477 if ($result == "success"){
478 wp_die('<p>'.__('<strong>Image saved.</strong> <br />You may <a href="JavaScript:window.close();">close this window / tab</a>.').'</p>');
479 }else{
480 wp_die('<p>'.__('<strong>Problem saving image.</strong> <br /><a href="JavaScript:window.close();">Close this window / tab</a> and try editing the image again.').'</p>');
481 }
482
483
484 //return;
485 }
486
487
488
489
490 public function add_my_menu_page() {
491 //add_menu_page("wpide", "wpide","edit_themes", "wpidesettings", array( &$this, 'my_menu_page') );
492 add_menu_page('WPide', 'WPide', 'edit_themes', "wpide", array( &$this, 'my_menu_page' ));
493 }
494
495 public function my_menu_page() {
496 if ( !current_user_can('edit_themes') )
497 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');
498
499 $app_url = get_bloginfo('url'); //need to make this https if we are currently looking on the site using https (even though https for admin might not be forced it can still cause issues)
500 if (is_ssl()) $app_url = str_replace("http:", "https:", $app_url);
501
502 ?>
503 <script>
504
505 var wpide_app_path = "<?php echo plugin_dir_url( __FILE__ ); ?>";
506
507 function the_filetree() {
508 jQuery('#wpide_file_browser').fileTree({ script: ajaxurl }, function(parent, file) {
509
510 if ( jQuery(parent).hasClass("create_new") ){ //create new file/folder
511 //to create a new item we need to know the name of it so show input
512
513 var item = eval('('+file+')');
514
515 //hide all inputs just incase one is selected
516 jQuery(".new_item_inputs").hide();
517 //show the input form for this
518 jQuery("div.new_" + item.type).show();
519 jQuery("div.new_" + item.type + " input[name='new_" + item.type + "']").focus();
520 jQuery("div.new_" + item.type + " input[name='new_" + item.type + "']").attr("rel", file);
521
522
523 }else if ( jQuery(".wpide_tab[rel='"+file+"']").length > 0) { //focus existing tab
524 jQuery(".wpide_tab[sessionrel='"+ jQuery(".wpide_tab[rel='"+file+"']").attr("sessionrel") +"']").click();//focus the already open tab
525 }else{ //open file
526
527 var image_patern =new RegExp("(\.jpg|\.gif|\.png|\.bmp)");
528 if ( image_patern.test(file) ){
529 //it's an image so open it for editing
530
531 //using modal+iframe
532 if ("lets not" == "use the modal for now"){
533
534 var NewDialog = jQuery('<div id="MenuDialog">\
535 <iframe src="http://www.sumopaint.com/app/?key=ebcdaezjeojbfgih&target=<?php echo get_bloginfo('url') . "?action=wpide_image_save";?>&url=<?php echo get_bloginfo('url') . "/wp-content";?>' + file + '&title=Edit image&service=Save back to WPide" width="100%" height="600px"> </iframe>\
536 </div>');
537 NewDialog.dialog({
538 modal: true,
539 title: "title",
540 show: 'clip',
541 hide: 'clip',
542 width:'800',
543 height:'600'
544 });
545
546 }else{ //open in new tab/window
547
548 var data = { action: 'wpide_image_edit_key', file: file, _wpnonce: jQuery('#_wpnonce').val(), _wp_http_referer: jQuery('#_wp_http_referer').val() };
549 var image_data = '';
550 jQuery.ajaxSetup({async:false}); //we need to wait until we get the response before opening the window
551 jQuery.post(ajaxurl, data, function(response) {
552
553 //with the response (which is a nonce), build the json data to pass to the image editor. The edit key (nonce) is only valid to edit this image
554 image_data = file+'::'+response;
555
556 });
557
558 jQuery.ajaxSetup({async:true});//enable async again
559
560
561 window.open('http://www.sumopaint.com/app/?key=ebcdaezjeojbfgih&url=<?php echo $app_url. "/wp-content";?>' + file + '&opt=' + image_data + '&title=Edit image&service=Save back to WPide&target=<?php echo urlencode( $app_url . "/wp-admin/admin.php?wpide_save_image=yes" ) ;?>');
562
563 }
564
565 }else{
566 jQuery(parent).addClass('wait');
567
568 wpide_set_file_contents(file, function(){
569
570 //once file loaded remove the wait class/indicator
571 jQuery(parent).removeClass('wait');
572
573 });
574
575 jQuery('#filename').val(file);
576 }
577
578 }
579
580 });
581 }
582
583 jQuery(document).ready(function($) {
584 // Handler for .ready() called.
585 the_filetree() ;
586
587
588
589
590
591
592 });
593 </script>
594
595 <?php
596 $url = wp_nonce_url('admin.php?page=wpide','plugin-name-action_wpidenonce');
597 if ( ! WP_Filesystem($creds) ) {
598 request_filesystem_credentials($url, '', true, false, null);
599 return;
600 }
601 ?>
602
603 <div id="poststuff" class="metabox-holder has-right-sidebar">
604
605 <div id="side-info-column" class="inner-sidebar">
606
607 <div id="wpide_info"><div id="wpide_info_content"></div> </div>
608
609 <div id="submitdiv" class="postbox ">
610 <h3 class="hndle"><span>Files</span></h3>
611 <div class="inside">
612 <div class="submitbox" id="submitpost">
613 <div id="minor-publishing">
614 </div>
615 <div id="major-publishing-actions">
616 <div id="wpide_file_browser"></div>
617 <br style="clear:both;" />
618 <div class="new_file new_item_inputs">
619 <label for="new_folder">File name</label><input class="has_data" name="new_file" type="text" rel="" value="" placeholder="Filename.ext" />
620 <a href="#" id="wpide_create_new_file" class="button-primary">CREATE</a>
621 </div>
622 <div class="new_directory new_item_inputs">
623 <label for="new_directory">Directory name</label><input class="has_data" name="new_directory" type="text" rel="" value="" placeholder="Filename.ext" />
624 <a href="#" id="wpide_create_new_directory" class="button-primary">CREATE</a>
625 </div>
626 <div class="clear"></div>
627 </div>
628 </div>
629 </div>
630 </div>
631
632
633 </div>
634
635 <div id="post-body">
636 <div id="wpide_toolbar" class="quicktags-toolbar">
637 <div id="wpide_toolbar_tabs"> </div>
638 <div id="dialog_window_minimized_container"></div>
639 </div>
640
641 <div id="wpide_toolbar_buttons">
642 <div id="wpide_message" class="error highlight"></div>
643 <a href="#"></a> <a href="#"></a> </div>
644
645
646 <div id='fancyeditordiv'></div>
647
648 <form id="wpide_save_container" action="" method="get">
649 <a href="#" id="wpide_save" class="button-primary">SAVE
650 FILE</a>
651 <input type="hidden" id="filename" name="filename" value="" />
652 <?php
653 if ( function_exists('wp_nonce_field') )
654 wp_nonce_field('plugin-name-action_wpidenonce');
655 ?>
656 </form>
657 </div>
658
659
660
661 </div>
662
663 <?php
664 }
665
666 }
667
668 $wpide = new wpide();
669
670 endif; // class_exists check
671
672 ?>
673