Пример #1
0
function arras_form_radio($data = '', $value = '', $checked = FALSE, $extra = '')
{
    if (!is_array($data)) {
        $data = array('name' => $data);
    }
    $data['type'] = 'radio';
    return arras_form_checkbox($data, $value, $checked, $extra);
}
Пример #2
0
    echo '<span class="grey">' . __('The developer of the child theme has disabled alternate stylesheets.', 'arras') . '</span>';
}
?>
</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-logo"><?php 
_e('Custom Logo', 'arras');
?>
</label></th>
<td>
<?php 
if (arras_get_option('logo') != 0) {
    echo wp_get_attachment_image(arras_get_option('logo'), 'full') . '<br />';
    echo arras_form_checkbox('arras-delete-logo', 'show', false, 'id="arras-delete-logo"');
    ?>
 
	<label for="arras-delete-logo"><?php 
    _e('Delete existing', 'arras');
    ?>
</label>
<?php 
}
?>
<p id="arras-logo-field"><input type="file" id="arras-logo" name="arras-logo" size="35" /></p>
</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-style"><?php 
Пример #3
0
function arras_admin_tapestry_default()
{
    $tapestry_settings = get_option('arras_tapestry_default');
    if (!is_array($tapestry_settings)) {
        $tapestry_settings = arras_defaults_tapestry_default();
    }
    ?>
	<h3><?php 
    _e('Tapestry: Node Based', 'arras');
    ?>
</h3>
	<table class="form-table">

	<tr valign="top">
	<th scope="row"><label for="arras-tapestry-default-excerpt"><?php 
    _e('Show Excerpt?', 'arras');
    ?>
</label></th>
	<td>
	<?php 
    echo arras_form_checkbox('arras-tapestry-default-excerpt', 'show', $tapestry_settings['excerpt'], 'id="arras-tapestry-default-excerpt"');
    ?>
	</td>
	</tr>
	<tr valign="top">
	<th scope="row"><label for="arras-tapestry-default-height"><?php 
    _e('Nodes per Row', 'arras');
    ?>
</label></th>
	<td>
	<?php 
    echo arras_form_input(array('name' => 'arras-tapestry-default-nodes', 'id' => 'arras-tapestry-default-nodes', 'size' => '3', 'value' => $tapestry_settings['nodes'], 'maxlength' => 1));
    ?>
	</td>
	</tr>
	
	</table>
	<?php 
}
</span>
<p><?php 
_e('If you have recently upgraded Arras to a new release, it is <span style="color: red">highly recommended</span> that you reset your theme options, clear your browser cache and restart your browser before proceeding.', 'arras');
?>
</p>
</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-credits"><?php 
_e('Display Credits', 'arras');
?>
</label></th>
<td>
<?php 
echo arras_form_checkbox('arras-credits', 'show', !arras_get_option('donate'), 'id="arras-credits"');
?>
 
<?php 
_e('Credits will only appear to the right of the theme options page.', 'arras');
?>
</td>
</tr>

</table>

<h3><?php 
_e('Site Information', 'arras');
?>
</h3>
<table class="form-table">
<h3><?php 
_e('Thumbnail Options', 'arras');
?>
</h3>
<table class="form-table">

<tr valign="top">
<th scope="row"><?php 
_e('Auto Thumbnails', 'arras');
?>
</th>
<td>

<?php 
echo arras_form_checkbox('arras-thumbs-auto', 'show', arras_get_option('auto_thumbs'), 'id="arras-thumbs-auto"');
?>
 
<label for="arras-thumbs-auto"><?php 
_e('Check this to allow the theme to automatically retrieve the first attached image from the post as featured image when no image is specified.', 'arras');
?>
</label>

</td>
</tr>
</table>

<h3><?php 
_e('Thumbnail Sizes', 'arras');
?>
</h3>
Пример #6
0
echo arras_form_input(array('name' => 'arras-layout-featured2-count', 'id' => 'arras-layout-featured2-count', 'size' => '5', 'value' => arras_get_option('featured2_count'), 'maxlength' => 2));
?>
 <?php 
' ' . _e('posts', 'arras');
?>
</td>
</tr>

