PluginProbe
WP Directory Kit / 1.2.7
WP Directory Kit v1.2.7
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / application / views / fields_edit / TEXTAREA_CODE.php

TEXTAREA_CODE.php in WP Directory Kit 1.2.7, at application/views/fields_edit/TEXTAREA_CODE.php

74 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Edit field TEXTAREA.
4 *
5 * This is the template that field layout for edit form
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <?php
14
15 //wmvc_dump($field);
16
17 if(isset($field->field))
18 {
19 $field_id = $field->field;
20 }
21 else
22 {
23 $field_id = 'field_'.$field->idfield;
24 }
25
26 if(!isset($field->hint))$field->hint = '';
27 if(!isset($field->columns_number))$field->columns_number = '';
28 if(!isset($field->class))$field->class = '';
29
30 $field_label = $field->field_label;
31
32 $required = '';
33 if(isset($field->is_required) && $field->is_required == 1)
34 $required = '*';
35
36 if(isset($field->rules) && strpos($field->rules, 'required') !== FALSE)
37 $required = '*';
38
39 wp_enqueue_script( 'code-editor' );
40 wp_enqueue_style( 'code-editor' );
41 wp_enqueue_script( 'htmlhint' );
42 wp_enqueue_script( 'csslint' );
43 wp_enqueue_script( 'jshint' );
44
45 ?>
46 <div class="wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>">
47 <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label>
48 <div class="wdk-field-container">
49 <?php
50 wp_editor((wmvc_show_data(esc_attr($field_id), $db_data, '', FALSE)), esc_attr($field_id), array (
51 'textarea_rows' => 5,
52 'media_buttons' => FALSE,
53 'wpautop' => false,
54 'teeny' => false,
55 'tinymce' => false,
56 'teeny' => false,
57 'dfw' => false,
58 'quicktags' => false
59 ));
60 ?>
61 <?php if(!empty($field->hint)):?>
62 <p class="wdk-hint">
63 <?php echo wp_kses_post($field->hint); ?>
64 </p>
65 <?php endif;?>
66 </div>
67 </div>
68
69 <script>
70 jQuery(document).ready(function($) {
71 wp.codeEditor.initialize($('#<?php echo esc_js($field_id);?>' ));
72 })
73 </script>
74