Skip to content

Commit

Permalink
Techozoic 2.0.4
Browse files Browse the repository at this point in the history
Changes
- Added two new navigation styles, Ribbon and Square.
- Added more color choices for navigation menus.
- Added option to specify width of navigation menu sub menus.
- Added ability to specify two Google Web fonts.
- Romanian Translation ,<img src="http://mobirout.com/uploads/ro.gif" alt="Romanian translation" /> Web Geek Science  (<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>)
- New post author block on single post screens, if user bio is filled out on profile page it is displayed along with gravatar.
  • Loading branch information
jeremyclark13 committed Apr 12, 2012
1 parent 34b25c1 commit ee4ac30
Show file tree
Hide file tree
Showing 29 changed files with 2,706 additions and 465 deletions.
31 changes: 21 additions & 10 deletions admin/css/admin-style.css
Expand Up @@ -12,6 +12,9 @@
max-width:780px;
background:#fff;
}
#optionsframework h3 {
cursor: default;
}
#optionsframework p {
margin-bottom:0;
padding-bottom:10px;
Expand Down Expand Up @@ -50,6 +53,9 @@
min-width:125px;
width:125px
}
#optionsframework .section-editor .explain{
max-width:100%;
}
#optionsframework .controls input, #optionsframework .controls select, #optionsframework .controls textarea {
margin-bottom:10px;
width:100%;
Expand Down Expand Up @@ -152,6 +158,14 @@
#optionsframework .mini .explain {
max-width:74%;
}

/* Editor */

#optionsframework .section-editor .explain {
float:none;
margin-bottom:5px;
}

/* Image Uploader */

#optionsframework .controls input.upload {
Expand Down Expand Up @@ -220,16 +234,13 @@
#optionsframework .button-primary {
float:right;
}
/* Backup Settings */

.import, .export {
margin: 20px 0;
padding: 0 0 20px 10px;
border: 1px solid #ECECEC;
background-color: #f9f9f9;
}
/* Bottom Section */

.import label {
display:block;
padding: 0 0 5px 0;
#optionsframework .section:before, #optionsframework .section:after {
content: "";
display: table;
}
#optionsframework .section:after {
clear: both;
}
89 changes: 48 additions & 41 deletions admin/options-framework.php
@@ -1,12 +1,10 @@
<?php
/*
Plugin Name: Options Framework
Plugin URI: http://www.wptheming.com
Description: A framework for building theme options.
Version: 0.8
Author: Devin Price
Author URI: http://www.wptheming.com
License: GPLv2
Version: 1.0
*/

/*
Expand All @@ -25,14 +23,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/* Basic plugin definitions */

define('OPTIONS_FRAMEWORK_VERSION', '0.9');

/* Make sure we don't expose any info if called directly */

if ( !function_exists( 'add_action' ) ) {
echo "Hi there! I'm just a little plugin, don't mind me.";
echo "Hi there! I'm just a little extension, don't mind me.";
exit;
}

Expand All @@ -46,6 +40,7 @@ function optionsframework_rolescheck () {
add_action( 'admin_menu', 'optionsframework_add_page');
add_action( 'admin_init', 'optionsframework_init' );
add_action( 'admin_init', 'optionsframework_mlu_init' );
add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
}
}

Expand All @@ -54,7 +49,7 @@ function optionsframework_rolescheck () {
add_action('init', 'optionsframework_load_backup' );

function optionsframework_load_backup() {
require_once dirname( __FILE__ ) . '/options-backup.php';
require_once dirname( __FILE__ ) . '/options-backup.php';
}

/* Loads the file for option sanitization */
Expand Down Expand Up @@ -113,6 +108,18 @@ function optionsframework_init() {
}
}

/**
* Ensures that a user with the 'edit_theme_options' capability can actually set the options
* See: http://core.trac.wordpress.org/ticket/14365
*
* @param string $capability The capability used for the page, which is manage_options by default.
* @return string The capability to actually use.
*/

