finish basic options page, on to handling submissions
This commit is contained in:
parent
c8db41accf
commit
ddc296036b
@ -3,7 +3,9 @@
|
|||||||
class ComicPressOptionsAdmin {
|
class ComicPressOptionsAdmin {
|
||||||
var $comicpress_options = array(
|
var $comicpress_options = array(
|
||||||
'comic_category_id' => 1,
|
'comic_category_id' => 1,
|
||||||
'thumbnail_dimensions' => '760x'
|
'comic_dimensions' => '760x',
|
||||||
|
'rss_dimensions' => '350x',
|
||||||
|
'thumbnail_dimensions' => '125x'
|
||||||
);
|
);
|
||||||
|
|
||||||
function render_admin() {
|
function render_admin() {
|
||||||
@ -61,7 +63,7 @@ class ComicPressOptionsAdmin {
|
|||||||
) as $id => $name) {
|
) as $id => $name) {
|
||||||
$dim = array_shift($parts);
|
$dim = array_shift($parts);
|
||||||
if (!empty($dim) && !is_numeric($dim)) { $dim = ""; }
|
if (!empty($dim) && !is_numeric($dim)) { $dim = ""; }
|
||||||
$output[] = '<label>' . $name . ': <input type="text" name="' . $root . '[' . $id . ']" value="' . $dim . '" /></label>';
|
$output[] = '<label>' . $name . ': <input type="text" name="' . $root . '[' . $id . ']" value="' . $dim . '" size="4" />px</label><br />';
|
||||||
}
|
}
|
||||||
return implode("\n", $output);
|
return implode("\n", $output);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,32 @@
|
|||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2>ComicPress Config</h2>
|
<h2><?php _e('ComicPress Config', 'comicpress') ?></h2>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="hidden" name="cp[_nonce]" value="<?php echo $nonce ?>" />
|
<input type="hidden" name="cp[_nonce]" value="<?php echo $nonce ?>" />
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Master Comic Category</th>
|
<th scope="row"><?php _e('Master Comic Category', 'comicpress') ?></th>
|
||||||
<td>
|
<td>
|
||||||
<select name="cp[comic_category_id]">
|
<select name="cp[comic_category_id]">
|
||||||
<?php echo $this->create_category_options($root_categories, $this->comicpress_options['comicpress_category_id']) ?>
|
<?php echo $this->create_category_options($root_categories, $this->comicpress_options['comicpress_category_id']) ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php foreach (array(
|
||||||
|
'comic_dimensions' => __('Comic Image Dimensions', 'comicpress'),
|
||||||
|
'rss_dimensions' => __('RSS Feed Image Dimensions', 'comicpress'),
|
||||||
|
'thumbnail_dimensions' => __('Thumbnail Image Dimensions', 'comicpress'),
|
||||||
|
) as $field => $name) { ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo $name ?></th>
|
||||||
|
<td>
|
||||||
|
<?php echo $this->create_dimension_selector('cp[' . $field . ']', $this->comicpress_options[$field]) ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
<td><input type="submit" value="Submit Changes" /></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user