</table>


<h3><?php 
_e('News Posts', 'arras');
?>
 <span class="enabler"><?php 
echo arras_form_checkbox('arras-enable-news', 'show', arras_get_option('enable_news'), 'id="arras-enable-news"');
?>
<label for="arras-enable-news"><?php 
_e('Show/Hide', 'arras');
?>
</label></span></h3>
<table class="form-table">

<tr valign="top">
<th scope="row"><?php 
_e('Selected Post Type', 'arras');
?>
</th>
<td>
<strong><?php 
echo arras_get_posttype_name(arras_get_option('news_posttype'));
Пример #7
0
function arras_custom_background()
{
    global $arras_custom_bg_options;
    $notices = '';
    if (!isset($arras_custom_bg_options)) {
        $arras_custom_bg_options = maybe_unserialize(get_option('arras_custom_bg_options'));
    }
    if (isset($_REQUEST['reset'])) {
        check_admin_referer('arras-custom-background');
        $arras_custom_bg_options = arras_get_custom_background_defaults();
        update_option('arras_custom_bg_options', maybe_serialize($arras_custom_bg_options));
        $notices = '<div class="updated"><p>' . __('Your settings have been reverted to the defaults.', 'arras') . '</p></div>';
    }
    if (isset($_REQUEST['save'])) {
        check_admin_referer('arras-custom-background');
        $defaults = !isset($arras_custom_bg_options) ? arras_get_custom_background_defaults() : $arras_custom_bg_options;
        if (isset($_FILES['import']) && $_FILES['import']['error'] != 4) {
            $overrides = array('test_form' => false);
            $file = wp_handle_upload($_FILES['import'], $overrides);
            if (isset($file['error'])) {
                die($file['error']);
            }
            $url = $file['url'];
            $type = $file['type'];
            $file = $file['file'];
            $filename = basename($file);
            // Construct the object array
            $object = array('post_title' => $filename, 'post_content' => $url, 'post_mime_type' => $type, 'guid' => $url);
            // Save the data
            $arras_custom_bg_options['id'] = wp_insert_attachment($object, $file);
        }
        $arras_custom_bg_options['enable'] = isset($_POST['bg-enable']);
        $arras_custom_bg_options['attachment'] = isset($_POST['bg-attachment']) ? $_POST['bg-attachment'] : $defaults['attachment'];
        $arras_custom_bg_options['pos-x'] = isset($_POST['bg-pos-x']) ? $_POST['bg-pos-x'] : $defaults['pos-x'];
        $arras_custom_bg_options['pos-y'] = isset($_POST['bg-pos-y']) ? $_POST['bg-pos-y'] : $defaults['pos-y'];
        $arras_custom_bg_options['repeat'] = isset($_POST['bg-repeat']) ? $_POST['bg-repeat'] : $defaults['repeat'];
        $arras_custom_bg_options['color'] = isset($_POST['bg-color']) && preg_match('/^#?(([a-fA-F0-9]){3}){1,2}$/', $_POST['bg-color']) ? $_POST['bg-color'] : $defaults['color'];
        $arras_custom_bg_options['foreground'] = isset($_POST['foreground']);
        $arras_custom_bg_options['wrap'] = isset($_POST['wrap']) ? $_POST['wrap'] : $defaults['wrap'];
        update_option('arras_custom_bg_options', maybe_serialize($arras_custom_bg_options));
        $notices = '<div class="updated"><p>' . __('Your settings have been saved to the database.', 'arras') . '</p></div>';
    }
    if (isset($_GET['page']) && $_GET['page'] == 'arras-custom-background') {
        ?>
	
	<script type="text/javascript">
	jQuery(document).ready(function() {
		 jQuery('#colorpicker').farbtastic('#bg-color');
		 jQuery('#colorpicker').hide();
		 jQuery('#bg-color').click(function() {
			jQuery('#colorpicker').fadeIn();
		 });
		 jQuery('#bg-color').blur(function() {
			jQuery('#colorpicker').fadeOut();
		 });
	});
	</script>
	
	<div class="wrap">
	
	<?php 
        echo $notices;
        ?>
	
	<?php 
        screen_icon('themes');
        ?>
	<h2><?php 
        _e('Custom Background', 'arras');
        ?>
</h2>
	
	<form enctype="multipart/form-data" id="arras-custom-bg-form" method="post" action="admin.php?page=arras-custom-background" class="clearfix">
		<?php 
        wp_nonce_field('arras-custom-background');
        ?>
		<div id="custom-bg-options">
			<p style="margin-top: 0">
			<?php 
        echo arras_form_checkbox('bg-enable', false, (bool) $arras_custom_bg_options['enable'], 'id="bg-enable"');
        ?>
			 <label style="display: inline; color: red;" for="bg-enable"><?php 
        _e('Activate Custom Background', 'arras');
        ?>
</label>
			</p>
			<div class="upload-bg">
				<label for="import"><?php 
        _e('Upload Background Image', 'arras');
        ?>
</label>
				<input type="file" id="upload" name="import" size="40" />
			</div>
			<div class="advanced">
				<p><label for="bg-attachment"><?php 
        _e('Background Attachment', 'arras');
        ?>
</label>
				<?php 
        echo arras_form_radio('bg-attachment', 'fixed', $arras_custom_bg_options['attachment'] == 'fixed') . __('Fixed', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-attachment', 'scroll', $arras_custom_bg_options['attachment'] == 'scroll') . __('Scroll (along with the rest of the page)', 'arras');
        ?>
</p>
				<p><label for="bg-pos-x"><?php 
        _e('Horizontal Position', 'arras');
        ?>
</label>
				<?php 
        echo arras_form_radio('bg-pos-x', 'left', $arras_custom_bg_options['pos-x'] == 'left') . __('Left', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-pos-x', 'center', $arras_custom_bg_options['pos-x'] == 'center') . __('Center', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-pos-x', 'right', $arras_custom_bg_options['pos-x'] == 'right') . __('Right', 'arras');
        ?>
</p>
				<p><label for="bg-pos-y"><?php 
        _e('Vertical Position', 'arras');
        ?>
</label>
				<?php 
        echo arras_form_radio('bg-pos-y', 'top', $arras_custom_bg_options['pos-y'] == 'top') . __('Top', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-pos-y', 'center', $arras_custom_bg_options['pos-y'] == 'center') . __('Center', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-pos-y', 'bottom', $arras_custom_bg_options['pos-y'] == 'bottom') . __('Bottom', 'arras');
        ?>
</p>
				<p><label for="bg-repeat"><?php 
        _e('Repeat Background Image?', 'arras');
        ?>
</label>
				<?php 
        echo arras_form_radio('bg-repeat', 'no-repeat', $arras_custom_bg_options['repeat'] == 'no-repeat') . __('None', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-repeat', 'repeat-x', $arras_custom_bg_options['repeat'] == 'repeat-x') . __('Repeat Horizontally', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-repeat', 'repeat-y', $arras_custom_bg_options['repeat'] == 'repeat-y') . __('Repeat Vertically', 'arras');
        ?>
<br />
				<?php 
        echo arras_form_radio('bg-repeat', 'repeat', $arras_custom_bg_options['repeat'] == 'repeat') . __('Repeat Both', 'arras');
        ?>
				</p>
				<p><label for="bg-color"><?php 
        _e('Background Color', 'arras');
        ?>
</label>
					<input type="text" id="bg-color" name="bg-color" size="7" value="<?php 
        echo $arras_custom_bg_options['color'];
        ?>
" />
					<div id="colorpicker"></div>
				</p>
				<p><?php 
        echo arras_form_checkbox('foreground', true, (bool) $arras_custom_bg_options['foreground'], 'id="foreground"');
        ?>
 <label style="display: inline" for="foreground"><?php 
        _e('Semi-Transparent Foreground', 'arras');
        ?>
</label><br /><?php 
        _e('This feature does not work in IE6 and for those using the legacy stylesheet.', 'arras');
        ?>
</p>
				<p><?php 
        echo arras_form_checkbox('wrap', true, (bool) $arras_custom_bg_options['wrap'], 'id="wrap"');
        ?>
 <label style="display: inline" for="foreground"><?php 
        _e('Apply Background from Top', 'arras');
        ?>
</label></p>
			</div>
			<p><input name="save" class="button-primary" type="submit" value="<?php 
        _e('Save Changes', 'arras');
        ?>
" />
			<input name="reset" class="button-secondary" type="submit" value="<?php 
        _e('Reset', 'arras');
        ?>
" /></p>
		</div><!-- #custom-bg-options -->
		<div id="custom-bg-preview">
			<h3><?php 
        _e('Current Background Image', 'arras');
        ?>
</h3>
			<?php 
        if (isset($arras_custom_bg_options['id']) && $arras_custom_bg_options['id'] != 0) {
            echo wp_get_attachment_image($arras_custom_bg_options['id'], 'full');
        }
        ?>
		</div><!-- #custom-bg-preview -->
	</form>
	
	</div><!-- .wrap -->
	
	<?php 
    }
    ?>
	
<?php 
}
Пример #8
0
?>
</label>
<br />

<?php 
echo arras_form_checkbox('arras-layout-post-tags', 'show', arras_get_option('post_tags'), 'id="arras-layout-post-tags"');
?>
 
<label for="arras-layout-post-tags"><?php 
_e('Tags (Header)', 'arras');
?>
</label>
<br />

<?php 
echo arras_form_checkbox('arras-layout-single-author', 'show', arras_get_option('display_author'), 'id="arras-layout-single-author"');
?>
 
<label for="arras-layout-single-author"><?php 
_e('Author Information', 'arras');
?>
</label>

</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-layout-metapos"><?php 
_e('Position of Custom Fields', 'arras');
?>
</label></th>
Пример #9
0
<div class="clearfix arras-options-wrapper">

<?php 
include 'arras-general.php';
if (!function_exists('wp_nav_menu')) {
    include 'arras-navigation.php';
}
include 'arras-home.php';
include 'arras-layout.php';
include 'arras-design.php';
include 'arras-thumbnails.php';
include 'arras-tools.php';
?>

<p class="arras-regen-thumbs-field"><?php 
echo arras_form_checkbox('arras-regen-thumbs', 'show', false, 'id="arras-regen-thumbs"');
?>
 
<label for="arras-regen-thumbs"><?php 
_e('Regenerate post thumbnails after saving.', 'arras');
?>
</label></p>
<p class="final-submit">
<input class="button-primary" type="submit" name="save" value="<?php 
_e('Save Changes', 'arras');
?>
" />
<input class="button-secondary" type="submit" name="reset" value="<?php 
_e('Reset Settings', 'arras');
?>
" />
Пример #10
0
_e('Author Information', 'arras');
?>
</label>

</td>
</tr>

<tr valign="top">
<th scope="row"><?php 
_e('Display Relative Post Dates', 'arras');
?>
</th>
<td>

<?php 
echo arras_form_checkbox('arras-layout-single-postdates', 'show', arras_get_option('relative_postdates'), 'id="arras-layout-single-postdates"');
?>
 
<label for="arras-layout-single-author"><?php 
_e('Check this to display post dates relative to current time (eg. 2 days ago ).', 'arras');
?>
</label>

</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-single-custom-taxonomies"><?php 
_e('Display Custom Taxonomies', 'arras');
?>
</label></th>
Пример #11
0
?>
</label>
<br />

<?php 
echo arras_form_checkbox('arras-layout-post-barheader', 'show', arras_get_option('postbar_header'), 'id="arras-layout-post-barheader"');
?>
 
<label for="arras-layout-post-barheader"><?php 
_e('Display Post Links in Header', 'arras');
?>
</label>
<br />

<?php 
echo arras_form_checkbox('arras-layout-post-barfooter', 'show', arras_get_option('postbar_footer'), 'id="arras-layout-post-barfooter"');
?>
 
<label for="arras-layout-post-barfooter"><?php 
_e('Display Post Links in Footer', 'arras');
?>
</label>

</td>
</tr>

<tr valign="top">
<th scope="row"><label for="arras-layout-metapos"><?php 
_e('Position of Custom Fields', 'arras');
?>
</label></th>