Changeset 2936435
- Timestamp:
- 07/10/2023 09:02:04 AM (3 years ago)
- Location:
- wp-custom-cursors
- Files:
-
- 2 edited
-
tags/3.2/admin/class-wp-custom-cursors-admin.php (modified) (3 diffs)
-
trunk/admin/class-wp-custom-cursors-admin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-custom-cursors/tags/3.2/admin/class-wp-custom-cursors-admin.php
r2932233 r2936435 164 164 165 165 if ($cursors) { 166 foreach ($cursors as $cursor) {167 166 ?> 168 167 <div class="card bg-light"> … … 173 172 </div> 174 173 </div> 175 <div class="row align-items-center shadow py-3 rounded-4"> 176 <div class="col-md-2 position-relative text-center"> 177 <?php 178 switch ($cursor->cursor_type) { 179 case "shape": 174 <?php 175 foreach ($cursors as $cursor) { 176 ?> 177 178 <div class="row align-items-center mt-3 shadow py-3 rounded-4"> 179 <div class="col-md-2 position-relative text-center"> 180 <?php 181 switch ($cursor->cursor_type) { 182 case "shape": 183 if (str_contains($cursor->cursor_shape, "created")) { 184 $id = substr($cursor->cursor_shape, 8); 185 global $wpdb; 186 $tablename = $wpdb->prefix . "created_cursors"; 187 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 188 189 $stripped = stripslashes($created_cursor->cursor_options); 190 $decoded = json_decode($stripped, false); 191 ?> 192 <label class="created-cursor-label" style="--fe-width: <?php echo $decoded->fe_width; ?>px; --fe-height: <?php echo $decoded->fe_height; ?>px; --fe-color: <?php echo $decoded->fe_color; ?>; --fe-radius: <?php echo $decoded->fe_radius; ?>px; --fe-border: <?php echo $decoded->fe_border_width; ?>px; --fe-border-color: <?php echo $decoded->fe_border_color; ?>; --fe-blending: <?php echo $decoded->fe_blending; ?>; --fe-zindex: <?php echo $decoded->fe_zindex; ?>; --se-width: <?php echo $decoded->se_width; ?>px; --se-height: <?php echo $decoded->se_height; ?>px; --se-color: <?php echo $decoded->se_color; ?>; --se-radius: <?php echo $decoded->se_radius; ?>px; --se-border: <?php echo $decoded->se_border_width; ?>px; --se-border-color: <?php echo $decoded->se_border_color; ?>; --se-blending: <?php echo $decoded->se_blending; ?>; --se-zindex: <?php echo $decoded->se_zindex; ?>;"><div class="cursor-el1" ></div><div class="cursor-el2"></div> 193 </label> 194 <?php 195 } 196 else { 197 ?> 198 <img src="<?php echo esc_url( plugins_url( 'img/cursors/'.$cursor->cursor_shape.'.svg', __FILE__ ) ); ?>" alt="<?php echo esc_html__('Cursor Shape '.$cursor->cursor_shape, 'wpcustom-cursors');?>" class="list-shape-image" /> 199 <?php 200 } 201 break; 202 case "image": 180 203 if (str_contains($cursor->cursor_shape, "created")) { 181 $id = substr($cursor->cursor_shape, 8); 204 $id = substr($cursor->cursor_shape, 8); 205 global $wpdb; 206 $tablename = $wpdb->prefix . "created_cursors"; 207 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 208 209 $stripped = stripslashes($created_cursor->cursor_options); 210 $decoded = json_decode($stripped, false); 211 ?> 212 <label class="created-cursor-label image" style="--width: <?php echo $decoded->width; ?>px; --background: <?php echo $decoded->background; ?>px; --color: <?php echo $decoded->color; ?>; --radius: <?php echo $decoded->radius; ?>px; --padding: <?php echo $decoded->padding; ?>px; --blending: <?php echo $decoded->blending; ?>; --click-point-x: <?php echo $click_point_x; ?>%; --click-point-y: <?php echo $click_point_y; ?>%;"><div class="img-wrapper"><img src="<?php echo $decoded->image_url; ?>" class="img-fluid" /></div> 213 </label> 214 <?php 215 } 216 else { 217 ?> 218 <img src="<?php echo $cursor->cursor_image; ?>" alt="<?php echo esc_html__('Cursor Image', 'wpcustom-cursors');?>" class="list-cursor-image" /> 219 <?php 220 } 221 break; 222 case "text": 223 if (str_contains($cursor->cursor_shape, "created")){ 224 $id = substr($cursor->cursor_shape, 8); 225 global $wpdb; 226 $tablename = $wpdb->prefix . "created_cursors"; 227 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 228 229 $stripped = stripslashes($created_cursor->cursor_options); 230 $decoded = json_decode($stripped, false); 231 232 if ($decoded->text_type == 'horizontal') { 233 ?> 234 <label class="created-cursor-label horizontal" style="--bg-color: <?php echo $decoded->hr_bgcolor; ?>; --hr-width: <?php echo $decoded->hr_width; ?>px; --hr-transfom: <?php echo $decoded->hr_transform; ?>; --hr-weight: <?php echo $decoded->hr_weight; ?>; --hr-color: <?php echo $decoded->hr_color; ?>; --hr-size: <?php echo $decoded->hr_size; ?>px;--hr-spacing: <?php echo $decoded->hr_spacing; ?>px;--hr-radius: <?php echo $decoded->hr_radius; ?>px;--hr-padding: <?php echo $decoded->hr_padding; ?>s; "> 235 <div class="hr-text"><?php echo $decoded->hr_text;?></div> 236 </label> 237 <?php 238 } 239 240 else { 241 242 ?> 243 <label class="created-cursor-label text" style="--dot-fill: <?php echo $decoded->dot_color; ?>; --text-width: <?php echo $decoded->width; ?>px; --text-transfom: <?php echo $decoded->text_transform; ?>; --font-weight: <?php echo $decoded->font_weight; ?>; --text-color: <?php echo $decoded->text_color; ?>; --font-size: <?php echo $decoded->font_size; ?>px;--word-spacing: <?php echo $decoded->word_spacing; ?>px;--animation-name: <?php echo $decoded->animation; ?>;--animation-duration: <?php echo $decoded->animation_duration; ?>s; --dot-width: <?php echo $decoded->dot_width; ?>px;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $decoded->text;?></textPath></text><circle cx="250" cy="250" r="<?php echo $decoded->dot_width;?>" id="svg_circle_node"/></svg> 244 </label> 245 <?php 246 247 } 248 } 249 else { 250 ?> 251 <label class="created-cursor-label text" style="--width: <?php echo $cursor->width; ?>px;--text-color: <?php echo $cursor->color; ?>;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $cursor->cursor_text;?></textPath></text></svg> 252 </label> 253 <?php 254 } 255 break; 256 } 257 ?> 258 </div> 259 <div class="col-md-2"> 260 <div> 261 <?php 262 echo esc_html(ucfirst($cursor->cursor_type)); 263 ?> 264 </div> 265 <div> 266 <?php 267 switch ($cursor->cursor_type) { 268 case 'shape': 269 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 270 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 271 $id = substr($cursor->cursor_shape, 8); 272 global $wpdb; 273 $tablename = $wpdb->prefix . "created_cursors"; 274 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 275 276 $stripped = stripslashes($created_cursor->cursor_options); 277 $decoded = json_decode($stripped, false); 278 279 echo '<div class="color-dot" style="background-color: '.$decoded->fe_color.'"></div>'; 280 echo '<div class="color-dot" style="background-color: '.$decoded->se_color.'"></div>'; 281 } 282 else { 283 echo '<div class="color-dot" style="background-color: '.$cursor->color.'"></div>'; 284 } 285 break; 286 287 case 'image': 288 echo esc_html__( 'Width: ', 'wpcustom-cursors' ); 289 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 290 $id = substr($cursor->cursor_shape, 8); 291 global $wpdb; 292 $tablename = $wpdb->prefix . "created_cursors"; 293 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 294 295 $stripped = stripslashes($created_cursor->cursor_options); 296 $decoded = json_decode($stripped, false); 297 298 echo '<span class="small">'.$decoded->width.' px</span>'; 299 } 300 else { 301 echo '<span class="small">'.$cursor->width.' px</span>'; 302 } 303 break; 304 305 case 'text': 306 $id = substr($cursor->cursor_shape, 8); 182 307 global $wpdb; 183 308 $tablename = $wpdb->prefix . "created_cursors"; … … 186 311 $stripped = stripslashes($created_cursor->cursor_options); 187 312 $decoded = json_decode($stripped, false); 188 ?> 189 <label class="created-cursor-label" style="--fe-width: <?php echo $decoded->fe_width; ?>px; --fe-height: <?php echo $decoded->fe_height; ?>px; --fe-color: <?php echo $decoded->fe_color; ?>; --fe-radius: <?php echo $decoded->fe_radius; ?>px; --fe-border: <?php echo $decoded->fe_border_width; ?>px; --fe-border-color: <?php echo $decoded->fe_border_color; ?>; --fe-blending: <?php echo $decoded->fe_blending; ?>; --fe-zindex: <?php echo $decoded->fe_zindex; ?>; --se-width: <?php echo $decoded->se_width; ?>px; --se-height: <?php echo $decoded->se_height; ?>px; --se-color: <?php echo $decoded->se_color; ?>; --se-radius: <?php echo $decoded->se_radius; ?>px; --se-border: <?php echo $decoded->se_border_width; ?>px; --se-border-color: <?php echo $decoded->se_border_color; ?>; --se-blending: <?php echo $decoded->se_blending; ?>; --se-zindex: <?php echo $decoded->se_zindex; ?>;"><div class="cursor-el1" ></div><div class="cursor-el2"></div> 190 </label> 191 <?php 313 314 if ($decoded->text_type == 'horizontal') { 315 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 316 echo '<div class="color-dot" style="background-color: '.$decoded->hr_bgcolor.'"></div>'; 317 } 318 else { 319 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 320 $id = substr($cursor->cursor_shape, 8); 321 global $wpdb; 322 $tablename = $wpdb->prefix . "created_cursors"; 323 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 324 325 $stripped = stripslashes($created_cursor->cursor_options); 326 $decoded = json_decode($stripped, false); 327 328 echo '<div class="color-dot" style="background-color: '.$decoded->text_color.'"></div>'; 329 } 330 331 break; 332 } 333 ?> 334 </div> 335 </div> 336 <div class="col-md-2"> 337 <div><?php echo esc_html__('Activate On:', 'wpcustom-cursors'); ?></div> 338 <?php if ($cursor->activate_on == 0) { 339 echo esc_html__( 'Body', 'wpcustom-cursors' ); 340 } 341 else { 342 switch ($cursor->selector_type) { 343 case 'tag': 344 echo "<".esc_html( $cursor->selector_data ).">"; 345 break; 346 case 'class': 347 echo ".".esc_html( $cursor->selector_data ); 348 break; 349 case 'id': 350 echo "#".esc_html( $cursor->selector_data ); 351 break; 352 case 'attribute': 353 echo "[".esc_html( $cursor->selector_data )."]"; 354 break; 355 default: 356 echo esc_html__( 'No data!', 'wpcustom-cursors' ); 357 break; 192 358 } 193 else { 194 ?> 195 <img src="<?php echo esc_url( plugins_url( 'img/cursors/'.$cursor->cursor_shape.'.svg', __FILE__ ) ); ?>" alt="<?php echo esc_html__('Cursor Shape '.$cursor->cursor_shape, 'wpcustom-cursors');?>" class="list-shape-image" /> 196 <?php 197 } 198 break; 199 case "image": 200 if (str_contains($cursor->cursor_shape, "created")) { 201 $id = substr($cursor->cursor_shape, 8); 202 global $wpdb; 203 $tablename = $wpdb->prefix . "created_cursors"; 204 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 205 206 $stripped = stripslashes($created_cursor->cursor_options); 207 $decoded = json_decode($stripped, false); 208 ?> 209 <label class="created-cursor-label image" style="--width: <?php echo $decoded->width; ?>px; --background: <?php echo $decoded->background; ?>px; --color: <?php echo $decoded->color; ?>; --radius: <?php echo $decoded->radius; ?>px; --padding: <?php echo $decoded->padding; ?>px; --blending: <?php echo $decoded->blending; ?>; --click-point-x: <?php echo $click_point_x; ?>%; --click-point-y: <?php echo $click_point_y; ?>%;"><div class="img-wrapper"><img src="<?php echo $decoded->image_url; ?>" class="img-fluid" /></div> 210 </label> 211 <?php 212 } 213 else { 214 ?> 215 <img src="<?php echo $cursor->cursor_image; ?>" alt="<?php echo esc_html__('Cursor Image', 'wpcustom-cursors');?>" class="list-cursor-image" /> 216 <?php 217 } 218 break; 219 case "text": 220 if (str_contains($cursor->cursor_shape, "created")){ 221 $id = substr($cursor->cursor_shape, 8); 222 global $wpdb; 223 $tablename = $wpdb->prefix . "created_cursors"; 224 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 225 226 $stripped = stripslashes($created_cursor->cursor_options); 227 $decoded = json_decode($stripped, false); 228 229 if ($decoded->text_type == 'horizontal') { 230 ?> 231 <label class="created-cursor-label horizontal" style="--bg-color: <?php echo $decoded->hr_bgcolor; ?>; --hr-width: <?php echo $decoded->hr_width; ?>px; --hr-transfom: <?php echo $decoded->hr_transform; ?>; --hr-weight: <?php echo $decoded->hr_weight; ?>; --hr-color: <?php echo $decoded->hr_color; ?>; --hr-size: <?php echo $decoded->hr_size; ?>px;--hr-spacing: <?php echo $decoded->hr_spacing; ?>px;--hr-radius: <?php echo $decoded->hr_radius; ?>px;--hr-padding: <?php echo $decoded->hr_padding; ?>s; "> 232 <div class="hr-text"><?php echo $decoded->hr_text;?></div> 233 </label> 234 <?php 235 } 236 237 else { 238 239 ?> 240 <label class="created-cursor-label text" style="--dot-fill: <?php echo $decoded->dot_color; ?>; --text-width: <?php echo $decoded->width; ?>px; --text-transfom: <?php echo $decoded->text_transform; ?>; --font-weight: <?php echo $decoded->font_weight; ?>; --text-color: <?php echo $decoded->text_color; ?>; --font-size: <?php echo $decoded->font_size; ?>px;--word-spacing: <?php echo $decoded->word_spacing; ?>px;--animation-name: <?php echo $decoded->animation; ?>;--animation-duration: <?php echo $decoded->animation_duration; ?>s; --dot-width: <?php echo $decoded->dot_width; ?>px;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $decoded->text;?></textPath></text><circle cx="250" cy="250" r="<?php echo $decoded->dot_width;?>" id="svg_circle_node"/></svg> 241 </label> 242 <?php 243 244 } 245 } 246 else { 247 ?> 248 <label class="created-cursor-label text" style="--width: <?php echo $cursor->width; ?>px;--text-color: <?php echo $cursor->color; ?>;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $cursor->cursor_text;?></textPath></text></svg> 249 </label> 250 <?php 251 } 252 break; 253 } 254 ?> 255 </div> 256 <div class="col-md-2"> 257 <div> 258 <?php 259 echo esc_html(ucfirst($cursor->cursor_type)); 260 ?> 261 </div> 262 <div> 263 <?php 264 switch ($cursor->cursor_type) { 265 case 'shape': 266 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 267 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 268 $id = substr($cursor->cursor_shape, 8); 269 global $wpdb; 270 $tablename = $wpdb->prefix . "created_cursors"; 271 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 272 273 $stripped = stripslashes($created_cursor->cursor_options); 274 $decoded = json_decode($stripped, false); 275 276 echo '<div class="color-dot" style="background-color: '.$decoded->fe_color.'"></div>'; 277 echo '<div class="color-dot" style="background-color: '.$decoded->se_color.'"></div>'; 278 } 279 else { 280 echo '<div class="color-dot" style="background-color: '.$cursor->color.'"></div>'; 281 } 282 break; 283 284 case 'image': 285 echo esc_html__( 'Width: ', 'wpcustom-cursors' ); 286 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 287 $id = substr($cursor->cursor_shape, 8); 288 global $wpdb; 289 $tablename = $wpdb->prefix . "created_cursors"; 290 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 291 292 $stripped = stripslashes($created_cursor->cursor_options); 293 $decoded = json_decode($stripped, false); 294 295 echo '<span class="small">'.$decoded->width.' px</span>'; 296 } 297 else { 298 echo '<span class="small">'.$cursor->width.' px</span>'; 299 } 300 break; 301 302 case 'text': 303 $id = substr($cursor->cursor_shape, 8); 304 global $wpdb; 305 $tablename = $wpdb->prefix . "created_cursors"; 306 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 307 308 $stripped = stripslashes($created_cursor->cursor_options); 309 $decoded = json_decode($stripped, false); 310 311 if ($decoded->text_type == 'horizontal') { 312 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 313 echo '<div class="color-dot" style="background-color: '.$decoded->hr_bgcolor.'"></div>'; 314 } 315 else { 316 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 317 $id = substr($cursor->cursor_shape, 8); 318 global $wpdb; 319 $tablename = $wpdb->prefix . "created_cursors"; 320 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 321 322 $stripped = stripslashes($created_cursor->cursor_options); 323 $decoded = json_decode($stripped, false); 324 325 echo '<div class="color-dot" style="background-color: '.$decoded->text_color.'"></div>'; 326 } 327 328 break; 329 } 330 ?> 331 </div> 332 </div> 333 <div class="col-md-2"> 334 <div><?php echo esc_html__('Activate On:', 'wpcustom-cursors'); ?></div> 335 <?php if ($cursor->activate_on == 0) { 336 echo esc_html__( 'Body', 'wpcustom-cursors' ); 337 } 338 else { 339 switch ($cursor->selector_type) { 340 case 'tag': 341 echo "<".esc_html( $cursor->selector_data ).">"; 342 break; 343 case 'class': 344 echo ".".esc_html( $cursor->selector_data ); 345 break; 346 case 'id': 347 echo "#".esc_html( $cursor->selector_data ); 348 break; 349 case 'attribute': 350 echo "[".esc_html( $cursor->selector_data )."]"; 351 break; 352 default: 353 echo esc_html__( 'No data!', 'wpcustom-cursors' ); 354 break; 355 } 356 } ?> 357 </div> 358 <div class="col-md-6 text-end"> 359 <a href="<?php menu_page_url('wpcc_add_new', true); ?>&edit_row=<?php echo intval( $cursor->cursor_id ); ?>" title="<?php echo esc_html__( 'Edit Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-pencil-line ri-lg"></i></a> 360 <form action="" class="d-inline-block" method="post"> 361 <input type="hidden" name="delete_row" value="<?php echo esc_html( $cursor->cursor_id ); ?>"> 362 <button type="submit" name="delete" title="<?php echo esc_html__( 'Delete Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-close-fill ri-lg"></i></button> 363 <?php wp_nonce_field( 'wpcc_delete_cursor', 'wpcc_delete_nonce' ); ?> 364 </form> 365 </div> 366 </div> 359 } ?> 360 </div> 361 <div class="col-md-6 text-end"> 362 <a href="<?php menu_page_url('wpcc_add_new', true); ?>&edit_row=<?php echo intval( $cursor->cursor_id ); ?>" title="<?php echo esc_html__( 'Edit Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-pencil-line ri-lg"></i></a> 363 <form action="" class="d-inline-block" method="post"> 364 <input type="hidden" name="delete_row" value="<?php echo esc_html( $cursor->cursor_id ); ?>"> 365 <button type="submit" name="delete" title="<?php echo esc_html__( 'Delete Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-close-fill ri-lg"></i></button> 366 <?php wp_nonce_field( 'wpcc_delete_cursor', 'wpcc_delete_nonce' ); ?> 367 </form> 368 </div> 369 </div> 370 <?php 371 } 372 ?> 367 373 </div> 368 374 </div> 369 <?php 370 } 375 <?php 371 376 } 372 377 else { -
wp-custom-cursors/trunk/admin/class-wp-custom-cursors-admin.php
r2932233 r2936435 164 164 165 165 if ($cursors) { 166 foreach ($cursors as $cursor) {167 166 ?> 168 167 <div class="card bg-light"> … … 173 172 </div> 174 173 </div> 175 <div class="row align-items-center shadow py-3 rounded-4"> 176 <div class="col-md-2 position-relative text-center"> 177 <?php 178 switch ($cursor->cursor_type) { 179 case "shape": 174 <?php 175 foreach ($cursors as $cursor) { 176 ?> 177 178 <div class="row align-items-center mt-3 shadow py-3 rounded-4"> 179 <div class="col-md-2 position-relative text-center"> 180 <?php 181 switch ($cursor->cursor_type) { 182 case "shape": 183 if (str_contains($cursor->cursor_shape, "created")) { 184 $id = substr($cursor->cursor_shape, 8); 185 global $wpdb; 186 $tablename = $wpdb->prefix . "created_cursors"; 187 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 188 189 $stripped = stripslashes($created_cursor->cursor_options); 190 $decoded = json_decode($stripped, false); 191 ?> 192 <label class="created-cursor-label" style="--fe-width: <?php echo $decoded->fe_width; ?>px; --fe-height: <?php echo $decoded->fe_height; ?>px; --fe-color: <?php echo $decoded->fe_color; ?>; --fe-radius: <?php echo $decoded->fe_radius; ?>px; --fe-border: <?php echo $decoded->fe_border_width; ?>px; --fe-border-color: <?php echo $decoded->fe_border_color; ?>; --fe-blending: <?php echo $decoded->fe_blending; ?>; --fe-zindex: <?php echo $decoded->fe_zindex; ?>; --se-width: <?php echo $decoded->se_width; ?>px; --se-height: <?php echo $decoded->se_height; ?>px; --se-color: <?php echo $decoded->se_color; ?>; --se-radius: <?php echo $decoded->se_radius; ?>px; --se-border: <?php echo $decoded->se_border_width; ?>px; --se-border-color: <?php echo $decoded->se_border_color; ?>; --se-blending: <?php echo $decoded->se_blending; ?>; --se-zindex: <?php echo $decoded->se_zindex; ?>;"><div class="cursor-el1" ></div><div class="cursor-el2"></div> 193 </label> 194 <?php 195 } 196 else { 197 ?> 198 <img src="<?php echo esc_url( plugins_url( 'img/cursors/'.$cursor->cursor_shape.'.svg', __FILE__ ) ); ?>" alt="<?php echo esc_html__('Cursor Shape '.$cursor->cursor_shape, 'wpcustom-cursors');?>" class="list-shape-image" /> 199 <?php 200 } 201 break; 202 case "image": 180 203 if (str_contains($cursor->cursor_shape, "created")) { 181 $id = substr($cursor->cursor_shape, 8); 204 $id = substr($cursor->cursor_shape, 8); 205 global $wpdb; 206 $tablename = $wpdb->prefix . "created_cursors"; 207 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 208 209 $stripped = stripslashes($created_cursor->cursor_options); 210 $decoded = json_decode($stripped, false); 211 ?> 212 <label class="created-cursor-label image" style="--width: <?php echo $decoded->width; ?>px; --background: <?php echo $decoded->background; ?>px; --color: <?php echo $decoded->color; ?>; --radius: <?php echo $decoded->radius; ?>px; --padding: <?php echo $decoded->padding; ?>px; --blending: <?php echo $decoded->blending; ?>; --click-point-x: <?php echo $click_point_x; ?>%; --click-point-y: <?php echo $click_point_y; ?>%;"><div class="img-wrapper"><img src="<?php echo $decoded->image_url; ?>" class="img-fluid" /></div> 213 </label> 214 <?php 215 } 216 else { 217 ?> 218 <img src="<?php echo $cursor->cursor_image; ?>" alt="<?php echo esc_html__('Cursor Image', 'wpcustom-cursors');?>" class="list-cursor-image" /> 219 <?php 220 } 221 break; 222 case "text": 223 if (str_contains($cursor->cursor_shape, "created")){ 224 $id = substr($cursor->cursor_shape, 8); 225 global $wpdb; 226 $tablename = $wpdb->prefix . "created_cursors"; 227 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 228 229 $stripped = stripslashes($created_cursor->cursor_options); 230 $decoded = json_decode($stripped, false); 231 232 if ($decoded->text_type == 'horizontal') { 233 ?> 234 <label class="created-cursor-label horizontal" style="--bg-color: <?php echo $decoded->hr_bgcolor; ?>; --hr-width: <?php echo $decoded->hr_width; ?>px; --hr-transfom: <?php echo $decoded->hr_transform; ?>; --hr-weight: <?php echo $decoded->hr_weight; ?>; --hr-color: <?php echo $decoded->hr_color; ?>; --hr-size: <?php echo $decoded->hr_size; ?>px;--hr-spacing: <?php echo $decoded->hr_spacing; ?>px;--hr-radius: <?php echo $decoded->hr_radius; ?>px;--hr-padding: <?php echo $decoded->hr_padding; ?>s; "> 235 <div class="hr-text"><?php echo $decoded->hr_text;?></div> 236 </label> 237 <?php 238 } 239 240 else { 241 242 ?> 243 <label class="created-cursor-label text" style="--dot-fill: <?php echo $decoded->dot_color; ?>; --text-width: <?php echo $decoded->width; ?>px; --text-transfom: <?php echo $decoded->text_transform; ?>; --font-weight: <?php echo $decoded->font_weight; ?>; --text-color: <?php echo $decoded->text_color; ?>; --font-size: <?php echo $decoded->font_size; ?>px;--word-spacing: <?php echo $decoded->word_spacing; ?>px;--animation-name: <?php echo $decoded->animation; ?>;--animation-duration: <?php echo $decoded->animation_duration; ?>s; --dot-width: <?php echo $decoded->dot_width; ?>px;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $decoded->text;?></textPath></text><circle cx="250" cy="250" r="<?php echo $decoded->dot_width;?>" id="svg_circle_node"/></svg> 244 </label> 245 <?php 246 247 } 248 } 249 else { 250 ?> 251 <label class="created-cursor-label text" style="--width: <?php echo $cursor->width; ?>px;--text-color: <?php echo $cursor->color; ?>;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $cursor->cursor_text;?></textPath></text></svg> 252 </label> 253 <?php 254 } 255 break; 256 } 257 ?> 258 </div> 259 <div class="col-md-2"> 260 <div> 261 <?php 262 echo esc_html(ucfirst($cursor->cursor_type)); 263 ?> 264 </div> 265 <div> 266 <?php 267 switch ($cursor->cursor_type) { 268 case 'shape': 269 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 270 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 271 $id = substr($cursor->cursor_shape, 8); 272 global $wpdb; 273 $tablename = $wpdb->prefix . "created_cursors"; 274 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 275 276 $stripped = stripslashes($created_cursor->cursor_options); 277 $decoded = json_decode($stripped, false); 278 279 echo '<div class="color-dot" style="background-color: '.$decoded->fe_color.'"></div>'; 280 echo '<div class="color-dot" style="background-color: '.$decoded->se_color.'"></div>'; 281 } 282 else { 283 echo '<div class="color-dot" style="background-color: '.$cursor->color.'"></div>'; 284 } 285 break; 286 287 case 'image': 288 echo esc_html__( 'Width: ', 'wpcustom-cursors' ); 289 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 290 $id = substr($cursor->cursor_shape, 8); 291 global $wpdb; 292 $tablename = $wpdb->prefix . "created_cursors"; 293 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 294 295 $stripped = stripslashes($created_cursor->cursor_options); 296 $decoded = json_decode($stripped, false); 297 298 echo '<span class="small">'.$decoded->width.' px</span>'; 299 } 300 else { 301 echo '<span class="small">'.$cursor->width.' px</span>'; 302 } 303 break; 304 305 case 'text': 306 $id = substr($cursor->cursor_shape, 8); 182 307 global $wpdb; 183 308 $tablename = $wpdb->prefix . "created_cursors"; … … 186 311 $stripped = stripslashes($created_cursor->cursor_options); 187 312 $decoded = json_decode($stripped, false); 188 ?> 189 <label class="created-cursor-label" style="--fe-width: <?php echo $decoded->fe_width; ?>px; --fe-height: <?php echo $decoded->fe_height; ?>px; --fe-color: <?php echo $decoded->fe_color; ?>; --fe-radius: <?php echo $decoded->fe_radius; ?>px; --fe-border: <?php echo $decoded->fe_border_width; ?>px; --fe-border-color: <?php echo $decoded->fe_border_color; ?>; --fe-blending: <?php echo $decoded->fe_blending; ?>; --fe-zindex: <?php echo $decoded->fe_zindex; ?>; --se-width: <?php echo $decoded->se_width; ?>px; --se-height: <?php echo $decoded->se_height; ?>px; --se-color: <?php echo $decoded->se_color; ?>; --se-radius: <?php echo $decoded->se_radius; ?>px; --se-border: <?php echo $decoded->se_border_width; ?>px; --se-border-color: <?php echo $decoded->se_border_color; ?>; --se-blending: <?php echo $decoded->se_blending; ?>; --se-zindex: <?php echo $decoded->se_zindex; ?>;"><div class="cursor-el1" ></div><div class="cursor-el2"></div> 190 </label> 191 <?php 313 314 if ($decoded->text_type == 'horizontal') { 315 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 316 echo '<div class="color-dot" style="background-color: '.$decoded->hr_bgcolor.'"></div>'; 317 } 318 else { 319 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 320 $id = substr($cursor->cursor_shape, 8); 321 global $wpdb; 322 $tablename = $wpdb->prefix . "created_cursors"; 323 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 324 325 $stripped = stripslashes($created_cursor->cursor_options); 326 $decoded = json_decode($stripped, false); 327 328 echo '<div class="color-dot" style="background-color: '.$decoded->text_color.'"></div>'; 329 } 330 331 break; 332 } 333 ?> 334 </div> 335 </div> 336 <div class="col-md-2"> 337 <div><?php echo esc_html__('Activate On:', 'wpcustom-cursors'); ?></div> 338 <?php if ($cursor->activate_on == 0) { 339 echo esc_html__( 'Body', 'wpcustom-cursors' ); 340 } 341 else { 342 switch ($cursor->selector_type) { 343 case 'tag': 344 echo "<".esc_html( $cursor->selector_data ).">"; 345 break; 346 case 'class': 347 echo ".".esc_html( $cursor->selector_data ); 348 break; 349 case 'id': 350 echo "#".esc_html( $cursor->selector_data ); 351 break; 352 case 'attribute': 353 echo "[".esc_html( $cursor->selector_data )."]"; 354 break; 355 default: 356 echo esc_html__( 'No data!', 'wpcustom-cursors' ); 357 break; 192 358 } 193 else { 194 ?> 195 <img src="<?php echo esc_url( plugins_url( 'img/cursors/'.$cursor->cursor_shape.'.svg', __FILE__ ) ); ?>" alt="<?php echo esc_html__('Cursor Shape '.$cursor->cursor_shape, 'wpcustom-cursors');?>" class="list-shape-image" /> 196 <?php 197 } 198 break; 199 case "image": 200 if (str_contains($cursor->cursor_shape, "created")) { 201 $id = substr($cursor->cursor_shape, 8); 202 global $wpdb; 203 $tablename = $wpdb->prefix . "created_cursors"; 204 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 205 206 $stripped = stripslashes($created_cursor->cursor_options); 207 $decoded = json_decode($stripped, false); 208 ?> 209 <label class="created-cursor-label image" style="--width: <?php echo $decoded->width; ?>px; --background: <?php echo $decoded->background; ?>px; --color: <?php echo $decoded->color; ?>; --radius: <?php echo $decoded->radius; ?>px; --padding: <?php echo $decoded->padding; ?>px; --blending: <?php echo $decoded->blending; ?>; --click-point-x: <?php echo $click_point_x; ?>%; --click-point-y: <?php echo $click_point_y; ?>%;"><div class="img-wrapper"><img src="<?php echo $decoded->image_url; ?>" class="img-fluid" /></div> 210 </label> 211 <?php 212 } 213 else { 214 ?> 215 <img src="<?php echo $cursor->cursor_image; ?>" alt="<?php echo esc_html__('Cursor Image', 'wpcustom-cursors');?>" class="list-cursor-image" /> 216 <?php 217 } 218 break; 219 case "text": 220 if (str_contains($cursor->cursor_shape, "created")){ 221 $id = substr($cursor->cursor_shape, 8); 222 global $wpdb; 223 $tablename = $wpdb->prefix . "created_cursors"; 224 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 225 226 $stripped = stripslashes($created_cursor->cursor_options); 227 $decoded = json_decode($stripped, false); 228 229 if ($decoded->text_type == 'horizontal') { 230 ?> 231 <label class="created-cursor-label horizontal" style="--bg-color: <?php echo $decoded->hr_bgcolor; ?>; --hr-width: <?php echo $decoded->hr_width; ?>px; --hr-transfom: <?php echo $decoded->hr_transform; ?>; --hr-weight: <?php echo $decoded->hr_weight; ?>; --hr-color: <?php echo $decoded->hr_color; ?>; --hr-size: <?php echo $decoded->hr_size; ?>px;--hr-spacing: <?php echo $decoded->hr_spacing; ?>px;--hr-radius: <?php echo $decoded->hr_radius; ?>px;--hr-padding: <?php echo $decoded->hr_padding; ?>s; "> 232 <div class="hr-text"><?php echo $decoded->hr_text;?></div> 233 </label> 234 <?php 235 } 236 237 else { 238 239 ?> 240 <label class="created-cursor-label text" style="--dot-fill: <?php echo $decoded->dot_color; ?>; --text-width: <?php echo $decoded->width; ?>px; --text-transfom: <?php echo $decoded->text_transform; ?>; --font-weight: <?php echo $decoded->font_weight; ?>; --text-color: <?php echo $decoded->text_color; ?>; --font-size: <?php echo $decoded->font_size; ?>px;--word-spacing: <?php echo $decoded->word_spacing; ?>px;--animation-name: <?php echo $decoded->animation; ?>;--animation-duration: <?php echo $decoded->animation_duration; ?>s; --dot-width: <?php echo $decoded->dot_width; ?>px;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $decoded->text;?></textPath></text><circle cx="250" cy="250" r="<?php echo $decoded->dot_width;?>" id="svg_circle_node"/></svg> 241 </label> 242 <?php 243 244 } 245 } 246 else { 247 ?> 248 <label class="created-cursor-label text" style="--width: <?php echo $cursor->width; ?>px;--text-color: <?php echo $cursor->color; ?>;"><svg viewBox="0 0 500 500" id="svg_node"><path d="M50,250c0-110.5,89.5-200,200-200s200,89.5,200,200s-89.5,200-200,200S50,360.5,50,250" id="textcircle" fill="none"></path><text dy="25" id="svg_text_cursor"><textPath xlink:href="#textcircle" id="textpath"><?php echo $cursor->cursor_text;?></textPath></text></svg> 249 </label> 250 <?php 251 } 252 break; 253 } 254 ?> 255 </div> 256 <div class="col-md-2"> 257 <div> 258 <?php 259 echo esc_html(ucfirst($cursor->cursor_type)); 260 ?> 261 </div> 262 <div> 263 <?php 264 switch ($cursor->cursor_type) { 265 case 'shape': 266 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 267 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 268 $id = substr($cursor->cursor_shape, 8); 269 global $wpdb; 270 $tablename = $wpdb->prefix . "created_cursors"; 271 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 272 273 $stripped = stripslashes($created_cursor->cursor_options); 274 $decoded = json_decode($stripped, false); 275 276 echo '<div class="color-dot" style="background-color: '.$decoded->fe_color.'"></div>'; 277 echo '<div class="color-dot" style="background-color: '.$decoded->se_color.'"></div>'; 278 } 279 else { 280 echo '<div class="color-dot" style="background-color: '.$cursor->color.'"></div>'; 281 } 282 break; 283 284 case 'image': 285 echo esc_html__( 'Width: ', 'wpcustom-cursors' ); 286 if ( str_contains( $cursor->cursor_shape, "created" ) ) { 287 $id = substr($cursor->cursor_shape, 8); 288 global $wpdb; 289 $tablename = $wpdb->prefix . "created_cursors"; 290 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 291 292 $stripped = stripslashes($created_cursor->cursor_options); 293 $decoded = json_decode($stripped, false); 294 295 echo '<span class="small">'.$decoded->width.' px</span>'; 296 } 297 else { 298 echo '<span class="small">'.$cursor->width.' px</span>'; 299 } 300 break; 301 302 case 'text': 303 $id = substr($cursor->cursor_shape, 8); 304 global $wpdb; 305 $tablename = $wpdb->prefix . "created_cursors"; 306 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 307 308 $stripped = stripslashes($created_cursor->cursor_options); 309 $decoded = json_decode($stripped, false); 310 311 if ($decoded->text_type == 'horizontal') { 312 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 313 echo '<div class="color-dot" style="background-color: '.$decoded->hr_bgcolor.'"></div>'; 314 } 315 else { 316 echo esc_html__( 'Color:', 'wpcustom-cursors' ); 317 $id = substr($cursor->cursor_shape, 8); 318 global $wpdb; 319 $tablename = $wpdb->prefix . "created_cursors"; 320 $created_cursor = $wpdb->get_row("SELECT * FROM $tablename WHERE cursor_id = $id"); 321 322 $stripped = stripslashes($created_cursor->cursor_options); 323 $decoded = json_decode($stripped, false); 324 325 echo '<div class="color-dot" style="background-color: '.$decoded->text_color.'"></div>'; 326 } 327 328 break; 329 } 330 ?> 331 </div> 332 </div> 333 <div class="col-md-2"> 334 <div><?php echo esc_html__('Activate On:', 'wpcustom-cursors'); ?></div> 335 <?php if ($cursor->activate_on == 0) { 336 echo esc_html__( 'Body', 'wpcustom-cursors' ); 337 } 338 else { 339 switch ($cursor->selector_type) { 340 case 'tag': 341 echo "<".esc_html( $cursor->selector_data ).">"; 342 break; 343 case 'class': 344 echo ".".esc_html( $cursor->selector_data ); 345 break; 346 case 'id': 347 echo "#".esc_html( $cursor->selector_data ); 348 break; 349 case 'attribute': 350 echo "[".esc_html( $cursor->selector_data )."]"; 351 break; 352 default: 353 echo esc_html__( 'No data!', 'wpcustom-cursors' ); 354 break; 355 } 356 } ?> 357 </div> 358 <div class="col-md-6 text-end"> 359 <a href="<?php menu_page_url('wpcc_add_new', true); ?>&edit_row=<?php echo intval( $cursor->cursor_id ); ?>" title="<?php echo esc_html__( 'Edit Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-pencil-line ri-lg"></i></a> 360 <form action="" class="d-inline-block" method="post"> 361 <input type="hidden" name="delete_row" value="<?php echo esc_html( $cursor->cursor_id ); ?>"> 362 <button type="submit" name="delete" title="<?php echo esc_html__( 'Delete Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-close-fill ri-lg"></i></button> 363 <?php wp_nonce_field( 'wpcc_delete_cursor', 'wpcc_delete_nonce' ); ?> 364 </form> 365 </div> 366 </div> 359 } ?> 360 </div> 361 <div class="col-md-6 text-end"> 362 <a href="<?php menu_page_url('wpcc_add_new', true); ?>&edit_row=<?php echo intval( $cursor->cursor_id ); ?>" title="<?php echo esc_html__( 'Edit Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-pencil-line ri-lg"></i></a> 363 <form action="" class="d-inline-block" method="post"> 364 <input type="hidden" name="delete_row" value="<?php echo esc_html( $cursor->cursor_id ); ?>"> 365 <button type="submit" name="delete" title="<?php echo esc_html__( 'Delete Cursor', 'wpcustom-cursors' ); ?>" class="wpcc-icon"><i class="ri-close-fill ri-lg"></i></button> 366 <?php wp_nonce_field( 'wpcc_delete_cursor', 'wpcc_delete_nonce' ); ?> 367 </form> 368 </div> 369 </div> 370 <?php 371 } 372 ?> 367 373 </div> 368 374 </div> 369 <?php 370 } 375 <?php 371 376 } 372 377 else {
Note: See TracChangeset
for help on using the changeset viewer.