0) {
$valid_partials[] = $matches[1];
}
}
$selected = reset($valid_partials);
if (isset($_REQUEST['cp']['partial'])) {
if (in_array($_REQUEST['cp']['partial'], $valid_partials)) {
$selected = $_REQUEST['cp']['partial'];
}
}
echo '
';
foreach ($valid_partials as $partial_name) {
echo '- ';
if ($partial_name == $selected) { echo ''; }
echo '' . $partial_name . '';
if ($partial_name == $selected) { echo ''; }
echo '
';
}
echo '
';
$is_original = false;
if ($_REQUEST['cp']['action'] == __('Delete override partial', 'comicpress')) {
unset($_REQUEST['cp']['code']);
}
if (isset($_REQUEST['cp']['code'])) {
$partial_code = htmlentities($_REQUEST['cp']['code']);
} else {
if (isset($this->comicpress->comicpress_options['override_partials'][$selected])) {
$partial_code = htmlentities($this->comicpress->comicpress_options['override_partials'][$selected]);
} else {
$is_original = true;
$partial_code = htmlentities(file_get_contents(get_template_directory() . DIRECTORY_SEPARATOR . $selected . '.inc'));
}
}
?>