26
26
// Don't duplicate me!
27
27
if ( !class_exists ( 'ReduxFramework ' ) ) {
28
28
29
- define ('REDUX_VERSION ' , '3.0.3 ' );
29
+ define ('REDUX_VERSION ' , '3.0.4 ' );
30
30
31
31
// Windows-proof constants: replace backward by forward slashes
32
32
// Thanks to: https://github.com/peterbouwmeester
@@ -115,8 +115,7 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
115
115
$ defaults ['show_import_export ' ] = true ;
116
116
$ defaults ['dev_mode ' ] = false ;
117
117
$ defaults ['system_info ' ] = false ;
118
- $ defaults ['admin_stylesheet ' ] = 'standard ' ;
119
- $ defaults ['footer_credit ' ] = '<span id="footer-thankyou"> ' . __ ( 'Options panel created using ' , 'redux-framework ' ) . '<a href=" ' . $ this ->framework_url . '" target="_blank"> ' . __ ('Redux Framework ' , 'redux-framework ' ) . '</a> v ' . $ this ->framework_version . '</span> ' ;
118
+ $ defaults ['footer_credit ' ] = '<span id="footer-thankyou"> ' . __ ( 'Options panel created using ' , 'redux-framework ' ) . ' <a href=" ' . $ this ->framework_url . '" target="_blank"> ' . __ ('Redux Framework ' , 'redux-framework ' ) . '</a> v ' . $ this ->framework_version . '</span> ' ;
120
119
$ defaults ['help_tabs ' ] = array ();
121
120
$ defaults ['help_sidebar ' ] = '' ; // __( '', 'redux-framework' );
122
121
$ defaults ['database ' ] = '' ; // possible: options, theme_mods, theme_mods_expanded, transient
@@ -153,6 +152,9 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
153
152
154
153
$ this ->extra_tabs = $ extra_tabs ;
155
154
155
+ // Options page
156
+ add_action ( 'admin_menu ' , array ( &$ this , '_internationalization ' ) );
157
+
156
158
// Set option with defaults
157
159
add_action ( 'init ' , array ( &$ this , '_set_default_options ' ) );
158
160
@@ -173,6 +175,10 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
173
175
174
176
}
175
177
178
+ public function _internationalization () {
179
+ load_plugin_textdomain ('redux-framework ' , false , basename ( dirname ( __FILE__ ) ) . '/languages ' );
180
+ }
181
+
176
182
public function get_instance () {
177
183
return $ this ->instance ;
178
184
}
@@ -736,9 +742,9 @@ public function _enqueue_output() {
736
742
public function _enqueue () {
737
743
global $ wp_styles ;
738
744
739
- wp_enqueue_script ('jquery ' );
740
- wp_enqueue_script ('jquery-ui-core ' );
741
-
745
+ wp_enqueue_script ('jquery ' );
746
+ wp_enqueue_script ('jquery-ui-core ' );
747
+ add_thickbox ();
742
748
743
749
wp_register_style (
744
750
'redux-css ' ,
@@ -785,11 +791,7 @@ public function _enqueue() {
785
791
786
792
wp_enqueue_style ( 'redux-lte-ie8 ' );
787
793
788
- if ( $ this ->args ['admin_stylesheet ' ] == 'standard ' ) {
789
- wp_enqueue_style ( 'redux-css ' );
790
- } elseif ( $ this ->args ['admin_stylesheet ' ] == 'custom ' ) {
791
- wp_enqueue_style ( 'redux-custom-css ' );
792
- }
794
+ wp_enqueue_style ( 'redux-css ' );
793
795
794
796
wp_enqueue_style ( 'redux-elusive-icon ' );
795
797
wp_enqueue_style ( 'redux-elusive-icon-ie7 ' );
@@ -1059,11 +1061,15 @@ public function _register_setting() {
1059
1061
if ( isset ( $ field ['title ' ] ) && isset ( $ field ['type ' ] ) && $ field ['type ' ] !== "info " && $ field ['type ' ] !== "group " ) {
1060
1062
$ default_mark = ( !empty ($ field ['default ' ]) && isset ($ this ->options [$ field ['id ' ]]) && $ this ->options [$ field ['id ' ]] == $ field ['default ' ] && !empty ( $ this ->args ['default_mark ' ] ) && isset ( $ field ['default ' ] ) ) ? $ this ->args ['default_mark ' ] : '' ;
1061
1063
if (!empty ($ field ['title ' ])) {
1062
- $ th = $ field ['title ' ] . $ default_mark ;
1064
+ $ th = $ field ['title ' ] . $ default_mark. "" ;
1063
1065
}
1066
+
1064
1067
if ( isset ( $ field ['subtitle ' ] ) ) {
1065
1068
$ th .= '<span class="description"> ' . $ field ['subtitle ' ] . '</span> ' ;
1066
1069
}
1070
+
1071
+
1072
+
1067
1073
}
1068
1074
if (!isset ($ field ['id ' ])) {
1069
1075
print_r ($ field );
@@ -1128,6 +1134,11 @@ public function _register_setting() {
1128
1134
}
1129
1135
$ this ->sections [$ k ]['fields ' ][$ fieldk ] = $ field ;
1130
1136
1137
+ if ( isset ( $ this ->args ['display_source ' ] ) ) {
1138
+ $ th .= '<div id=" ' .$ field ['id ' ].'-settings" style="display:none;"><pre> ' .var_export ($ this ->sections [$ k ]['fields ' ][$ fieldk ], true ).'</pre></div> ' ;
1139
+ $ th .= '<br /><a href="#TB_inline?width=600&height=800&inlineId= ' .$ field ['id ' ].'-settings" class="thickbox"><small>View Source</small></a> ' ;
1140
+ }
1141
+
1131
1142
add_settings_field ( $ fieldk . '_field ' , $ th , array ( &$ this , '_field_input ' ), $ this ->args ['opt_name ' ] . $ k . '_section_group ' , $ this ->args ['opt_name ' ] . $ k . '_section ' , $ field ); // checkbox
1132
1143
}
1133
1144
}
@@ -1427,7 +1438,7 @@ public function _options_page_html() {
1427
1438
echo '<div id="info_bar"> ' ;
1428
1439
echo '<a href="javascript:void(0);" id="expand_options"> ' . __ ( 'Expand ' , 'redux-framework ' ) . '</a> ' ;
1429
1440
echo '<div class="redux-action_bar"> ' ;
1430
- submit_button ( '' , 'primary ' , 'redux_save ' , false );
1441
+ submit_button ( __ ( ' Save Changes ' , ' redux-framework ' ) , 'primary ' , 'redux_save ' , false );
1431
1442
echo ' ' ;
1432
1443
submit_button ( __ ( 'Reset to Defaults ' , 'redux-framework ' ), 'secondary ' , $ this ->args ['opt_name ' ] . '[defaults] ' , false );
1433
1444
echo '</div> ' ;
@@ -1684,7 +1695,7 @@ public function _options_page_html() {
1684
1695
}
1685
1696
1686
1697
echo '<div class="redux-action_bar"> ' ;
1687
- submit_button ( '' , 'primary ' , 'redux_save ' , false );
1698
+ submit_button ( __ ( ' Save Changes ' , ' redux-framework ' ) , 'primary ' , 'redux_save ' , false );
1688
1699
echo ' ' ;
1689
1700
submit_button ( __ ( 'Reset to Defaults ' , 'redux-framework ' ), 'secondary ' , $ this ->args ['opt_name ' ] . '[defaults] ' , false );
1690
1701
echo '</div> ' ;
0 commit comments