Source

elbee-elgee / includes / parent-options.php

<?php
/**
 * parent-options.php handles the back-end options for Elbee Elgee
 *
 * @package		Elbee-Elgee
 * @copyright	Copyright (c) 2011, Doug Stewart
 * @license		http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
 *
 * @since		Elbee-Elgee 1.0
 */

// Look for layout CSS files to auto-load
$css_layout_path = TEMPLATEPATH . '/layouts/css/';
$css_layouts = array();

if ( is_dir($css_layout_path) ) {
	if ($css_layout_dir = opendir($css_layout_path) ) { 
		while ( ($css_layout_file = readdir($css_layout_dir)) !== false ) {
			if( stristr($css_layout_file, ".css") !== false ){
				$css_layouts[] = array( 'input' => $css_layout_file, 'image' => get_template_directory_uri() . '/layouts/css/images/' . basename($css_layout_file, '.css') . '.png');
			}
		}	
	}
}	

// Look for color/design CSS files to auto-load
$alt_stylesheet_path = TEMPLATEPATH . '/styles/';
$alt_stylesheets = array();

if ( is_dir($alt_stylesheet_path) ) {
	if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { 
		while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
			if(stristr($alt_stylesheet_file, ".css") !== false) {
				$alt_stylesheets[] = $alt_stylesheet_file;
			}
		}	
	}
}	

$css_layouts_tmp = asort($css_layouts);

$alt_stylesheets_tmp = asort($alt_stylesheets);
$alt_stylesheets_tmp = array_unshift($alt_stylesheets, "Select a stylesheet:", "*none*");

$parent_options_array = array(
	"tabs" => array( 'general', 'styling', 'mobile' ),
	
	"general" => array(
			"name"		=> __( 'General', 'lblg' ),
			"type"		=> "tab",
			"contents"	=> array(
				"blog_meta_info" => array(	"name" => __( 'Blog Meta Info', 'lblg' ),
						"type" => "subhead"),

				"display_footer_copyright" => array(	"name" => __( 'Display Copyright', 'lblg' ),
						"desc" => __( 'Display your copyright information in the footer<br /><br /><b>Default:</b> true', 'lblg' ), 
						"std" => "1",
						"type" => "checkbox"),

				"footer_copyright" => array(	"name" => __( 'Copyright Statement', 'lblg' ),
						"desc" => sprintf( __( 'The following text will be displayed by default: <b><p>%s %s</p></b>', 'lblg' ), get_bloginfo('name'), lblg_copyright() ),
						"std" => "",
						"type" => "textarea",
						"options" => array("rows" => "5",
										   "cols" => "40") ),

				"display_footer_credits" => array(	"name" => __( 'Display Credits', 'lblg' ),
						"desc" => __( 'Display your site credits in the footer<br /><br /><b>Default:</b> true', 'lblg' ), 
						"std" => "1",
						"type" => "checkbox"),

				"footer_credit_text" => array(	"name" => __( 'Footer Credits', 'lblg' ),
						"desc" => sprintf( __( 'Footer credit text defaults to: <b><p>Powered by %s %s and %s</p></b> Change it to fit your site. (I would appreciate the link love, though, if you would leave it in...)  HTML should work just fine, raw PHP not so much.', 'lblg' ), '<a href="http://wordpress.org">WordPress</a>', get_bloginfo('version'), '<a href="http://literalbarrage.org/blog/code/elbee-elgee">Elbee Elgee</a>' ),
						"std" => "",
						"type" => "textarea",
						"options" => array("rows" => "5",
										   "cols" => "40") ),

				"archives_excerpt" => array(	"name" => __( 'Archives/Excerpt', 'lblg'),
						"desc" => sprintf( __( 'Use %sthe_excerpt()%s to display a shortened version of your posts\' content on archive pages.<br /><br /><b>Default:</b> true', 'lblg' ), '<a href="http://codex.wordpress.org/Function_Reference/the_excerpt">', '</a>' ),
						"std" => "1",
						"type" => "checkbox" ),
			)
	),
	
	"styling" => array(
		"name"		=> __( 'Styling', 'lblg' ),
		"type"		=> "tab",
		"contents"	=> array(
				"style_options" => array(	"name" => __( 'Style Options', 'lblg' ),
						"type" => "subhead"),

						"alt_stylesheet" => array(	"name" => __('Theme Stylesheet', 'lblg' ),
								"desc" => __('Place additional theme stylesheets and assets in ', 'lblg' ) . '<code>' . TEMPLATEPATH . "/styles/</code> " . __('to add them as styling options', 'lblg' ),
							    "std" => "Select a stylesheet:",
							    "type" => "select",
							    "options" => $alt_stylesheets),

				"layout_stylesheet" => array(	"name" => __('Layout', 'lblg' ),
						"desc" => sprintf( __( 'Place additional layout stylesheets in %s to add them as layout options', 'lblg' ), '<code>' . TEMPLATEPATH . '/layouts/</code>' ),
			    		"std" => "",
			    		"type" => "imageradio",
			    		"options" => $css_layouts),

				"use_custom_header" => array(	"name" => __('Use Custom Headers', 'lblg' ),
						"desc" => sprintf( __( 'Use WordPress\'s built-in %sCustom Header Image API%s to define a custom image for your theme<br /><br /><b>Default:</b> true', 'lblg' ), '<a href="http://codex.wordpress.org/Custom_Headers">', '</a>' ),
						"std" => "1",
						"type" => "checkbox"),

				"use_dynamic_header" => array(	"name" => __( 'Use Dynamic Headers', 'lblg' ),
						"desc" => __( 'Check this box if you want the header to dynamically resize to the size of header images', 'lblg' ),
						"std" => "1",
						"type" => "checkbox"),
		)
	),
	
	"mobile" => array(
				"name" => __( 'Mobile/Responsive', 'lblg' ),
				"type" => "tab",
				"contents" => array(
					"enable_responsive_css" => array(	"name" => __( 'Enable Responsive CSS', 'lblg' ),
							"desc" => __( 'Enable "responsive" CSS.', 'lblg' ),
							"std" => "1",
							"type" => "checkbox"),
					"enable_mobile_menu" => array(	"name"	=> __( 'Enable Mobile Nav Menu', 'lblg' ),
							"desc" => __( 'Enable alternate mobile/"respponsive" menu function.', 'lblg' ),
							"std" => "1",
							"type" => "checkbox"),
				),
	),
);

