Log in with username/password: lyceum/lyceum

root/branches/1.0/src/lyceum/system-admin/settings.php

Revision 1268, 8.1 kB (checked in by jjb, 2 years ago)

Bringing back r1251, using taglib.

Line 
1 <?php
2 require('system-config.php');
3 require('../../lib/taglib.php');
4 $site_title = get_settings('site_title');
5
6 $myblogs = get_userblogs();
7 arrayify($myblogs);
8
9 // ===========================================================================
10 ?>
11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
12     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13
14 <html xmlns="http://www.w3.org/1999/xhtml">
15
16 <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'); ?>" />
23 </head>
24
25
26 <body>
27
28 <div id="PageWrapper" class="AdminMain">
29
30 <?php require(ABSPATH . '/system-admin/lyceum-header.php'); ?>
31    
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 <?php
55
56 function lyceum_settings_input($option, $inputrow){
57     return
58     _form(array('method'=>'post', 'action'=>'setoption.php', 'class'=>'lyceum_form'),
59         tokeninput('setoption.php', $option) .
60         _input(array('type'=>'hidden', 'name'=>'option', 'value'=>$option)) .
61
62         _table(array('class'=>'FormTable'),
63             _col(array('width'=>'20%')) .
64             _col(array('width'=>'80%')) .
65
66             _tbody(
67                 _tr( $inputrow )
68     )));
69 }
70
71 function lyceum_settings_textual_input($option, $description, $documentation, $input){
72     return lyceum_settings_input($option,
73         _th(array('scope'=>'row'), _label(array('for'=>$option), $description)) .
74         _td(
75             $input .
76             _input(array('type'=>'submit', 'value'=>'Submit', 'name'=>'submit', 'class'=>'Button' )) .
77             ( $documentation ? _div( array('class'=>"HelpText"), $documentation) : '')
78         ));
79 }
80
81 function lyceum_settings_text_input($option, $description, $documentation = false, $maxlength = false){
82     return lyceum_settings_textual_input($option, $description, $documentation,
83         _input( array( 'type'=>'text', 'name'=>'value', 'id'=>$option, 'maxlength'=>($maxlength ? $maxlength : '100'),
84                        'value'=>get_option($option), 'class'=>'TextInput')));
85 };
86
87 function lyceum_settings_textarea_input($option, $description, $documentation){
88     return lyceum_settings_textual_input($option, $description, $documentation,
89         _textarea( array( 'name'=>'value', 'cols'=>'60', 'rows'=>'5', 'id'=>'slug_blacklist', 'class'=>'TextArea'),
90                           get_option($option)));
91 };
92
93 function lyceum_settings_boolean_input($option, $description, $documentation, $warning=false){
94     return lyceum_settings_input($option,
95         _th(array('scope'=>'row'),_span(array('class'=>'Label'), $description)) .
96         _td(
97             _ul(array( 'class'=>'HorizList Inputs'),
98                 _li(_input( array_merge(array('type'=>'radio', 'name'=>'value', 'id'=>$option.'_1', 'value'=>'1'),
99                     (  get_option($option) ? array('checked'=>'checked') : array()))) . _label( array('for'=>$option.'_1'), 'Enabled')) .
100                 _li(_input( array_merge(array('type'=>'radio', 'name'=>'value', 'id'=>$option.'_0', 'value'=>'0'),
101                     ( !get_option($option) ? array('checked'=>'checked') : array()))) . _label( array('for'=>$option.'_0'), 'Disabled'))
102             ) .
103             _input( array('type'=>'submit', 'value'=>'Submit', 'name'=>'submit', 'class'=>'Button') ) .
104             _div( array('class'=>'HelpText'), $documentation) .
105             ( $warning ? _div( array('class'=>'Note'), $warning) : '' )
106         ));
107 }
108
109 echo
110 lyceum_settings_text_input('site_title', 'Site Title') .
111 lyceum_settings_text_input('system_admin_email', 'System Admin email') .
112 lyceum_settings_text_input('wp-content_file_path', 'wp-content_file_path', 'The file path where individual blog uploads and cache are kept.', 200) .
113 lyceum_settings_text_input('fileupload_base_url', 'File upload base url', 'This needs to work with wp-content_file_path above.') .
114 lyceum_settings_text_input('system_charset', 'System character encoding') .
115 lyceum_settings_text_input('email_structure', 'email regex', 'Regular expression against which new email addresses must match (example: <strong>/.*@example\.tld/</strong>)') .
116 lyceum_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>)') .
117 lyceum_settings_textarea_input('slug_blacklist', 'Unregisterable Slugs', 'Comma-separated with no spaces.') .
118 lyceum_settings_textarea_input('username_blacklist', 'Unregisterable Usernames', 'Comma-separated with no spaces.') .
119 lyceum_settings_boolean_input('users_can_register', 'Open Registration', 'Allow users to register themselves for an account and blog. (Above regular expression still applies.)') .
120 lyceum_settings_boolean_input('users_can_create_blogs', 'Can users create blogs?', '') .
121 lyceum_settings_text_input('users_can_create_num_blogs', 'How many blogs can users create?', '0 means no limit') .
122 lyceum_settings_boolean_input('presentation_tab', 'User Customization', 'Allow users to change their blog\'s theme and adjust its settings.') .
123 lyceum_settings_textarea_input('new_user_welcome_message', 'New user welcome message', '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.') .
124 lyceum_settings_textarea_input('new_blog_welcome_message', 'New blog welcome message', 'The message that will be emailed to a user upon creation of a blog.') .
125 lyceum_settings_boolean_input('create_example_post', 'Create Example Post', 'Should an example blog post be created when a new blog is created?') .
126 lyceum_settings_text_input('example_post_title', 'Example post title', 'The title of the example post.') .
127 lyceum_settings_textarea_input('example_post_body', 'Example post body', 'The body of the example post.') .
128 lyceum_settings_boolean_input('create_example_page', 'Create Example Page', 'Should an example page be created when a new blog is created?') .
129 lyceum_settings_text_input('example_page_title', 'Example page title', 'The title of the example page.') .
130 lyceum_settings_textarea_input('example_page_body', 'Example page body', 'The body of the example page.') .
131 lyceum_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.') .
132 lyceum_settings_boolean_input('gzipcompression', 'gzip Compression', 'Compress articles (gzip) if browsers ask for them.', 'This feature has not been thoroughly tested.') .
133 lyceum_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.");
134 ?>
135
136 <form method="post" action="adminip.php" class="lyceum_form">
137     <?php echo tokeninput('adminip.php')?>
138
139     <table class="FormTable">
140         <col width="20%" />
141         <col width="80%" />
142
143         <tbody>
144             <tr>
145                 <th scope="row"><label for="admin_ip">New Admin IP</label></th>
146                 <td>
147                     <input type="text" name="ip" id="admin_ip" maxlength="15" class="TextInput" />
148                     <input type="submit" value="Submit" name="submit" class="Button" />
149                 </td>
150             </tr>
151
152             <tr>
153                 <th scope="row">Current Admin IPs</th>
154                 <td>
155                     <ul>
156 <?php
157 $ips = get_admin_ips();
158 foreach($ips as $ip) {
159 ?>
160                                         <li><?php echo $ip ?></li>
161 <?php
162 }
163 ?>
164                     </ul>
165                 </td>
166             </tr>
167
168         </tbody>
169     </table>
170 </form>
171
172             </div>
173
174         </div>
175         <!-- END: main column -->
176
177     </div>
178     <!-- END: body -->
179
180     <hr />
181
182 <?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?>
183
184 </div>
185
186
187 </body>
188
189 </html>
190
Note: See TracBrowser for help on using the browser.
Log in with username/password: lyceum/lyceum