Completed
Push — master ( 8d9355...4de7f8 )
by
unknown
01:45
created
admin/includes/menus/settings.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		if ( !is_user_logged_in() )
99 99
 			return;
100 100
         
101
-        // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
101
+		// check for lasso story engine and add a class doniting this
102
+		$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103 103
 
104 104
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105 105
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111 111
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112 112
 		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
113
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114 114
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115 115
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116 116
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136 136
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
137 137
         
138
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
138
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
140 140
 		// do we support pending status
141 141
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 			$insert_comp_ui = 'drag';
148 148
 		}
149 149
         
150
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
150
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
154 154
 
155 155
 ?>
156 156
 		<div class="wrap">
Please login to merge, or discard this patch.
lasso.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
63 63
 
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
110
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
-        if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
109
+	public function __construct(){
110
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
+		if ($add_table) {
112
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
113 113
             
114
-        }
114
+		}
115 115
 	}
116 116
     
117
-    function scripts()
118
-    {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
-    }
117
+	function scripts()
118
+	{
119
+		add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
+			add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
+			wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
+			wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
+	}
125 125
     
126
-    function editus_table_edit_menu()
127
-    { ?>
126
+	function editus_table_edit_menu()
127
+	{ ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130 130
           <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
@@ -134,31 +134,31 @@  discard block
 block discarded – undo
134 134
           <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
135 135
         </ul>
136 136
     <?php
137
-    }
137
+	}
138 138
     
139 139
     
140
-    function editus_html_table()
141
-    {   
142
-        return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
-    }
140
+	function editus_html_table()
141
+	{   
142
+		return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
+	}
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
147
-        $custom = array(
148
-               'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
150
-                          'content' => self::editus_html_table(),
151
-                )
152
-        );
153
-        return array_merge( $array, $custom );
154
-    }
146
+	function editus_components_add_table( $array ){
147
+		$custom = array(
148
+			   'htmltable' => array(
149
+						 'name'    => __('HTML Table','lasso'),
150
+						  'content' => self::editus_html_table(),
151
+				)
152
+		);
153
+		return array_merge( $array, $custom );
154
+	}
155 155
 
156 156
 
157
-    function editus_toolbar_components_add_table( ) {
158
-          ?>
157
+	function editus_toolbar_components_add_table( ) {
158
+		  ?>
159 159
           <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
160 160
           <?php
161
-    }
161
+	}
162 162
 }
163 163
 
164 164
 
@@ -169,37 +169,37 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
173
-        add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+	public function __construct(){
173
+		add_action('wp_enqueue_scripts', array($this,'scripts'));
174 174
 	}
175 175
     
176
-    function scripts()
177
-    {
178
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
-            //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
-            //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
-    }
176
+	function scripts()
177
+	{
178
+			add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
+			add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
+			//wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
+			//wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
+	}
184 184
    
185
-    function editus_components_add_paragraph( $array ){
186
-        $custom = array(
187
-               'htmlparagraph' => array(
188
-                         'name'    => __('HTML Paragraph','lasso'),
189
-                          'content' => self::editus_html_paragraph(),
190
-                )
191
-        );
192
-        return array_merge( $array, $custom );
193
-    }
185
+	function editus_components_add_paragraph( $array ){
186
+		$custom = array(
187
+			   'htmlparagraph' => array(
188
+						 'name'    => __('HTML Paragraph','lasso'),
189
+						  'content' => self::editus_html_paragraph(),
190
+				)
191
+		);
192
+		return array_merge( $array, $custom );
193
+	}
194 194
     
195 195
     
196
-    function editus_html_paragraph()
197
-    {   
198
-        return '<p contenteditable="true"><br></p>';
199
-    }
196
+	function editus_html_paragraph()
197
+	{   
198
+		return '<p contenteditable="true"><br></p>';
199
+	}
200 200
 
201
-    function editus_paragraph_style()
202
-    { ?>
201
+	function editus_paragraph_style()
202
+	{ ?>
203 203
         <style>
204 204
         #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before
205 205
         { 
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
         }
209 209
         </style>
210 210
     <?php
211
-    }
211
+	}
212 212
     
213 213
 
214
-    function editus_toolbar_components_add_paragraph( ) {
215
-          ?>
214
+	function editus_toolbar_components_add_paragraph( ) {
215
+		  ?>
216 216
           <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
217 217
           <?php
218
-    }
218
+	}
219 219
 }
220 220
 
221 221
 //Disable it for now
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
236
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
237 237
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	
249 249
 	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
250 250
 
251
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
251
+	$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
252 252
 
253 253
 	?>
254 254
 	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	
462 462
 	//editor options
463 463
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
464
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
464
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
465 465
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
466 466
 
467 467
 	// are we singular
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	// do we support pending status
475 475
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
476 476
     