if( function_exists('bp_get_loggedin_user_nav') ) {
	$parent_options_array['tabs'][] = 'buddypress';
	$parent_options_array['buddypress'] = array(
		"name"		=> __( 'BuddyPress', 'lblg' ),
		"type"		=> "tab",
		"contents"	=> array(
			"bp_subhead" => array( "name" => __( 'BuddyPress-specific Options', 'lblg' ),
								   "type" => "subhead" ),
			
			"disable_bp_js" => array( "name" => __( 'Disable BuddyPress JavaScript/AJAX', 'lblg' ),
									  "desc" => __( 'Elbee Elgee automatically integrates the BuddyPress default theme javascript and AJAX functionality. You may switch this off, though the experience will degrade somewhat.<br /><br /><b>Default:</b> false', 'lblg' ),
									  "std" => "0",
									  "type" => "checkbox" ),
									
			"disable_bp_css" => array( "name" => __( 'Disable BuddyPress CSS', 'lblg' ),
									   "desc" => __( "Elbee Elgee comes with basic CSS styles that give BuddyPress pages a standard look and feel. You can extend upon these styles in your child theme's CSS or simply disable them and construct your own.<br /><br /><b>Default:</b> false", 'lblg' ),
									   "std" => "0",
									   "type" => "checkbox" ),
			
			"disable_bp_searchform" => array( "name" => __( 'Disable BuddyPress search form', 'lblg' ),
											  "desc" => __( 'Disables the BP search form in the site header.<br /><br /><b>Default:</b> false', 'lblg' ),
											  "std" => "0",
											  "type" => "checkbox" ),
			
			"disable_bp_menu" => array( "name" => __( 'Disable custom BuddyPress menu', 'lblg' ),
										"desc" => __( 'Disables the BP menu in the site header.<br /><br /><b>Default:</b> falsee', 'lblg' ),
										"std" => "0",
										"type" => "checkbox" ),
		),
	);
}

if( function_exists( 'bbp_version' ) ){
	$parent_options_array['tabs'][] = 'bbpress';
	$parent_options_array['bbpress'] = array(
		"name"		=> __( 'bbPress', 'lblg' ),
		"type"		=> "tab",
		"contents"	=> array(
			"bbp_subhead" => array( "name" => __( 'bbPress-specific Options', 'lblg' ),
									"type" => "subhead"),
			"bbp_force_1_column" => array( "name" => __( 'Disable Sidebar Widget Areas', 'lblg' ),
												  "desc" => __( 'Disable the sidebar widget areas, essentially forcing all bbPress forum/topic screens to use 1 column layouts. <br /> (Can increase readability/functionality of bbPress forums, depending upon your chosen layout).<br /><br /><b>Default:</b> false', 'lblg' ),
												  "type" => "checkbox",
												  "std" => "0" ),
			"bbp_disable_footer" => array( "name" => __( 'Disable Footer Widget Areas', 'lblg' ),
												  "desc" => __( 'Disable the footer widget areas when viewing bbPress forums/topics.<br /><br /><b>Default:</b> false', 'lblg' ),
												  "type" => "checkbox",
												  "std" => "0" ),
		),
	);
}

$parent_theme_array[ 'options' ] = $parent_options_array;

return $parent_theme_array;
?>