Skip to content
This repository has been archived by the owner on Mar 17, 2018. It is now read-only.

Commit

Permalink
update 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
awps committed Jun 4, 2013
2 parents aba0d5a + a2ce940 commit 52fda39
Show file tree
Hide file tree
Showing 72 changed files with 123 additions and 45 deletions.
Empty file modified admin/assets/css/admin-style.css
100644 → 100755
Empty file.
Empty file modified admin/assets/css/color-picker.min.css
100644 → 100755
Empty file.
Empty file modified admin/assets/css/jquery-ui-custom.css
100644 → 100755
Empty file.
Empty file modified admin/assets/images/1col.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/2-col-portfolio.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/2cl.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/2cr.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/3-col-portfolio.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/3cm.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/3cr.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/4-col-portfolio.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/accept.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/button_check.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/Thumbs.db
100644 → 100755
Empty file.
Empty file modified admin/assets/images/colorpicker/blank.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_background.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_hex.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_hsb_b.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_hsb_h.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_hsb_s.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_indic.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_overlay.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_rgb_b.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_rgb_g.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_rgb_r.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_select.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/colorpicker_submit.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/colorpicker/select.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/dropdown-arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified admin/assets/images/favicon.ico
100644 → 100755
Empty file.
Empty file modified admin/assets/images/handle.png
100644 → 100755
Empty file modified admin/assets/images/icon-add.png
100644 → 100755
Empty file modified admin/assets/images/icon-backup.png
100644 → 100755
Empty file modified admin/assets/images/icon-delete.png
100644 → 100755
Empty file modified admin/assets/images/icon-docs.png
100644 → 100755
Empty file modified admin/assets/images/icon-edit.png
100644 → 100755
Empty file modified admin/assets/images/icon-home.png
100644 → 100755
Empty file modified admin/assets/images/icon-info.png
100644 → 100755
Empty file modified admin/assets/images/icon-notice.png
100644 → 100755
Empty file modified admin/assets/images/icon-paint.png
100644 → 100755
Empty file modified admin/assets/images/icon-settings.png
100644 → 100755
Empty file modified admin/assets/images/icon-slider.png
100644 → 100755
Empty file modified admin/assets/images/icon-warn.png
100644 → 100755
Empty file modified admin/assets/images/icon_option.png
100644 → 100755
Empty file modified admin/assets/images/loading-bottom.gif
100644 → 100755
Empty file modified admin/assets/images/select.png
100644 → 100755
Empty file modified admin/assets/images/sign_warning.png
100644 → 100755
Empty file modified admin/assets/images/slider-control.png
100644 → 100755
Empty file modified admin/assets/images/stop.png
100644 → 100755
Empty file modified admin/assets/images/switch.gif
100644 → 100755
Empty file modified admin/assets/images/toggle_tabs.png
100644 → 100755
Empty file modified admin/assets/images/ui-bg_flat_0_aaaaaa_40x100.png
100644 → 100755
Empty file modified admin/assets/images/warning.png
100644 → 100755
Empty file modified admin/assets/images/wrench.png
100644 → 100755
Empty file modified admin/assets/images/wrench16.png
100644 → 100755
Empty file modified admin/assets/js/color-picker.min.js
100644 → 100755
Empty file.
Empty file modified admin/assets/js/cookie.js
100644 → 100755
Empty file.
Empty file modified admin/assets/js/iris.min.js
100644 → 100755
Empty file.
Empty file modified admin/assets/js/jquery.maskedinput-1.2.2.js
100644 → 100755
Empty file.
Empty file modified admin/assets/js/jquery.tipsy.js
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion admin/assets/js/smof.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ jQuery(document).ready(function($){
var newSlide = '<li class="temphide"><div class="slide_header"><strong>Slide ' + newNum + '</strong><input type="hidden" class="slide of-input order" name="' + sliderId + '[' + newNum + '][order]" id="' + sliderId + '_slide_order-' + newNum + '" value="' + newNum + '"><a class="slide_edit_button" href="#">Edit</a></div><div class="slide_body" style="display: none; "><label>Title</label><input class="slide of-input of-slider-title" name="' + sliderId + '[' + newNum + '][title]" id="' + sliderId + '_' + newNum + '_slide_title" value=""><label>Image URL</label><input class="upload slide of-input" name="' + sliderId + '[' + newNum + '][url]" id="' + sliderId + '_' + newNum + '_slide_url" value=""><div class="upload_button_div"><span class="button media_upload_button" id="' + sliderId + '_' + newNum + '">Upload</span><span class="button remove-image hide" id="reset_' + sliderId + '_' + newNum + '" title="' + sliderId + '_' + newNum + '">Remove</span></div><div class="screenshot"></div><label>Link URL (optional)</label><input class="slide of-input" name="' + sliderId + '[' + newNum + '][link]" id="' + sliderId + '_' + newNum + '_slide_link" value=""><label>Description (optional)</label><textarea class="slide of-input" name="' + sliderId + '[' + newNum + '][description]" id="' + sliderId + '_' + newNum + '_slide_description" cols="8" rows="8"></textarea><a class="slide_delete_button" href="#">Delete</a><div class="clear"></div></div></li>';

slidesContainer.append(newSlide);
$('.temphide').fadeIn('fast', function() {
var nSlide = slidesContainer.find('.temphide');
nSlide.fadeIn('fast', function() {
$(this).removeClass('temphide');
});

Expand Down
66 changes: 47 additions & 19 deletions admin/classes/class.options_machine.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@ function sanitize_option( $value ) {
*/
public static function optionsframework_machine($options) {

$data = of_get_options();
$smof_data = of_get_options();

$data = $smof_data;

$defaults = array();
$counter = 0;
$menu = '';
$output = '';

do_action('optionsframework_machine_before', array(
'options' => $options,
'smof_data' => $smof_data,
));

foreach ($options as $value) {

Expand Down Expand Up @@ -146,8 +150,12 @@ public static function optionsframework_machine($options) {
if($value['mod'] == 'mini') { $mini = 'mini';}
$output .= '<div class="select_wrapper ' . $mini . '">';
$output .= '<select class="select of-input" name="'.$value['id'].'" id="'. $value['id'] .'">';
foreach ($value['options'] as $select_ID => $option) {
$output .= '<option id="' . $select_ID . '" value="'.$option.'" ' . selected($smof_data[$value['id']], $option, false) . ' />'.$option.'</option>';

foreach ($value['options'] as $select_ID => $option) {
$theValue = $option;
if (!is_numeric($select_ID))
$theValue = $select_ID;
$output .= '<option id="' . $select_ID . '" value="'.$theValue.'" ' . selected($smof_data[$value['id']], $option, false) . ' />'.$option.'</option>';
}
$output .= '</select></div>';
break;
Expand Down Expand Up @@ -454,21 +462,21 @@ public static function optionsframework_machine($options) {

$i = 0;
$select_value = isset($smof_data[$value['id']]) && !empty($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';

foreach ($value['options'] as $key => $option)
{
$i++;

$checked = '';
$selected = '';
if(NULL!=checked($select_value, $option, false)) {
$checked = checked($select_value, $option, false);
$selected = 'of-radio-tile-selected';
if (is_array($value['options'])) {
foreach ($value['options'] as $key => $option) {
$i++;

$checked = '';
$selected = '';
if(NULL!=checked($select_value, $option, false)) {
$checked = checked($select_value, $option, false);
$selected = 'of-radio-tile-selected';
}
$output .= '<span>';
$output .= '<input type="radio" id="of-radio-tile-' . $value['id'] . $i . '" class="checkbox of-radio-tile-radio" value="'.$option.'" name="'.$value['id'].'" '.$checked.' />';
$output .= '<div class="of-radio-tile-img '. $selected .'" style="background: url('.$option.')" onClick="document.getElementById(\'of-radio-tile-'. $value['id'] . $i.'\').checked = true;"></div>';
$output .= '</span>';
}
$output .= '<span>';
$output .= '<input type="radio" id="of-radio-tile-' . $value['id'] . $i . '" class="checkbox of-radio-tile-radio" value="'.$option.'" name="'.$value['id'].'" '.$checked.' />';
$output .= '<div class="of-radio-tile-img '. $selected .'" style="background: url('.$option.')" onClick="document.getElementById(\'of-radio-tile-'. $value['id'] . $i.'\').checked = true;"></div>';
$output .= '</span>';
}

break;
Expand All @@ -478,7 +486,9 @@ public static function optionsframework_machine($options) {

$instructions = $value['desc'];
$backup = of_get_options(BACKUPS);

$init = of_get_options('smof_init');


if(!isset($backup['backup_log'])) {
$log = 'No backups yet';
} else {
Expand Down Expand Up @@ -617,6 +627,15 @@ public static function optionsframework_machine($options) {
break;

}

do_action('optionsframework_machine_loop', array(
'options' => $options,
'smof_data' => $smof_data,
'defaults' => $defaults,
'counter' => $counter,
'menu' => $menu,
'output' => $output
));

//description of each option
if ( $value['type'] != 'heading') {
Expand All @@ -632,6 +651,15 @@ public static function optionsframework_machine($options) {
}

$output .= '</div>';

do_action('optionsframework_machine_after', array(
'options' => $options,
'smof_data' => $smof_data,
'defaults' => $defaults,
'counter' => $counter,
'menu' => $menu,
'output' => $output
));

return array($output,$menu,$defaults);

Expand Down
Empty file modified admin/front-end/options.php
100644 → 100755
Empty file.
60 changes: 45 additions & 15 deletions admin/functions/functions.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,23 @@ function of_head() { do_action( 'of_head' ); }
*/
function of_option_setup()
{
global $of_options, $options_machine;
global $of_options, $options_machine, $smof_data;
do_action('of_option_setup_before', array(
'of_options'=>$of_options, 'options_machine'=>$options_machine, 'smof_data'=>$smof_data
));
$options_machine = new Options_Machine($of_options);

if (!of_get_options())
{

if (empty($smof_data) || !isset($smof_data['smof_init'])) { // Let's set the values if the theme's already been active
of_save_options($options_machine->Defaults);
of_save_options(date('r'), 'smof_init');
$smof_data = of_get_options();
$data = $smof_data;
}
do_action('of_option_setup_after', array(
'of_options'=>$of_options, 'options_machine'=>$options_machine, 'smof_data'=>$smof_data
));


}

/**
Expand Down Expand Up @@ -80,18 +90,23 @@ function of_get_header_classes_array()
* @return array
*/
function of_get_options($key = null, $data = null) {
<<<<<<< HEAD

if ($key != "") { // Get one specific value
=======
do_action('of_get_options_before', array(
'key'=>$key, 'data'=>$data
));
if ($key != null) { // Get one specific value
>>>>>>> a2ce9408a41e403d69ca51769c068974e3e4eec6
$data = get_theme_mod($key, $data);
} else { // Get all values
$data = get_theme_mods();
}

if (empty($data)) { // Let's check to make sure this isn't empty
//$data = of_save_options($options_machine->Defaults);
}
$data = apply_filters('of_options_after_load', $data);

do_action('of_option_setup_before', array(
'key'=>$key, 'data'=>$data
));
return $data;

}
Expand All @@ -105,16 +120,30 @@ function of_get_options($key = null, $data = null) {
* @uses update_option()
* @return void
*/
function of_save_options($data, $key = "")
{
function of_save_options($data, $key = null) {
global $smof_data;
if (empty($data))
return;
do_action('of_save_options_before', array(
'key'=>$key, 'data'=>$data
));
$data = apply_filters('of_options_before_save', $data);
if ($key != "") { // Update one specific value
if ($key != null) { // Update one specific value
if ($key == BACKUPS) {
unset($data['smof_init']); // Don't want to change this.
}
set_theme_mod($key, $data);
} else { // Update all values in $data
foreach ( $data as $k=>$v ) {
set_theme_mod($k, $v);
}
if ($smof_data[$k] != $v || !isset($smof_data[$k])) { // Only write to the DB when we need to
set_theme_mod($k, $v);
}
}
}
do_action('of_save_options_after', array(
'key'=>$key, 'data'=>$data
));

}


Expand All @@ -124,5 +153,6 @@ function of_save_options($data, $key = "")
* @since forever
*/

$data = of_get_options();

$smof_data = of_get_options();
$data = $smof_data;
2 changes: 1 addition & 1 deletion admin/functions/functions.filters.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @return array
*/
function of_filter_save_media_upload($data) {

if(!is_array($data)) return $data;
foreach ($data as $key => $value) {
if (is_string($value)) {
$data[$key] = str_replace(
Expand Down
35 changes: 27 additions & 8 deletions admin/functions/functions.interface.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,26 @@
function optionsframework_admin_init()
{
// Rev up the Options Machine
global $of_options, $options_machine;
global $of_options, $options_machine, $smof_data, $data;
$options_machine = new Options_Machine($of_options);
$smof_data = of_get_options();
$data = $smof_data;
do_action('optionsframework_admin_init_before', array(
'of_options' => $of_options,
'options_machine' => $options_machine,
'smof_data' => $smof_data
));
if (empty($smof_data['smof_init'])) { // Let's set the values if the theme's already been active
of_save_options($options_machine->Defaults);
of_save_options(date('r'), 'smof_init');
$smof_data = of_get_options();
$options_machine = new Options_Machine($of_options);
}
do_action('optionsframework_admin_init_after', array(
'of_options' => $of_options,
'options_machine' => $options_machine,
'smof_data' => $smof_data
));
}

/**
Expand Down Expand Up @@ -56,11 +74,7 @@ function optionsframework_options_page(){
$smof_data = of_get_options();
print_r($smof_data);
*/

if (empty($smof_data)) { // Let's set the values if the theme's already been active
of_save_options($options_machine->Defaults);
$smof_data = of_get_options();
}


include_once( ADMIN_PATH . 'front-end/options.php' );

Expand All @@ -82,6 +96,7 @@ function of_style_only(){
wp_register_style( 'wp-color-picker', ADMIN_DIR . 'assets/css/color-picker.min.css' );
}
wp_enqueue_style( 'wp-color-picker' );
do_action('of_style_only_after');

}

Expand Down Expand Up @@ -122,6 +137,8 @@ function of_load_only()
if ( function_exists( 'wp_enqueue_media' ) )
wp_enqueue_media();

do_action('of_load_only_after');

}

/**
Expand Down Expand Up @@ -244,10 +261,10 @@ function of_ajax_callback()
}
elseif($save_type == 'import_options'){


$smof_data = unserialize(base64_decode($_POST['data'])); //100% safe - ignore theme check nag
unset($smof_data['smof_init']);
of_save_options($smof_data);

$smof_data = of_get_options();

die('1');
}
Expand All @@ -264,7 +281,9 @@ function of_ajax_callback()
}
elseif ($save_type == 'reset')
{

of_save_options($options_machine->Defaults);
of_save_options(date('r'), 'smof_init');

die('1'); //options reset
}
Expand Down
Empty file modified admin/functions/functions.load.php
100644 → 100755
Empty file.
Empty file modified admin/functions/functions.options.php
100644 → 100755
Empty file.
Empty file modified admin/functions/functions.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
*
* @since 1.0.0
*/
if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) add_action('admin_head','of_option_setup');
//if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) add_action('admin_head','of_option_setup');
add_action('admin_head', 'optionsframework_admin_message');
add_action('admin_init','optionsframework_admin_init');
add_action('admin_menu', 'optionsframework_add_admin');
Expand Down
Empty file modified admin/layouts/default.css
100644 → 100755
Empty file.
Empty file modified admin/layouts/placebo.css
100644 → 100755
Empty file.

0 comments on commit 52fda39

Please sign in to comment.