477
-    $excerpt = $post->post_excerpt;
477
+	$excerpt = $post->post_excerpt;
478 478
 
479 479
 ?>
480 480
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 						}?>
554 554
 						<?php 
555 555
 						if ($allow_change_date) { 
556
-						    $dateformat = get_option( 'date_format' ); 
556
+							$dateformat = get_option( 'date_format' ); 
557 557
 						?>
558 558
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
559 559
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 						if ( !empty( $types ) ) {
669 669
 							// get the first element
670 670
 							$keys = array_keys($types);
671
-						    $type =$keys[0];						
671
+							$type =$keys[0];						
672 672
 							$type = preg_replace( '/s\b/','', $type );
673 673
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
674 674
 						}
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
 	global $post;
697 697
 	
698 698
 	global $wp_post_types;
699
-    $labels = &$wp_post_types['post']->labels;
700
-    $labels->name = 'Articles';
699
+	$labels = &$wp_post_types['post']->labels;
700
+	$labels->name = 'Articles';
701 701
 
702 702
 	ob_start();
703 703
 
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 	ob_start();
758 758
 
759 759
 
760
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
760
+	$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
761 761
     
762 762
 	// let users add custom css classes
763 763
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
 function lasso_editor_options_blob() {
860 860
 
861 861
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
862
-    $codes   = add_wpimg_options( $codes );
862
+	$codes   = add_wpimg_options( $codes );
863 863
 	$codes   = add_wpimg_block_options( $codes );
864
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
864
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
865 865
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
866 866
 
867 867
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -963,9 +963,9 @@  discard block
 block discarded – undo
963 963
 		$return .= '</form>';
964 964
 
965 965
 		// extra JS codes
966
-        if (isset($shortcode['codes'])) {
967
-		    $return .= $shortcode['codes'];
968
-        }
966
+		if (isset($shortcode['codes'])) {
967
+			$return .= $shortcode['codes'];
968
+		}
969 969
 		$blob[$slug] = $return;
970 970
 	}
971 971
 
@@ -974,95 +974,95 @@  discard block
 block discarded – undo
974 974
 
975 975
 
976 976
 function add_wpimg_options( $shortcodes ) {
977
-    $custom = array(
978
-        'wpimg'    => array(
979
-            'name'     => __( 'Image', 'lasso' ),
980
-            'type'     => 'single',
981
-            'atts'     => array(
982
-                'img'    => array(
983
-                    'type'  => 'media_upload',
984
-                    'default'  => '',
985
-                    'desc'   => __( 'Image URL', 'lasso' ),
986
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
987
-                ),
988
-                'align'    => array(
989
-                    'type'  => 'select',
990
-                    'values'  => array(						
991
-                        array(
992
-                            'value' => 'center',
993
-                            'name' => __( 'Center', 'aesop-core' )
994
-                        ),
995
-                        array(
996
-                            'value' => 'left',
997
-                            'name' => __( 'Left', 'aesop-core' )
998
-                        ),
999
-                        array(
1000
-                            'value' => 'right',
1001
-                            'name' => __( 'Right', 'aesop-core' )
1002
-                        ),
1003
-                    ),
1004
-                    'default'  => 'center',
1005
-                    'desc'   => __( 'Alignment', 'lasso' ),
1006
-                    'tip'=>''
1007
-                ),			
977
+	$custom = array(
978
+		'wpimg'    => array(
979
+			'name'     => __( 'Image', 'lasso' ),
980
+			'type'     => 'single',
981
+			'atts'     => array(
982
+				'img'    => array(
983
+					'type'  => 'media_upload',
984
+					'default'  => '',
985
+					'desc'   => __( 'Image URL', 'lasso' ),
986
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
987
+				),
988
+				'align'    => array(
989
+					'type'  => 'select',
990
+					'values'  => array(						
991
+						array(
992
+							'value' => 'center',
993
+							'name' => __( 'Center', 'aesop-core' )
994
+						),
995
+						array(
996
+							'value' => 'left',
997
+							'name' => __( 'Left', 'aesop-core' )
998
+						),
999
+						array(
1000
+							'value' => 'right',
1001
+							'name' => __( 'Right', 'aesop-core' )
1002
+						),
1003
+					),
1004
+					'default'  => 'center',
1005
+					'desc'   => __( 'Alignment', 'lasso' ),
1006
+					'tip'=>''
1007
+				),			
1008 1008
                 
1009
-                'imgwidth'    => array(
1010
-                    'type'  => 'text_small',
1011
-                    'default'  => '300px',
1012
-                    'desc'   => __( 'Image Width', 'lasso' ),
1013
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1014
-                ),
1015
-                'imgheight'    => array(
1016
-                    'type'  => 'text_small',
1017
-                    'default'  => '',
1018
-                    'desc'   => __( 'Image Height', 'lasso' ),
1019
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1020
-                ),	
1021
-                'linkoption'    => array(
1022
-                    'type'  => 'select',
1023
-                    'values'  => array(						
1024
-                        array(
1025
-                            'value' => 'none',
1026
-                            'name' => __( 'None', 'aesop-core' )
1027
-                        ),
1028
-                        array(
1029
-                            'value' => 'img',
1030
-                            'name' => __( 'Image', 'aesop-core' )
1031
-                        ),
1032
-                        array(
1033
-                            'value' => 'url',
1034
-                            'name' => __( 'URL', 'aesop-core' )
1035
-                        ),
1036
-                    ),
1037
-                    'default'  => 'none',
1038
-                    'desc'   => __( 'Link', 'lasso' ),
1039
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1040
-                ),				
1009
+				'imgwidth'    => array(
1010
+					'type'  => 'text_small',
1011
+					'default'  => '300px',
1012
+					'desc'   => __( 'Image Width', 'lasso' ),
1013
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1014
+				),
1015
+				'imgheight'    => array(
1016
+					'type'  => 'text_small',
1017
+					'default'  => '',
1018
+					'desc'   => __( 'Image Height', 'lasso' ),
1019
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1020
+				),	
1021
+				'linkoption'    => array(
1022
+					'type'  => 'select',
1023
+					'values'  => array(						
1024
+						array(
1025
+							'value' => 'none',
1026
+							'name' => __( 'None', 'aesop-core' )
1027
+						),
1028
+						array(
1029
+							'value' => 'img',
1030
+							'name' => __( 'Image', 'aesop-core' )
1031
+						),
1032
+						array(
1033
+							'value' => 'url',
1034
+							'name' => __( 'URL', 'aesop-core' )
1035
+						),
1036
+					),
1037
+					'default'  => 'none',
1038
+					'desc'   => __( 'Link', 'lasso' ),
1039
+					'tip'  => __( 'Click leads to:', 'lasso' )
1040
+				),				
1041 1041
                 
1042
-                'link'    => array(
1043
-                    'type'  => 'text',
1044
-                    'default'  => '',
1045
-                    'desc'   => __( 'URL Link', 'lasso' ),
1046
-                    'tip'  => __( 'URL link', 'lasso' )
1047
-                ),
1048
-                'alt'    => array(
1049
-                    'type'  => 'text',
1050
-                    'default'  => '',
1051
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1052
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1053
-                ),
1042
+				'link'    => array(
1043
+					'type'  => 'text',
1044
+					'default'  => '',
1045
+					'desc'   => __( 'URL Link', 'lasso' ),
1046
+					'tip'  => __( 'URL link', 'lasso' )
1047
+				),
1048
+				'alt'    => array(
1049
+					'type'  => 'text',
1050
+					'default'  => '',
1051
+					'desc'   => __( 'Image ALT', 'lasso' ),
1052
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1053
+				),
1054 1054
                 
1055
-                'caption'    => array(
1056
-                    'type'  => 'text_area',
1057
-                    'default'  => '',
1058
-                    'desc'   => __( 'Caption', 'lasso' ),
1059
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1060
-                ),
1055
+				'caption'    => array(
1056
+					'type'  => 'text_area',
1057
+					'default'  => '',
1058
+					'desc'   => __( 'Caption', 'lasso' ),
1059
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1060
+				),
1061 1061
                 
1062 1062
 
1063
-            ),
1064
-            'desc'     => __( 'An image.', 'aesop-core' ),
1065
-            'codes'    => '<script>	            
1063
+			),
1064
+			'desc'     => __( 'An image.', 'aesop-core' ),
1065
+			'codes'    => '<script>	            
1066 1066
 						jQuery(document).ready(function($){
1067 1067
                             function linkSetting(l){								
1068 1068
 							    if ( l=="url") {
@@ -1082,69 +1082,69 @@  discard block
 block discarded – undo
1082 1082
 							})
1083 1083
 						});
1084 1084
 			           </script>'
1085
-        )
1086
-    );
1085
+		)
1086
+	);
1087 1087
 
1088
-    return array_merge( $shortcodes, $custom );
1088
+	return array_merge( $shortcodes, $custom );
1089 1089
 }
1090 1090
 
1091 1091
 function add_wpimg_block_options( $shortcodes ) {
1092
-    $custom = array(
1093
-        'wpimg-block'    => array(
1094
-            'name'     => __( 'Image', 'lasso' ),
1095
-            'type'     => 'single',
1096
-            'atts'     => array(
1097
-                'img'    => array(
1098
-                    'type'  => 'media_upload',
1099
-                    'default'  => '',
1100
-                    'desc'   => __( 'Image URL', 'lasso' ),
1101
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1102
-                ),
1103
-                'align'    => array(
1104
-                    'type'  => 'select',
1105
-                    'values'  => array(						
1106
-                        array(
1107
-                            'value' => 'center',
1108
-                            'name' => __( 'Center', 'aesop-core' )
1109
-                        ),
1110
-                        array(
1111
-                            'value' => 'left',
1112
-                            'name' => __( 'Left', 'aesop-core' )
1113
-                        ),
1114
-                        array(
1115
-                            'value' => 'right',
1116
-                            'name' => __( 'Right', 'aesop-core' )
1117
-                        ),
1118
-                    ),
1119
-                    'default'  => 'center',
1120
-                    'desc'   => __( 'Alignment', 'lasso' ),
1121
-                    'tip'=>''
1122
-                ),		
1123
-                'alt'    => array(
1124
-                    'type'  => 'text',
1125
-                    'default'  => '',
1126
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1127
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1128
-                ),
1129
-                'caption'    => array(
1130
-                    'type'  => 'text',
1131
-                    'default'  => '',
1132
-                    'desc'   => __( 'Caption', 'lasso' ),
1133
-                    'tip'  => __( 'Caption for the image.', 'lasso' )
1134
-                ),
1092
+	$custom = array(
1093
+		'wpimg-block'    => array(
1094
+			'name'     => __( 'Image', 'lasso' ),
1095
+			'type'     => 'single',
1096
+			'atts'     => array(
1097
+				'img'    => array(
1098
+					'type'  => 'media_upload',
1099
+					'default'  => '',
1100
+					'desc'   => __( 'Image URL', 'lasso' ),
1101
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1102
+				),
1103
+				'align'    => array(
1104
+					'type'  => 'select',
1105
+					'values'  => array(						
1106
+						array(
1107
+							'value' => 'center',
1108
+							'name' => __( 'Center', 'aesop-core' )
1109
+						),
1110
+						array(
1111
+							'value' => 'left',
1112
+							'name' => __( 'Left', 'aesop-core' )
1113
+						),
1114
+						array(
1115
+							'value' => 'right',
1116
+							'name' => __( 'Right', 'aesop-core' )
1117
+						),
1118
+					),
1119
+					'default'  => 'center',
1120
+					'desc'   => __( 'Alignment', 'lasso' ),
1121
+					'tip'=>''
1122
+				),		
1123
+				'alt'    => array(
1124
+					'type'  => 'text',
1125
+					'default'  => '',
1126
+					'desc'   => __( 'Image ALT', 'lasso' ),
1127
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1128
+				),
1129
+				'caption'    => array(
1130
+					'type'  => 'text',
1131
+					'default'  => '',
1132
+					'desc'   => __( 'Caption', 'lasso' ),
1133
+					'tip'  => __( 'Caption for the image.', 'lasso' )
1134
+				),
1135 1135
                
1136 1136
 
1137
-            ),
1138
-            'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1139
-            'codes'    => '<script>	            
1137
+			),
1138
+			'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1139
+			'codes'    => '<script>	            
1140 1140
 						jQuery(document).ready(function($){
1141 1141
                             
1142 1142
 						});
1143 1143
 			           </script>'
1144
-        )
1145
-    );
1144
+		)
1145
+	);
1146 1146
 
1147
-    return array_merge( $shortcodes, $custom );
1147
+	return array_merge( $shortcodes, $custom );
1148 1148
 }
1149 1149
 
1150 1150
 /**
@@ -1189,23 +1189,23 @@  discard block
 block discarded – undo
1189 1189
  * @return string
1190 1190
  */
1191 1191
 function lasso_editor_adjustBrightness($hex, $steps) { 
1192
-    $steps = max(-255, min(255, $steps));
1192
+	$steps = max(-255, min(255, $steps));
1193 1193
 
1194
-    // Normalize into a six character long hex string
1195
-    $hex = str_replace('#', '', $hex);
1196
-    if (strlen($hex) == 3) {
1197
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1198
-    }
1194
+	// Normalize into a six character long hex string
1195
+	$hex = str_replace('#', '', $hex);
1196
+	if (strlen($hex) == 3) {
1197
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1198
+	}
1199 1199
 
1200
-    // Split into three parts: R, G and B
1201
-    $color_parts = str_split($hex, 2);
1202
-    $return = '#';
1200
+	// Split into three parts: R, G and B
1201
+	$color_parts = str_split($hex, 2);
1202
+	$return = '#';
1203 1203
 
1204
-    foreach ($color_parts as $color) {
1205
-        $color   = hexdec($color); // Convert to decimal
1206
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1207
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1208
-    }
1204
+	foreach ($color_parts as $color) {
1205
+		$color   = hexdec($color); // Convert to decimal
1206
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1207
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1208
+	}
1209 1209
 
1210
-    return $return;
1210
+	return $return;
1211 1211
 }
Please login to merge, or discard this patch.
public/includes/lasso.php 1 patch
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		
60 60
 		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61 61
 		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
62
+		add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63 63
 		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64 64
 		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65 65
 		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70 70
 		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+		add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+		add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
+		add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
273 273
 	}
