PluginProbe
M Chart / 1.2.1
M Chart v1.2.1
2.3.2 2.3.1 2.3 2.2.2 2.2.1 2.2 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.10 1.10.1 1.11 1.11.1 1.11.2 1.12 1.2 1.2.1 1.3 1.3.1 1.3.2 All 53 releases
m-chart / components / templates / highcharts-settings.php

highcharts-settings.php in M Chart 1.2.1, at components/templates/highcharts-settings.php

180 lines 8.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $type_option_names = array(
3 'line' => esc_html__( 'Line', 'm-chart' ),
4 'spline' => esc_html__( 'Spline', 'm-chart' ),
5 'area' => esc_html__( 'Area', 'm-chart' ),
6 'column' => esc_html__( 'Column', 'm-chart' ),
7 'bar' => esc_html__( 'Bar', 'm-chart' ),
8 'pie' => esc_html__( 'Pie', 'm-chart' ),
9 );
10
11 $parse_option_names = array(
12 'columns' => esc_html__( 'Columns', 'm-chart' ),
13 'rows' => esc_html__( 'Rows', 'm-chart' ),
14 );
15
16 ?>
17 <div class="settings">
18 <div class="row one">
19 <p>
20 <label for="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>"><?php esc_html_e( 'Type', 'm-chart' ); ?></label><br />
21 <select name='<?php echo esc_attr( $this->get_field_name( 'type' ) ); ?>' class='select' id="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>">
22 <?php
23 foreach ( m_chart()->highcharts()->type_options as $type ) {
24 ?>
25 <option value="<?php echo esc_attr( $type ); ?>"<?php selected( $type, $post_meta['type'] ); ?>>
26 <?php echo esc_html( $type_option_names[ $type ] ); ?>
27 </option>
28 <?php
29 }
30 ?>
31 </select>
32 </p>
33 <p>
34 <label for="<?php echo $this->get_field_id( 'theme' ); ?>"><?php esc_html_e( 'Theme', 'm-chart' ); ?></label><br />
35 <select name="<?php echo $this->get_field_name( 'theme' ); ?>" id="<?php echo $this->get_field_id( 'theme' ); ?>">
36 <?php
37 foreach ( m_chart()->highcharts()->get_themes() as $theme ) {
38 ?>
39 <option value="<?php echo esc_attr( $theme->slug ); ?>"<?php selected( $theme->slug, $post_meta['theme'] ); ?>>
40 <?php esc_html_e( $theme->name, 'm-chart' ); ?>
41 </option>
42 <?php
43 }
44 ?>
45 </select>
46 </p>
47 <p>
48 <label for="<?php echo esc_attr( $this->get_field_id( 'height' ) ); ?>"><?php esc_html_e( 'Height', 'm-chart' ); ?></label><br />
49 <input type="number" name="<?php echo esc_attr( $this->get_field_name( 'height' ) ); ?>" value="<?php echo absint( $post_meta['height'] ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'height' ) ); ?>" min="300" max="900" />
50 </p>
51 </div>
52 <div class="row two">
53 <p>
54 <label for="<?php echo esc_attr( $this->get_field_id( 'parse_in' ) ); ?>"><?php esc_html_e( 'Parse data in', 'm-chart' ); ?></label><br />
55 <select name='<?php echo esc_attr( $this->get_field_name( 'parse_in' ) ); ?>' class='select' id="<?php echo esc_attr( $this->get_field_id( 'parse_in' ) ); ?>">
56 <?php
57 foreach ( m_chart()->parse_options as $parse_in ) {
58 ?>
59 <option value="<?php echo esc_attr( $parse_in ); ?>"<?php selected( $parse_in, $post_meta['parse_in'] ); ?>>
60 <?php echo esc_html( $parse_option_names[ $parse_in ] ); ?>
61 </option>
62 <?php
63 }
64 ?>
65 </select>
66 </p>
67 <p class="labels">
68 &nbsp;<br />
69 <label for="<?php echo esc_attr( $this->get_field_id( 'labels' ) ); ?>">
70 <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'labels' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'labels' ) ); ?>" value="1"<?php checked( $post_meta['labels'], true ); ?>/>
71 <?php esc_html_e( 'Show labels', 'm-chart' ); ?>
72 </label>
73 </p>
74 <p>
75 &nbsp;<br />
76 <label for="<?php echo esc_attr( $this->get_field_id( 'legend' ) ); ?>">
77 <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'legend' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'legend' ) ); ?>" value="1"<?php checked( $post_meta['legend'], true ); ?>/>
78 <?php esc_html_e( 'Show legend', 'm-chart' ); ?>
79 </label>
80 </p>
81 </div>
82 <div class="row three vertical-axis">
83 <p>
84 <label for="<?php echo esc_attr( $this->get_field_id( 'y-title' ) ); ?>"><?php esc_html_e( 'Vertical axis title', 'm-chart' ); ?></label><br />
85 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'y_title' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'y-title' ) ); ?>" value="<?php echo esc_attr( $post_meta['y_title'] ); ?>" style="width: 100%;" />
86 </p>
87 <p class="units">
88 <label for="<?php echo esc_attr( $this->get_field_id( 'y-units' ) ); ?>"><?php esc_html_e( 'Units', 'm-chart' ); ?></label><br />
89 <select name='<?php echo esc_attr( $this->get_field_name( 'y_units' ) ); ?>' id="<?php echo esc_attr( $this->get_field_id( 'y-units' ) ); ?>" class='select'>
90 <option value=""><?php esc_html_e( 'N/A', 'm-chart' ); ?></option>
91 <?php
92 foreach ( m_chart()->get_unit_terms() as $parent => $units ) {
93 ?>
94 <option value="" disabled="disabled">
95 <?php echo esc_html( $parent ); ?>
96 </option>
97 <?php
98
99 foreach ( $units as $unit ) {
100 ?>
101 <option value="<?php echo esc_attr( $unit->name ); ?>"<?php selected( $unit->name, $post_meta['y_units'] ); ?>>
102 <?php echo esc_html( $unit->name ); ?>
103 </option>
104 <?php
105 }
106 }
107 ?>
108 </select>
109 </p>
110 </div>
111 <div class="row four y-min">
112 <p>
113 <label for="<?php echo esc_attr( $this->get_field_id( 'y-min' ) ); ?>">
114 <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'y_min' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'y-min' ) ); ?>" value="1"<?php checked( $post_meta['y_min'], true ); ?>/>
115 <?php esc_html_e( 'Force vertical axis minimum to zero', 'm-chart' ) ?>
116 </label>
117 </p>
118 </div>
119 <div class="row five horizontal-axis">
120 <p>
121 <label for="<?php echo esc_attr( $this->get_field_id( 'x-title' ) ); ?>"><?php esc_html_e( 'Horizontal axis title', 'm-chart' ); ?></label><br />
122 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'x_title' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'x-title' ) ); ?>" value="<?php echo esc_attr( $post_meta['x_title'] ); ?>" style="width: 100%;" />
123 </p>
124 <p class="units">
125 <label for="<?php echo esc_attr( $this->get_field_id( 'x-units' ) ); ?>"><?php esc_html_e( 'Units', 'm-chart' ); ?></label><br />
126 <select name='<?php echo esc_attr( $this->get_field_name( 'x_units' ) ); ?>' id="<?php echo esc_attr( $this->get_field_id( 'x-units' ) ); ?>" class='select'>
127 <option value=""><?php esc_html_e( 'N/A', 'm-chart' ) ?></option>
128 <?php
129 foreach ( m_chart()->get_unit_terms() as $parent => $units ) {
130 ?>
131 <option value="" disabled="disabled">
132 <?php echo esc_html( $parent ); ?>
133 </option>
134 <?php
135
136 foreach ( $units as $unit ) {
137 ?>
138 <option value="<?php echo esc_attr( $unit->name ); ?>"<?php selected( $unit->name, $post_meta['x_units'] ); ?>>
139 <?php echo esc_html( $unit->name ); ?>
140 </option>
141 <?php
142 }
143 }
144 ?>
145 </select>
146 </p>
147 </div>
148 <div class="row six">
149 <p>
150 <label for="<?php echo esc_attr( $this->get_field_id( 'source' ) ); ?>"><?php esc_html_e( 'Source', 'm-chart' ); ?></label><br />
151 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'source' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'source' ) ); ?>" value="<?php echo esc_attr( $post_meta['source'] ); ?>" style="width: 100%;" placeholder="Name of the source of this data" />
152 </p>
153 <p>
154 <label for="<?php echo esc_attr( $this->get_field_id( 'source-url' ) ); ?>"><?php esc_html_e( 'Source URL', 'm-chart' ); ?></label><br />
155 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'source_url' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'source-url' ) ); ?>" value="<?php echo esc_attr( $post_meta['source_url'] ); ?>" style="width: 100%;" placeholder="URL to the source of this data" />
156 </p>
157 </div>
158 </div>
159 <div class="row seven">
160 <p>
161 <label for="<?php echo esc_attr( $this->get_field_id( 'shortcode' ) ); ?>"><?php esc_html_e( 'Shortcode', 'm-chart' ); ?></label><br />
162 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'shortcode' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'shortcode' ) ); ?>" value='[chart id="<?php echo absint( $post->ID ); ?>"]' style="width: 100%;" readonly="readonly" />
163 </p>
164 <p class="image">
165 <label for="<?php echo esc_attr( $this->get_field_id( 'image' ) ); ?>"><?php esc_html_e( 'Image', 'm-chart' ); ?></label><br />
166 <?php
167 if ( $image ) {
168 ?>
169 <input class="input" type="text" name="<?php echo esc_attr( $this->get_field_name( 'image' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'image' ) ); ?>" value="<?php echo esc_url( $image['url'] ); ?>" style="width: 100%;" readonly="readonly" />
170 <a href="<?php echo esc_url( $image['url'] ); ?>" class="button" target="_blank"><?php esc_html_e( 'View', 'm-chart' ); ?></a>
171 <?php
172 } elseif ( 'default' != $settings['performance'] ) {
173 ?><em><?php esc_html_e( 'Image generation is disabled', 'm-chart' ); ?></em><?php
174 } else {
175 ?><em><?php esc_html_e( 'Save/Update this post to generate the image version', 'm-chart' ); ?></em><?php
176 }
177 ?>
178 </p>
179 <input type="hidden" name="<?php echo esc_attr( $this->get_field_name( 'library' ) ); ?>" value="highcharts" id="<?php echo esc_attr( $this->get_field_id( 'library' ) ); ?>">
180 </div>