Log in with username/password: lyceum/lyceum

Changeset 1263

Show
Ignore:
Timestamp:
11/24/07 00:13:59 (10 months ago)
Author:
jjb
Message:

Bringing settings.php back to r1160, with subsequent changes to be added shortly in more organized manner, and while retaining taglib rewrite.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/src/lyceum/system-admin/settings.php

    r1251 r1263  
    22require('system-config.php'); 
    33require('../../lib/taglib.php'); 
    4 $site_title = get_settings('site_title'); 
    5  
    6 $myblogs = get_userblogs(); 
    7 arrayify($myblogs); 
    8  
    9 // =========================================================================== 
    104?> 
    11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    12    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    13  
     5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    146<html xmlns="http://www.w3.org/1999/xhtml"> 
    157 
    168<head> 
    17    <title><?php echo $site_title ?>: Lyceum System Settings</title> 
    18  
    19    <link rel="stylesheet" href="<?php echo LURL ?>/wp-admin/wp-admin.css" type="text/css" /> 
    20    <link rel="stylesheet" href="<?php echo LURL ?>/system-admin/lyceum.css" type="text/css" /> 
    21  
    22    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> 
     9   <title>Lyceum System Settings</title> 
     10   <link rel="stylesheet" href="../wp-admin/wp-admin.css" type="text/css" /> 
     11   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    2312</head> 
    24  
    2513 
    2614<body> 
    2715 
    28 <div id="PageWrapper" class="AdminMain"> 
     16<div id="lyceumhead"> 
     17   <div id="lyceumheadleft"> 
     18<?php 
     19   echo '<strong>'.get_settings('site_title').'</strong>: '; 
     20   echo '<a href="'.LURL.'/profile">'. __('My Account') . '</a>'; 
    2921 
    30 <?php require(ABSPATH . '/system-admin/lyceum-header.php'); ?> 
     22   $myblogs = get_userblogs(); 
     23   arrayify($myblogs); 
     24   foreach ($myblogs as $b){ 
     25      if ($b->id == $blog && !$inprofile) 
     26         echo ' &bull; <strong>'.$b->blogname.'</strong>'; 
     27      else  
     28         echo ' &bull; <a href="'.$b->home.'/admin/">'.$b->blogname.'</a>'; 
     29   } 
     30    
     31   echo ' &bull; <strong>System Settings</strong>'; 
     32?>  
     33   </div> 
    3134 
    32    <hr /> 
    33  
    34    <!-- BEGIN: body --> 
    35    <div id="BodyWrapper"> 
    36  
    37       <!-- BEGIN: main column --> 
    38       <div id="MainColumn"> 
    39  
    40          <!-- BEGIN: main nav --> 
    41          <ul id="MainNav"> 
    42             <li class="Selected"><span><a href="settings.php">System Settings</a></span></li> 
    43             <li><span><a href="blog-management.php">Blogs</a></span></li> 
    44             <li><span><a href="user-management.php">Users</a></span></li> 
    45             <li><span><a href="systemplugins.php">Plugins</a></span></li> 
    46             <li><span><a href="rewriterules.php">Apache Rewrite Rules</a></span></li> 
    47          </ul> 
    48          <div class="ClearFix TabBorder"><!-- do not remove --></div> 
    49          <!-- END: main nav --> 
    50  
    51          <div class="wrap"> 
    52             <h2>Lyceum Config</h2> 
    53  
    54             <form method="post" action="setoption.php" class="lyceum_form"> 
    55                <?php echo tokeninput('setoption.php', 'site_title')?> 
    56                <input type="hidden" name="option" value="site_title" /> 
    57  
    58                <table class="FormTable"> 
    59                   <col width="20%" /> 
    60                   <col width="80%" /> 
    61  
    62                   <tbody> 
    63                      <tr> 
    64                         <th scope="row"><label for="site_title">Site Title</label></th> 
    65                         <td> 
    66                            <input type="text" name="value" id="site_title" maxlength="100" value="<?php echo  get_option('site_title') ?>" class="TextInput" /> 
    67                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    68                         </td> 
    69                      </tr> 
    70                   </tbody> 
    71                </table> 
    72             </form> 
    73  
    74             <form method="post" action="setoption.php" class="lyceum_form"> 
    75                <?php echo tokeninput('setoption.php', 'system_admin_email')?> 
    76                <input type="hidden" name="option" value="system_admin_email" /> 
    77  
    78                <table class="FormTable"> 
    79                   <col width="20%" /> 
    80                   <col width="80%" /> 
    81  
    82                   <tbody> 
    83                      <tr> 
    84                         <th scope="row"><label for="system_admin_email">System Admin Email</label></th> 
    85                         <td> 
    86                            <input type="text" name="value" id="system_admin_email" maxlength="100" value="<?php echo  get_option('system_admin_email') ?>" class="TextInput" /> 
    87                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    88                         </td> 
    89                      </tr> 
    90                   </tbody> 
    91                </table> 
    92             </form> 
    93  
    94             <form method="post" action="setoption.php" class="lyceum_form"> 
    95                <?php echo tokeninput('setoption.php', 'wp-content_file_path')?> 
    96                <input type="hidden" name="option" value="wp-content_file_path" /> 
    97  
    98                <table class="FormTable"> 
    99                   <col width="20%" /> 
    100                   <col width="80%" /> 
    101  
    102                   <tbody> 
    103                      <tr> 
    104                         <th scope="row"><label for="wp_content_path">wp-content_file_path</label></th> 
    105                         <td> 
    106                            <input type="text" name="value" id="wp_content_path" maxlength="200" value="<?php echo  get_option('wp-content_file_path') ?>" class="TextInput" /> 
    107                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    108                            <div class="HelpText">The file path where individual blog uploads and cache are kept.</div> 
    109                         </td> 
    110                      </tr> 
    111                   </tbody> 
    112                </table> 
    113             </form> 
    114  
    115             <form method="post" action="setoption.php" class="lyceum_form"> 
    116                <?php echo tokeninput('setoption.php', 'fileupload_base_url')?> 
    117                <input type="hidden" name="option" value="fileupload_base_url" /> 
    118  
    119                <table class="FormTable"> 
    120                   <col width="20%" /> 
    121                   <col width="80%" /> 
    122  
    123                   <tbody> 
    124                      <tr> 
    125                         <th scope="row"><label for="fileupload_base_url">File upload base url</label></th> 
    126                         <td> 
    127                            <input type="text" name="value" id="fileupload_base_url" maxlength="100" value="<?php echo  get_option('fileupload_base_url') ?>" class="TextInput" /> 
    128                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    129                            <div class="HelpText">This needs to work with wp-content_file_path above.</div> 
    130                         </td> 
    131                      </tr> 
    132                   </tbody> 
    133                </table> 
    134             </form> 
    135  
    136             <form method="post" action="setoption.php" class="lyceum_form"> 
    137                <?php echo tokeninput('setoption.php', 'blog_charset')?> 
    138                <input type="hidden" name="option" value="blog_charset" /> 
    139  
    140                <table class="FormTable"> 
    141                   <col width="20%" /> 
    142                   <col width="80%" /> 
    143  
    144                   <tbody> 
    145                      <tr> 
    146                         <th scope="row"><label for="blog_charset">System character encoding</label></th> 
    147                         <td> 
    148                            <input type="text" name="value" id="blog_charset" maxlength="100" value="<?php echo  get_option('blog_charset') ?>" class="TextInput" /> 
    149                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    150                         </td> 
    151                      </tr> 
    152                   </tbody> 
    153                </table> 
    154             </form> 
    155  
    156             <form method="post" action="setoption.php" class="lyceum_form"> 
    157                <?php echo tokeninput('setoption.php', 'html_type')?> 
    158                <input type="hidden" name="option" value="html_type" /> 
    159  
    160                <table class="FormTable"> 
    161                   <col width="20%" /> 
    162                   <col width="80%" /> 
    163  
    164                   <tbody> 
    165                      <tr> 
    166                         <th scope="row"><label for="html_type">System HTML type</label></th> 
    167                         <td> 
    168                            <input type="text" name="value" id="html_type" maxlength="100" value="<?php echo  get_option('html_type') ?>" class="TextInput" /> 
    169                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    170                         </td> 
    171                      </tr> 
    172                   </tbody> 
    173                </table> 
    174             </form> 
    175  
    176             <form method="post" action="setoption.php" class="lyceum_form"> 
    177                <?php echo tokeninput('setoption.php', 'email_structure')?> 
    178                <input type="hidden" name="option" value="email_structure" /> 
    179  
    180                <table class="FormTable"> 
    181                   <col width="20%" /> 
    182                   <col width="80%" /> 
    183  
    184                   <tbody> 
    185                      <tr> 
    186                         <th scope="row"><label for="email_structure">email regex</label></th> 
    187                         <td> 
    188                            <input type="text" name="value" id="email_structure" maxlength="100" value="<?php echo  get_option('email_structure') ?>" class="TextInput" /> 
    189                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    190                            <div class="HelpText">Regular expression against which new email addresses must match (example: <strong>/.*@example\.tld/</strong>)</div> 
    191                         </td> 
    192                      </tr> 
    193                   </tbody> 
    194                </table> 
    195             </form> 
    196  
    197             <form method="post" action="setoption.php" class="lyceum_form"> 
    198                <?php echo tokeninput('setoption.php', 'email_structure_error_message')?> 
    199                <input type="hidden" name="option" value="email_structure_error_message" /> 
    200  
    201                <table class="FormTable"> 
    202                   <col width="20%" /> 
    203                   <col width="80%" /> 
    204  
    205                   <tbody> 
    206                      <tr> 
    207                         <th scope="row"><label for="email_regex_error">email regex error</label></th> 
    208                         <td> 
    209                            <input type="text" name="value" id="email_regex_error" maxlength="100" value="<?php echo  get_option('email_structure_error_message') ?>" class="TextInput" /> 
    210                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    211                            <div class="HelpText">(example: <strong>You must have a example.tld email address in order to make an account.</strong>)</div> 
    212                         </td> 
    213                      </tr> 
    214                   </tbody> 
    215                </table> 
    216             </form> 
    217  
    218             <form method="post" action="setoption.php" class="lyceum_form"> 
    219                <?php echo tokeninput('setoption.php', 'slug_blacklist')?> 
    220                <input type="hidden" name="option" value="slug_blacklist" /> 
    221  
    222                <table class="FormTable"> 
    223                   <col width="20%" /> 
    224                   <col width="80%" /> 
    225  
    226                   <tbody> 
    227                      <tr> 
    228                         <th scope="row"><label for="slug_blacklist">Unregisterable Slugs</label></th> 
    229                         <td> 
    230                            <textarea name="value" cols="60" rows="5" id="slug_blacklist" class="TextArea"><?php echo  get_option('slug_blacklist') ?></textarea> 
    231                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    232                            <div class="HelpText">Comma-separated with no spaces.</div> 
    233                         </td> 
    234                      </tr> 
    235                   </tbody> 
    236                </table> 
    237             </form> 
    238  
    239             <form method="post" action="setoption.php" class="lyceum_form"> 
    240                <?php echo tokeninput('setoption.php', 'username_blacklist')?> 
    241                <input type="hidden" name="option" value="username_blacklist" /> 
    242  
    243                <table class="FormTable"> 
    244                   <col width="20%" /> 
    245                   <col width="80%" /> 
    246  
    247                   <tbody> 
    248                      <tr> 
    249                         <th scope="row"><label for="username_blacklist">Unregisterable Usernames</label></th> 
    250                         <td> 
    251                            <textarea name="value" cols="60" rows="5" id="username_blacklist" class="TextArea"><?php echo  get_option('username_blacklist') ?></textarea> 
    252                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    253                            <div class="HelpText">Comma-separated with no spaces.</div> 
    254                         </td> 
    255                      </tr> 
    256                   </tbody> 
    257                </table> 
    258             </form> 
    259  
    260             <form method="post" action="setoption.php" class="lyceum_form"> 
    261                <?php echo tokeninput('setoption.php', 'users_can_register')?> 
    262                <input type="hidden" name="option" value="users_can_register" /> 
    263  
    264                <table class="FormTable"> 
    265                   <col width="20%" /> 
    266                   <col width="80%" /> 
    267  
    268                   <tbody> 
    269                      <tr> 
    270                         <th scope="row"><span class="Label">Open Registration</span></th> 
    271                         <td> 
    272                            <ul class="HorizList Inputs"> 
    273                               <li><input type="radio" name="value" id="open_reg_1" value="1" <?php echo  get_option('users_can_register')?'checked="checked"':"" ?> /> <label for="open_reg_1">Enabled</label></li> 
    274                               <li><input type="radio" name="value" id="open_reg_0" value="0" <?php echo  !get_option('users_can_register')?'checked="checked"':"" ?> /> <label for="open_reg_0">Disabled</label></li> 
    275                            </ul> 
    276                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    277                            <div class="HelpText">Allow users to register themselves for an account and blog. (Above regular expression still applies.)</div> 
    278                         </td> 
    279                      </tr> 
    280                   </tbody> 
    281                </table> 
    282             </form> 
    283  
    284             <form method="post" action="setoption.php" class="lyceum_form"> 
    285                <?php echo tokeninput('setoption.php', 'presentation_tab')?> 
    286                <input type="hidden" name="option" value="presentation_tab" /> 
    287  
    288                <table class="FormTable"> 
    289                   <col width="20%" /> 
    290                   <col width="80%" /> 
    291  
    292                   <tbody> 
    293                      <tr> 
    294                         <th scope="row"><span class="Label">User Customization</span></th> 
    295                         <td> 
    296                            <ul class="HorizList Inputs"> 
    297                               <li><input type="radio" name="value" id="presentation_tab_1" value="1" <?php echo  get_option('presentation_tab')?'checked="checked"':"" ?> /> <label for="presentation_tab_1">Enabled</label></li> 
    298                               <li><input type="radio" name="value" id="presentation_tab_0" value="0" <?php echo  !get_option('presentation_tab')?'checked="checked"':"" ?> /> <label for="presentation_tab_0">Disabled</label></li> 
    299                            </ul> 
    300                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    301                            <div class="HelpText">Allow users to change their blog's theme and adjust its settings.</div> 
    302                         </td> 
    303                      </tr> 
    304                   </tbody> 
    305                </table> 
    306             </form> 
    307  
    308             <form method="post" action="setoption.php" class="lyceum_form"> 
    309                <?php echo tokeninput('setoption.php', 'new_user_welcome_message')?> 
    310                <input type="hidden" name="option" value="new_user_welcome_message" /> 
    311  
    312                <table class="FormTable"> 
    313                   <col width="20%" /> 
    314                   <col width="80%" /> 
    315  
    316                   <tbody> 
    317                      <tr> 
    318                         <th scope="row"><label for="new_user_welcome_message">New user welcome message</label></th> 
    319                         <td> 
    320                            <textarea name="value" cols="60" rows="5" id="new_user_welcome_message" class="TextArea"><?php echo  get_option('new_user_welcome_message') ?></textarea> 
    321                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    322                            <div class="HelpText">The message that will be emailed to a user upon account creation. If a user simultaneously registers and creates a blog, they will get both this message and the one below.</div> 
    323                         </td> 
    324                      </tr> 
    325                   </tbody> 
    326                </table> 
    327             </form> 
    328  
    329             <form method="post" action="setoption.php" class="lyceum_form"> 
    330                <?php echo tokeninput('setoption.php', 'new_blog_welcome_message')?> 
    331                <input type="hidden" name="option" value="new_blog_welcome_message" /> 
    332  
    333                <table class="FormTable"> 
    334                   <col width="20%" /> 
    335                   <col width="80%" /> 
    336  
    337                   <tbody> 
    338                      <tr> 
    339                         <th scope="row"><label for="new_blog_welcome_message">New blog welcome message</label></th> 
    340                         <td> 
    341                            <textarea name="value" cols="60" rows="5" id="new_blog_welcome_message" class="TextArea"><?php echo  get_option('new_blog_welcome_message') ?></textarea> 
    342                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    343                            <div class="HelpText">The message that will be emailed to a user upon creation of a blog.</div> 
    344                         </td> 
    345                      </tr> 
    346                   </tbody> 
    347                </table> 
    348             </form> 
    349  
    350             <form method="post" action="setoption.php" class="lyceum_form"> 
    351                <?php echo tokeninput('setoption.php', 'create_example_post')?> 
    352                <input type="hidden" name="option" value="create_example_post" /> 
    353  
    354                <table class="FormTable"> 
    355                   <col width="20%" /> 
    356                   <col width="80%" /> 
    357  
    358                   <tbody> 
    359                      <tr> 
    360                         <th scope="row"><span class="Label">Create Example Post</span></th> 
    361                         <td> 
    362                            <ul class="HorizList Inputs"> 
    363                               <li><input type="radio" name="value" id="create_example_post_1" value="1" <?php echo  get_option('create_example_post')?'checked="checked"':"" ?> /> <label for="create_example_post_1">Yes</label></li> 
    364                               <li><input type="radio" name="value" id="create_example_post_0" value="0" <?php echo  !get_option('create_example_post')?'checked="checked"':"" ?> /> <label for="create_example_post_0">No</label></li> 
    365                            </ul> 
    366                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    367                            <div class="HelpText">Should an example blog post be created when a new blog is created?</div> 
    368                         </td> 
    369                      </tr> 
    370                   </tbody> 
    371                </table> 
    372             </form> 
    373  
    374             <form method="post" action="setoption.php" class="lyceum_form"> 
    375                <?php echo tokeninput('setoption.php', 'example_post_title')?> 
    376                <input type="hidden" name="option" value="example_post_title" /> 
    377  
    378                <table class="FormTable"> 
    379                   <col width="20%" /> 
    380                   <col width="80%" /> 
    381  
    382                   <tbody> 
    383                      <tr> 
    384                         <th scope="row"><label for="example_post_title">Example post title</label></th> 
    385                         <td> 
    386                            <input type="text" name="value" id="example_post_title" maxlength="100" value="<?php echo  get_option('example_post_title') ?>" class="TextInput" /> 
    387                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    388                            <div class="HelpText">The title of the example post.</div> 
    389                         </td> 
    390                      </tr> 
    391                   </tbody> 
    392                </table> 
    393             </form> 
     35   <div id="user_info"><?php printf(__('<strong>%s</strong>'), $user_identity) ?>  
     36      [<a href="<?php echo LURL?>/login?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>] 
     37      [<a href="<?php echo LURL?>/register?action=addblog" title="<?php _e('Create new blog with currently logged in account') ?>"><?php _e('Create Blog'); ?></a>] 
     38   </div> 
     39</div> 
    39440 
    39541 
    396             <form method="post" action="setoption.php" class="lyceum_form"> 
    397                <?php echo tokeninput('setoption.php', 'example_post_body')?> 
    398                <input type="hidden" name="option" value="example_post_body" /> 
     42<ul> 
     43   <li><a href="systemplugins.php">System-wide plugins</a></li> 
     44   <li><a href="blog-management.php">Blogs</a></li> 
     45   <li><a href="user-management.php">Users</a></li> 
     46   <li><a href="rewriterules.php">Rewrite Rules</a></li> 
     47</ul> 
    39948 
    400                <table class="FormTable"> 
    401                   <col width="20%" /> 
    402                   <col width="80%" /> 
    40349 
    404                   <tbody> 
    405                      <tr> 
    406                         <th scope="row"><label for="username_blacklist">Example post body</label></th> 
    407                         <td> 
    408                            <textarea name="value" cols="60" rows="5" id="example_post_body" class="TextArea"><?php echo  get_option('example_post_body') ?></textarea> 
    409                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    410                            <div class="HelpText">The body of the example post.</div> 
    411                         </td> 
    412                      </tr> 
    413                   </tbody> 
    414                </table> 
    415             </form> 
     50<?php 
    41651 
    417             <form method="post" action="setoption.php" class="lyceum_form"> 
    418                <?php echo tokeninput('setoption.php', 'create_example_page')?> 
    419                <input type="hidden" name="option" value="create_example_page" /> 
     52function lyceum_settings_input($option, $inputrow){ 
     53   return 
     54   _form(array('method'=>'post', 'action'=>'setoption.php', 'class'=>'lyceum_form'), 
     55      tokeninput('setoption.php', $option) . 
     56      _input(array('type'=>'hidden', 'name'=>'option', 'value'=>$option)) . 
    42057 
    421               <table class="FormTable"> 
    422                  <col width="20%" /> 
    423                  <col width="80%" /> 
     58      _table(array('class'=>'FormTable'), 
     59         _col(array('width'=>'20%')) . 
     60         _col(array('width'=>'80%')) . 
    42461 
    425                   <tbody> 
    426                      <tr> 
    427                         <th scope="row"><span class="Label">Create example page</span></th> 
    428                         <td> 
    429                            <ul class="HorizList Inputs"> 
    430                               <li><input type="radio" name="value" id="create_example_page_1" value="1" <?php echo  get_option('create_example_page')?'checked="checked"':"" ?> /> <label for="create_example_page_1">Yes</label></li> 
    431                               <li><input type="radio" name="value" id="create_example_page_0" value="0" <?php echo  !get_option('create_example_page')?'checked="checked"':"" ?> /> <label for="create_example_page_0">No</label></li> 
    432                            </ul> 
    433                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    434                            <div class="HelpText">Should an example page be created when a new blog is created?</div> 
    435                         </td> 
    436                      </tr> 
    437                   </tbody> 
    438                </table> 
    439             </form> 
     62         _tbody( 
     63            _tr( $inputrow ) 
     64   ))); 
     65
    44066 
    441             <form method="post" action="setoption.php" class="lyceum_form"> 
    442                <?php echo tokeninput('setoption.php', 'example_page_title')?> 
    443                <input type="hidden" name="option" value="example_page_title" /> 
     67function lyceum_settings_textual_input($option, $description, $documentation, $input){ 
     68   return lyceum_settings_input($option, 
     69      _th(array('scope'=>'row'), _label(array('for'=>$option), $description)) . 
     70      _td( 
     71         $input . 
     72         _input(array('type'=>'submit', 'value'=>'Submit', 'name'=>'submit', 'class'=>'Button' )) . 
     73         ( $documentation ? _div( array('class'=>"HelpText"), $documentation) : '') 
     74      )); 
     75
    44476 
    445                <table class="FormTable"> 
    446                   <col width="20%" /> 
    447                   <col width="80%" /> 
     77function lyceum_settings_text_input($option, $description, $documentation = false, $maxlength = false){ 
     78   return lyceum_settings_textual_input($option, $description, $documentation, 
     79      _input( array( 'type'=>'text', 'name'=>'value', 'id'=>$option, 'maxlength'=>($maxlength ? $maxlength : '100'), 
     80                     'value'=>get_option($option), 'class'=>'TextInput'))); 
     81}; 
    44882 
    449                   <tbody> 
    450                      <tr> 
    451                         <th scope="row"><label for="example_page_title">Example page title</label></th> 
    452                         <td> 
    453                            <input type="text" name="value" id="example_page_title" maxlength="100" value="<?php echo  get_option('example_page_title') ?>" class="TextInput" /> 
    454                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    455                            <div class="HelpText">The title of the example page.</div> 
    456                         </td> 
    457                      </tr> 
    458                   </tbody> 
    459                </table> 
    460             </form> 
     83function lyceum_settings_textarea_input($option, $description, $documentation){ 
     84   return lyceum_settings_textual_input($option, $description, $documentation, 
     85      _textarea( array( 'name'=>'value', 'cols'=>'60', 'rows'=>'5', 'id'=>'slug_blacklist', 'class'=>'TextArea'), 
     86                        get_option($option))); 
     87}; 
    46188 
    462             <form method="post" action="setoption.php" class="lyceum_form"> 
    463                <?php echo tokeninput('setoption.php', 'example_page_body')?> 
    464                <input type="hidden" name="option" value="example_page_body" /> 
     89function lyceum_settings_boolean_input($option, $description, $documentation, $warning=false){ 
     90   return lyceum_settings_input($option, 
     91      _th(array('scope'=>'row'),_span(array('class'=>'Label'), $description)) . 
     92      _td( 
     93         _ul(array( 'class'=>'HorizList Inputs'), 
     94            _li(_input( array_merge(array('type'=>'radio', 'name'=>'value', 'id'=>$option.'_1', 'value'=>'1'),  
     95               (  get_option($option) ? array('checked'=>'checked') : array()))) . _label( array('for'=>$option.'_1'), 'Enabled')) . 
     96            _li(_input( array_merge(array('type'=>'radio', 'name'=>'value', 'id'=>$option.'_0', 'value'=>'0'), 
     97               ( !get_option($option) ? array('checked'=>'checked') : array()))) . _label( array('for'=>$option.'_0'), 'Disabled')) 
     98         ) . 
     99         _input( array('type'=>'submit', 'value'=>'Submit', 'name'=>'submit', 'class'=>'Button') ) . 
     100         _div( array('class'=>'HelpText'), $documentation) . 
     101         ( $warning ? _div( array('class'=>'Note'), $warning) : '' ) 
     102      )); 
     103
    465104 
    466                <table class="FormTable"> 
    467                   <col width="20%" /> 
    468                   <col width="80%" /> 
     105echo 
     106lyceum_settings_text_input('site_title', 'Site Title') . 
     107lyceum_settings_text_input('system_admin_email', 'System Admin email') . 
     108lyceum_settings_text_input('wp-content_file_path', 'wp-content_file_path', 'The file path where individual blog uploads and cache are kept.', 200) . 
     109lyceum_settings_text_input('fileupload_base_url', 'File upload base url', 'This needs to work with wp-content_file_path above.') . 
     110lyceum_settings_text_input('system_charset', 'System character encoding') . 
     111lyceum_settings_text_input('email_structure', 'email regex', 'Regular expression against which new email addresses must match (example: <strong>/.*@example\.tld/</strong>)') . 
     112lyceum_settings_text_input('email_structure_error_message', 'email regex error', '(example: <strong>You must have a example.tld email address in order to make an account.</strong>)') . 
     113lyceum_settings_textarea_input('slug_blacklist', 'Unregisterable Slugs', 'Comma-separated with no spaces.') . 
     114lyceum_settings_textarea_input('username_blacklist', 'Unregisterable Usernames', 'Comma-separated with no spaces.') . 
     115lyceum_settings_boolean_input('users_can_register', 'Open Registration', 'Allow users to register themselves for an account and blog. (Above regular expression still applies.)') . 
     116lyceum_settings_boolean_input('users_can_create_blogs', 'Can users create blogs?', '') . 
     117lyceum_settings_text_input('users_can_create_num_blogs', 'How many blogs can users create?', '0 means no limit') . 
     118lyceum_settings_boolean_input('presentation_tab', 'User Customization', 'Allow users to change their blog\'s theme and adjust its settings.') . 
     119lyceum_settings_boolean_input('import_allowed', 'Import Scripts', 'Allow users to use the import scripts?', 'These scripts are not yet thoroughly tested and are therefore a potential security vulnerability.') . 
     120lyceum_settings_boolean_input('gzipcompression', 'gzip Compression', 'Compress articles (gzip) if browsers ask for them.', 'This feature has not been thoroughly tested.') . 
     121lyceum_settings_boolean_input('restrict_admin_ip', 'Restrict Admin IP', 'Restrict IP addresses from which an administrator may log in.', "<strong>BEFORE YOU TURN THIS ON:</strong> Make sure that your current IP address, <strong>{$_SERVER['REMOTE_ADDR']}</strong>, is in the list below."); 
     122?> 
    469123 
    470                   <tbody> 
    471                      <tr> 
    472                         <th scope="row"><label for="username_blacklist">Example page body</label></th> 
    473                         <td> 
    474                            <textarea name="value" cols="60" rows="5" id="example_page_body" class="TextArea"><?php echo  get_option('example_page_body') ?></textarea> 
    475                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    476                            <div class="HelpText">The body of the example page.</div> 
    477                         </td> 
    478                      </tr> 
    479                   </tbody> 
    480                </table> 
    481             </form> 
     124<form method="post" action="adminip.php" class="lyceum_form"> 
     125   <?php echo tokeninput('adminip.php')?> 
    482126 
    483            <form method="post" action="setoption.php" class="lyceum_form"> 
    484               <?php echo tokeninput('setoption.php', 'import_allowed')?
    485               <input type="hidden" name="option" value="import_allowed" /> 
     127   <table class="FormTable"> 
     128      <col width="20%" /
     129      <col width="80%" /> 
    486130 
    487                <table class="FormTable"> 
    488                   <col width="20%" /> 
    489                   <col width="80%" /> 
     131      <tbody> 
     132         <tr> 
     133            <th scope="row"><label for="admin_ip">New Admin IP</label></th> 
     134            <td> 
     135               <input type="text" name="ip" id="admin_ip" maxlength="15" class="TextInput" /> 
     136               <input type="submit" value="Submit" name="submit" class="Button" /> 
     137            </td> 
     138         </tr> 
    490139 
    491                   <tbody> 
    492                      <tr> 
    493                         <th scope="row"><span class="Label">Import Scripts</span></th> 
    494                         <td> 
    495                            <ul class="HorizList Inputs"> 
    496                               <li><input type="radio" name="value" id="import_allowed_1" value="1" <?php echo  get_option('import_allowed')?'checked="checked"':"" ?> /> <label for="import_allowed_1">Enabled</label></li> 
    497                               <li><input type="radio" name="value" id="import_allowed_0" value="0" <?php echo  !get_option('import_allowed')?'checked="checked"':"" ?> /> <label for="import_allowed_0">Disabled</label></li> 
    498                            </ul> 
    499                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    500                            <div class="HelpText">Allow users to use the import scripts? (These scripts are not yet thoroughly tested and are therefore a potential security vulnerability)</div> 
    501                         </td> 
    502                      </tr> 
    503                   </tbody> 
    504                </table> 
    505             </form> 
    506  
    507             <form method="post" action="setoption.php" class="lyceum_form"> 
    508                <?php echo tokeninput('setoption.php', 'gzipcompression')?> 
    509                <input type="hidden" name="option" value="gzipcompression" /> 
    510  
    511                <table class="FormTable"> 
    512                   <col width="20%" /> 
    513                   <col width="80%" /> 
    514  
    515                   <tbody> 
    516                      <tr> 
    517                         <th scope="row"><span class="Label">gzip Compression</span></th> 
    518                         <td> 
    519                            <ul class="HorizList Inputs"> 
    520                               <li><input type="radio" name="value" id="gzipcompression_1" value="1" <?php echo  get_option('gzipcompression')?'checked="checked"':"" ?> /> <label for="gzipcompression_1">Enabled</label></li> 
    521                               <li><input type="radio" name="value" id="gzipcompression_0" value="0" <?php echo  !get_option('gzipcompression')?'checked="checked"':"" ?> /> <label for="gzipcompression_0">Disabled</label></li> 
    522                            </ul> 
    523                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    524                            <div class="HelpText">Compress articles (gzip) if browsers ask for them.</div> 
    525                            <div class="Note">This feature has not been tested.</div> 
    526                         </td> 
    527                      </tr> 
    528                   </tbody> 
    529                </table> 
    530             </form> 
    531  
    532             <form method="post" action="setoption.php" class="lyceum_form"> 
    533                <?php echo tokeninput('setoption.php', 'restrict_admin_ip')?> 
    534                <input type="hidden" name="option" value="restrict_admin_ip" /> 
    535  
    536                <table class="FormTable"> 
    537                   <col width="20%" /> 
    538                   <col width="80%" /> 
    539  
    540                   <tbody> 
    541                      <tr> 
    542                         <th scope="row"><span class="Label">Restrict Admin IP</span></th> 
    543                         <td> 
    544                            <ul class="HorizList Inputs"> 
    545                               <li><input type="radio" name="value" id="restrict_admin_ip_1" value="1" <?php echo  get_option('restrict_admin_ip')?'checked="checked"':"" ?> /> <label for="restrict_admin_ip_1">Enabled</label></li> 
    546                               <li><input type="radio" name="value" id="restrict_admin_ip_0" value="0" <?php echo  !get_option('restrict_admin_ip')?'checked="checked"':"" ?> /> <label for="restrict_admin_ip_0">Disabled</label></li> 
    547                            </ul> 
    548                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    549                            <div class="HelpText">Restrict IP addresses from which an administrator may log in.</div> 
    550                            <div class="Note"><strong>BEFORE YOU TURN THIS ON:</strong> Make sure that your current IP address, <strong><?php echo $_SERVER['REMOTE_ADDR']?></strong>, is in the list below.</div> 
    551                         </td> 
    552                      </tr> 
    553                   </tbody> 
    554                </table> 
    555             </form> 
    556  
    557             <form method="post" action="adminip.php" class="lyceum_form"> 
    558                <?php echo tokeninput('adminip.php')?> 
    559  
    560                <table class="FormTable"> 
    561                   <col width="20%" /> 
    562                   <col width="80%" /> 
    563  
    564                   <tbody> 
    565                      <tr> 
    566                         <th scope="row"><label for="admin_ip">New Admin IP</label></th> 
    567                         <td> 
    568                            <input type="text" name="ip" id="admin_ip" maxlength="15" class="TextInput" /> 
    569                            <input type="submit" value="Submit" name="submit" class="Button" /> 
    570                         </td> 
    571                      </tr> 
    572  
    573                      <tr> 
    574                         <th scope="row">Current Admin IPs</th> 
    575                         <td> 
    576                            <ul> 
     140         <tr> 
     141            <th scope="row">Current Admin IPs</th> 
     142            <td> 
     143               <ul> 
    577144<?php 
    578145$ips = get_admin_ips(); 
    579 foreach($ips as $ip) { 
     146foreach($ips as $ip) 
     147   echo '<li>'.$ip.'</li>'; 
    580148?> 
    581                               <li><?php echo $ip ?></li> 
    582 <?php 
    583 
    584 ?> 
    585                            </ul> 
    586                         </td> 
    587                      </tr> 
     149               </ul> 
     150            </td> 
     151         </tr> 
    588152 
    589                   </tbody> 
    590                </table> 
    591             </form> 
    592  
    593          </div> 
    594  
    595       </div> 
    596       <!-- END: main column --> 
    597  
    598    </div> 
    599    <!-- END: body --> 
    600  
    601    <hr /> 
    602  
    603 <?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?> 
    604  
    605 </div> 
    606  
     153      </tbody> 
     154   </table> 
     155</form> 
    607156 
    608157</body> 
Log in with username/password: lyceum/lyceum