274 274
 	
275
-    // new ajax function to lock post for editing
275
+	// new ajax function to lock post for editing
276 276
 	public function editus_lock_post()
277 277
 	{
278 278
 		$post_id= $_POST["postid"];
279 279
 		$locked = wp_check_post_lock($post_id);
280 280
 		
281 281
 		if (!$locked) {
282
-		    wp_set_post_lock($post_id);
282
+			wp_set_post_lock($post_id);
283 283
 			echo "true";
284 284
 		} else {
285 285
 			$user_info = get_userdata($locked);
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	{
293 293
 		$post_id= $_POST["postid"];
294 294
 		$locked = wp_check_post_lock($post_id);
295
-        if (!$locked) {
296
-            delete_post_meta( $post_id, '_edit_lock');
297
-        }
295
+		if (!$locked) {
296
+			delete_post_meta( $post_id, '_edit_lock');
297
+		}
298 298
 		echo "true";
299 299
 		
300 300
 		exit;
@@ -324,14 +324,14 @@  discard block
 block discarded – undo
324 324
 		$status = isset( $data['status'] ) ? $data['status'] : false;
325 325
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
326 326
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
327
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
327
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
328 328
 	
329 329
 
330 330
 		$args = array(
331 331
 			'ID'   			=> (int) $postid,
332 332
 			'post_name'  	=> $slug,
333 333
 			'post_status' 	=> $status,
334
-            'post_excerpt'  => $excerpt
334
+			'post_excerpt'  => $excerpt
335 335
 		);
336 336
 		
337 337
 		
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
 		exit;
400 400
 	}
401 401
     
402
-    public function editus_do_block()
402
+	public function editus_do_block()
403 403
 	{
404 404
 		
405 405
 		$code= $_POST["code"];
406 406
 
407
-        $out = do_blocks( $code );
407
+		$out = do_blocks( $code );
408 408
 		
409 409
 		echo $out;
410 410
 		exit;
@@ -423,63 +423,63 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 		}
425 425
 		if ($code == "aesop_video") {
426
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
-		    echo aesop_video_shortcode($atts);
426
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
427
+			echo aesop_video_shortcode($atts);
428 428
 		}
429 429
 		else if ($code == "aesop_image") {
430
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
-		    echo aesop_image_shortcode($atts);
430
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
431
+			echo aesop_image_shortcode($atts);
432 432
 		}
433 433
 		else if ($code == "aesop_quote") {
434
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
-		    echo aesop_quote_shortcode($atts);
434
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
435
+			echo aesop_quote_shortcode($atts);
436 436
 		}
437 437
 		else if ($code == "aesop_parallax") {
438
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
-		    echo aesop_parallax_shortcode($atts);
438
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
439
+			echo aesop_parallax_shortcode($atts);
440 440
 		}
441 441
 		else if ($code == "aesop_character") {
442
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
-		    echo aesop_character_shortcode($atts);
442
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
443
+			echo aesop_character_shortcode($atts);
444 444
 		}
445 445
 		else if ($code == "aesop_collection") {
446
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
-		    echo aesop_collection_shortcode($atts);
446
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
447
+			echo aesop_collection_shortcode($atts);
448 448
 		}
449 449
 		else if ($code == "aesop_chapter") {
450
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
-		    echo aesop_chapter_shortcode($atts);
450
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
451
+			echo aesop_chapter_shortcode($atts);
452 452
 		}
453 453
 		else if ($code == "aesop_content") {
454
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
454
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
455
+			echo aesop_content_shortcode($atts, $atts['content_data']);
456 456
 		}
457 457
 		else if ($code == "aesop_gallery") {
458
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
458
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
459
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
460 460
 		}
461 461
 		else if ($code == "aesop_audio") {
462
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
-		    echo aesop_audio_shortcode($atts);
462
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
463
+			echo aesop_audio_shortcode($atts);
464 464
 		}
465 465
 		else if ($code == "aesop_document") {
466
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
-		    echo aesop_document_shortcode($atts);
466
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
467
+			echo aesop_document_shortcode($atts);
468 468
 		}
469
-        /*else if ($code == "aesop_content") {
469
+		/*else if ($code == "aesop_content") {
470 470
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
471 471
 		    echo aesop_content_shortcode($atts);
472 472
 		}*/
473
-        else if ($code == "aesop_wpimg") {
474
-            self::wpimg($atts);
473
+		else if ($code == "aesop_wpimg") {
474
+			self::wpimg($atts);
475 475
 		}
476 476
 		else if ($code == "aesop_wpimg-block") {
477
-            self::wpimg_block($atts);
477
+			self::wpimg_block($atts);
478 478
 		}
479 479
 		else {
480 480
 			$code = '['.$code.' ';
481 481
 			foreach ($atts as $key => $value) {
482
-			    $code = ''.$key.'="'.$value.'" ';
482
+				$code = ''.$key.'="'.$value.'" ';
483 483
 			}
484 484
 			$code = $code.']';
485 485
 			echo do_shortcode($code);
@@ -488,88 +488,88 @@  discard block
 block discarded – undo
488 488
 		exit; 
489 489
 	}
490 490
     
491
-    public static function wpimg($atts) {
491
+	public static function wpimg($atts) {
492 492
 
493
-        echo '<figure data-component-type="wpimg"';
493
+		echo '<figure data-component-type="wpimg"';
494 494
         
495
-        $extra = "";
495
+		$extra = "";
496 496
         
497
-        // try to use srcset and sizes on new WP installs
497
+		// try to use srcset and sizes on new WP installs
498 498
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
499 499
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
500 500
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
501
-            $extra = "srcset='$srcset' sizes='$sizes' ";
502
-        }
503
-        if ($atts['align']=="left") {
504
-            $extra .= 'class="alignleft';
505
-        } else if ($atts['align']=="right") {
506
-            $extra .= 'class="alignright';
507
-        } else {
508
-            $extra .= 'class="aligncenter';
509
-        }
510
-        if ($atts['imgwidth'] || $atts['imgheight']) {
511
-            if ($atts['imgwidth']) {
512
-                $extra .= 'width:'. $atts['imgwidth'].';';
513
-            }
514
-            if ($atts['imgheight']) {
515
-                $extra .= 'height:'. $atts['imgheight'].';';
516
-            }
501
+			$extra = "srcset='$srcset' sizes='$sizes' ";
502
+		}
503
+		if ($atts['align']=="left") {
504
+			$extra .= 'class="alignleft';
505
+		} else if ($atts['align']=="right") {
506
+			$extra .= 'class="alignright';
507
+		} else {
508
+			$extra .= 'class="aligncenter';
509
+		}
510
+		if ($atts['imgwidth'] || $atts['imgheight']) {
511
+			if ($atts['imgwidth']) {
512
+				$extra .= 'width:'. $atts['imgwidth'].';';
513
+			}
514
+			if ($atts['imgheight']) {
515
+				$extra .= 'height:'. $atts['imgheight'].';';
516
+			}
517 517
             
518
-        }
519
-        $extra .= '"';
518
+		}
519
+		$extra .= '"';
520 520
         
521
-        foreach ($atts as $key => $value) {
521
+		foreach ($atts as $key => $value) {
522 522
 			 echo ' data-'.$key.'="'.$value.'"';
523 523
 		}
524
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
525
-        echo ' class="wp-caption lasso-component">';
526
-        $hrefset = false;
527
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
528
-        {
529
-            echo '<a href="' . $atts['link'] . '">';
530
-            $hrefset = true;
531
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
532
-            echo '<a href="' . $atts['img'] . '">';
533
-            $hrefset = true;
534
-        }
535
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
536
-        if ($hrefset)
537
-        {
538
-            echo '</a>';
539
-        }
540
-        if ($atts['caption'])
541
-        {
542
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
543
-        }
544
-        echo '</figure>';
545
-        echo '<p><br></p>';
546
-        return;
547
-    }
524
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
525
+		echo ' class="wp-caption lasso-component">';
526
+		$hrefset = false;
527
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
528
+		{
529
+			echo '<a href="' . $atts['link'] . '">';
530
+			$hrefset = true;
531
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
532
+			echo '<a href="' . $atts['img'] . '">';
533
+			$hrefset = true;
534
+		}
535
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
536
+		if ($hrefset)
537
+		{
538
+			echo '</a>';
539
+		}
540
+		if ($atts['caption'])
541
+		{
542
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
543
+		}
544
+		echo '</figure>';
545
+		echo '<p><br></p>';
546
+		return;
547
+	}
548 548
 	
549 549
 	public static function wpimg_block($atts) {
550 550
 		$imgextra = '';
551 551
 		if (!empty($atts['id'])) {
552 552
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
553 553
 		}
554
-        $figclass = 'aligncenter';
555
-        if ($atts['align']=="left") {
556
-            $figclass = 'alignleft';
557
-        } else if ($atts['align']=="right") {
558
-            $figclass = 'alignright';
559
-        } else {
560
-            $figclass = 'aligncenter';
561
-        }
562
-        echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
563
-        echo '<figure class="'.$figclass.' size-large" data-component-type="wpimg-block">';        
564
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' ">';
565
-        if ($atts['caption'])
566
-        {
567
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
568
-        }
569
-        echo '</figure></div>';
570
-        echo '<p><br></p>';
571
-        return;
572
-    }
554
+		$figclass = 'aligncenter';
555
+		if ($atts['align']=="left") {
556
+			$figclass = 'alignleft';
557
+		} else if ($atts['align']=="right") {
558
+			$figclass = 'alignright';
559
+		} else {
560
+			$figclass = 'aligncenter';
561
+		}
562
+		echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
563
+		echo '<figure class="'.$figclass.' size-large" data-component-type="wpimg-block">';        
564
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' ">';
565
+		if ($atts['caption'])
566
+		{
567
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
568
+		}
569
+		echo '</figure></div>';
570
+		echo '<p><br></p>';
571
+		return;
572
+	}
573 573
 	
574 574
 	
575 575
 	public function get_ase_options()
@@ -605,12 +605,12 @@  discard block
 block discarded – undo
605 605
 		exit;
606 606
 	}
