PluginProbe
WPIDE – File Manager & Code Editor / 2.0.6
WPIDE – File Manager & Code Editor v2.0.6
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.6, at WPide.php

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