File Editors: Display list of theme/plugin files in scrollable directory tree.

Props WraithKenny, afercia, melchoyce, westonruter.
Amends [41721].
Fixes #24048.


git-svn-id: https://develop.svn.wordpress.org/trunk@41851 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-10-13 02:38:19 +00:00
parent 1eda9654da
commit 8bf9afb4f4
5 changed files with 959 additions and 80 deletions

View File

@@ -231,7 +231,7 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
</div>
<div id="templateside">
<h2><?php _e( 'Plugin Files' ); ?></h2>
<h2 id="plugin-files-label"><?php _e( 'Plugin Files' ); ?></h2>
<?php
$plugin_editable_files = array();
@@ -241,12 +241,14 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
}
}
?>
<ul>
<?php foreach ( $plugin_editable_files as $plugin_file ) : ?>
<li class="<?php echo esc_attr( $file === $plugin_file ? 'notice notice-info' : '' ); ?>">
<a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ); ?>&amp;plugin=<?php echo urlencode( $plugin ); ?>"><?php echo esc_html( preg_replace( '#^.+?/#', '', $plugin_file ) ); ?></a>
</li>
<?php endforeach; ?>
<ul role="tree" aria-labelledby="plugin-files-label">
<li role="treeitem" tabindex="-1" aria-expanded="true"
aria-level="1"
aria-posinset="1"
aria-setsize="1">
<ul role="group" style="padding-left: 0;">
<?php wp_print_plugin_file_tree( wp_make_plugin_file_tree( $plugin_editable_files ) ); ?>
</ul>
</ul>
</div>
<form name="template" id="template" action="plugin-editor.php" method="post">