function optionsframework_page_capability( $capability ) {
return 'edit_theme_options';
}

/*
* Adds default options to the database if they aren't already present.
* May update this later to load only on plugin activation, or theme
Expand Down Expand Up @@ -165,16 +172,16 @@ function optionsframework_setdefaults() {
/* Add a subpage called "Theme Options" to the appearance menu. */

if ( !function_exists( 'optionsframework_add_page' ) ) {
function optionsframework_add_page() {

$of_page = add_theme_page(__('Techozoic Setting','techozoic'), __('Techozoic Setting','techozoic'), 'edit_theme_options', 'options-framework','optionsframework_page');

// Adds actions to hook in the required css and javascript
add_action("admin_print_styles-$of_page",'optionsframework_load_styles');
add_action("admin_print_scripts-$of_page", 'optionsframework_load_scripts');
function optionsframework_add_page() {
$of_page = add_theme_page('Techozoic Settings', 'Techozoic Settings', 'edit_theme_options', 'options-framework','optionsframework_page');

// Load the required CSS and javscript
add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
}

}
}

/* Loads the CSS */

Expand All @@ -185,15 +192,18 @@ function optionsframework_load_styles() {

/* Loads the javascript */

function optionsframework_load_scripts() {
function optionsframework_load_scripts($hook) {

// Inline scripts from options-interface.php
add_action('admin_head', 'of_admin_head');
if ( 'appearance_page_options-framework' != $hook )
return;

// Enqueued scripts
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'js/colorpicker.js', array('jquery'));
wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_DIRECTORY.'js/options-custom.js', array('jquery'));

// Inline scripts from options-interface.php
add_action('admin_head', 'of_admin_head');
}

function of_admin_head() {
Expand All @@ -215,25 +225,24 @@ function of_admin_head() {
*/

if ( !function_exists( 'optionsframework_page' ) ) {
function optionsframework_page() {
$options = optionsframework_options();
$return = optionsframework_fields();
settings_errors();
?>

function optionsframework_page() {
settings_errors();
?>

<div class="wrap">
<?php screen_icon( 'themes' ); ?>
<h2 class="nav-tab-wrapper">
<?php echo $return[1]; ?>
<?php echo optionsframework_tabs(); ?>
</h2>

<div class="metabox-holder">
<div id="optionsframework" class="postbox">
<form action="options.php" method="post">
<?php settings_fields('optionsframework'); ?>

<?php echo $return[0]; /* Settings */ ?>
<div id="optionsframework-submit">
<?php optionsframework_fields(); /* Settings */ ?>

<div id="optionsframework-submit">
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options','techozoic' ); ?>" />
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults','techozoic' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!','techozoic' ) ); ?>' );" />
<div class="clear"></div>
Expand All @@ -244,7 +253,7 @@ function optionsframework_page() {
</div> <!-- / .wrap -->

<?php
}
}
}

/**
Expand Down Expand Up @@ -376,9 +385,9 @@ function of_get_default_values() {
$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $prev_settings[$option['id']], $option);
}
} else{
$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
}
}
$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
}
}
if ($option['type'] == 'color' && $prev_settings) {
$output[$option['id']] = '#' . $prev_settings[$option['id']];
}
Expand All @@ -392,19 +401,17 @@ function of_get_default_values() {
/**
* Add Theme Options menu item to Admin Bar.
*/

add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );

function optionsframework_adminbar() {

global $wp_admin_bar;

$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'of_theme_options',
'parent' => 'appearance',
'id' => 'of_theme_options',
'title' => __( 'Techozoic Settings','techozoic' ),
'href' => admin_url( 'themes.php?page=options-framework' )
));
'href' => admin_url( 'themes.php?page=options-framework' )
));
}

if ( ! function_exists( 'of_get_option' ) ) {
Expand Down

0 comments on commit ee4ac30

Please sign in to comment.