Skip to content

Commit 4aa407d

Browse files
committed
code format, cleanup
Signed-off-by:KProvance <[email protected]>
1 parent 7794fd7 commit 4aa407d

File tree

13 files changed

+1378
-1629
lines changed

13 files changed

+1378
-1629
lines changed

ReduxCore/assets/js/redux.js

Lines changed: 245 additions & 210 deletions
Large diffs are not rendered by default.

ReduxCore/extensions/customizer/extension_customizer.php

Lines changed: 436 additions & 448 deletions
Large diffs are not rendered by default.

ReduxCore/inc/class.redux_helpers.php

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
// Exit if accessed directly
4-
if( !defined( 'ABSPATH' ) ) exit;
4+
if( !defined( 'ABSPATH' ) ) {
5+
exit;
6+
}
57

68
// Don't duplicate me!
79
if( !class_exists( 'Redux_Helpers' ) ) {
@@ -19,39 +21,39 @@ public static function tabFromField($parent, $field) {
1921
foreach( $parent->sections as $k => $section ) {
2022
if ( !isset( $section['title'] ) ){
2123
continue;
22-
}
23-
24+
}
25+
2426
if ( isset( $section['fields'] ) && !empty( $section['fields'] ) ) {
2527
if ( Redux_Helpers::recursive_array_search($field, $section['fields'])) {
2628
return $k;
2729
continue;
2830
}
29-
}
30-
}
31-
}
32-
31+
}
32+
}
33+
}
34+
3335
public static function isFieldInUse($parent, $field) {
3436
foreach( $parent->sections as $k => $section ) {
3537
if ( !isset( $section['title'] ) ){
3638
continue;
37-
}
38-
39+
}
40+
3941
if ( isset( $section['fields'] ) && !empty( $section['fields'] ) ) {
4042
if ( Redux_Helpers::recursive_array_search($field, $section['fields'])) {
4143
return true;
4244
continue;
4345
}
44-
}
45-
}
46+
}
47+
}
4648
}
47-
49+
4850
public static function isParentTheme($file) {
4951
if (strpos(self::cleanFilePath($file), self::cleanFilePath(get_template_directory())) !== false) {
5052
return true;
51-
}
53+
}
5254
return false;
5355
}
54-
56+
5557
public static function isChildTheme($file) {
5658
if (strpos(self::cleanFilePath($file), self::cleanFilePath(get_stylesheet_directory())) !== false) {
5759
return true;
@@ -62,14 +64,14 @@ public static function isChildTheme($file) {
6264
private static function reduxAsPlugin() {
6365
return ReduxFramework::$_as_plugin;
6466
}
65-
67+
6668
public static function isTheme ($file) {
6769
if (true == self::isChildTheme($file) || true == self::isParentTheme($file)) {
6870
return true;
6971
}
7072
return false;
7173
}
72-
74+
7375
public static function array_in_array($needle, $haystack) {
7476
//Make sure $needle is an array for foreach
7577
if (!is_array($needle)) {
@@ -84,16 +86,16 @@ public static function array_in_array($needle, $haystack) {
8486
//Return FALSE if none of the values from $needle are found in $haystack
8587
return false;
8688
}
87-
89+
8890
public static function recursive_array_search($needle, $haystack) {
8991
foreach($haystack as $key => $value) {
9092
if($needle === $value || (is_array($value) && self::recursive_array_search($needle, $value) !== false)) {
9193
return true;
9294
}
9395
}
9496
return false;
95-
}
96-
97+
}
98+
9799
/**
98100
* Take a path and return it clean
99101
* @param string $path
@@ -112,7 +114,7 @@ public static function cleanFilePath( $path ) {
112114
*
113115
* Takes the color hex value and converts to a rgba.
114116
*
115-
* @since ReduxFramework 3.0.4
117+
* @since ReduxFramework 3.0.4
116118
*/
117119
public static function hex2rgba($hex, $alpha = '') {
118120
$hex = str_replace("#", "", $hex);
@@ -125,14 +127,14 @@ public static function hex2rgba($hex, $alpha = '') {
125127
$g = hexdec(substr($hex,2,2));
126128
$b = hexdec(substr($hex,4,2));
127129
}
128-
$rgb = $r.','.$g.','.$b;
129-
130+
$rgb = $r.','.$g.','.$b;
131+
130132
if ('' == $alpha) {
131133
return $rgb;
132134
} else {
133135
$alpha = floatval($alpha);
134136
return 'rgba(' . $rgb . ',' . $alpha . ')';
135137
}
136-
}
138+
}
137139
}
138140
}

ReduxCore/inc/class.redux_instances.php

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,66 @@
44
* Redux Framework Instance Container Class
55
*
66
* Automatically captures and stores all instances
7-
* of ReduxFramework at instantiation.
8-
*
7+
* of ReduxFramework at instantiation.
8+
*
99
* @package Redux_Framework
1010
* @subpackage Core
1111
*/
12-
class ReduxFrameworkInstances
13-
{
14-
/**
15-
* ReduxFrameworkInstances
16-
* @var object
17-
*/
18-
private static $instance;
19-
/**
20-
* ReduxFramework instances
21-
* @var array
22-
*/
23-
private static $instances;
12+
class ReduxFrameworkInstances {
13+
14+
/**
15+
* ReduxFrameworkInstances
16+
* @var object
17+
*/
18+
private static $instance;
2419

25-
/**
26-
* Get Instance
27-
*
28-
* Get ReduxFrameworkInstances instance
29-
* OR an instance of ReduxFramework by [opt_name]
30-
*
31-
* @param string $opt_name the defined opt_name
32-
* @return object class instance
33-
*/
34-
public static function get_instance( $opt_name = false ) {
20+
/**
21+
* ReduxFramework instances
22+
* @var array
23+
*/
24+
private static $instances;
3525

36-
if ( is_null( self::$instance ) )
37-
self::$instance = new self();
26+
/**
27+
* Get Instance
28+
*
29+
* Get ReduxFrameworkInstances instance
30+
* OR an instance of ReduxFramework by [opt_name]
31+
*
32+
* @param string $opt_name the defined opt_name
33+
* @return object class instance
34+
*/
35+
public static function get_instance($opt_name = false) {
3836

39-
if ( $opt_name && !empty( self::$instances[ $opt_name ] ) ) {
40-
return self::$instances[ $opt_name ];
41-
}
37+
if (is_null(self::$instance))
38+
self::$instance = new self();
4239

43-
return self::$instance;
44-
}
40+
if ($opt_name && !empty(self::$instances[$opt_name])) {
41+
return self::$instances[$opt_name];
42+
}
4543

46-
/**
47-
* Get all instantiated ReduxFramework instances (so far)
48-
* @return [type] [description]
49-
*/
50-
public static function get_all_instances() {
51-
return self::$instances;
52-
}
44+
return self::$instance;
45+
}
5346

54-
private function __construct() {
55-
add_action( 'redux/construct', array( $this, 'capture' ), 5, 1 );
56-
}
47+
/**
48+
* Get all instantiated ReduxFramework instances (so far)
49+
* @return [type] [description]
50+
*/
51+
public static function get_all_instances() {
52+
return self::$instances;
53+
}
5754

58-
function capture( $ReduxFramework ) {
59-
$this->store( $ReduxFramework );
60-
}
55+
private function __construct() {
56+
add_action('redux/construct', array($this, 'capture'), 5, 1);
57+
}
6158

62-
private function store( $ReduxFramework ) {
59+
function capture($ReduxFramework) {
60+
$this->store($ReduxFramework);
61+
}
6362

64-
if ( $ReduxFramework instanceof ReduxFramework ) {
65-
$key = $ReduxFramework->args['opt_name'];
66-
self::$instances[ $key ] = $ReduxFramework;
67-
}
68-
}
69-
}
63+
private function store($ReduxFramework) {
64+
if ($ReduxFramework instanceof ReduxFramework) {
65+
$key = $ReduxFramework->args['opt_name'];
66+
self::$instances[$key] = $ReduxFramework;
67+
}
68+
}
69+
}

ReduxCore/inc/debug.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
*/
2323

2424
// Exit if accessed directly
25-
if( !defined( 'ABSPATH' ) ) exit;
25+
if( !defined( 'ABSPATH' ) ) {
26+
exit;
27+
}
2628

2729
if( !class_exists( 'ReduxDebugObject' ) ) {
2830

@@ -34,8 +36,8 @@
3436
class ReduxDebugObject {
3537
public function __construct($parent) {
3638
$this->parent = $parent;
37-
}
38-
39+
}
40+
3941
public function render() {
4042
echo '<div id="dev_mode_default_section_group' . '" class="redux-group-tab">';
4143
echo '<h3>' . __( 'Options Object', 'redux-framework' ) . '</h3>';
@@ -55,7 +57,7 @@ public function render() {
5557

5658
echo '</div>';
5759
}
58-
60+
5961
public function render_tab() {
6062
echo '<li id="dev_mode_default_section_group_li" class="redux-group-tab-link-li">';
6163

@@ -69,7 +71,7 @@ public function render_tab() {
6971
echo '<a href="javascript:void(0);" id="dev_mode_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="dev_mode_default">' . $icon . ' <span class="group_title">' . __( 'Options Object', 'redux-framework' ) . '</span></a>';
7072
echo '</li>';
7173
}
72-
74+
7375
public function add_submenu() {
7476
add_submenu_page(
7577
$this->parent->args['page_slug'],
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.redux-container-text {
2-
label {
3-
float: left;
4-
display: block;
5-
line-height: 28px;
6-
min-width: 100px;
7-
}
2+
label {
3+
float: left;
4+
display: block;
5+
line-height: 28px;
6+
min-width: 100px;
7+
}
88
}

0 commit comments

Comments
 (0)