| Server IP : 216.238.66.20 / Your IP : 216.73.216.249 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/sweetheart.mx/htdocs/wp-content/plugins/pods/ui/fields/ |
Upload File : |
<?php
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
pods_form_enqueue_script( 'pods-codemirror' );
pods_form_enqueue_style( 'pods-codemirror' );
pods_form_enqueue_style( 'pods-styles' );
pods_form_enqueue_script( 'pods-codemirror-loadmode' );
$type = 'textarea';
$attributes = array();
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes( $attributes, $name, $form_field_type, $options, 'pods-ui-field-codemirror' );
?>
<div class="pods-codemirror pods-compat-container pods-form-ui-field">
<div class="code-toolbar"><!-- Placeholder --></div>
<textarea<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?>><?php echo esc_textarea( $value ); ?></textarea>
<div class="code-footer"><!-- Placeholder --></div>
<script>
var $textarea_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>,
codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>;
jQuery( function ( $ ) {
$textarea_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?> = jQuery( 'textarea#<?php echo esc_js( $attributes['id'] ); ?>' );
CodeMirror.modeURL = "<?php echo esc_js( PODS_URL ); ?>ui/js/codemirror/mode/%N/%N.js";
if ( 'undefined' == typeof codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?> ) {
codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?> = CodeMirror.fromTextArea( document.getElementById( "<?php echo esc_js( $attributes['id'] ); ?>" ), {
lineNumbers : true,
matchBrackets : true,
mode : "application/x-httpd-php",
indentUnit : 4,
indentWithTabs : false,
lineWrapping : true,
enterMode : "keep",
tabMode : "shift"
} );
codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>.on( 'blur', function () {
var value = codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>.getValue();
$textarea_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>.val( value );
} );
CodeMirror.autoLoadMode( codemirror_<?php echo esc_js( pods_js_name( $attributes['id'] ) ); ?>, 'php' );
}
} );
</script>
</div>