|
68 | 68 | 'align' => 'left', |
69 | 69 | ] |
70 | 70 | ), |
| 71 | + new OOUI\FieldLayout( |
| 72 | + can_configure() ? |
| 73 | + new OOUI\MultilineTextInputWidget( [ |
| 74 | + 'name' => 'siteConfig', |
| 75 | + 'placeholder' => "\$wgSitename = 'Test wiki';", |
| 76 | + 'rows' => 4, |
| 77 | + ] ) : |
| 78 | + new OOUI\MessageWidget( [ |
| 79 | + 'label' => 'Only trusted users can modify site config.', |
| 80 | + ] ), |
| 81 | + [ |
| 82 | + 'label' => 'Site config:', |
| 83 | + 'help' => new OOUI\HtmlSnippet( 'This file will be <strong>public</strong>.' ), |
| 84 | + 'helpInline' => true, |
| 85 | + 'align' => 'left', |
| 86 | + ] |
| 87 | + ), |
71 | 88 | new DetailsFieldLayout( |
72 | 89 | new OOUI\CheckboxMultiselectInputWidget( [ |
73 | 90 | 'name' => 'repos[]', |
74 | 91 | 'options' => $repoOptions, |
75 | 92 | 'value' => array_keys( $repoData ), |
76 | 93 | ] ), |
77 | 94 | [ |
78 | | - 'label' => 'Choose extensions to enable (default: all):', |
| 95 | + 'label' => 'Choose extensions to enable:', |
| 96 | + 'help' => new OOUI\HtmlSnippet( '<br/>Defaults to all' ), |
| 97 | + 'helpInline' => true, |
79 | 98 | 'align' => 'left', |
80 | 99 | ] |
81 | 100 | ), |
|
157 | 176 | } |
158 | 177 | $creator = get_creator( $dir ); |
159 | 178 | $created = get_created( $dir ); |
| 179 | + $siteConfig = get_if_file_exists( 'wikis/' . $dir . '/w/config.txt' ); |
| 180 | + $hasConfig = $siteConfig && strlen( trim( $siteConfig ) ); |
160 | 181 |
|
161 | 182 | if ( !$created ) { |
162 | 183 | // Add created.txt to old wikis |
|
169 | 190 | $wikis[ $dir ] = [ |
170 | 191 | 'mtime' => $created, |
171 | 192 | 'title' => $title, |
172 | | - 'creator' => $creator |
| 193 | + 'creator' => $creator, |
| 194 | + 'hasConfig' => $hasConfig, |
173 | 195 | ]; |
174 | 196 | } |
175 | 197 | } |
|
190 | 212 | $anyCanDelete = $anyCanDelete || $canDelete; |
191 | 213 | $rows .= '<tr' . ( $creator !== $username ? ' class="other"' : '' ) . '>' . |
192 | 214 | '<td class="title">' . ( $title ?: '<em>No patches</em>' ) . '</td>' . |
193 | | - '<td><a href="wikis/' . $wiki . '/w">' . $wiki . '</a></td>' . |
| 215 | + '<td>' . |
| 216 | + ( !empty( $data[ 'hasConfig' ] ) ? |
| 217 | + '<a href="wikis/' . $wiki . '/w/config.txt">Config</a>' : |
| 218 | + '' |
| 219 | + ) . |
| 220 | + '</td>' . |
| 221 | + '<td><a href="wikis/' . $wiki . '/w">' . substr( $wiki, 0, 20 ) . '…</a></td>' . |
194 | 222 | '<td class="date">' . date( 'c', $data[ 'mtime' ] ) . '</td>' . |
195 | 223 | ( $useOAuth ? '<td>' . ( $creator ? user_link( $creator ) : '?' ) . '</td>' : '' ) . |
196 | 224 | ( $canDelete ? |
|
202 | 230 |
|
203 | 231 | echo '<tr>' . |
204 | 232 | '<th>Patches</th>' . |
| 233 | + '<th>Config</th>' . |
205 | 234 | '<th>Link</th>' . |
206 | 235 | '<th>Time</th>' . |
207 | 236 | ( $useOAuth ? '<th>Creator</th>' : '' ) . |
|
0 commit comments