Exemplo n.º 1
0
                                if (!$field['size']) {
                                    ?>
width:<?php 
                                    echo $frmpro_settings->field_width;
                                }
                                ?>
" <?php 
                                do_action('frm_field_input_html', $field);
                                ?>
><?php 
                                echo FrmAppHelper::esc_textarea($field['value']);
                                ?>
</textarea>
<?php 
                                global $frm_mobile;
                                if ($frm_mobile or FrmProFieldsHelper::mobile_check()) {
                                } else {
                                    global $frm_rte_loaded;
                                    $frm_rte_loaded[] = 'field_' . $field['field_key'];
                                }
                            }
                        } else {
                            if ($field['type'] == 'file') {
                                ?>
<input type="file" name="file<?php 
                                echo $field['id'];
                                ?>
" id="field_<?php 
                                echo $field['field_key'];
                                ?>
" <?php 
Exemplo n.º 2
0
px;<?php 
                                if (!$field['size']) {
                                    ?>
width:<?php 
                                    echo $frmpro_settings->field_width;
                                }
                                ?>
" <?php 
                                do_action('frm_field_input_html', $field);
                                ?>
><?php 
                                echo FrmAppHelper::esc_textarea($field['value']);
                                ?>
</textarea>
<?php 
                                if (!FrmProFieldsHelper::mobile_check()) {
                                    if (!isset($frm_vars['rte_loaded'])) {
                                        $frm_vars['rte_loaded'] = array();
                                    }
                                    $frm_vars['rte_loaded'][] = 'field_' . $field['field_key'];
                                }
                            }
                        } else {
                            if ($field['type'] == 'file') {
                                if (isset($field['read_only']) && $field['read_only'] && (!isset($frm_vars['readonly']) || $frm_vars['readonly'] != 'disabled')) {
                                    foreach ((array) maybe_unserialize($field['value']) as $media_id) {
                                        if (!is_numeric($media_id)) {
                                            continue;
                                        }
                                        ?>
<input type="hidden" name="<?php 
 function graph_shortcode($atts)
 {
     if (isset($atts['google']) and $atts['google'] or isset($atts['type']) and in_array($atts['type'], array('geo', 'SteppedArea', 'table'))) {
         return $this->google_graph($atts);
     }
     global $frm_mobile;
     if ($frm_mobile or FrmProFieldsHelper::mobile_check()) {
         return $this->google_graph($atts);
     }
     //fallback to google graphs if mobile device
     $defaults = array('id' => false, 'id2' => false, 'id3' => false, 'id4' => false, 'ids' => false, 'include_js' => true, 'colors' => '#EF8C08,#21759B,#1C9E05', 'grid_color' => '#f7e8bf', 'bg_color' => '#FFFFFF', 'height' => 400, 'width' => 400, 'truncate' => 40, 'truncate_label' => 7, 'response_count' => 10, 'user_id' => false, 'type' => 'default', 'x_axis' => false, 'data_type' => 'count', 'limit' => '', 'x_start' => '', 'x_end' => '', 'show_key' => false, 'min' => '', 'max' => '', 'include_zero' => false, 'google' => false);
     extract(shortcode_atts($defaults, $atts));
     if (!$id) {
         return;
     }
     global $frm_field;
     if (!$ids and ($id2 or $id3 or $id4)) {
         $ids = array($id2, $id3, $id4);
         $ids = implode(',', $ids);
     }
     $x_axis = (!$x_axis or $x_axis == 'false') ? false : $x_axis;
     $user_id = FrmProAppHelper::get_user_id_param($user_id);
     $html = $js = $js_content = $js_content2 = '';
     $fields = $frm_field->getAll("fi.id in ({$id})");
     $colors = explode(',', $colors);
     require_once FRMPRO_PATH . '/js/ofc-library/open-flash-chart-object.php';
     require_once FRMPRO_PATH . '/js/ofc-library/open-flash-chart.php';
     global $wp_scripts;
     $swfobject = isset($wp_scripts->registered['swfobject']) ? $wp_scripts->registered['swfobject'] : '';
     $json2 = isset($wp_scripts->registered['json2']) ? $wp_scripts->registered['json2'] : '';
     $js_content .= '<script type="text/javascript">';
     if ($include_js and (!in_array('swfobject', $wp_scripts->done) or !in_array('json2', $wp_scripts->done))) {
         $js_content .= 'if(typeof(swfobject) == "undefined")
             jQuery("head").append(\'<script type="text/javascript" src="' . $wp_scripts->base_url . $swfobject->src . '"><\\/script>\');
             jQuery("head").append(\'<script type="text/javascript" src="' . $wp_scripts->base_url . $json2->src . '"><\\/script>\');' . "\n";
         $wp_scripts->done[] = 'swfobject';
         $wp_scripts->done[] = 'json2';
     }
     global $frm_gr_count;
     if (!$frm_gr_count) {
         $frm_gr_count = 0;
     }
     foreach ($fields as $field) {
         $frm_gr_count++;
         $this_id = $field->id . '_' . $frm_gr_count;
         $html .= '<div id="chart_' . $this_id . '"></div>';
         $js .= 'swfobject.embedSWF("' . FRMPRO_URL . '/js/open-flash-chart.swf","chart_' . $this_id . '","' . $width . '","' . $height . '","9.0.0","expressInstall.swf",{"get-data":"get_data_' . $this_id . '"},{"wmode" : "transparent"});';
         $js_content2 .= 'function get_data_' . $this_id . '(){return JSON.stringify(data_' . $this_id . ');}';
         $js_content2 .= 'var data_' . $this_id . '=' . $this->get_graph($field, compact('ids', 'colors', 'grid_color', 'bg_color', 'truncate', 'truncate_label', 'response_count', 'user_id', 'type', 'x_axis', 'data_type', 'limit', 'x_start', 'x_end', 'show_key', 'min', 'max', 'include_zero', 'width')) . ';';
     }
     $js_content .= $js . $js_content2;
     $js_content .= '</script>';
     return $js_content . $html;
 }