|
Revision 3987, 1.4 kB
(checked in by ryan, 2 years ago)
|
Strip and texturize importer title. Props Nazgul. fixes #2897
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
require_once ('admin.php'); |
|---|
| 3 |
$title = __('Import'); |
|---|
| 4 |
$parent_file = 'import.php'; |
|---|
| 5 |
require_once ('admin-header.php'); |
|---|
| 6 |
?> |
|---|
| 7 |
|
|---|
| 8 |
<div class="wrap"> |
|---|
| 9 |
<h2><?php _e('Import'); ?></h2> |
|---|
| 10 |
<p><?php _e('If you have posts or comments in another system WordPress can import them into your current blog. To get started, choose a system to import from below:'); ?></p> |
|---|
| 11 |
|
|---|
| 12 |
<?php |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
$import_loc = 'wp-admin/import'; |
|---|
| 16 |
$import_root = ABSPATH.$import_loc; |
|---|
| 17 |
$imports_dir = @ dir($import_root); |
|---|
| 18 |
if ($imports_dir) { |
|---|
| 19 |
while (($file = $imports_dir->read()) !== false) { |
|---|
| 20 |
if (preg_match('|^\.+$|', $file)) |
|---|
| 21 |
continue; |
|---|
| 22 |
if (preg_match('|\.php$|', $file)) |
|---|
| 23 |
require_once("$import_root/$file"); |
|---|
| 24 |
} |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
$importers = get_importers(); |
|---|
| 28 |
|
|---|
| 29 |
if (empty ($importers)) { |
|---|
| 30 |
echo '<p>'.__('No importers are available.').'</p>'; |
|---|
| 31 |
} else { |
|---|
| 32 |
?> |
|---|
| 33 |
<table width="100%" cellpadding="3" cellspacing="3"> |
|---|
| 34 |
|
|---|
| 35 |
<?php |
|---|
| 36 |
$style = ''; |
|---|
| 37 |
foreach ($importers as $id => $data) { |
|---|
| 38 |
$style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; |
|---|
| 39 |
$action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>"; |
|---|
| 40 |
|
|---|
| 41 |
if ($style != '') |
|---|
| 42 |
$style = 'class="'.$style.'"'; |
|---|
| 43 |
echo " |
|---|
| 44 |
<tr $style> |
|---|
| 45 |
<td class=\"togl\">$action</td> |
|---|
| 46 |
<td class=\"desc\">{$data[1]}</td> |
|---|
| 47 |
</tr>"; |
|---|
| 48 |
} |
|---|
| 49 |
?> |
|---|
| 50 |
|
|---|
| 51 |
</table> |
|---|
| 52 |
<?php |
|---|
| 53 |
} |
|---|
| 54 |
?> |
|---|
| 55 |
|
|---|
| 56 |
</div> |
|---|
| 57 |
|
|---|
| 58 |
<?php |
|---|
| 59 |
|
|---|
| 60 |
include ('admin-footer.php'); |
|---|
| 61 |
?> |
|---|
| 62 |
|
|---|
| 63 |
|
|---|