Make WordPress Core


Ignore:
Timestamp:
04/17/2004 06:44:10 PM (22 years ago)
Author:
saxmatt
Message:

Admin revamp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/templates.php

    r1028 r1089  
    5858    require_once("admin-header.php");
    5959
    60     if ($user_level < 3) {
     60    if ($user_level < 5) {
    6161        die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
    6262    }
     
    8383    require_once('admin-header.php');
    8484
    85     if ($user_level <= 3) {
     85    if ($user_level <= 5) {
    8686        die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
    8787    }
     
    112112
    113113    ?>
     114<?php if ('te' == $_GET['a']) : ?>
     115<div class="updated"><p>File edited successfully.</p></div>
     116<?php endif; ?>
    114117 <div class="wrap">
    115118  <?php
    116     echo "Editing <strong>$file</strong> $warning";
    117     if ('te' == $a)
    118         echo "<em>File edited successfully.</em>";
     119    echo "<p>Editing <strong>$file</strong> $warning</p>";
    119120   
    120121    if (!$error) {
     
    124125     <input type="hidden" name="action" value="update" />
    125126     <input type="hidden" name="file" value="<?php echo $file ?>" />
    126      <br />
     127     <p class="submit">
    127128     <?php
    128129        if (is_writeable($real_file)) {
    129             echo "<input type='submit' name='submit' value='Update File' tabindex='2' />";
     130            echo "<input type='submit' name='submit' value='Update File &raquo;' tabindex='2' />";
    130131        } else {
    131132            echo "<input type='button' name='oops' value='(You cannot update that file/template: must make it writable, e.g. CHMOD 666)' tabindex='2' />";
    132133        }
    133134        ?>
     135</p>
    134136   </form>
    135137  <?php
    136138    } else {
    137         echo '<p>Oops, no such file exists! Double check the name and try again, merci.</p>';
     139        echo '<div class="error"><p>Oops, no such file exists! Double check the name and try again, merci.</p></div>';
    138140    }
    139141    ?>
     
    152154    <li><a href="templates.php?file=.htaccess">.htaccess (for rewrite rules)</a></li>
    153155    <li><a href="templates.php?file=my-hacks.php">my-hacks.php</a></li>
     156    </ul>
     157<?php
     158$plugins_dir = @ dir(ABSPATH . 'wp-content/plugins');
     159if ($plugins_dir) {
     160    while(($file = $plugins_dir->read()) !== false) {
     161      if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) )
     162        $plugin_files[] = $file;
     163    }
     164}
     165if ($plugins_dir || $plugin_files) :
     166?>
     167  <p>Plugin files:</p>
     168  <ul>
     169<?php foreach($plugin_files as $plugin_file) : ?>
     170    <li><a href="templates.php?file=wp-content/plugins/<?php echo $plugin_file; ?>"><?php echo $plugin_file; ?></a></li>
     171<?php endforeach; ?>
    154172  </ul>
    155   <p>Note: of course, you can also edit the files/templates in your text editor of choice and upload them. This online editor is only meant to be used when you don't have access to a text editor or FTP client.</p>
     173<?php endif; ?>
     174  <p>Note: of course, you can also edit the files/templates in your text editor of choice and upload them. This online editor is only meant to be used when you don&#8217;t have access to a text editor or FTP client.</p>
    156175</div>
    157176<?php
Note: See TracChangeset for help on using the changeset viewer.