607 607
     
608
-    /* This function doesn't actually publish post, but should be called when a post is published */
609
-    public function on_publish_post( ) {
608
+	/* This function doesn't actually publish post, but should be called when a post is published */
609
+	public function on_publish_post( ) {
610 610
 
611 611
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
612 612
         
613
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
613
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
614 614
 
615 615
 		exit;
616 616
 	}
@@ -668,14 +668,14 @@  discard block
 block discarded – undo
668 668
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
669 669
 			
670 670
 			if ($taxonomy =='category') {
671
-                // convert from names to category ids
671
+				// convert from names to category ids
672 672
 				$cats = array();
673 673
 				foreach ($value as $cat) {
674 674
 					$cat_id = get_cat_ID($cat);
675 675
 					if ($cat_id !=0) {
676 676
 						$cats [] = $cat_id;
677 677
 					} else if ($allow_new_category) {
678
-					    $cats [] = wp_create_category($cat);
678
+						$cats [] = wp_create_category($cat);
679 679
 					}
680 680
 				}
681 681
 				$value = $cats;
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		}
696 696
 	}
697 697
     
698
-    public function create_gallery( ) {
698
+	public function create_gallery( ) {
699 699
 
700 700
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
701 701
         
@@ -749,10 +749,10 @@  discard block
 block discarded – undo
749 749
 			'message' => 'gallery-created',
750 750
 			'id' => $postid)
751 751
 		);
