Permalink
Browse files

update 1.5.1

  • Loading branch information...
2 parents aba0d5a + a2ce940 commit 52fda39586833e5cee39c9cae9d880ddcf6f1214 @Smartik89 Smartik89 committed Jun 4, 2013
Showing with 123 additions and 45 deletions.
  1. 0 admin/assets/css/admin-style.css
  2. 0 admin/assets/css/color-picker.min.css
  3. 0 admin/assets/css/jquery-ui-custom.css
  4. BIN admin/assets/images/1col.png
  5. BIN admin/assets/images/2-col-portfolio.png
  6. BIN admin/assets/images/2cl.png
  7. BIN admin/assets/images/2cr.png
  8. BIN admin/assets/images/3-col-portfolio.png
  9. BIN admin/assets/images/3cm.png
  10. BIN admin/assets/images/3cr.png
  11. BIN admin/assets/images/4-col-portfolio.png
  12. BIN admin/assets/images/accept.png
  13. BIN admin/assets/images/button_check.png
  14. BIN admin/assets/images/colorpicker/Thumbs.db
  15. BIN admin/assets/images/colorpicker/blank.gif
  16. BIN admin/assets/images/colorpicker/colorpicker_background.png
  17. BIN admin/assets/images/colorpicker/colorpicker_hex.png
  18. BIN admin/assets/images/colorpicker/colorpicker_hsb_b.png
  19. BIN admin/assets/images/colorpicker/colorpicker_hsb_h.png
  20. BIN admin/assets/images/colorpicker/colorpicker_hsb_s.png
  21. BIN admin/assets/images/colorpicker/colorpicker_indic.gif
  22. BIN admin/assets/images/colorpicker/colorpicker_overlay.png
  23. BIN admin/assets/images/colorpicker/colorpicker_rgb_b.png
  24. BIN admin/assets/images/colorpicker/colorpicker_rgb_g.png
  25. BIN admin/assets/images/colorpicker/colorpicker_rgb_r.png
  26. BIN admin/assets/images/colorpicker/colorpicker_select.gif
  27. BIN admin/assets/images/colorpicker/colorpicker_submit.png
  28. BIN admin/assets/images/colorpicker/select.png
  29. BIN admin/assets/images/dropdown-arrow.png
  30. BIN admin/assets/images/favicon.ico
  31. BIN admin/assets/images/handle.png
  32. BIN admin/assets/images/icon-add.png
  33. BIN admin/assets/images/icon-backup.png
  34. BIN admin/assets/images/icon-delete.png
  35. BIN admin/assets/images/icon-docs.png
  36. BIN admin/assets/images/icon-edit.png
  37. BIN admin/assets/images/icon-home.png
  38. BIN admin/assets/images/icon-info.png
  39. BIN admin/assets/images/icon-notice.png
  40. BIN admin/assets/images/icon-paint.png
  41. BIN admin/assets/images/icon-settings.png
  42. BIN admin/assets/images/icon-slider.png
  43. BIN admin/assets/images/icon-warn.png
  44. BIN admin/assets/images/icon_option.png
  45. BIN admin/assets/images/loading-bottom.gif
  46. BIN admin/assets/images/select.png
  47. BIN admin/assets/images/sign_warning.png
  48. BIN admin/assets/images/slider-control.png
  49. BIN admin/assets/images/stop.png
  50. BIN admin/assets/images/switch.gif
  51. BIN admin/assets/images/toggle_tabs.png
  52. BIN admin/assets/images/ui-bg_flat_0_aaaaaa_40x100.png
  53. BIN admin/assets/images/warning.png
  54. BIN admin/assets/images/wrench.png
  55. BIN admin/assets/images/wrench16.png
  56. 0 admin/assets/js/color-picker.min.js
  57. 0 admin/assets/js/cookie.js
  58. 0 admin/assets/js/iris.min.js
  59. 0 admin/assets/js/jquery.maskedinput-1.2.2.js
  60. 0 admin/assets/js/jquery.tipsy.js
  61. +2 −1 admin/assets/js/smof.js
  62. +47 −19 admin/classes/class.options_machine.php
  63. 0 admin/front-end/options.php
  64. +45 −15 admin/functions/functions.admin.php
  65. +1 −1 admin/functions/functions.filters.php
  66. +27 −8 admin/functions/functions.interface.php
  67. 0 admin/functions/functions.load.php
  68. 0 admin/functions/functions.options.php
  69. 0 admin/functions/functions.php
  70. +1 −1 admin/index.php
  71. 0 admin/layouts/default.css
  72. 0 admin/layouts/placebo.css
View
No changes.
View
No changes.
View
No changes.
View
0 admin/assets/images/1col.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 admin/assets/images/2cl.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 admin/assets/images/2cr.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 admin/assets/images/3cm.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 admin/assets/images/3cr.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
No changes.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
No changes.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
0 admin/assets/images/stop.png 100644 → 100755
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
No changes.
View
0 admin/assets/js/cookie.js 100644 → 100755
No changes.
View
0 admin/assets/js/iris.min.js 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
3 admin/assets/js/smof.js 100644 → 100755
@@ -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');
});
View
@@ -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) {
@@ -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;
@@ -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;
@@ -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 {
@@ -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') {
@@ -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);
View
0 admin/front-end/options.php 100644 → 100755
No changes.
@@ -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
+ ));
+
+
}
/**
@@ -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;
}
@@ -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
+ ));
+
}
@@ -124,5 +153,6 @@ function of_save_options($data, $key = "")
* @since forever
*/
-$data = of_get_options();
+
$smof_data = of_get_options();
+$data = $smof_data;
View
@@ -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(
View
@@ -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
+ ));
}
/**
@@ -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' );
@@ -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');
}
@@ -122,6 +137,8 @@ function of_load_only()
if ( function_exists( 'wp_enqueue_media' ) )
wp_enqueue_media();
+ do_action('of_load_only_after');
+
}
/**
@@ -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');
}
@@ -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
}
View
No changes.
View
No changes.
View
No changes.
View
@@ -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');
View
0 admin/layouts/default.css 100644 → 100755
No changes.
View
0 admin/layouts/placebo.css 100644 → 100755
No changes.

0 comments on commit 52fda39

Please sign in to comment.