752
-        exit;
752
+		exit;
753 753
 	}
754 754
     
755
-    public function update_gallery( ) {
755
+	public function update_gallery( ) {
756 756
         
757 757
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
758 758
         
@@ -768,12 +768,12 @@  discard block
 block discarded – undo
768 768
 
769 769
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
770 770
 
771
-        echo json_encode( array('message' => 'gallery-updated') );
771
+		echo json_encode( array('message' => 'gallery-updated') );
772 772
 
773
-        exit;
773
+		exit;
774 774
 	}
775 775
     
776
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
776
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
777 777
 
778 778
 		// gallery width
779 779
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	public function set_date( $postid, $value) {
858 858
 		if( $value ) {
859 859
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
860
-            wp_update_post(
860
+			wp_update_post(
861 861
 				array (
862 862
 					'ID'            => $postid, // ID of the post to update
863 863
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
public/includes/assets.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $use_wpimgblock = false;
95
+			$use_wpimgblock = false;
96 96
             
97
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
97
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
98 98
 
99 99
 			
100 100
 			//text alignement
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			$tz_offset = get_UTC_offset();
133 133
 			$post_date = get_the_time('U', $postid);
134 134
 			$time = (time()+$tz_offset);
135
-            $delta = $time - $post_date;
135
+			$delta = $time - $post_date;
136 136
             
137 137
 			$strings = array(
138 138
 				'save' 				=> __('Save','lasso'),
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
188 188
 			
189 189
 			
190
-            if ($allow_change_date) {
191
-			    $permalink = get_site_url().'/?p='.$postid;
192
-            } else {
193
-                $permalink = get_permalink($postid);
194
-            }
190
+			if ($allow_change_date) {
191
+				$permalink = get_site_url().'/?p='.$postid;
192
+			} else {
193
+				$permalink = get_permalink($postid);
194
+			}
195 195
 			
196 196
 			// rest api
197 197
 			$rest_nonce = '';
@@ -211,17 +211,17 @@  discard block
 block discarded – undo
211 211
 				}
212 212
 			}
213 213
             
214
-            //excerpt
215
-            $post_excerpt = "";
216
-            $post_excerpt = $post->post_excerpt;
214
+			//excerpt
215
+			$post_excerpt = "";
216
+			$post_excerpt = $post->post_excerpt;
217 217
             
218
-            //find if this is multi page. -1 if not
219
-            $multipage = self::is_multipage();
220
-            $post_content = "";
221
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
-            //if ($multipage != -1) {
223
-               $post_content = $post->post_content;
224
-            //}
218
+			//find if this is multi page. -1 if not
219
+			$multipage = self::is_multipage();
220
+			$post_content = "";
221
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
+			//if ($multipage != -1) {
223
+			   $post_content = $post->post_content;
224
+			//}
225 225
 
226 226
 			// localized objects
227 227
 			$objects = array(
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 				'customFields'      => $custom_fields,
299 299
 				'clickToInsert'     => ($insert_comp_ui =='click'),
300 300
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
301
-                'rtl'               => is_rtl(),				
301
+				'rtl'               => is_rtl(),				
302 302
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
303 303
 				'linksEditable'    => $links_editable,
304 304
 				'supportPendingStatus' => !$no_pending_status,
305 305
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
306
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
-                'multipages'=> $multipage,
308
-                'post_content'=>$post_content,
309
-                'post_excerpt'=>$post_excerpt,
310
-                'oldWPimg'=> $use_old_wpimg =='on',
311
-                'useWPImgBlk'=> $use_wpimgblock,
312
-                'prefixHTTP'=> $link_prefix_http =='on'
306
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
+				'multipages'=> $multipage,
308
+				'post_content'=>$post_content,
309
+				'post_excerpt'=>$post_excerpt,
310
+				'oldWPimg'=> $use_old_wpimg =='on',
311
+				'useWPImgBlk'=> $use_wpimgblock,
312
+				'prefixHTTP'=> $link_prefix_http =='on'
313 313
 			);
314 314
 
315 315
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 			
318 318
 			
319 319
 			if (!$using_restapiv2) {
320
-               // enqueue REST API V1
320
+			   // enqueue REST API V1
321 321
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
322 322
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
323 323
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			if ($show_color) {
334 334
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
335 335
 			} else {
336
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
336
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
337 337
 			}
338 338
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
339 339
 
@@ -342,44 +342,44 @@  discard block
 block discarded – undo
342 342
 
343 343
 	}
344 344
     
345
-    function gutenberg_active() {
345
+	function gutenberg_active() {
346 346
         
347
-        // Gutenberg plugin is installed and activated.
348
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
-
350
-        // Block editor since 5.0.
351
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
-
353
-        if ( ! $gutenberg && ! $block_editor ) {
354
-            return false;
355
-        }
356
-
357
-        if ( self::is_classic_editor_plugin_active() ) {
358
-            $editor_option       = get_option( 'classic-editor-replace' );
359
-            $block_editor_active = array( 'no-replace', 'block' );
360
-
361
-            return in_array( $editor_option, $block_editor_active, true );
362
-        }
363
-
364
-        return true;
365
-    }
366
-
367
-    /**
368
-     * Check if Classic Editor plugin is active.
369
-     *
370
-     * @return bool
371
-     */
372
-    function is_classic_editor_plugin_active() {
373
-        if ( ! function_exists( 'is_plugin_active' ) ) {
374
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
-        }
376
-
377
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
-            return true;
379
-        }
380
-
381
-        return false;
382
-    }
347
+		// Gutenberg plugin is installed and activated.
348
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
+
350
+		// Block editor since 5.0.
351
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
+
353
+		if ( ! $gutenberg && ! $block_editor ) {
354
+			return false;
355
+		}
356
+
357
+		if ( self::is_classic_editor_plugin_active() ) {
358
+			$editor_option       = get_option( 'classic-editor-replace' );
359
+			$block_editor_active = array( 'no-replace', 'block' );
360
+
361
+			return in_array( $editor_option, $block_editor_active, true );
362
+		}
363
+
364
+		return true;
365
+	}
366
+
367
+	/**
368
+	 * Check if Classic Editor plugin is active.
369
+	 *
370
+	 * @return bool
371
+	 */
372
+	function is_classic_editor_plugin_active() {
373
+		if ( ! function_exists( 'is_plugin_active' ) ) {
374
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
+		}
376
+
377
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
+			return true;
379
+		}
380
+
381
+		return false;
382
+	}
383 383
 
384 384
 }
385 385
 
Please login to merge, or discard this patch.
public/includes/components.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -236,16 +236,16 @@  discard block
 block discarded – undo
236 236
 if ( !function_exists('lasso_wp_image') ):
237 237
 
238 238
 	function lasso_wp_image(){
239
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
-        if ($use_wp_block_image == 'on') {
242
-        	return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
-        }
244
-        else if ($use_old_wpimg != 'on') {
245
-        	return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
-        } else {
247
-            return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
-        }
239
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
+		if ($use_wp_block_image == 'on') {
242
+			return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
+		}
244
+		else if ($use_old_wpimg != 'on') {
245
+			return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
+		} else {
247
+			return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
+		}
249 249
 	}
250 250
 
251 251
 endif;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
 if ( !function_exists('lasso_wp_image_block') ):
289 289
 	function lasso_wp_image_block(){
290
-        return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
290
+		return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
291 291
 	}
292 292
 
293 293
 endif;
Please login to merge, or discard this patch.