Version Description
- Updated in-place edit to work with more characters and function without the save buttons
- Fixed bug causing several form options to be lost when the form name or description was edited without also clicking update for the whole form
- Made more user interface modifications
- PRO: Added dynamic default values for GET/POST variables
- PRO: Added shortcode for fetching field-wide calculations
[frm-stats id=5 type=(count, total, average, or median)]
- PRO: Added icon link to duplicate an individual field
- PRO: Increased the WPMU efficiency so the templates are only updated if the database version is changed
- PRO: Added functionality to the 'Data From Entries' field to use another observed 'Data From Entries' field to join a third form
- PRO: Fixed admin entry searches to start on first page of results if search was submitted from a higher page
Download this release
Release Info
Developer | sswells |
Plugin | Formidable Forms – Form Builder for WordPress |
Version | 1.01.04 |
Comparing to | |
See all releases |
Code changes from version 1.0.12 to 1.01.04
- classes/controllers/FrmAppController.php +76 -24
- classes/controllers/FrmFieldsController.php +4 -6
- classes/controllers/FrmFormsController.php +5 -5
- classes/controllers/FrmSettingsController.php +11 -14
- classes/helpers/FrmAppHelper.php +7 -4
- classes/helpers/FrmEntriesHelper.php +8 -2
- classes/helpers/FrmFieldsHelper.php +4 -4
- classes/helpers/FrmFormsHelper.php +2 -1
- classes/models/FrmEntry.php +15 -10
- classes/models/FrmField.php +15 -6
- classes/models/FrmForm.php +50 -22
- classes/models/FrmSettings.php +13 -19
- classes/models/FrmUpdate.php +57 -18
- classes/templates/contact.php +0 -3
- classes/views/frm-entries/direct.php +12 -7
- classes/views/frm-entries/form.php +8 -2
- classes/views/frm-entries/frm-entry.php +0 -1
- classes/views/frm-entries/new.php +3 -3
- classes/views/frm-fields/input.php +9 -8
- classes/views/frm-fields/single-option.php +2 -2
- classes/views/frm-forms/add_field.php +51 -65
- classes/views/frm-forms/add_field_links.php +84 -55
- classes/views/frm-forms/edit.php +5 -0
- classes/views/frm-forms/footer.php +53 -31
- classes/views/frm-forms/form.php +12 -5
- classes/views/frm-forms/list.php +1 -1
- classes/views/frm-forms/new-field-js.php +20 -90
- classes/views/frm-forms/new-option-js.php +7 -32
- classes/views/frm-forms/new-selection.php +1 -1
- classes/views/frm-settings/form.php +10 -2
- classes/views/shared/head.php +2 -2
- css/frm_admin.css +423 -28
- css/frm_display.css +12 -6
- formidable.php +3 -3
- images/duplicate.png +0 -0
- images/move.png +0 -0
- images/trash.png +0 -0
- js/jquery/jquery-ui-themepicker.js +539 -20
- js/jquery/jquery.editinplace.js +4 -2
- js/jquery/jquery.editinplace.packed.js +4 -4
- js/json2.js +0 -461
- js/list-items.js +13 -25
- js/nicedit.js +0 -118
- js/ofc-library/JSON.php +0 -806
- js/ofc-library/README.txt +0 -16
- js/ofc-library/dot_base.php +0 -231
- js/ofc-library/json_format.php +0 -86
- js/ofc-library/ofc_area_base.php +0 -40
- js/ofc-library/ofc_area_hollow.php +0 -10
- js/ofc-library/ofc_area_line.php +0 -10
- js/ofc-library/ofc_arrow.php +0 -27
- js/ofc-library/ofc_bar.php +0 -34
- js/ofc-library/ofc_bar_3d.php +0 -22
- js/ofc-library/ofc_bar_base.php +0 -97
- js/ofc-library/ofc_bar_filled.php +0 -39
- js/ofc-library/ofc_bar_glass.php +0 -131
- js/ofc-library/ofc_bar_sketch.php +0 -29
- js/ofc-library/ofc_bar_stack.php +0 -55
- js/ofc-library/ofc_candle.php +0 -41
- js/ofc-library/ofc_hbar.php +0 -64
- js/ofc-library/ofc_line.php +0 -157
- js/ofc-library/ofc_line_base.php +0 -92
- js/ofc-library/ofc_line_dot.php +0 -33
- js/ofc-library/ofc_line_hollow.php +0 -9
- js/ofc-library/ofc_line_style.php +0 -11
- js/ofc-library/ofc_menu.php +0 -56
- js/ofc-library/ofc_pie.php +0 -257
- js/ofc-library/ofc_radar_axis.php +0 -47
- js/ofc-library/ofc_radar_axis_labels.php +0 -15
- js/ofc-library/ofc_radar_spoke_labels.php +0 -15
- js/ofc-library/ofc_scatter.php +0 -47
- js/ofc-library/ofc_scatter_line.php +0 -49
- js/ofc-library/ofc_shape.php +0 -25
- js/ofc-library/ofc_sugar.php +0 -43
- js/ofc-library/ofc_tags.php +0 -133
- js/ofc-library/ofc_title.php +0 -39
- js/ofc-library/ofc_tooltip.php +0 -67
- js/ofc-library/ofc_upload_image.php +0 -70
- js/ofc-library/ofc_x_axis.php +0 -140
- js/ofc-library/ofc_x_axis_label.php +0 -45
- js/ofc-library/ofc_x_axis_labels.php +0 -69
- js/ofc-library/ofc_x_legend.php +0 -15
- js/ofc-library/ofc_y_axis.php +0 -17
- js/ofc-library/ofc_y_axis_base.php +0 -116
- js/ofc-library/ofc_y_axis_label.php +0 -38
- js/ofc-library/ofc_y_axis_labels.php +0 -57
- js/ofc-library/ofc_y_axis_right.php +0 -6
- js/ofc-library/ofc_y_legend.php +0 -15
- js/ofc-library/open-flash-chart-object.php +0 -109
- js/ofc-library/open-flash-chart.php +0 -178
- js/open-flash-chart.swf +0 -0
- js/swfobject.js +0 -5
- readme.txt +54 -8
classes/controllers/FrmAppController.php
CHANGED
@@ -4,6 +4,8 @@ class FrmAppController{
|
|
4 |
function FrmAppController(){
|
5 |
add_action('admin_menu', array( $this, 'menu' ));
|
6 |
add_filter( 'plugin_action_links_'.FRM_PLUGIN_NAME.'/'.FRM_PLUGIN_NAME.'.php', array( $this, 'settings_link'), 10, 2 );
|
|
|
|
|
7 |
add_filter('the_content', array( $this, 'page_route' ), 1);
|
8 |
add_action('init', array($this, 'front_head'));
|
9 |
add_action('admin_init', array( $this, 'admin_js'));
|
@@ -18,12 +20,9 @@ class FrmAppController{
|
|
18 |
}
|
19 |
|
20 |
function menu(){
|
21 |
-
global $
|
22 |
|
23 |
add_menu_page(FRM_PLUGIN_TITLE, FRM_PLUGIN_TITLE, 8, FRM_PLUGIN_NAME, array($frm_forms_controller,'route'), FRM_URL . '/images/icon_16.png');
|
24 |
-
|
25 |
-
//if(!$frmpro_is_installed)
|
26 |
-
//add_submenu_page(FRM_PLUGIN_TITLE, FRM_PLUGIN_TITLE .' | Pro Statistics', 'Pro Statistics', 8, FRM_PLUGIN_TITLE.'-statistics',array($this,''));
|
27 |
}
|
28 |
|
29 |
// Adds a settings link to the plugins page
|
@@ -33,10 +32,43 @@ class FrmAppController{
|
|
33 |
return $links;
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
function head(){
|
37 |
-
|
38 |
-
$css_file =
|
39 |
-
$js_file = 'list-items.js';
|
40 |
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
41 |
}
|
42 |
|
@@ -52,22 +84,38 @@ class FrmAppController{
|
|
52 |
}
|
53 |
|
54 |
function front_head(){
|
55 |
-
if (
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
function install(){
|
60 |
global $wpdb, $frm_form, $frm_field, $frm_app_helper;
|
61 |
-
$db_version = 1.
|
62 |
$old_db_version = get_option('frm_db_version');
|
63 |
|
64 |
-
$fields_table = $wpdb->prefix . "frm_fields";
|
65 |
-
$forms_table = $wpdb->prefix . "frm_forms";
|
66 |
-
$items_table = $wpdb->prefix . "frm_items";
|
67 |
-
$item_metas_table = $wpdb->prefix . "frm_item_metas";
|
68 |
-
|
69 |
if ($db_version != $old_db_version){
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
/* Create/Upgrade Fields Table */
|
73 |
$sql = "CREATE TABLE {$fields_table} (
|
@@ -85,7 +133,7 @@ class FrmAppController{
|
|
85 |
created_at datetime NOT NULL,
|
86 |
PRIMARY KEY (id),
|
87 |
KEY form_id (form_id)
|
88 |
-
);";
|
89 |
|
90 |
dbDelta($sql);
|
91 |
|
@@ -104,7 +152,7 @@ class FrmAppController{
|
|
104 |
options longtext default NULL,
|
105 |
created_at datetime NOT NULL,
|
106 |
PRIMARY KEY (id)
|
107 |
-
);";
|
108 |
|
109 |
dbDelta($sql);
|
110 |
|
@@ -120,7 +168,7 @@ class FrmAppController{
|
|
120 |
PRIMARY KEY (id),
|
121 |
KEY form_id (form_id),
|
122 |
KEY parent_item_id (parent_item_id)
|
123 |
-
);";
|
124 |
|
125 |
dbDelta($sql);
|
126 |
|
@@ -135,13 +183,9 @@ class FrmAppController{
|
|
135 |
PRIMARY KEY (id),
|
136 |
KEY field_id (field_id),
|
137 |
KEY item_id (item_id)
|
138 |
-
);";
|
139 |
|
140 |
dbDelta($sql);
|
141 |
-
|
142 |
-
/***** SAVE DB VERSION *****/
|
143 |
-
update_option('frm_db_version',$db_version);
|
144 |
-
}
|
145 |
|
146 |
/**** ADD DEFAULT TEMPLATES ****/
|
147 |
$templates = glob(FRM_TEMPLATES_PATH."/*.php");
|
@@ -150,9 +194,16 @@ class FrmAppController{
|
|
150 |
$filename = preg_replace("#".FRM_TEMPLATES_PATH."/#","",$templates[$i]);
|
151 |
$filename = str_replace('.php','', $filename);
|
152 |
$form = $frm_form->getAll("form_key='{$filename}' and is_template='1' and default_template='1'", '', ' LIMIT 1');
|
|
|
|
|
|
|
153 |
require_once($templates[$i]);
|
154 |
}
|
155 |
|
|
|
|
|
|
|
|
|
156 |
do_action('frm_after_install');
|
157 |
}
|
158 |
|
@@ -215,5 +266,6 @@ class FrmAppController{
|
|
215 |
function widget_text_filter_callback( $matches ) {
|
216 |
return do_shortcode( $matches[0] );
|
217 |
}
|
|
|
218 |
}
|
219 |
?>
|
4 |
function FrmAppController(){
|
5 |
add_action('admin_menu', array( $this, 'menu' ));
|
6 |
add_filter( 'plugin_action_links_'.FRM_PLUGIN_NAME.'/'.FRM_PLUGIN_NAME.'.php', array( $this, 'settings_link'), 10, 2 );
|
7 |
+
add_action('after_plugin_row_'.FRM_PLUGIN_NAME.'/'.FRM_PLUGIN_NAME.'.php', array( $this,'frmpro_action_needed'));
|
8 |
+
add_action('admin_notices', array( $this,'frmpro_get_started_headline'));
|
9 |
add_filter('the_content', array( $this, 'page_route' ), 1);
|
10 |
add_action('init', array($this, 'front_head'));
|
11 |
add_action('admin_init', array( $this, 'admin_js'));
|
20 |
}
|
21 |
|
22 |
function menu(){
|
23 |
+
global $frm_forms_controller;
|
24 |
|
25 |
add_menu_page(FRM_PLUGIN_TITLE, FRM_PLUGIN_TITLE, 8, FRM_PLUGIN_NAME, array($frm_forms_controller,'route'), FRM_URL . '/images/icon_16.png');
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
// Adds a settings link to the plugins page
|
32 |
return $links;
|
33 |
}
|
34 |
|
35 |
+
function frmpro_action_needed( $plugin ){
|
36 |
+
global $frm_update;
|
37 |
+
|
38 |
+
if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed() ){
|
39 |
+
if (IS_WPMU and $frm_update->pro_wpmu and !is_site_admin())
|
40 |
+
return;
|
41 |
+
$frm_update->queue_update(true);
|
42 |
+
$inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $plugin, 'upgrade-plugin_' . $plugin);
|
43 |
+
?>
|
44 |
+
<td colspan="3" class="plugin-update"><div class="update-message" style="-moz-border-radius:5px; border:1px solid #CC0000;; margin:5px; background-color:#FFEBE8; padding:3px 5px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', FRM_PLUGIN_NAME), '<a href="'.$inst_install_url.'">', '</a>'); ?></div></td>
|
45 |
+
<?php
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
function frmpro_get_started_headline(){
|
50 |
+
global $frm_update;
|
51 |
+
|
52 |
+
// Don't display this error as we're upgrading the thing... cmon
|
53 |
+
if(isset($_GET['action']) and $_GET['action'] == 'upgrade-plugin')
|
54 |
+
return;
|
55 |
+
|
56 |
+
if (IS_WPMU and $frm_update->pro_wpmu and !is_site_admin())
|
57 |
+
return;
|
58 |
+
|
59 |
+
if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed()){
|
60 |
+
$frm_update->queue_update(true);
|
61 |
+
$inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $frm_update->plugin_name, 'upgrade-plugin_' . $frm_update->plugin_name);
|
62 |
+
?>
|
63 |
+
<div class="error" style="padding:7px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', FRM_PLUGIN_NAME), '<a href="'.$inst_install_url.'">','</a>'); ?></div>
|
64 |
+
<?php
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
function head(){
|
69 |
+
$css_file = array('frm_admin' => FRM_URL. '/css/frm_admin.css');
|
70 |
+
$css_file = apply_filters('frm_app_css', $css_file);
|
71 |
+
$js_file = FRM_URL . '/js/list-items.js';
|
72 |
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
73 |
}
|
74 |
|
84 |
}
|
85 |
|
86 |
function front_head(){
|
87 |
+
if (IS_WPMU){
|
88 |
+
$db_version = 1.0; // this is the version of the database we're moving to
|
89 |
+
$old_db_version = get_option('frm_db_version');
|
90 |
+
if ($db_version != $old_db_version)
|
91 |
+
$this->install();
|
92 |
+
}
|
93 |
+
//if (!is_admin()){
|
94 |
+
$css = apply_filters('get_frm_stylesheet', FRM_URL .'/css/frm_display.css');
|
95 |
+
wp_enqueue_style('frm-forms', $css);
|
96 |
+
//}
|
97 |
}
|
98 |
|
99 |
function install(){
|
100 |
global $wpdb, $frm_form, $frm_field, $frm_app_helper;
|
101 |
+
$db_version = 1.01; // this is the version of the database we're moving to
|
102 |
$old_db_version = get_option('frm_db_version');
|
103 |
|
|
|
|
|
|
|
|
|
|
|
104 |
if ($db_version != $old_db_version){
|
105 |
+
$fields_table = $wpdb->prefix . "frm_fields";
|
106 |
+
$forms_table = $wpdb->prefix . "frm_forms";
|
107 |
+
$items_table = $wpdb->prefix . "frm_items";
|
108 |
+
$item_metas_table = $wpdb->prefix . "frm_item_metas";
|
109 |
+
|
110 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
111 |
+
|
112 |
+
$charset_collate = '';
|
113 |
+
if( $wpdb->has_cap( 'collation' ) ){
|
114 |
+
if( !empty($wpdb->charset) )
|
115 |
+
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
116 |
+
if( !empty($wpdb->collate) )
|
117 |
+
$charset_collate .= " COLLATE $wpdb->collate";
|
118 |
+
}
|
119 |
|
120 |
/* Create/Upgrade Fields Table */
|
121 |
$sql = "CREATE TABLE {$fields_table} (
|
133 |
created_at datetime NOT NULL,
|
134 |
PRIMARY KEY (id),
|
135 |
KEY form_id (form_id)
|
136 |
+
) {$charset_collate};";
|
137 |
|
138 |
dbDelta($sql);
|
139 |
|
152 |
options longtext default NULL,
|
153 |
created_at datetime NOT NULL,
|
154 |
PRIMARY KEY (id)
|
155 |
+
) {$charset_collate};";
|
156 |
|
157 |
dbDelta($sql);
|
158 |
|
168 |
PRIMARY KEY (id),
|
169 |
KEY form_id (form_id),
|
170 |
KEY parent_item_id (parent_item_id)
|
171 |
+
) {$charset_collate};";
|
172 |
|
173 |
dbDelta($sql);
|
174 |
|
183 |
PRIMARY KEY (id),
|
184 |
KEY field_id (field_id),
|
185 |
KEY item_id (item_id)
|
186 |
+
) {$charset_collate};";
|
187 |
|
188 |
dbDelta($sql);
|
|
|
|
|
|
|
|
|
189 |
|
190 |
/**** ADD DEFAULT TEMPLATES ****/
|
191 |
$templates = glob(FRM_TEMPLATES_PATH."/*.php");
|
194 |
$filename = preg_replace("#".FRM_TEMPLATES_PATH."/#","",$templates[$i]);
|
195 |
$filename = str_replace('.php','', $filename);
|
196 |
$form = $frm_form->getAll("form_key='{$filename}' and is_template='1' and default_template='1'", '', ' LIMIT 1');
|
197 |
+
$values = FrmFormsHelper::setup_new_vars();
|
198 |
+
$values['form_key'] = $filename;
|
199 |
+
$values['is_template'] = $values['default_template'] = 1;
|
200 |
require_once($templates[$i]);
|
201 |
}
|
202 |
|
203 |
+
/***** SAVE DB VERSION *****/
|
204 |
+
update_option('frm_db_version',$db_version);
|
205 |
+
}
|
206 |
+
|
207 |
do_action('frm_after_install');
|
208 |
}
|
209 |
|
266 |
function widget_text_filter_callback( $matches ) {
|
267 |
return do_shortcode( $matches[0] );
|
268 |
}
|
269 |
+
|
270 |
}
|
271 |
?>
|
classes/controllers/FrmFieldsController.php
CHANGED
@@ -92,7 +92,7 @@ class FrmFieldsController{
|
|
92 |
function add_option(){
|
93 |
global $frm_field;
|
94 |
|
95 |
-
$id =
|
96 |
$field = $frm_field->getOne($id);
|
97 |
$options = unserialize($field->options);
|
98 |
$last = max(array_keys($options));
|
@@ -127,12 +127,10 @@ class FrmFieldsController{
|
|
127 |
|
128 |
function delete_option(){
|
129 |
global $frm_field;
|
130 |
-
$
|
131 |
-
$id = str_replace('frm_delete_field_', '', $ids[0]);
|
132 |
-
$field = $frm_field->getOne($id);
|
133 |
$options = unserialize($field->options);
|
134 |
-
unset($options[$
|
135 |
-
$frm_field->update($
|
136 |
die();
|
137 |
}
|
138 |
|
92 |
function add_option(){
|
93 |
global $frm_field;
|
94 |
|
95 |
+
$id = $_POST['field_id'];
|
96 |
$field = $frm_field->getOne($id);
|
97 |
$options = unserialize($field->options);
|
98 |
$last = max(array_keys($options));
|
127 |
|
128 |
function delete_option(){
|
129 |
global $frm_field;
|
130 |
+
$field = $frm_field->getOne($_POST['field_id']);
|
|
|
|
|
131 |
$options = unserialize($field->options);
|
132 |
+
unset($options[$_POST['opt_key']]);
|
133 |
+
$frm_field->update($_POST['field_id'], array('options' => serialize($options)));
|
134 |
die();
|
135 |
}
|
136 |
|
classes/controllers/FrmFormsController.php
CHANGED
@@ -19,7 +19,7 @@ class FrmFormsController{
|
|
19 |
|
20 |
function head(){
|
21 |
$css_file = array('jquery-ui-1.7.2.custom' => FRM_URL.'/css/ui-lightness/jquery-ui-1.7.2.custom.css', 'frm_admin' => FRM_URL. '/css/frm_admin.css');
|
22 |
-
$js_file = 'list-items.js';
|
23 |
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
24 |
}
|
25 |
|
@@ -118,8 +118,7 @@ class FrmFormsController{
|
|
118 |
|
119 |
function page_preview(){
|
120 |
global $frm_form;
|
121 |
-
$description = true;
|
122 |
-
$title = true;
|
123 |
$params = $this->get_params();
|
124 |
if (!$params['form']) return;
|
125 |
$form = $frm_form->getOne($params['form']);
|
@@ -127,7 +126,7 @@ class FrmFormsController{
|
|
127 |
}
|
128 |
|
129 |
function preview(){
|
130 |
-
global $frm_form;
|
131 |
if ( !defined( 'ABSPATH' ) && !defined( 'XMLRPC_REQUEST' )) {
|
132 |
$root = dirname(dirname(dirname(dirname(__FILE__))));
|
133 |
include_once( $root.'/wp-config.php' );
|
@@ -144,7 +143,8 @@ class FrmFormsController{
|
|
144 |
if (!$form) $form = $frm_form->getAll('','',' LIMIT 1');
|
145 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
146 |
$description = $title = true;
|
147 |
-
|
|
|
148 |
require_once(FRM_VIEWS_PATH.'/frm-entries/direct.php');
|
149 |
}
|
150 |
|
19 |
|
20 |
function head(){
|
21 |
$css_file = array('jquery-ui-1.7.2.custom' => FRM_URL.'/css/ui-lightness/jquery-ui-1.7.2.custom.css', 'frm_admin' => FRM_URL. '/css/frm_admin.css');
|
22 |
+
$js_file = array(FRM_URL . '/js/list-items.js', FRM_URL . '/js/jquery/jquery-ui-themepicker.js');
|
23 |
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
24 |
}
|
25 |
|
118 |
|
119 |
function page_preview(){
|
120 |
global $frm_form;
|
121 |
+
$description = $title = true;
|
|
|
122 |
$params = $this->get_params();
|
123 |
if (!$params['form']) return;
|
124 |
$form = $frm_form->getOne($params['form']);
|
126 |
}
|
127 |
|
128 |
function preview(){
|
129 |
+
global $frm_form, $frm_settings;
|
130 |
if ( !defined( 'ABSPATH' ) && !defined( 'XMLRPC_REQUEST' )) {
|
131 |
$root = dirname(dirname(dirname(dirname(__FILE__))));
|
132 |
include_once( $root.'/wp-config.php' );
|
143 |
if (!$form) $form = $frm_form->getAll('','',' LIMIT 1');
|
144 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
145 |
$description = $title = true;
|
146 |
+
$custom_style = (isset($form_options['custom_style'])) ? $form_options['custom_style'] : $frm_settings->custom_style;
|
147 |
+
|
148 |
require_once(FRM_VIEWS_PATH.'/frm-entries/direct.php');
|
149 |
}
|
150 |
|
classes/controllers/FrmSettingsController.php
CHANGED
@@ -3,28 +3,25 @@
|
|
3 |
class FrmSettingsController{
|
4 |
function FrmSettingsController(){
|
5 |
add_action('admin_menu', array( $this, 'menu' ), 25);
|
|
|
6 |
add_action('admin_head-'.FRM_PLUGIN_NAME.'_page_'.FRM_PLUGIN_NAME.'-settings', array($this,'head'));
|
7 |
}
|
8 |
|
9 |
function menu(){
|
10 |
-
global $frm_update;
|
11 |
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Settings', 'Settings', 8, FRM_PLUGIN_NAME.'-settings', array($this,'route'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. FRM_PLUGIN_TITLE . ' Pro', FRM_PLUGIN_TITLE . ' Pro', 8, FRM_PLUGIN_NAME.'-pro-settings', array($frm_update,'pro_cred_form'));
|
13 |
}
|
14 |
|
15 |
function head(){
|
16 |
-
|
17 |
-
|
18 |
-
$js_file = 'jquery/jquery-ui-themepicker.js';
|
19 |
-
?>
|
20 |
-
<link type="text/css" rel="stylesheet" href="http://jqueryui.com/themes/base/ui.all.css" />
|
21 |
-
<script>
|
22 |
-
jQuery(document).ready(function($){
|
23 |
-
$('#frm_switcher').themeswitcher();
|
24 |
-
});
|
25 |
-
</script>
|
26 |
-
<?php
|
27 |
-
require_once(FRM_VIEWS_PATH . '/shared/head.php');
|
28 |
}
|
29 |
|
30 |
function display_form(){
|
@@ -38,7 +35,7 @@ class FrmSettingsController{
|
|
38 |
//$errors = $frm_settings->validate($_POST,array());
|
39 |
$errors = array();
|
40 |
$frm_settings->update($_POST);
|
41 |
-
|
42 |
if( empty($errors) ){
|
43 |
$frm_settings->store();
|
44 |
$message = 'Settings Saved';
|
3 |
class FrmSettingsController{
|
4 |
function FrmSettingsController(){
|
5 |
add_action('admin_menu', array( $this, 'menu' ), 25);
|
6 |
+
add_action('admin_menu', array( $this, 'pro_menu' ), 19);
|
7 |
add_action('admin_head-'.FRM_PLUGIN_NAME.'_page_'.FRM_PLUGIN_NAME.'-settings', array($this,'head'));
|
8 |
}
|
9 |
|
10 |
function menu(){
|
|
|
11 |
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | Settings', 'Settings', 8, FRM_PLUGIN_NAME.'-settings', array($this,'route'));
|
12 |
+
}
|
13 |
+
|
14 |
+
function pro_menu(){
|
15 |
+
global $frm_update;
|
16 |
+
if (IS_WPMU and !is_site_admin() and get_site_option($frm_update->pro_wpmu_store))
|
17 |
+
return;
|
18 |
+
|
19 |
add_submenu_page(FRM_PLUGIN_NAME, FRM_PLUGIN_TITLE .' | '. FRM_PLUGIN_TITLE . ' Pro', FRM_PLUGIN_TITLE . ' Pro', 8, FRM_PLUGIN_NAME.'-pro-settings', array($frm_update,'pro_cred_form'));
|
20 |
}
|
21 |
|
22 |
function head(){
|
23 |
+
$css_file = array('frm_admin' => FRM_URL. '/css/frm_admin.css');
|
24 |
+
require(FRM_VIEWS_PATH . '/shared/head.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
function display_form(){
|
35 |
//$errors = $frm_settings->validate($_POST,array());
|
36 |
$errors = array();
|
37 |
$frm_settings->update($_POST);
|
38 |
+
|
39 |
if( empty($errors) ){
|
40 |
$frm_settings->store();
|
41 |
$message = 'Settings Saved';
|
classes/helpers/FrmAppHelper.php
CHANGED
@@ -56,7 +56,7 @@ class FrmAppHelper{
|
|
56 |
|
57 |
function setup_edit_vars($record, $table, $fields='', $default=false){
|
58 |
if(!$record) return false;
|
59 |
-
global $frm_entry_meta, $frm_form, $frm_app_controller;
|
60 |
$values = array();
|
61 |
|
62 |
$values['id'] = $record->id;
|
@@ -76,7 +76,7 @@ class FrmAppHelper{
|
|
76 |
$field_options = stripslashes_deep(unserialize($field->field_options));
|
77 |
$field_type = isset($_POST['field_options']['type_'.$field->id]) ? $_POST['field_options']['type_'.$field->id] : $field->type;
|
78 |
$new_value = (isset($_POST['item_meta'][$field->id])) ? $_POST['item_meta'][$field->id] : $meta_value;
|
79 |
-
$new_value =
|
80 |
|
81 |
$field_array = array('id' => $field->id,
|
82 |
'value' => $new_value,
|
@@ -90,7 +90,7 @@ class FrmAppHelper{
|
|
90 |
'field_order' => $field->field_order,
|
91 |
'form_id' => $field->form_id);
|
92 |
|
93 |
-
foreach (array('size' =>
|
94 |
$field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field_options[$opt]) ? $field_options[$opt]: $default_opt);
|
95 |
|
96 |
$values['fields'][] = apply_filters('frm_setup_edit_fields_vars', stripslashes_deep($field_array), $field, $values['id']);
|
@@ -112,10 +112,13 @@ class FrmAppHelper{
|
|
112 |
}
|
113 |
|
114 |
$email = get_option('admin_email');
|
115 |
-
foreach (array('email_to' => $email, 'submit_value' => 'Submit', 'success_msg' => 'Your responses were successfully submitted. Thank you!') as $opt => $default){
|
116 |
if (!isset($values[$opt]))
|
117 |
$values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
|
118 |
}
|
|
|
|
|
|
|
119 |
|
120 |
if (!isset($values['akismet']))
|
121 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
56 |
|
57 |
function setup_edit_vars($record, $table, $fields='', $default=false){
|
58 |
if(!$record) return false;
|
59 |
+
global $frm_entry_meta, $frm_form, $frm_app_controller, $frm_settings;
|
60 |
$values = array();
|
61 |
|
62 |
$values['id'] = $record->id;
|
76 |
$field_options = stripslashes_deep(unserialize($field->field_options));
|
77 |
$field_type = isset($_POST['field_options']['type_'.$field->id]) ? $_POST['field_options']['type_'.$field->id] : $field->type;
|
78 |
$new_value = (isset($_POST['item_meta'][$field->id])) ? $_POST['item_meta'][$field->id] : $meta_value;
|
79 |
+
$new_value = stripslashes_deep(maybe_unserialize($new_value));
|
80 |
|
81 |
$field_array = array('id' => $field->id,
|
82 |
'value' => $new_value,
|
90 |
'field_order' => $field->field_order,
|
91 |
'form_id' => $field->form_id);
|
92 |
|
93 |
+
foreach (array('size' => '','max' => '','label' => 'top','invalid' => '','required_indicator' => '*','blank' => '', 'clear_on_focus' => 0, 'custom_html' => FrmFieldsHelper::get_default_html($field), 'default_blank' => 0) as $opt => $default_opt)
|
94 |
$field_array[$opt] = ($_POST and isset($_POST['field_options'][$opt.'_'.$field->id]) ) ? $_POST['field_options'][$opt.'_'.$field->id] : (isset($field_options[$opt]) ? $field_options[$opt]: $default_opt);
|
95 |
|
96 |
$values['fields'][] = apply_filters('frm_setup_edit_fields_vars', stripslashes_deep($field_array), $field, $values['id']);
|
112 |
}
|
113 |
|
114 |
$email = get_option('admin_email');
|
115 |
+
foreach (array('custom_style' => $frm_settings->custom_style, 'email_to' => $email, 'submit_value' => 'Submit', 'success_msg' => 'Your responses were successfully submitted. Thank you!') as $opt => $default){
|
116 |
if (!isset($values[$opt]))
|
117 |
$values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
|
118 |
}
|
119 |
+
|
120 |
+
if (!isset($values['custom_style']))
|
121 |
+
$values['custom_style'] = ($_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : $frm_settings->custom_style;
|
122 |
|
123 |
if (!isset($values['akismet']))
|
124 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
classes/helpers/FrmEntriesHelper.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
class FrmEntriesHelper{
|
4 |
|
5 |
function setup_new_vars($fields){
|
6 |
-
global $frm_app_controller, $frm_form;
|
7 |
$values = array();
|
8 |
foreach (array('name' => '', 'description' => '', 'item_key' => '') as $var => $default)
|
9 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
@@ -18,6 +18,8 @@ class FrmEntriesHelper{
|
|
18 |
if ($field->type != 'checkbox')
|
19 |
$new_value = apply_filters('frm_get_default_value', stripslashes($new_value));
|
20 |
|
|
|
|
|
21 |
$field_array = array('id' => $field->id,
|
22 |
'value' => $new_value,
|
23 |
'default_value' => $new_value,
|
@@ -30,7 +32,7 @@ class FrmEntriesHelper{
|
|
30 |
'field_order' => $field->field_order,
|
31 |
'form_id' => $field->form_id);
|
32 |
|
33 |
-
foreach (array('size' =>
|
34 |
$field_array[$opt] = (isset($field_options[$opt]) && $field_options[$opt] != '') ? $field_options[$opt] : $default_opt;
|
35 |
|
36 |
$values['fields'][] = apply_filters('frm_setup_new_fields_vars', stripslashes_deep($field_array), $field);
|
@@ -45,6 +47,10 @@ class FrmEntriesHelper{
|
|
45 |
foreach ($options as $opt => $value)
|
46 |
$values[$opt] = $frm_app_controller->get_param($opt, $value);
|
47 |
}
|
|
|
|
|
|
|
|
|
48 |
if (!isset($values['email_to']))
|
49 |
$values['email_to'] = '';
|
50 |
|
3 |
class FrmEntriesHelper{
|
4 |
|
5 |
function setup_new_vars($fields){
|
6 |
+
global $frm_app_controller, $frm_form, $frm_settings;
|
7 |
$values = array();
|
8 |
foreach (array('name' => '', 'description' => '', 'item_key' => '') as $var => $default)
|
9 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
18 |
if ($field->type != 'checkbox')
|
19 |
$new_value = apply_filters('frm_get_default_value', stripslashes($new_value));
|
20 |
|
21 |
+
$new_value = stripslashes_deep(maybe_unserialize($new_value));
|
22 |
+
|
23 |
$field_array = array('id' => $field->id,
|
24 |
'value' => $new_value,
|
25 |
'default_value' => $new_value,
|
32 |
'field_order' => $field->field_order,
|
33 |
'form_id' => $field->form_id);
|
34 |
|
35 |
+
foreach (array('size' => '','max' => '','label' => 'top','invalid' => '','required_indicator' => '','blank' => '', 'clear_on_focus' => 0, 'custom_html' => FrmFieldsHelper::get_default_html($field), 'default_blank' => 0) as $opt => $default_opt)
|
36 |
$field_array[$opt] = (isset($field_options[$opt]) && $field_options[$opt] != '') ? $field_options[$opt] : $default_opt;
|
37 |
|
38 |
$values['fields'][] = apply_filters('frm_setup_new_fields_vars', stripslashes_deep($field_array), $field);
|
47 |
foreach ($options as $opt => $value)
|
48 |
$values[$opt] = $frm_app_controller->get_param($opt, $value);
|
49 |
}
|
50 |
+
|
51 |
+
if (!isset($values['custom_style']))
|
52 |
+
$values['custom_style'] = $frm_settings->custom_style;
|
53 |
+
|
54 |
if (!isset($values['email_to']))
|
55 |
$values['email_to'] = '';
|
56 |
|
classes/helpers/FrmFieldsHelper.php
CHANGED
@@ -13,7 +13,7 @@ class FrmFieldsHelper{
|
|
13 |
$values[$var] = $default;
|
14 |
|
15 |
$values['field_options'] = array();
|
16 |
-
foreach (array('size' => '
|
17 |
$values['field_options'][$var] = $default;
|
18 |
|
19 |
if ($type == 'radio' || ($type == 'checkbox'))
|
@@ -41,7 +41,7 @@ class FrmFieldsHelper{
|
|
41 |
|
42 |
foreach (array('field_key' => $record->field_key, 'type' => $record->type, 'default_value'=> $record->default_value, 'field_order' => $record->field_order, 'required' => $record->required) as $var => $default)
|
43 |
$values[$var] = $frm_app_controller->get_param($var, $default);
|
44 |
-
|
45 |
$values['options'] = unserialize($record->options);
|
46 |
$field_options = unserialize($record->field_options);
|
47 |
$values['field_options'] = $field_options;
|
@@ -118,12 +118,12 @@ DEFAULT_HTML;
|
|
118 |
}
|
119 |
|
120 |
function show_onfocus_js($field_id, $clear_on_focus){ ?>
|
121 |
-
<a href="javascript:frm_clear_on_focus(<?php echo $field_id; ?>,<?php echo $clear_on_focus; ?>)" class="<?php echo ($clear_on_focus) ?'':'frm_inactive_icon'; ?>" id="clear_field_<?php echo $field_id; ?>" title="Set this field to <?php echo ($clear_on_focus)?'not ':''; ?>clear on click"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></a>
|
122 |
<?php
|
123 |
}
|
124 |
|
125 |
function show_default_blank_js($field_id, $default_blank){ ?>
|
126 |
-
<a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon'; ?>" id="default_blank_<?php echo $field_id; ?>" title="This default value should <?php echo ($default_blank)?'not ':''; ?>be considered blank"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></a>
|
127 |
<?php
|
128 |
}
|
129 |
|
13 |
$values[$var] = $default;
|
14 |
|
15 |
$values['field_options'] = array();
|
16 |
+
foreach (array('size' => '', 'max' => '', 'label' => 'top', 'required_indicator' => '*', 'clear_on_focus' => 0, 'custom_html' => FrmFieldsHelper::get_default_html($type), 'default_blank' => 0) as $var => $default)
|
17 |
$values['field_options'][$var] = $default;
|
18 |
|
19 |
if ($type == 'radio' || ($type == 'checkbox'))
|
41 |
|
42 |
foreach (array('field_key' => $record->field_key, 'type' => $record->type, 'default_value'=> $record->default_value, 'field_order' => $record->field_order, 'required' => $record->required) as $var => $default)
|
43 |
$values[$var] = $frm_app_controller->get_param($var, $default);
|
44 |
+
|
45 |
$values['options'] = unserialize($record->options);
|
46 |
$field_options = unserialize($record->field_options);
|
47 |
$values['field_options'] = $field_options;
|
118 |
}
|
119 |
|
120 |
function show_onfocus_js($field_id, $clear_on_focus){ ?>
|
121 |
+
<a href="javascript:frm_clear_on_focus(<?php echo $field_id; ?>,<?php echo $clear_on_focus; ?>)" class="<?php echo ($clear_on_focus) ?'':'frm_inactive_icon'; ?> frm-show-hover" id="clear_field_<?php echo $field_id; ?>" title="Set this field to <?php echo ($clear_on_focus)?'not ':''; ?>clear on click"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></a>
|
122 |
<?php
|
123 |
}
|
124 |
|
125 |
function show_default_blank_js($field_id, $default_blank){ ?>
|
126 |
+
<a href="javascript:frm_default_blank(<?php echo $field_id; ?>,<?php echo $default_blank ?>)" class="<?php echo ($default_blank) ?'':'frm_inactive_icon'; ?> frm-show-hover" id="default_blank_<?php echo $field_id; ?>" title="This default value should <?php echo ($default_blank)?'not ':''; ?>be considered blank"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></a>
|
127 |
<?php
|
128 |
}
|
129 |
|
classes/helpers/FrmFormsHelper.php
CHANGED
@@ -43,7 +43,7 @@ class FrmFormsHelper{
|
|
43 |
}
|
44 |
|
45 |
function setup_new_vars(){
|
46 |
-
global $frm_app_controller, $frm_form;
|
47 |
$values = array();
|
48 |
foreach (array('name' => 'Untitled Form', 'description' => '') as $var => $default)
|
49 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
@@ -53,6 +53,7 @@ class FrmFormsHelper{
|
|
53 |
|
54 |
$values['form_key'] = ($_POST and isset($_POST['form_key']))?$_POST['form_key']:(FrmAppHelper::get_unique_key('', $frm_form->table_name, 'form_key'));
|
55 |
$values['email_to'] = ($_POST and isset($_POST['options']['email_to'])) ? $_POST['options']['email_to'] : get_option('admin_email');
|
|
|
56 |
$values['submit_value'] = ($_POST and isset($_POST['options']['submit_value'])) ? $_POST['options']['submit_value'] : 'Submit';
|
57 |
$values['success_msg'] = ($_POST and isset($_POST['options']['success_msg'])) ? $_POST['options']['success_msg'] : 'Your responses were successfully submitted. Thank you!';
|
58 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
43 |
}
|
44 |
|
45 |
function setup_new_vars(){
|
46 |
+
global $frm_app_controller, $frm_form, $frm_settings;
|
47 |
$values = array();
|
48 |
foreach (array('name' => 'Untitled Form', 'description' => '') as $var => $default)
|
49 |
$values[$var] = stripslashes($frm_app_controller->get_param($var, $default));
|
53 |
|
54 |
$values['form_key'] = ($_POST and isset($_POST['form_key']))?$_POST['form_key']:(FrmAppHelper::get_unique_key('', $frm_form->table_name, 'form_key'));
|
55 |
$values['email_to'] = ($_POST and isset($_POST['options']['email_to'])) ? $_POST['options']['email_to'] : get_option('admin_email');
|
56 |
+
$values['custom_style'] = ($_POST and isset($_POST['options']['custom_style'])) ? $_POST['options']['custom_style'] : $frm_settings->custom_style;
|
57 |
$values['submit_value'] = ($_POST and isset($_POST['options']['submit_value'])) ? $_POST['options']['submit_value'] : 'Submit';
|
58 |
$values['success_msg'] = ($_POST and isset($_POST['options']['success_msg'])) ? $_POST['options']['success_msg'] : 'Your responses were successfully submitted. Thank you!';
|
59 |
$values['akismet'] = ($_POST and isset($_POST['options']['akismet'])) ? 1 : 0;
|
classes/models/FrmEntry.php
CHANGED
@@ -76,7 +76,7 @@ class FrmEntry{
|
|
76 |
global $wpdb, $frm_entry_meta;
|
77 |
|
78 |
// Disconnect the child items from this parent item
|
79 |
-
|
80 |
|
81 |
$reset = 'DELETE FROM ' . $frm_entry_meta->table_name . ' WHERE item_id=' . $id;
|
82 |
$destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
|
@@ -90,15 +90,6 @@ class FrmEntry{
|
|
90 |
$form_id = isset($value) ? $form_id : NULL;
|
91 |
return $wpdb->update( $this->table_name, array('form_id' => $form_id), array( 'id' => $id ) );
|
92 |
}
|
93 |
-
|
94 |
-
function getOneByKey( $key ){
|
95 |
-
global $wpdb, $frm_entry_meta;
|
96 |
-
$query = "SELECT it.*".//", meta.* " .
|
97 |
-
"FROM {$this->table_name} it ".
|
98 |
-
//"LEFT OUTER JOIN {$frm_entry_meta->table_name} meta ON meta.item_id=it.id " .
|
99 |
-
"WHERE it.item_key='" . $key . "'";
|
100 |
-
return $wpdb->get_row($query);
|
101 |
-
}
|
102 |
|
103 |
function getOne( $id ){
|
104 |
global $wpdb, $frm_form;
|
@@ -113,6 +104,20 @@ class FrmEntry{
|
|
113 |
$query .= " WHERE it.item_key='" . $id ."'";
|
114 |
return $wpdb->get_row($query);
|
115 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
function getAll($where = '', $order_by = '', $limit = ''){
|
118 |
global $wpdb, $frm_form, $frm_app_helper;
|
76 |
global $wpdb, $frm_entry_meta;
|
77 |
|
78 |
// Disconnect the child items from this parent item
|
79 |
+
//$query_results = $wpdb->update( $this->table_name, array('parent_item_id' => null), array( 'parent_item_id' => $id ) );
|
80 |
|
81 |
$reset = 'DELETE FROM ' . $frm_entry_meta->table_name . ' WHERE item_id=' . $id;
|
82 |
$destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
|
90 |
$form_id = isset($value) ? $form_id : NULL;
|
91 |
return $wpdb->update( $this->table_name, array('form_id' => $form_id), array( 'id' => $id ) );
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
function getOne( $id ){
|
95 |
global $wpdb, $frm_form;
|
104 |
$query .= " WHERE it.item_key='" . $id ."'";
|
105 |
return $wpdb->get_row($query);
|
106 |
}
|
107 |
+
|
108 |
+
function exists( $id ){
|
109 |
+
global $wpdb, $frm_form;
|
110 |
+
$query = 'SELECT id FROM '. $this->table_name;
|
111 |
+
if(is_numeric($id))
|
112 |
+
$query .= ' WHERE id=' . $id;
|
113 |
+
else
|
114 |
+
$query .= " WHERE item_key='" . $id ."'";
|
115 |
+
$id = $wpdb->get_var($query);
|
116 |
+
if ($id && $id > 0)
|
117 |
+
return true;
|
118 |
+
else
|
119 |
+
return false;
|
120 |
+
}
|
121 |
|
122 |
function getAll($where = '', $order_by = '', $limit = ''){
|
123 |
global $wpdb, $frm_form, $frm_app_helper;
|
classes/models/FrmField.php
CHANGED
@@ -32,10 +32,11 @@ class FrmField{
|
|
32 |
}
|
33 |
}
|
34 |
|
35 |
-
function duplicate($old_form_id
|
36 |
-
foreach ($this->getAll("fi.form_id = $old_form_id") as $field){
|
37 |
$values = array();
|
38 |
-
$
|
|
|
39 |
$values['field_options'] = unserialize($field->field_options);
|
40 |
$values['form_id'] = $form_id;
|
41 |
foreach (array('name','description','type','default_value','options','field_order','required') as $col)
|
@@ -77,12 +78,20 @@ class FrmField{
|
|
77 |
return $wpdb->get_row($query);
|
78 |
}
|
79 |
|
80 |
-
function getAll($where = '', $order_by = '', $limit = ''){
|
81 |
global $wpdb, $frm_form, $frm_app_helper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
$query = 'SELECT fi.*, ' .
|
83 |
'fr.name as form_name ' .
|
84 |
-
'FROM '. $
|
85 |
-
'LEFT OUTER JOIN ' . $
|
86 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
87 |
if ($limit == ' LIMIT 1')
|
88 |
$results = $wpdb->get_row($query);
|
32 |
}
|
33 |
}
|
34 |
|
35 |
+
function duplicate($old_form_id, $form_id, $copy_keys=false, $blog_id=false){
|
36 |
+
foreach ($this->getAll("fi.form_id = $old_form_id",'','',$blog_id) as $field){
|
37 |
$values = array();
|
38 |
+
$new_key = ($copy_keys) ? $field->field_key : '';
|
39 |
+
$values['field_key'] = FrmAppHelper::get_unique_key($new_key, $this->table_name, 'field_key');
|
40 |
$values['field_options'] = unserialize($field->field_options);
|
41 |
$values['form_id'] = $form_id;
|
42 |
foreach (array('name','description','type','default_value','options','field_order','required') as $col)
|
78 |
return $wpdb->get_row($query);
|
79 |
}
|
80 |
|
81 |
+
function getAll($where = '', $order_by = '', $limit = '', $blog_id=false){
|
82 |
global $wpdb, $frm_form, $frm_app_helper;
|
83 |
+
if ($blog_id and IS_WPMU){
|
84 |
+
global $wpmuBaseTablePrefix;
|
85 |
+
$table_name = "{$wpmuBaseTablePrefix}{$blog_id}_frm_fields";
|
86 |
+
$form_table_name = "{$wpmuBaseTablePrefix}{$blog_id}_frm_forms";
|
87 |
+
}else{
|
88 |
+
$table_name = $this->table_name;
|
89 |
+
$form_table_name = $frm_form->table_name;
|
90 |
+
}
|
91 |
$query = 'SELECT fi.*, ' .
|
92 |
'fr.name as form_name ' .
|
93 |
+
'FROM '. $table_name . ' fi ' .
|
94 |
+
'LEFT OUTER JOIN ' . $form_table_name . ' fr ON fi.form_id=fr.id' .
|
95 |
$frm_app_helper->prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
|
96 |
if ($limit == ' LIMIT 1')
|
97 |
$results = $wpdb->get_row($query);
|
classes/models/FrmForm.php
CHANGED
@@ -33,17 +33,26 @@ class FrmForm{
|
|
33 |
return $wpdb->insert_id;
|
34 |
}
|
35 |
|
36 |
-
function duplicate( $id, $template=false ){
|
37 |
global $wpdb, $frm_form, $frm_field;
|
38 |
|
39 |
-
$values = $frm_form->getOne( $id );
|
40 |
-
|
41 |
$new_values = array();
|
42 |
-
$
|
|
|
43 |
$new_values['name'] = $values->name;
|
44 |
$new_values['description'] = $values->description;
|
45 |
$new_values['status'] = (!$template)?'draft':'';
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
$new_values['logged_in'] = $values->logged_in ? $values->logged_in : 0;
|
48 |
$new_values['editable'] = $values->editable ? $values->editable : 0;
|
49 |
$new_values['created_at'] = current_time('mysql', 1);
|
@@ -53,7 +62,7 @@ class FrmForm{
|
|
53 |
|
54 |
if($query_results){
|
55 |
$form_id = $wpdb->insert_id;
|
56 |
-
$frm_field->duplicate($id, $form_id);
|
57 |
|
58 |
return $form_id;
|
59 |
}else
|
@@ -71,21 +80,25 @@ class FrmForm{
|
|
71 |
|
72 |
$form_fields = array('form_key','name','description','status','prli_link_id');
|
73 |
|
74 |
-
$options = array();
|
75 |
-
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
76 |
-
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] : 'Submit';
|
77 |
-
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] : '';
|
78 |
-
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
79 |
-
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
80 |
-
$options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
|
81 |
-
$options = apply_filters('frm_form_options_before_update', $options, $values);
|
82 |
-
|
83 |
$new_values = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
foreach ($values as $value_key => $value){
|
85 |
if (in_array($value_key, $form_fields))
|
86 |
$new_values[$value_key] = $value;
|
87 |
}
|
88 |
-
$new_values['options'] = serialize($options);
|
89 |
|
90 |
$query_results = $wpdb->update( $this->table_name, $new_values, array( 'id' => $id ) );
|
91 |
|
@@ -101,7 +114,7 @@ class FrmForm{
|
|
101 |
$field_options = unserialize($field->field_options);
|
102 |
foreach (array('size','max','label','invalid','required_indicator','blank') as $opt)
|
103 |
$field_options[$opt] = isset($values['field_options'][$opt.'_'.$field_id]) ? trim($values['field_options'][$opt.'_'.$field_id]) : '';
|
104 |
-
$field_options['custom_html'] = isset($values['field_options']['custom_html_'.$field_id]) ? $values['field_options']['custom_html_'.$field_id] : FrmFieldsHelper::get_default_html($field->type);
|
105 |
$field_options = apply_filters('frm_update_field_options', $field_options, $field_id, $values);
|
106 |
$default_value = maybe_serialize($values['item_meta'][$field_id]);
|
107 |
$field_key = (isset($values['field_options']['field_key_'.$field_id]))? $values['field_options']['field_key_'.$field_id] : $field->field_key;
|
@@ -153,7 +166,10 @@ class FrmForm{
|
|
153 |
$query_results = $wpdb->query($query);
|
154 |
|
155 |
$destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
|
156 |
-
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
function getName( $id ){
|
@@ -171,12 +187,24 @@ class FrmForm{
|
|
171 |
$query = 'SELECT id FROM ' . $this->table_name . ' WHERE name="' . $name . '";';
|
172 |
return $wpdb->get_var($query);
|
173 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
-
function getOne( $id ){
|
176 |
global $wpdb;
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
$query = 'SELECT * FROM ' . $this->table_name . ' WHERE form_key="' . $id . '";';
|
181 |
return $wpdb->get_row($query);
|
182 |
}
|
33 |
return $wpdb->insert_id;
|
34 |
}
|
35 |
|
36 |
+
function duplicate( $id, $template=false, $copy_keys=false, $blog_id=false ){
|
37 |
global $wpdb, $frm_form, $frm_field;
|
38 |
|
39 |
+
$values = $frm_form->getOne( $id, $blog_id );
|
40 |
+
|
41 |
$new_values = array();
|
42 |
+
$new_key = ($copy_keys) ? $values->form_key : '';
|
43 |
+
$new_values['form_key'] = FrmAppHelper::get_unique_key($new_key, $this->table_name, 'form_key');
|
44 |
$new_values['name'] = $values->name;
|
45 |
$new_values['description'] = $values->description;
|
46 |
$new_values['status'] = (!$template)?'draft':'';
|
47 |
+
if ($blog_id){
|
48 |
+
$new_values['status'] = 'published';
|
49 |
+
$new_options = unserialize($values->options);
|
50 |
+
$new_options['email_to'] = get_option('admin_email');
|
51 |
+
$new_options['copy'] = false;
|
52 |
+
$new_values['options'] = serialize($new_options);
|
53 |
+
}else
|
54 |
+
$new_values['options'] = $values->options;
|
55 |
+
|
56 |
$new_values['logged_in'] = $values->logged_in ? $values->logged_in : 0;
|
57 |
$new_values['editable'] = $values->editable ? $values->editable : 0;
|
58 |
$new_values['created_at'] = current_time('mysql', 1);
|
62 |
|
63 |
if($query_results){
|
64 |
$form_id = $wpdb->insert_id;
|
65 |
+
$frm_field->duplicate($id, $form_id, $copy_keys, $blog_id);
|
66 |
|
67 |
return $form_id;
|
68 |
}else
|
80 |
|
81 |
$form_fields = array('form_key','name','description','status','prli_link_id');
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
$new_values = array();
|
84 |
+
|
85 |
+
if (isset($values['options'])){
|
86 |
+
$options = array();
|
87 |
+
$options['email_to'] = isset($values['options']['email_to']) ? $values['options']['email_to'] : '';
|
88 |
+
$options['submit_value'] = isset($values['options']['submit_value']) ? $values['options']['submit_value'] : 'Submit';
|
89 |
+
$options['success_msg'] = isset($values['options']['success_msg']) ? $values['options']['success_msg'] : '';
|
90 |
+
$options['akismet'] = isset($values['options']['akismet']) ? 1 : 0;
|
91 |
+
$options['custom_style'] = isset($values['options']['custom_style']) ? 1 : 0;
|
92 |
+
$options['before_html'] = isset($values['options']['before_html']) ? $values['options']['before_html'] : FrmFormsHelper::get_default_html('before');
|
93 |
+
$options['after_html'] = isset($values['options']['after_html']) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html('after');
|
94 |
+
$options = apply_filters('frm_form_options_before_update', $options, $values);
|
95 |
+
$new_values['options'] = serialize($options);
|
96 |
+
}
|
97 |
+
|
98 |
foreach ($values as $value_key => $value){
|
99 |
if (in_array($value_key, $form_fields))
|
100 |
$new_values[$value_key] = $value;
|
101 |
}
|
|
|
102 |
|
103 |
$query_results = $wpdb->update( $this->table_name, $new_values, array( 'id' => $id ) );
|
104 |
|
114 |
$field_options = unserialize($field->field_options);
|
115 |
foreach (array('size','max','label','invalid','required_indicator','blank') as $opt)
|
116 |
$field_options[$opt] = isset($values['field_options'][$opt.'_'.$field_id]) ? trim($values['field_options'][$opt.'_'.$field_id]) : '';
|
117 |
+
$field_options['custom_html'] = isset($values['field_options']['custom_html_'.$field_id]) ? $values['field_options']['custom_html_'.$field_id] : (isset($field_options['custom_html']) ? $field_options['custom_html'] : FrmFieldsHelper::get_default_html($field->type));
|
118 |
$field_options = apply_filters('frm_update_field_options', $field_options, $field_id, $values);
|
119 |
$default_value = maybe_serialize($values['item_meta'][$field_id]);
|
120 |
$field_key = (isset($values['field_options']['field_key_'.$field_id]))? $values['field_options']['field_key_'.$field_id] : $field->field_key;
|
166 |
$query_results = $wpdb->query($query);
|
167 |
|
168 |
$destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
|
169 |
+
$query_results = $wpdb->query($destroy);
|
170 |
+
if ($query_results)
|
171 |
+
do_action('frm_destroy_form', $id);
|
172 |
+
return $query_results;
|
173 |
}
|
174 |
|
175 |
function getName( $id ){
|
187 |
$query = 'SELECT id FROM ' . $this->table_name . ' WHERE name="' . $name . '";';
|
188 |
return $wpdb->get_var($query);
|
189 |
}
|
190 |
+
|
191 |
+
function getIdByKey( $key ){
|
192 |
+
global $wpdb;
|
193 |
+
$query = "SELECT id FROM $this->table_name WHERE form_key='$key' LIMIT 1";
|
194 |
+
return $wpdb->get_var($query);
|
195 |
+
}
|
196 |
|
197 |
+
function getOne( $id, $blog_id=false ){
|
198 |
global $wpdb;
|
199 |
+
|
200 |
+
if (is_numeric($id)){
|
201 |
+
if ($blog_id and IS_WPMU){
|
202 |
+
global $wpmuBaseTablePrefix;
|
203 |
+
$table_name = "{$wpmuBaseTablePrefix}{$blog_id}_frm_forms";
|
204 |
+
}else
|
205 |
+
$table_name = $this->table_name;
|
206 |
+
$query = "SELECT * FROM $table_name WHERE id='$id'";
|
207 |
+
}else
|
208 |
$query = 'SELECT * FROM ' . $this->table_name . ' WHERE form_key="' . $id . '";';
|
209 |
return $wpdb->get_row($query);
|
210 |
}
|
classes/models/FrmSettings.php
CHANGED
@@ -3,10 +3,9 @@ class FrmSettings{
|
|
3 |
// Page Setup Variables
|
4 |
var $preview_page_id;
|
5 |
var $preview_page_id_str;
|
6 |
-
var $theme_css;
|
7 |
-
var $theme_name;
|
8 |
-
var $theme_nicename;
|
9 |
var $lock_keys;
|
|
|
|
|
10 |
|
11 |
function FrmSettings(){
|
12 |
$this->set_default_options();
|
@@ -18,38 +17,33 @@ class FrmSettings{
|
|
18 |
|
19 |
$this->preview_page_id_str = 'frm-preview-page-id';
|
20 |
|
21 |
-
if(!isset($this->theme_css)){
|
22 |
-
$this->theme_css = FRM_URL.'/css/ui-lightness/jquery-ui-1.7.2.custom.css';
|
23 |
-
$this->theme_name = 'UI lightness';
|
24 |
-
}
|
25 |
-
|
26 |
-
$this->theme_nicename = sanitize_title_with_dashes($this->theme_name);
|
27 |
-
|
28 |
if(!isset($this->lock_keys))
|
29 |
$this->lock_keys = true;
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
function validate($params,$errors){
|
33 |
-
if($params[ $this->preview_page_id_str ] == 0)
|
34 |
-
|
35 |
-
|
36 |
return $errors;
|
37 |
}
|
38 |
|
39 |
function update($params){
|
40 |
$this->preview_page_id = (int)$params[ $this->preview_page_id_str ];
|
41 |
-
if (isset($params[ 'frm_themepicker_css' ]))
|
42 |
-
$this->theme_css = $params[ 'frm_themepicker_css' ];
|
43 |
-
|
44 |
-
if (isset($params[ 'frm_themepicker_name' ]))
|
45 |
-
$this->theme_name = $params[ 'frm_themepicker_name' ];
|
46 |
-
|
47 |
$this->lock_keys = isset($params['frm_lock_keys']) ? 1 : 0;
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
function store(){
|
51 |
// Save the posted value in the database
|
52 |
update_option( 'frm_options', $this);
|
|
|
|
|
53 |
}
|
54 |
|
55 |
}
|
3 |
// Page Setup Variables
|
4 |
var $preview_page_id;
|
5 |
var $preview_page_id_str;
|
|
|
|
|
|
|
6 |
var $lock_keys;
|
7 |
+
|
8 |
+
var $custom_style;
|
9 |
|
10 |
function FrmSettings(){
|
11 |
$this->set_default_options();
|
17 |
|
18 |
$this->preview_page_id_str = 'frm-preview-page-id';
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
if(!isset($this->lock_keys))
|
21 |
$this->lock_keys = true;
|
22 |
+
|
23 |
+
if(!isset($this->custom_style))
|
24 |
+
$this->custom_style = true;
|
25 |
}
|
26 |
|
27 |
function validate($params,$errors){
|
28 |
+
//if($params[ $this->preview_page_id_str ] == 0)
|
29 |
+
// $errors[] = "The Preview Page Must Not Be Blank.";
|
30 |
+
$errors = apply_filters( 'frm_validate_settings', $errors, $params );
|
31 |
return $errors;
|
32 |
}
|
33 |
|
34 |
function update($params){
|
35 |
$this->preview_page_id = (int)$params[ $this->preview_page_id_str ];
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
$this->lock_keys = isset($params['frm_lock_keys']) ? 1 : 0;
|
37 |
+
$this->custom_style = isset($params['frm_custom_style']) ? 1 : 0;
|
38 |
+
|
39 |
+
do_action( 'frm_update_settings', $params );
|
40 |
}
|
41 |
|
42 |
function store(){
|
43 |
// Save the posted value in the database
|
44 |
update_option( 'frm_options', $this);
|
45 |
+
|
46 |
+
do_action( 'frm_store_settings' );
|
47 |
}
|
48 |
|
49 |
}
|
classes/models/FrmUpdate.php
CHANGED
@@ -12,12 +12,14 @@ class FrmUpdate{
|
|
12 |
|
13 |
var $pro_cred_store;
|
14 |
var $pro_auth_store;
|
|
|
15 |
|
16 |
var $pro_username_label;
|
17 |
var $pro_password_label;
|
18 |
|
19 |
var $pro_username_str;
|
20 |
var $pro_password_str;
|
|
|
21 |
|
22 |
var $pro_error_message_str;
|
23 |
|
@@ -37,6 +39,7 @@ class FrmUpdate{
|
|
37 |
$this->pro_mothership = 'http://formidablepro.com';
|
38 |
$this->pro_cred_store = 'frmpro-credentials';
|
39 |
$this->pro_auth_store = 'frmpro-authorized';
|
|
|
40 |
$this->pro_last_checked_store = 'frmpro_last_checked_update';
|
41 |
$this->pro_username_label = __(FRM_PLUGIN_TITLE .' Pro Username', FRM_PLUGIN_NAME);
|
42 |
$this->pro_password_label = __(FRM_PLUGIN_TITLE .' Pro Password', FRM_PLUGIN_NAME);
|
@@ -46,10 +49,17 @@ class FrmUpdate{
|
|
46 |
$this->pro_check_interval = 60*60; // Checking every hour
|
47 |
$this->pro_username_str = 'proplug-username';
|
48 |
$this->pro_password_str = 'proplug-password';
|
|
|
49 |
$this->pro_mothership_xmlrpc_url = $this->pro_mothership . '/xmlrpc.php';
|
50 |
|
51 |
// Retrieve Pro Credentials
|
52 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
if($creds and is_array($creds)){
|
54 |
extract($creds);
|
55 |
$this->pro_username = ((isset($username) and !empty($username))?$username:'');
|
@@ -68,14 +78,20 @@ class FrmUpdate{
|
|
68 |
|
69 |
function pro_is_authorized($force_check=false){
|
70 |
if( !empty($this->pro_username) and !empty($this->pro_password) ){
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
return false;
|
@@ -135,6 +151,11 @@ class FrmUpdate{
|
|
135 |
}
|
136 |
|
137 |
$this->display_pro_cred_form(); ?>
|
|
|
|
|
|
|
|
|
|
|
138 |
</div>
|
139 |
<?php
|
140 |
}
|
@@ -155,11 +176,20 @@ class FrmUpdate{
|
|
155 |
</td>
|
156 |
</tr>
|
157 |
<tr class="form-field">
|
158 |
-
<td valign="top"
|
159 |
<td width="85%">
|
160 |
<input type="password" name="<?php echo $this->pro_password_str; ?>" value="<?php echo $password; ?>"/>
|
161 |
</td>
|
162 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
</table>
|
164 |
<p class="submit">
|
165 |
<input type="submit" name="Submit" value="<?php _e('Save', FRM_PLUGIN_NAME); ?>" />
|
@@ -173,15 +203,23 @@ class FrmUpdate{
|
|
173 |
$user_authorized = $this->authorize_user($creds['username'], $creds['password']);
|
174 |
|
175 |
if(!empty($user_authorized) and $user_authorized){
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
|
185 |
}
|
186 |
|
187 |
return $user_authorized;
|
@@ -190,8 +228,9 @@ class FrmUpdate{
|
|
190 |
function get_pro_cred_form_vals(){
|
191 |
$username = ((isset($_POST[$this->pro_username_str]))?$_POST[$this->pro_username_str]:$this->pro_username);
|
192 |
$password = ((isset($_POST[$this->pro_password_str]))?$_POST[$this->pro_password_str]:$this->pro_password);
|
|
|
193 |
|
194 |
-
return compact('username','password');
|
195 |
}
|
196 |
|
197 |
function get_download_url($version){
|
12 |
|
13 |
var $pro_cred_store;
|
14 |
var $pro_auth_store;
|
15 |
+
var $pro_wpmu_store;
|
16 |
|
17 |
var $pro_username_label;
|
18 |
var $pro_password_label;
|
19 |
|
20 |
var $pro_username_str;
|
21 |
var $pro_password_str;
|
22 |
+
var $pro_wpmu_str;
|
23 |
|
24 |
var $pro_error_message_str;
|
25 |
|
39 |
$this->pro_mothership = 'http://formidablepro.com';
|
40 |
$this->pro_cred_store = 'frmpro-credentials';
|
41 |
$this->pro_auth_store = 'frmpro-authorized';
|
42 |
+
$this->pro_auth_store = 'frmpro-wpmu-sitewide';
|
43 |
$this->pro_last_checked_store = 'frmpro_last_checked_update';
|
44 |
$this->pro_username_label = __(FRM_PLUGIN_TITLE .' Pro Username', FRM_PLUGIN_NAME);
|
45 |
$this->pro_password_label = __(FRM_PLUGIN_TITLE .' Pro Password', FRM_PLUGIN_NAME);
|
49 |
$this->pro_check_interval = 60*60; // Checking every hour
|
50 |
$this->pro_username_str = 'proplug-username';
|
51 |
$this->pro_password_str = 'proplug-password';
|
52 |
+
$this->pro_wpmu_str = 'proplug-wpmu';
|
53 |
$this->pro_mothership_xmlrpc_url = $this->pro_mothership . '/xmlrpc.php';
|
54 |
|
55 |
// Retrieve Pro Credentials
|
56 |
+
$this->pro_wpmu = false;
|
57 |
+
if (IS_WPMU and get_site_option($this->pro_wpmu_store)){
|
58 |
+
$creds = get_site_option($this->pro_cred_store);
|
59 |
+
$this->pro_wpmu = true;
|
60 |
+
}else
|
61 |
+
$creds = get_option($this->pro_cred_store);
|
62 |
+
|
63 |
if($creds and is_array($creds)){
|
64 |
extract($creds);
|
65 |
$this->pro_username = ((isset($username) and !empty($username))?$username:'');
|
78 |
|
79 |
function pro_is_authorized($force_check=false){
|
80 |
if( !empty($this->pro_username) and !empty($this->pro_password) ){
|
81 |
+
if (IS_WPMU and $this->pro_wpmu)
|
82 |
+
$authorized = get_site_option($this->pro_auth_store);
|
83 |
+
else
|
84 |
+
$authorized = get_option($this->pro_auth_store);
|
85 |
+
if(!$force_check and isset($authorized))
|
86 |
+
return $authorized;
|
87 |
+
else{
|
88 |
+
$new_auth = $this->authorize_user($this->pro_username,$this->pro_password);
|
89 |
+
if (IS_WPMU and $this->pro_wpmu)
|
90 |
+
update_site_option($this->pro_auth_store, $new_auth);
|
91 |
+
else
|
92 |
+
update_option($this->pro_auth_store, $new_auth);
|
93 |
+
return $new_auth;
|
94 |
+
}
|
95 |
}
|
96 |
|
97 |
return false;
|
151 |
}
|
152 |
|
153 |
$this->display_pro_cred_form(); ?>
|
154 |
+
|
155 |
+
<p>Ready to take your forms to the next level?<br/>
|
156 |
+
Formidable Pro will help you style forms, manage data, and get reports.</p>
|
157 |
+
|
158 |
+
<a href="http://formidablepro.com">Learn More »</a>
|
159 |
</div>
|
160 |
<?php
|
161 |
}
|
176 |
</td>
|
177 |
</tr>
|
178 |
<tr class="form-field">
|
179 |
+
<td valign="top"><?php echo $this->pro_password_label; ?>:</td>
|
180 |
<td width="85%">
|
181 |
<input type="password" name="<?php echo $this->pro_password_str; ?>" value="<?php echo $password; ?>"/>
|
182 |
</td>
|
183 |
</tr>
|
184 |
+
<?php if (IS_WPMU){ ?>
|
185 |
+
<tr>
|
186 |
+
<td valign="top"><?php _e('WordPress MU', FRM_PLUGIN_NAME); ?>:</td>
|
187 |
+
<td valign="top">
|
188 |
+
<input type="checkbox" value="1" name="<?php echo $this->pro_wpmu_str; ?>" <?php checked($wpmu, 1) ?>>
|
189 |
+
<?php _e('Use this username and password to enable Formidable Pro site-wide', FRM_PLUGIN_NAME); ?>
|
190 |
+
</td>
|
191 |
+
</tr>
|
192 |
+
<?php } ?>
|
193 |
</table>
|
194 |
<p class="submit">
|
195 |
<input type="submit" name="Submit" value="<?php _e('Save', FRM_PLUGIN_NAME); ?>" />
|
203 |
$user_authorized = $this->authorize_user($creds['username'], $creds['password']);
|
204 |
|
205 |
if(!empty($user_authorized) and $user_authorized){
|
206 |
+
if (IS_WPMU)
|
207 |
+
update_site_option($this->pro_wpmu_store, $creds['wpmu']);
|
208 |
+
|
209 |
+
if ($creds['wpmu']){
|
210 |
+
update_site_option($this->pro_cred_store, $creds);
|
211 |
+
update_site_option($this->pro_auth_store, $user_authorized);
|
212 |
+
}else{
|
213 |
+
update_option($this->pro_cred_store, $creds);
|
214 |
+
update_option($this->pro_auth_store, $user_authorized);
|
215 |
+
}
|
216 |
|
217 |
+
extract($creds);
|
218 |
+
$this->pro_username = ((isset($username) and !empty($username))?$username:'');
|
219 |
+
$this->pro_password = ((isset($password) and !empty($password))?$password:'');
|
220 |
|
221 |
+
if(!$this->pro_is_installed())
|
222 |
+
$this->queue_update(true);
|
223 |
}
|
224 |
|
225 |
return $user_authorized;
|
228 |
function get_pro_cred_form_vals(){
|
229 |
$username = ((isset($_POST[$this->pro_username_str]))?$_POST[$this->pro_username_str]:$this->pro_username);
|
230 |
$password = ((isset($_POST[$this->pro_password_str]))?$_POST[$this->pro_password_str]:$this->pro_password);
|
231 |
+
$wpmu = (isset($_POST[$this->pro_wpmu_str])) ? true : $this->pro_wpmu;
|
232 |
|
233 |
+
return compact('username','password','wpmu');
|
234 |
}
|
235 |
|
236 |
function get_download_url($version){
|
classes/templates/contact.php
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$values = FrmFormsHelper::setup_new_vars();
|
4 |
$values['name'] = 'Contact Us';
|
5 |
-
$values['form_key'] = 'contact';
|
6 |
$values['description'] = 'We would like to hear from you. Please send us a message by filling out the form below and we will get back with you shortly.';
|
7 |
-
$values['is_template'] = $values['default_template'] = 1;
|
8 |
|
9 |
if ($form){
|
10 |
$form_id = $form->id;
|
1 |
<?php
|
2 |
|
|
|
3 |
$values['name'] = 'Contact Us';
|
|
|
4 |
$values['description'] = 'We would like to hear from you. Please send us a message by filling out the form below and we will get back with you shortly.';
|
|
|
5 |
|
6 |
if ($form){
|
7 |
$form_id = $form->id;
|
classes/views/frm-entries/direct.php
CHANGED
@@ -1,11 +1,16 @@
|
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
-
<html xmlns="http://www.w3.org/1999/xhtml"
|
3 |
-
|
4 |
-
|
5 |
-
<
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
</head>
|
10 |
<body>
|
11 |
<?php require_once('frm-entry.php'); ?>
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
|
3 |
+
|
4 |
+
<head profile="http://gmpg.org/xfn/11">
|
5 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
|
6 |
+
|
7 |
+
<?php global $frm_blogurl; ?>
|
8 |
+
<?php if ($custom_style){
|
9 |
+
$css = apply_filters('get_frm_stylesheet', FRM_URL .'/css/frm_display.css');
|
10 |
+
?>
|
11 |
+
<link type="text/css" href="<?php echo $css; ?>" rel="Stylesheet" />
|
12 |
+
<?php } ?>
|
13 |
+
<?php do_action('frm_direct_link_head'); ?>
|
14 |
</head>
|
15 |
<body>
|
16 |
<?php require_once('frm-entry.php'); ?>
|
classes/views/frm-entries/form.php
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
<?php echo FrmFormsHelper::replace_shortcodes($values['before_html'], $form, $title, $description); ?>
|
2 |
|
3 |
<div id="frm_form_fields">
|
|
|
4 |
<div>
|
|
|
5 |
<input type="hidden" name="form_id" value="<?php echo $form->id ?>" />
|
|
|
|
|
|
|
6 |
<?php if (isset($controller) && isset($plugin)){ ?>
|
7 |
<input type="hidden" name="controller" value="<?php echo $controller; ?>" />
|
8 |
<input type="hidden" name="plugin" value="<?php echo $plugin; ?>" />
|
@@ -26,12 +31,13 @@
|
|
26 |
global $frm_settings;
|
27 |
?>
|
28 |
<?php if (is_admin() && !$frm_settings->lock_keys){ ?>
|
29 |
-
<div class="
|
30 |
-
<label
|
31 |
<input type="text" id="item_key" name="item_key" value="<?php echo $values['item_key'] ?>" />
|
32 |
</div>
|
33 |
<?php } ?>
|
34 |
</div>
|
|
|
35 |
</div>
|
36 |
|
37 |
<?php echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); ?>
|
1 |
<?php echo FrmFormsHelper::replace_shortcodes($values['before_html'], $form, $title, $description); ?>
|
2 |
|
3 |
<div id="frm_form_fields">
|
4 |
+
<fieldset>
|
5 |
<div>
|
6 |
+
<input type="hidden" name="action" value="<?php echo $form_action ?>" />
|
7 |
<input type="hidden" name="form_id" value="<?php echo $form->id ?>" />
|
8 |
+
<?php if (isset($id)){ ?>
|
9 |
+
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
10 |
+
<?php } ?>
|
11 |
<?php if (isset($controller) && isset($plugin)){ ?>
|
12 |
<input type="hidden" name="controller" value="<?php echo $controller; ?>" />
|
13 |
<input type="hidden" name="plugin" value="<?php echo $plugin; ?>" />
|
31 |
global $frm_settings;
|
32 |
?>
|
33 |
<?php if (is_admin() && !$frm_settings->lock_keys){ ?>
|
34 |
+
<div class="form-field">
|
35 |
+
<label>Entry Key</label>
|
36 |
<input type="text" id="item_key" name="item_key" value="<?php echo $values['item_key'] ?>" />
|
37 |
</div>
|
38 |
<?php } ?>
|
39 |
</div>
|
40 |
+
</fieldset>
|
41 |
</div>
|
42 |
|
43 |
<?php echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); ?>
|
classes/views/frm-entries/frm-entry.php
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
<?php
|
2 |
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $frm_recaptcha_enabled, $user_ID;
|
3 |
$fields = $frm_field->getAll("fi.form_id='$form->id'", ' ORDER BY field_order');
|
4 |
-
//$values = FrmEntriesHelper::setup_new_vars($fields);
|
5 |
$form_name = $form->name;
|
6 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
7 |
|
1 |
<?php
|
2 |
global $frm_form, $frm_field, $frm_entry, $frm_entry_meta, $frm_recaptcha_enabled, $user_ID;
|
3 |
$fields = $frm_field->getAll("fi.form_id='$form->id'", ' ORDER BY field_order');
|
|
|
4 |
$form_name = $form->name;
|
5 |
$form_options = stripslashes_deep(maybe_unserialize($form->options));
|
6 |
|
classes/views/frm-entries/new.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<div class="frm_forms" id="frm_form_<?php echo $form->id ?>_container">
|
2 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
3 |
|
4 |
-
<form action="" enctype="multipart/form-data" method="post" class="frm-show-form"
|
5 |
-
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/frm-entries/form.php'); ?>
|
8 |
|
1 |
+
<div class="frm_forms<?php echo ($values['custom_style']) ? ' with_frm_style' : ''; ?>" id="frm_form_<?php echo $form->id ?>_container">
|
2 |
<?php require(FRM_VIEWS_PATH.'/shared/errors.php'); ?>
|
3 |
|
4 |
+
<form action="" enctype="multipart/form-data" method="post" class="frm-show-form" id="form_<?php echo $form->form_key ?>">
|
5 |
+
<?php $form_action = 'create'; ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/frm-entries/form.php'); ?>
|
8 |
|
classes/views/frm-fields/input.php
CHANGED
@@ -1,18 +1,18 @@
|
|
|
|
1 |
<?php if ($field['type'] == 'text'){ ?>
|
2 |
-
<input type="text" id="field_<?php echo $field['field_key'] ?>" name="<?php echo $field_name ?>" value="<?php echo $field['value'] ?>" size="<?php echo $field['size'] ?>" maxlength="<?php echo $field['max'] ?>" <?php echo ($field['clear_on_focus']) ? 'onfocus="frmClearDefault(\''.$field['default_value'].'\', this)" onblur="frmReplaceDefault(\''.$field['default_value'].'\', this)"':''; ?>/>
|
3 |
|
4 |
<?php }else if ($field['type'] == 'textarea'){ ?>
|
5 |
-
<textarea name="<?php echo $field_name ?>" cols="<?php echo $field['size'] ?>" rows="<?php echo $field['max'] ?>" <?php echo ($field['clear_on_focus']) ? 'onfocus="frmClearDefault(\''.$field['default_value'].'\', this)" onblur="frmReplaceDefault(\''.$field['default_value'].'\', this)"':''; ?>><?php echo $field['value'] ?></textarea>
|
6 |
|
7 |
<?php }else if ($field['type'] == 'radio'){
|
8 |
if (is_array($field['options'])){
|
9 |
foreach($field['options'] as $opt){ ?>
|
10 |
-
<input type=
|
11 |
-
<?php echo $opt ?><br/>
|
12 |
<?php }
|
13 |
} ?>
|
14 |
<?php }else if ($field['type'] == 'select'){?>
|
15 |
-
<select name="<?php echo $field_name ?>" id="item_meta<?php echo $field['id'] ?>"
|
16 |
<?php foreach ($field['options'] as $opt){ ?>
|
17 |
<option value='<?php echo $opt ?>' <?php if ($field['value'] == $opt) echo 'selected="selected"'; ?>><?php echo $opt ?></option>
|
18 |
<?php } ?>
|
@@ -22,10 +22,11 @@
|
|
22 |
if ($frm_recaptcha_enabled)
|
23 |
FrmAppHelper::display_recaptcha($errors);
|
24 |
}else if ($field['type'] == 'checkbox'){
|
25 |
-
$checked_values =
|
26 |
foreach ($field['options'] as $opt){
|
27 |
-
$checked = ((!is_array($checked_values) && $checked_values == $opt ) || (is_array($checked_values) && in_array($opt, $checked_values)))?' checked="true"':'';
|
28 |
-
|
|
|
29 |
}
|
30 |
}else do_action('frm_form_fields',$field, $field_name);
|
31 |
?>
|
1 |
+
<?php $auto_width = (isset($field['size']) && $field['size'] > 0) ? 'class="auto_width"' : ''; ?>
|
2 |
<?php if ($field['type'] == 'text'){ ?>
|
3 |
+
<input type="text" id="field_<?php echo $field['field_key'] ?>" name="<?php echo $field_name ?>" value="<?php echo $field['value'] ?>" size="<?php echo $field['size'] ?>" maxlength="<?php echo $field['max'] ?>" <?php echo ($field['clear_on_focus']) ? 'onfocus="frmClearDefault(\''.$field['default_value'].'\', this)" onblur="frmReplaceDefault(\''.$field['default_value'].'\', this)"':''; ?> <?php echo $auto_width ?>/>
|
4 |
|
5 |
<?php }else if ($field['type'] == 'textarea'){ ?>
|
6 |
+
<textarea name="<?php echo $field_name ?>" cols="<?php echo $field['size'] ?>" rows="<?php echo $field['max'] ?>" <?php echo ($field['clear_on_focus']) ? 'onfocus="frmClearDefault(\''.$field['default_value'].'\', this)" onblur="frmReplaceDefault(\''.$field['default_value'].'\', this)"':''; ?> <?php echo $auto_width ?>><?php echo $field['value'] ?></textarea>
|
7 |
|
8 |
<?php }else if ($field['type'] == 'radio'){
|
9 |
if (is_array($field['options'])){
|
10 |
foreach($field['options'] as $opt){ ?>
|
11 |
+
<div class="frm_radio"><input type="radio" name="<?php echo $field_name ?>" value="<?php echo $opt ?>" <?php if ($field['value'] == $opt) echo 'checked="checked"'; ?> /><span><?php echo $opt ?></span></div>
|
|
|
12 |
<?php }
|
13 |
} ?>
|
14 |
<?php }else if ($field['type'] == 'select'){?>
|
15 |
+
<select name="<?php echo $field_name ?>" id="item_meta<?php echo $field['id'] ?>" <?php echo $auto_width ?>>
|
16 |
<?php foreach ($field['options'] as $opt){ ?>
|
17 |
<option value='<?php echo $opt ?>' <?php if ($field['value'] == $opt) echo 'selected="selected"'; ?>><?php echo $opt ?></option>
|
18 |
<?php } ?>
|
22 |
if ($frm_recaptcha_enabled)
|
23 |
FrmAppHelper::display_recaptcha($errors);
|
24 |
}else if ($field['type'] == 'checkbox'){
|
25 |
+
$checked_values = $field['value'];
|
26 |
foreach ($field['options'] as $opt){
|
27 |
+
$checked = ((!is_array($checked_values) && $checked_values == $opt ) || (is_array($checked_values) && in_array($opt, $checked_values)))?' checked="true"':''; ?>
|
28 |
+
<div class="frm_checkbox"><input type="checkbox" name="<?php echo $field_name ?>[]" value="<?php echo $opt ?>" <?php echo $checked ?> /><span><?php echo $opt ?></span></div>
|
29 |
+
<?php
|
30 |
}
|
31 |
}else do_action('frm_form_fields',$field, $field_name);
|
32 |
?>
|
classes/views/frm-fields/single-option.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<span id="frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container" class="frm_single_option">
|
|
|
|
|
2 |
<?php if ($field['type'] != 'select'){ ?>
|
3 |
<input type='<?php echo $field['type'] ?>' name='<?php echo $field_name ?><?php echo ($field['type'] == 'checkbox')?'[]':''; ?>' value='<?php echo $opt ?>'<?php echo isset($checked)? $checked : ''; ?>/>
|
4 |
<?php } ?>
|
5 |
<span class="frm_ipe_field_option" id="field_<?php echo $field['id']?>-<?php echo $opt_key ?>"><?php echo $opt ?></span>
|
6 |
-
<span class="frm_spacer"></span>
|
7 |
-
<a href="javascript:void(0);" class="ui-icon ui-icon-trash alignleft frm_delete_field_option" id="frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>"></a>
|
8 |
</span>
|
9 |
<div class="clear"></div>
|
1 |
<span id="frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container" class="frm_single_option">
|
2 |
+
<span class="frm_spacer"></span>
|
3 |
+
<a href="javascript:frm_delete_field_option(<?php echo $field['id']?>, <?php echo $opt_key ?>);" class="frm_single_show_hover alignleft" ><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
4 |
<?php if ($field['type'] != 'select'){ ?>
|
5 |
<input type='<?php echo $field['type'] ?>' name='<?php echo $field_name ?><?php echo ($field['type'] == 'checkbox')?'[]':''; ?>' value='<?php echo $opt ?>'<?php echo isset($checked)? $checked : ''; ?>/>
|
6 |
<?php } ?>
|
7 |
<span class="frm_ipe_field_option" id="field_<?php echo $field['id']?>-<?php echo $opt_key ?>"><?php echo $opt ?></span>
|
|
|
|
|
8 |
</span>
|
9 |
<div class="clear"></div>
|
classes/views/frm-forms/add_field.php
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
<?php $display = apply_filters('frm_display_field_options', array('type' => $field['type'], 'field_data' => $field, 'required' => true, 'description' => true, 'options' => true, 'label_position' => true, 'invalid' => false, 'size' => false, 'clear_on_focus' => false, 'default_blank' => true)); ?>
|
2 |
|
3 |
<li id="frm_field_id_<?php echo $field['id']; ?>" class="edit_form_item frm_field_box ui-state-default frm_hide_options<?php echo $display['options'] ?>">
|
4 |
-
<
|
5 |
-
<a href="javascript:
|
|
|
|
|
6 |
<?php if ($display['required']){ ?>
|
7 |
<span id="require_field_<?php echo $field['id']; ?>">
|
8 |
<a href="javascript:frm_mark_required( <?php echo $field['id']; ?>, <?php echo $field_required = ($field['required'] == '0')?('0'):('1'); ?>)" class="ui-icon ui-icon-star alignleft frm_required<?php echo $field_required ?>" id="req_field_<?php echo $field['id']; ?>" title="Mark as <?php echo ($field['required'] == '0')?'':'not '; ?>Required"></a>
|
@@ -16,14 +18,15 @@
|
|
16 |
<textarea name="<?php echo $field_name ?>" cols="<?php echo $field['size']; ?>" rows="<?php echo $field['max']; ?>"><?php echo $field['default_value']; ?></textarea>
|
17 |
|
18 |
<?php }else if ($field['type'] == 'radio' || $field['type'] == 'checkbox'){
|
19 |
-
$field['value'] = maybe_unserialize($field['default_value']);
|
20 |
-
require(FRM_VIEWS_PATH.'/frm-fields/radio.php'); ?>
|
21 |
-
|
22 |
-
|
|
|
23 |
</div>
|
24 |
|
25 |
<?php }else if ($field['type'] == 'select'){ ?>
|
26 |
-
<select name=
|
27 |
<?php foreach ($field['options'] as $opt){
|
28 |
$selected = ($field['default_value'] == $opt)?(' selected="selected"'):(''); ?>
|
29 |
<option value="<?php echo $opt ?>"<?php echo $selected ?>><?php echo $opt ?></option>
|
@@ -31,11 +34,13 @@
|
|
31 |
</select>
|
32 |
<?php if ($display['default_blank']) FrmFieldsHelper::show_default_blank_js($field['id'], $field['default_blank']); ?>
|
33 |
<br/>
|
|
|
34 |
<?php foreach ($field['options'] as $opt_key => $opt)
|
35 |
require(FRM_VIEWS_PATH.'/frm-fields/single-option.php');
|
36 |
?>
|
37 |
-
|
38 |
-
|
|
|
39 |
<?php do_action('frm_add_multiple_opts', $field); ?>
|
40 |
</div>
|
41 |
|
@@ -64,62 +69,43 @@ if ($display['description']){ ?>
|
|
64 |
}
|
65 |
|
66 |
if ($display['options']){ ?>
|
67 |
-
<
|
68 |
-
<
|
69 |
-
<
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
<?php
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
</
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
<
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
102 |
</div>
|
103 |
<?php } ?>
|
104 |
</li>
|
105 |
-
|
106 |
-
<script type="text/javascript">
|
107 |
-
jQuery(document).ready(function() {
|
108 |
-
jQuery("#frm_delete_field<?php echo $field['id']; ?>").click(function(){
|
109 |
-
if(confirm("<?php _e('Are you sure you want to delete this field and all data associated with it?', FRM_PLUGIN_NAME); ?>")){
|
110 |
-
jQuery.ajax({
|
111 |
-
type:"POST",
|
112 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
113 |
-
data:"action=frm_delete_field&field_id=<?php echo $field['id']; ?>",
|
114 |
-
success:function(msg){
|
115 |
-
jQuery('#new_fields').append(msg);
|
116 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?>").hide('highlight',{},500,callback);
|
117 |
-
}
|
118 |
-
});
|
119 |
-
return false;
|
120 |
-
}
|
121 |
-
});
|
122 |
-
|
123 |
-
function callback(){setTimeout(function(){jQuery("#frm_delete_field<?php echo $field['id']; ?>:hidden").removeAttr('style').hide().fadeIn();}, 1000);};
|
124 |
-
});
|
125 |
-
</script>
|
1 |
<?php $display = apply_filters('frm_display_field_options', array('type' => $field['type'], 'field_data' => $field, 'required' => true, 'description' => true, 'options' => true, 'label_position' => true, 'invalid' => false, 'size' => false, 'clear_on_focus' => false, 'default_blank' => true)); ?>
|
2 |
|
3 |
<li id="frm_field_id_<?php echo $field['id']; ?>" class="edit_form_item frm_field_box ui-state-default frm_hide_options<?php echo $display['options'] ?>">
|
4 |
+
<a href="javascript:void(0);" class="alignright frm-show-hover frm-move" title="Move Field"><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="Move"></a>
|
5 |
+
<a href="javascript:frm_delete_field(<?php echo $field['id']; ?>)" class="alignright frm-show-hover" id="frm_delete_field<?php echo $field['id']; ?>" title="Delete Field"><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></a>
|
6 |
+
<?php do_action('frm_extra_field_actions', $field['id']); ?>
|
7 |
+
|
8 |
<?php if ($display['required']){ ?>
|
9 |
<span id="require_field_<?php echo $field['id']; ?>">
|
10 |
<a href="javascript:frm_mark_required( <?php echo $field['id']; ?>, <?php echo $field_required = ($field['required'] == '0')?('0'):('1'); ?>)" class="ui-icon ui-icon-star alignleft frm_required<?php echo $field_required ?>" id="req_field_<?php echo $field['id']; ?>" title="Mark as <?php echo ($field['required'] == '0')?'':'not '; ?>Required"></a>
|
18 |
<textarea name="<?php echo $field_name ?>" cols="<?php echo $field['size']; ?>" rows="<?php echo $field['max']; ?>"><?php echo $field['default_value']; ?></textarea>
|
19 |
|
20 |
<?php }else if ($field['type'] == 'radio' || $field['type'] == 'checkbox'){
|
21 |
+
$field['value'] = maybe_unserialize($field['default_value']); ?>
|
22 |
+
<?php require(FRM_VIEWS_PATH.'/frm-fields/radio.php'); ?>
|
23 |
+
|
24 |
+
<div id="frm_add_field_<?php echo $field['id']; ?>" class="frm-show-click">
|
25 |
+
<a href="javascript:frm_add_field_option(<?php echo $field['id']; ?>)"><span class="ui-icon ui-icon-plusthick alignleft"></span> Add an Option</a>
|
26 |
</div>
|
27 |
|
28 |
<?php }else if ($field['type'] == 'select'){ ?>
|
29 |
+
<select name="<?php echo $field_name ?>" id="<?php echo $field_name ?>">
|
30 |
<?php foreach ($field['options'] as $opt){
|
31 |
$selected = ($field['default_value'] == $opt)?(' selected="selected"'):(''); ?>
|
32 |
<option value="<?php echo $opt ?>"<?php echo $selected ?>><?php echo $opt ?></option>
|
34 |
</select>
|
35 |
<?php if ($display['default_blank']) FrmFieldsHelper::show_default_blank_js($field['id'], $field['default_blank']); ?>
|
36 |
<br/>
|
37 |
+
<div class="frm-show-click">
|
38 |
<?php foreach ($field['options'] as $opt_key => $opt)
|
39 |
require(FRM_VIEWS_PATH.'/frm-fields/single-option.php');
|
40 |
?>
|
41 |
+
</div>
|
42 |
+
<div id="frm_add_field_<?php echo $field['id']; ?>" class="frm-show-click">
|
43 |
+
<a href="javascript:frm_add_field_option(<?php echo $field['id']; ?>)"><span class="ui-icon ui-icon-plusthick alignleft"></span> Add an Option</a>
|
44 |
<?php do_action('frm_add_multiple_opts', $field); ?>
|
45 |
</div>
|
46 |
|
69 |
}
|
70 |
|
71 |
if ($display['options']){ ?>
|
72 |
+
<h3 class="ui-accordion-header ui-state-default">
|
73 |
+
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
74 |
+
<a href="#">Field Options</a>
|
75 |
+
</h3>
|
76 |
+
<div class="ui-widget-content ui-corner-bottom">
|
77 |
+
<?php if ($display['size']){ ?>
|
78 |
+
<p><label><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')?'Columns':'Field Size' ?>:</label>
|
79 |
+
<input type="text" name="field_options[size_<?php echo $field['id'] ?>]" value="<?php echo $field['size']; ?>" size="5">
|
80 |
+
|
81 |
+
<label class="nofloat"><?php echo ($field['type'] == 'textarea' || $field['type'] == 'rte')?'Rows':'Max length of input' ?>:</label>
|
82 |
+
<input type="text" name="field_options[max_<?php echo $field['id'] ?>]" value="<?php echo $field['max']; ?>" size="5">
|
83 |
+
</p>
|
84 |
+
<?php } ?>
|
85 |
+
<?php if ($display['label_position']){ ?>
|
86 |
+
<p><label>Label Position:</label>
|
87 |
+
<select name="field_options[label_<?php echo $field['id'] ?>]">
|
88 |
+
<option value="top"<?php echo ($field['label'] == 'top')?(' selected="true"'):(''); ?>>Top</option>
|
89 |
+
<option value="left"<?php echo ($field['label'] == 'left')?(' selected="true"'):(''); ?>>Left</option>
|
90 |
+
<option value="none"<?php echo ($field['label'] == 'none')?(' selected="true"'):(''); ?>>Hidden</option>
|
91 |
+
</select>
|
92 |
+
</p>
|
93 |
+
<?php } ?>
|
94 |
+
<?php if ($display['required']){ ?>
|
95 |
+
<p><label>Indicate required field with:</label>
|
96 |
+
<input type="text" name="field_options[required_indicator_<?php echo $field['id'] ?>]" value="<?php echo $field['required_indicator']; ?>">
|
97 |
+
</p>
|
98 |
+
<p><label>Error message if required field is left blank:</label>
|
99 |
+
<input type="text" name="field_options[blank_<?php echo $field['id'] ?>]" value="<?php echo $field['blank']; ?>" size="50">
|
100 |
+
</p>
|
101 |
+
<?php } ?>
|
102 |
+
<?php if ($display['invalid']){ ?>
|
103 |
+
<p><label>Error message if entry is an invalid format:</label>
|
104 |
+
<input type="text" name="field_options[invalid_<?php echo $field['id'] ?>]" value="<?php echo $field['invalid']; ?>" size="50">
|
105 |
+
</p>
|
106 |
+
<?php } ?>
|
107 |
+
<?php do_action('frm_field_options_form', $field, $display); ?>
|
108 |
+
|
109 |
</div>
|
110 |
<?php } ?>
|
111 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/views/frm-forms/add_field_links.php
CHANGED
@@ -1,66 +1,95 @@
|
|
1 |
<div id="frm_form_options" class="alignright">
|
2 |
<?php if (!$values['is_template']){ ?>
|
3 |
-
<
|
4 |
-
|
5 |
-
</div>
|
6 |
<?php } ?>
|
7 |
|
8 |
<ul class="frmbutton nodrag">
|
9 |
-
<li><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="blank" >Preview Form</a></li>
|
10 |
<?php global $frm_settings; if ($frm_settings->preview_page_id > 0){ ?>
|
11 |
-
<li><a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="blank" class="frmbutton">Preview Form in Current Theme</a></li>
|
12 |
<?php } ?>
|
13 |
</ul>
|
14 |
|
15 |
-
<
|
16 |
-
<
|
17 |
-
|
18 |
-
<li class="frmbutton" id="<?php echo $field_key ?>"><a href="javascript:void(0);" class="add_frm_field_link" id="<?php echo $field_key ?>"><?php echo $field_type ?></a></li>
|
19 |
-
<?php } ?>
|
20 |
-
<?php if (!$frm_recaptcha_enabled && !function_exists( 'akismet_http_post' )){
|
21 |
-
global $frm_siteurl;
|
22 |
-
echo '<p class="howto">Hint: Download and activate <a href="'.$frm_siteurl.'/wp-admin/plugin-install.php?tab=plugin-information&plugin=wp-recaptcha&TB_iframe=true&width=640&height=593" class="thickbox onclick" title="WP-reCAPTCHA 2.9.6">WP-reCAPTCHA</a> to add a captcha to your form. Alternatively activate Akismet for captcha-free spam screening.</p>';
|
23 |
-
} ?>
|
24 |
-
</ul>
|
25 |
-
|
26 |
-
<h4>Pro Fields</h4>
|
27 |
-
<ul class="field_type_list">
|
28 |
-
<?php
|
29 |
-
if($frmpro_is_installed){
|
30 |
-
foreach ($frm_pro_field_selection as $field_key => $field_type){ ?>
|
31 |
-
<li class="frmbutton" id="<?php echo $field_key ?>"><a href="javascript:void(0);" class="add_frm_field_link" id="<?php echo $field_key ?>"><?php echo $field_type ?></a></li>
|
32 |
-
<?php }
|
33 |
-
}else
|
34 |
-
foreach ($frm_pro_field_selection as $field_key => $field_type)
|
35 |
-
echo '<li class="frmbutton">'.$field_type.'</li>';
|
36 |
-
?>
|
37 |
-
</ul>
|
38 |
-
|
39 |
-
<br/>
|
40 |
-
<h3>KEY</h3>
|
41 |
-
<ul class="ui-state-default" style="border:none; font-weight:normal">
|
42 |
-
<li><span class="ui-icon ui-icon-star alignleft"></span> = required field</li>
|
43 |
-
<li><span class="frm_inactive_icon ui-icon ui-icon-star alignleft"></span> = not required</li>
|
44 |
-
<li><span><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span> = clear default data on click</li>
|
45 |
-
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span> = do not clear default data on click</li>
|
46 |
-
<li><span><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span> = default value will NOT pass validation</li>
|
47 |
-
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span> = default value will pass validation</li>
|
48 |
-
<li><span class="ui-icon ui-icon-trash alignleft"></span> = delete field and all inputed data</li>
|
49 |
-
</ul>
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
data:"action=frm_insert_field&form_id=<?php echo $id; ?>&field="+this.getAttribute('id'),
|
62 |
-
success:function(msg){jQuery('#new_fields').append(msg);}
|
63 |
-
});
|
64 |
-
});
|
65 |
-
})
|
66 |
-
</script>
|
1 |
<div id="frm_form_options" class="alignright">
|
2 |
<?php if (!$values['is_template']){ ?>
|
3 |
+
<p class="howto">Copy this code and paste it into your post, page or text widget:</p>
|
4 |
+
<input type='text' style="text-align:center; font-weight:bold; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='[formidable id=<?php echo $id; ?>]' /><br/><br/>
|
|
|
5 |
<?php } ?>
|
6 |
|
7 |
<ul class="frmbutton nodrag">
|
8 |
+
<li class="ui-widget-header"><a href="<?php echo FrmFormsHelper::get_direct_link($values['form_key']); ?>" target="blank" >Preview Form</a></li>
|
9 |
<?php global $frm_settings; if ($frm_settings->preview_page_id > 0){ ?>
|
10 |
+
<li class="ui-widget-header"><a href="<?php echo add_query_arg('form', $values['form_key'], get_permalink($frm_settings->preview_page_id)) ?>" target="blank" class="frmbutton">Preview Form in Current Theme</a></li>
|
11 |
<?php } ?>
|
12 |
</ul>
|
13 |
|
14 |
+
<p class="howto">Click on or drag a field into your form</p>
|
15 |
+
<div id="themeRoller" class="clearfix">
|
16 |
+
<div id="rollerTabs">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
<fieldset class="clearfix">
|
19 |
+
<div class="theme-group clearfix">
|
20 |
+
<div class="theme-group-header state-default">
|
21 |
+
<span class="icon icon-triangle-1-e">Collapse</span>
|
22 |
+
<a href="#">Basic Fields</a>
|
23 |
+
</div><!-- /theme group Error -->
|
24 |
+
<div class="theme-group-content corner-bottom clearfix">
|
25 |
+
<div class="clearfix">
|
26 |
+
<ul class="field_type_list">
|
27 |
+
<?php foreach ($frm_field_selection as $field_key => $field_type){ ?>
|
28 |
+
<li class="frmbutton button" id="<?php echo $field_key ?>"><a href="javascript:add_frm_field_link(<?php echo $id ?>, '<?php echo $field_key ?>');"><?php echo $field_type ?></a></li>
|
29 |
+
<?php } ?>
|
30 |
+
<?php if (!$frm_recaptcha_enabled && !function_exists( 'akismet_http_post' )){
|
31 |
+
global $frm_siteurl;
|
32 |
+
echo '<p class="howto">Hint: Download and activate <a href="'.$frm_siteurl.'/wp-admin/plugin-install.php?tab=plugin-information&plugin=wp-recaptcha&TB_iframe=true&width=640&height=593" class="thickbox onclick" title="WP-reCAPTCHA 2.9.6">WP-reCAPTCHA</a> to add a captcha to your form. Alternatively activate Akismet for captcha-free spam screening.</p>';
|
33 |
+
} ?>
|
34 |
+
</ul>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
</div><!-- /theme group content -->
|
38 |
+
</div><!-- /theme group -->
|
39 |
+
|
40 |
+
<div class="theme-group clearfix">
|
41 |
+
<div class="theme-group-header state-default">
|
42 |
+
<span class="icon icon-triangle-1-e">Collapse</span>
|
43 |
+
<a href="#">Pro Fields</a>
|
44 |
+
</div><!-- /theme group Error -->
|
45 |
+
<div class="theme-group-content corner-bottom clearfix">
|
46 |
+
<div class="clearfix">
|
47 |
+
<ul class="field_type_list">
|
48 |
+
<?php
|
49 |
+
if($frmpro_is_installed){
|
50 |
+
foreach ($frm_pro_field_selection as $field_key => $field_type){ ?>
|
51 |
+
<li class="frmbutton button" id="<?php echo $field_key ?>"><a href="javascript:add_frm_field_link(<?php echo $id ?>, '<?php echo $field_key ?>');"><?php echo $field_type ?></a></li>
|
52 |
+
<?php }
|
53 |
+
}else
|
54 |
+
foreach ($frm_pro_field_selection as $field_key => $field_type)
|
55 |
+
echo '<li class="frmbutton">'.$field_type.'</li>';
|
56 |
+
?>
|
57 |
+
</ul>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
</div><!-- /theme group content -->
|
61 |
+
</div><!-- /theme group -->
|
62 |
+
|
63 |
+
|
64 |
+
<div class="theme-group clearfix">
|
65 |
+
<div class="theme-group-header state-default">
|
66 |
+
<span class="icon icon-triangle-1-e">Collapse</span>
|
67 |
+
<a href="#">Key</a>
|
68 |
+
</div><!-- /theme group Content -->
|
69 |
+
<div class="theme-group-content corner-bottom clearfix">
|
70 |
+
|
71 |
+
<div class="clearfix">
|
72 |
+
<ul class="ui-state-default">
|
73 |
+
<li><span class="ui-icon ui-icon-star alignleft"></span> = required field</li>
|
74 |
+
<li><span class="frm_inactive_icon ui-icon ui-icon-star alignleft"></span> = not required</li>
|
75 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span> = clear default text on click</li>
|
76 |
+
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></span> = do not clear default text on click</li>
|
77 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span> = default value will NOT pass validation</li>
|
78 |
+
<li><span class="frm_inactive_icon"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></span> = default value will pass validation</li>
|
79 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/trash.png" alt="Delete"></span> = delete field and all inputed data</li>
|
80 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/duplicate.png" alt="Move"></span> = duplicate field</li>
|
81 |
+
<li><span><img src="<?php echo FRM_IMAGES_URL ?>/move.png" alt="Move"></span> = move field</li>
|
82 |
+
</ul>
|
83 |
+
|
84 |
+
</div>
|
85 |
+
</div><!-- /theme group content -->
|
86 |
+
</div><!-- /theme group -->
|
87 |
+
<?php do_action('frm_extra_form_instructions'); ?>
|
88 |
+
</fieldset>
|
89 |
|
90 |
+
</div>
|
91 |
+
</div><!-- /themeroller -->
|
92 |
+
|
93 |
+
<p class="howto">Enter or select default values into fields on this form.</p>
|
94 |
+
|
95 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
classes/views/frm-forms/edit.php
CHANGED
@@ -8,6 +8,11 @@
|
|
8 |
|
9 |
<div class="frm_form_builder alignleft" id="poststuff">
|
10 |
<form name="form1" method="post" action="">
|
|
|
|
|
|
|
|
|
|
|
11 |
<input type="hidden" name="action" value="update">
|
12 |
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
13 |
<?php wp_nonce_field('update-options'); ?>
|
8 |
|
9 |
<div class="frm_form_builder alignleft" id="poststuff">
|
10 |
<form name="form1" method="post" action="">
|
11 |
+
<p class="submit">
|
12 |
+
<input type="submit" name="Submit" value="Update" class="button-primary" /> or
|
13 |
+
<a href="?page=<?php echo FRM_PLUGIN_NAME ?>">Cancel</a>
|
14 |
+
</p>
|
15 |
+
|
16 |
<input type="hidden" name="action" value="update">
|
17 |
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
18 |
<?php wp_nonce_field('update-options'); ?>
|
classes/views/frm-forms/footer.php
CHANGED
@@ -3,39 +3,25 @@ jQuery(document).ready(function($){
|
|
3 |
$(".frm_ipe_field_option").editInPlace({
|
4 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
5 |
params:"action=frm_field_option_ipe",
|
6 |
-
show_buttons:true,
|
7 |
default_text:'(Blank)'
|
8 |
});
|
9 |
|
10 |
$(".frm_ipe_field_option_select").editInPlace({
|
11 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
12 |
params:"action=frm_field_option_ipe",
|
13 |
-
show_buttons:true,
|
14 |
default_text:'(Blank)'
|
15 |
});
|
16 |
|
17 |
-
$(".frm_delete_field_option").click(function(){
|
18 |
-
var thisid=this.getAttribute('id');
|
19 |
-
jQuery.ajax({
|
20 |
-
type:"POST",url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
21 |
-
data:"action=frm_delete_field_option&field="+thisid,
|
22 |
-
success:function(msg){ $('#'+thisid+'_container').hide('highlight');}
|
23 |
-
});
|
24 |
-
return false;
|
25 |
-
});
|
26 |
-
|
27 |
$(".frm_ipe_form_name").editInPlace({
|
28 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
29 |
params:"action=frm_form_name_in_place_edit&form_id=<?php echo $id; ?>",
|
30 |
-
value_required:"true",
|
31 |
-
show_buttons:true
|
32 |
});
|
33 |
|
34 |
$(".frm_ipe_form_desc").editInPlace({
|
35 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
36 |
params:"action=frm_form_desc_in_place_edit&form_id=<?php echo $id; ?>",
|
37 |
field_type:"textarea",
|
38 |
-
show_buttons:true,
|
39 |
textarea_rows:3,
|
40 |
textarea_cols:60,
|
41 |
default_text:"(Click here to add form description or instructions)"
|
@@ -43,29 +29,16 @@ $(".frm_ipe_form_desc").editInPlace({
|
|
43 |
$(".frm_ipe_field_label").editInPlace({
|
44 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
45 |
params:"action=frm_field_name_in_place_edit",
|
46 |
-
value_required:"true"
|
47 |
-
show_buttons:true
|
48 |
});
|
49 |
|
50 |
$(".frm_ipe_field_desc").editInPlace({
|
51 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
52 |
params:"action=frm_field_desc_in_place_edit",
|
53 |
default_text:"(Click here to add optional description or instructions)",
|
54 |
-
show_buttons:true,
|
55 |
field_type:'textarea',
|
56 |
textarea_rows:1
|
57 |
});
|
58 |
-
|
59 |
-
$(".frm_add_field_option").click(function(){
|
60 |
-
var thisid=this.getAttribute('id');
|
61 |
-
jQuery.ajax({
|
62 |
-
type:"POST",
|
63 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
64 |
-
data:"action=frm_add_field_option&field="+thisid,
|
65 |
-
success:function(msg){ $('#frm_add_'+thisid).before(msg);}
|
66 |
-
});
|
67 |
-
return false;
|
68 |
-
});
|
69 |
|
70 |
$("#new_fields").sortable({
|
71 |
cursor:'move',
|
@@ -97,6 +70,15 @@ jQuery("ul.field_type_list, .field_type_list li").disableSelection();
|
|
97 |
|
98 |
//window.onunload = function(){jQuery.ajax({type:"POST",url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",data:"action=frm_delete_form_wo_fields&form_id=<?php echo $id; ?>"});return false;};
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
function frm_mark_required(field_id, required){
|
101 |
var thisid= 'req_field_' + field_id;
|
102 |
if (required == '0')
|
@@ -126,7 +108,7 @@ function frm_clear_on_focus(field_id, active){
|
|
126 |
type:"POST",
|
127 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
128 |
data:"action=frm_clear_on_focus&field="+field_id+"&active="+switch_to,
|
129 |
-
success:function(msg){ jQuery('#'+thisid).replaceWith('<a href="javascript:frm_clear_on_focus( '+field_id+', '+switch_to+')" class="'+new_class +'" id="'+thisid+'"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></a>');}
|
130 |
});
|
131 |
};
|
132 |
|
@@ -144,7 +126,47 @@ function frm_default_blank(field_id, active){
|
|
144 |
type:"POST",
|
145 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
146 |
data:"action=frm_default_blank&field="+field_id+"&active="+switch_to,
|
147 |
-
success:function(msg){ jQuery('#'+thisid).replaceWith('<a href="javascript:frm_default_blank(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
});
|
149 |
};
|
150 |
</script>
|
3 |
$(".frm_ipe_field_option").editInPlace({
|
4 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
5 |
params:"action=frm_field_option_ipe",
|
|
|
6 |
default_text:'(Blank)'
|
7 |
});
|
8 |
|
9 |
$(".frm_ipe_field_option_select").editInPlace({
|
10 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
11 |
params:"action=frm_field_option_ipe",
|
|
|
12 |
default_text:'(Blank)'
|
13 |
});
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$(".frm_ipe_form_name").editInPlace({
|
16 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
17 |
params:"action=frm_form_name_in_place_edit&form_id=<?php echo $id; ?>",
|
18 |
+
value_required:"true", bg_out:'#fff'
|
|
|
19 |
});
|
20 |
|
21 |
$(".frm_ipe_form_desc").editInPlace({
|
22 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
23 |
params:"action=frm_form_desc_in_place_edit&form_id=<?php echo $id; ?>",
|
24 |
field_type:"textarea",
|
|
|
25 |
textarea_rows:3,
|
26 |
textarea_cols:60,
|
27 |
default_text:"(Click here to add form description or instructions)"
|
29 |
$(".frm_ipe_field_label").editInPlace({
|
30 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
31 |
params:"action=frm_field_name_in_place_edit",
|
32 |
+
value_required:"true"
|
|
|
33 |
});
|
34 |
|
35 |
$(".frm_ipe_field_desc").editInPlace({
|
36 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
37 |
params:"action=frm_field_desc_in_place_edit",
|
38 |
default_text:"(Click here to add optional description or instructions)",
|
|
|
39 |
field_type:'textarea',
|
40 |
textarea_rows:1
|
41 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
$("#new_fields").sortable({
|
44 |
cursor:'move',
|
70 |
|
71 |
//window.onunload = function(){jQuery.ajax({type:"POST",url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",data:"action=frm_delete_form_wo_fields&form_id=<?php echo $id; ?>"});return false;};
|
72 |
|
73 |
+
function add_frm_field_link(form_id, field_type){
|
74 |
+
jQuery.ajax({
|
75 |
+
type:"POST",
|
76 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
77 |
+
data:"action=frm_insert_field&form_id="+form_id+"&field="+field_type,
|
78 |
+
success:function(msg){jQuery('#new_fields').append(msg);}
|
79 |
+
});
|
80 |
+
};
|
81 |
+
|
82 |
function frm_mark_required(field_id, required){
|
83 |
var thisid= 'req_field_' + field_id;
|
84 |
if (required == '0')
|
108 |
type:"POST",
|
109 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
110 |
data:"action=frm_clear_on_focus&field="+field_id+"&active="+switch_to,
|
111 |
+
success:function(msg){ jQuery('#'+thisid).replaceWith('<a href="javascript:frm_clear_on_focus( '+field_id+', '+switch_to+')" class="'+new_class +' frm-show-hover" id="'+thisid+'"><img src="<?php echo FRM_IMAGES_URL?>/reload.png"></a>');}
|
112 |
});
|
113 |
};
|
114 |
|
126 |
type:"POST",
|
127 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
128 |
data:"action=frm_default_blank&field="+field_id+"&active="+switch_to,
|
129 |
+
success:function(msg){ jQuery('#'+thisid).replaceWith('<a href="javascript:frm_default_blank('+field_id+', '+switch_to+')" class="'+new_class +' frm-show-hover" id="'+thisid+'"><img src="<?php echo FRM_IMAGES_URL?>/error.png"></a>');}
|
130 |
+
});
|
131 |
+
};
|
132 |
+
|
133 |
+
function frm_duplicate_field(field_id){
|
134 |
+
jQuery.ajax({
|
135 |
+
type:"POST",
|
136 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
137 |
+
data:"action=frm_duplicate_field&field_id="+field_id,
|
138 |
+
success:function(msg){jQuery('#new_fields').append(msg);}
|
139 |
+
});
|
140 |
+
};
|
141 |
+
|
142 |
+
function frm_delete_field(field_id){
|
143 |
+
if(confirm("<?php _e('Are you sure you want to delete this field and all data associated with it?', FRM_PLUGIN_NAME); ?>")){
|
144 |
+
jQuery.ajax({
|
145 |
+
type:"POST",
|
146 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
147 |
+
data:"action=frm_delete_field&field_id="+field_id,
|
148 |
+
success:function(msg){
|
149 |
+
jQuery('#new_fields').append(msg);
|
150 |
+
jQuery("#frm_field_id_"+field_id).hide('highlight',{},500, setTimeout(function(){ jQuery("#frm_delete_field"+field_id+":hidden").removeAttr('style').hide().fadeIn(); }, 1000));
|
151 |
+
}
|
152 |
+
});
|
153 |
+
}
|
154 |
+
};
|
155 |
+
|
156 |
+
function frm_add_field_option(field_id){
|
157 |
+
jQuery.ajax({
|
158 |
+
type:"POST",
|
159 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
160 |
+
data:"action=frm_add_field_option&field_id="+field_id,
|
161 |
+
success:function(msg){jQuery('#frm_add_field_'+field_id).before(msg);}
|
162 |
+
});
|
163 |
+
};
|
164 |
+
|
165 |
+
function frm_delete_field_option(field_id, opt_key){
|
166 |
+
jQuery.ajax({
|
167 |
+
type:"POST",url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
168 |
+
data:"action=frm_delete_field_option&field_id="+field_id+"&opt_key="+opt_key,
|
169 |
+
success:function(msg){ jQuery('#frm_delete_field_'+field_id+'-'+opt_key+'_container').hide('highlight');}
|
170 |
});
|
171 |
};
|
172 |
</script>
|
classes/views/frm-forms/form.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
<div id="form_desc" class="edit_form_item frm_field_box frm_head_box">
|
3 |
<h2 class="frm_ipe_form_name" id="frmform_<?php echo $id; ?>"><?php echo $values['name']; ?></h2>
|
4 |
<div class="frm_ipe_form_desc"><?php echo wpautop($values['description']); ?></div>
|
@@ -15,9 +15,11 @@ if (isset($values['fields']) && !empty($values['fields'])){
|
|
15 |
</ul>
|
16 |
|
17 |
<?php if (!$values['is_template']){ ?>
|
18 |
-
<
|
19 |
-
|
20 |
-
|
|
|
|
|
21 |
<span class="alignright"><a title="<?php _e("Edit HTML" , FRM_PLUGIN_NAME) ?>" href="#TB_inline?height=500&width=700&inlineId=frm_editable_html" class="thickbox button"><?php _e("Edit HTML" , FRM_PLUGIN_NAME) ?></a></span>
|
22 |
|
23 |
<p style="clear:both;"><label>Form ShortCodes:</label>
|
@@ -26,6 +28,10 @@ if (isset($values['fields']) && !empty($values['fields'])){
|
|
26 |
|
27 |
<p><label>Form Key</label>
|
28 |
<input type="text" name="form_key" value="<?php echo $values['form_key']; ?>" />
|
|
|
|
|
|
|
|
|
29 |
</p>
|
30 |
|
31 |
<p><label>Email Form Responses to</label>
|
@@ -86,5 +92,6 @@ if (isset($values['fields']) && !empty($values['fields'])){
|
|
86 |
<li><b>Add class name if field has an error on form submit:</b> [error_class]</li>
|
87 |
</ul>
|
88 |
</div>
|
89 |
-
|
90 |
<?php } ?>
|
|
1 |
+
<div id="frm_form_editor_container">
|
2 |
<div id="form_desc" class="edit_form_item frm_field_box frm_head_box">
|
3 |
<h2 class="frm_ipe_form_name" id="frmform_<?php echo $id; ?>"><?php echo $values['name']; ?></h2>
|
4 |
<div class="frm_ipe_form_desc"><?php echo wpautop($values['description']); ?></div>
|
15 |
</ul>
|
16 |
|
17 |
<?php if (!$values['is_template']){ ?>
|
18 |
+
<h3 class="ui-accordion-header ui-state-default">
|
19 |
+
<span class="ui-icon ui-icon-triangle-1-e"></span>
|
20 |
+
<a href="#">Advanced Form Options</a>
|
21 |
+
</h3>
|
22 |
+
<div class="ui-widget-content ui-corner-bottom">
|
23 |
<span class="alignright"><a title="<?php _e("Edit HTML" , FRM_PLUGIN_NAME) ?>" href="#TB_inline?height=500&width=700&inlineId=frm_editable_html" class="thickbox button"><?php _e("Edit HTML" , FRM_PLUGIN_NAME) ?></a></span>
|
24 |
|
25 |
<p style="clear:both;"><label>Form ShortCodes:</label>
|
28 |
|
29 |
<p><label>Form Key</label>
|
30 |
<input type="text" name="form_key" value="<?php echo $values['form_key']; ?>" />
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<p><label>Styling</label><input type="checkbox" name="options[custom_style]" <?php echo ($values['custom_style']) ? (' checked="checked"') : (''); ?> />
|
34 |
+
Use Formidable styling for this form
|
35 |
</p>
|
36 |
|
37 |
<p><label>Email Form Responses to</label>
|
92 |
<li><b>Add class name if field has an error on form submit:</b> [error_class]</li>
|
93 |
</ul>
|
94 |
</div>
|
95 |
+
|
96 |
<?php } ?>
|
97 |
+
</div>
|
classes/views/frm-forms/list.php
CHANGED
@@ -27,7 +27,7 @@
|
|
27 |
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Name<?php echo (($sort_str == 'name')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
28 |
<th class="manage-column"><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=description<?php echo (($sort_str == 'description' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Description<?php echo (($sort_str == 'description')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
29 |
<th class="manage-column" width="70px"><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=form_key<?php echo (($sort_str == 'form_key' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Key<?php echo (($sort_str == 'form_key')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
30 |
-
<th class="manage-column" width="
|
31 |
<th class="manage-column">Direct Link</th>
|
32 |
<th class="manage-column" width="115px">ShortCode</th>
|
33 |
<?php } ?>
|
27 |
<a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Name<?php echo (($sort_str == 'name')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
28 |
<th class="manage-column"><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=description<?php echo (($sort_str == 'description' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Description<?php echo (($sort_str == 'description')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
29 |
<th class="manage-column" width="70px"><a href="?page=<?php echo FRM_PLUGIN_NAME; ?>&sort=form_key<?php echo (($sort_str == 'form_key' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Key<?php echo (($sort_str == 'form_key')?' <img src="'.FRM_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
|
30 |
+
<th class="manage-column" width="60px">Entries</th>
|
31 |
<th class="manage-column">Direct Link</th>
|
32 |
<th class="manage-column" width="115px">ShortCode</th>
|
33 |
<?php } ?>
|
classes/views/frm-forms/new-field-js.php
CHANGED
@@ -1,109 +1,39 @@
|
|
1 |
<script>
|
2 |
-
jQuery(document).ready(function(){
|
3 |
-
jQuery('#frm_field_id_<?php echo $field['id'];
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
jQuery('#frm_field_id_<?php echo $field['id']; ?>.ui-state-default').hover(
|
7 |
-
function(){jQuery(this).children(".
|
8 |
-
function(){jQuery(this).
|
9 |
);
|
10 |
|
11 |
-
|
12 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?> .toggle_container').hide();
|
13 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?> .trigger').toggle(
|
14 |
-
function(){jQuery(this).addClass("active");},
|
15 |
-
function(){jQuery(this).removeClass("active");}
|
16 |
-
);
|
17 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?> .trigger').click(function(){jQuery(this).next(".toggle_container").slideToggle("slow");});
|
18 |
|
19 |
-
jQuery('#frm_field_id_<?php echo $field['id']; ?> .
|
20 |
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_option').hover(
|
21 |
-
function(){jQuery(this).children(".
|
22 |
-
function(){jQuery(this).children(".
|
23 |
);
|
24 |
|
25 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_option").editInPlace({
|
26 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
27 |
-
params:"action=frm_field_option_ipe",
|
28 |
-
show_buttons:true,
|
29 |
-
default_text:'(Blank)'
|
30 |
-
});
|
31 |
-
|
32 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_option_select").editInPlace({
|
33 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
34 |
-
params:"action=frm_field_option_ipe",
|
35 |
-
show_buttons:true,
|
36 |
-
default_text:'(Blank)',
|
37 |
-
callback: function(original_element, html, original){
|
38 |
-
jQuery("#"+original_element+'_select').html("The updated text is: " + html);
|
39 |
-
return(html);
|
40 |
-
}
|
41 |
-
});
|
42 |
-
|
43 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_delete_field_option").click( function(){
|
44 |
-
var thisid=this.getAttribute('id');
|
45 |
-
jQuery.ajax({
|
46 |
-
type:"POST",
|
47 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
48 |
-
data:"action=frm_delete_field_option&field="+thisid,
|
49 |
-
success:function(msg){
|
50 |
-
jQuery('#'+thisid+'_container').hide('highlight');
|
51 |
-
}
|
52 |
-
});
|
53 |
-
return false;
|
54 |
});
|
55 |
|
56 |
-
|
57 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
58 |
-
params:"action=frm_field_name_in_place_edit",
|
59 |
-
|
60 |
-
show_buttons:true
|
61 |
-
});
|
62 |
|
63 |
-
|
64 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
65 |
params:"action=frm_field_desc_in_place_edit",
|
66 |
-
default_text:"(Click here to add optional
|
67 |
-
|
68 |
-
field_type:'textarea',
|
69 |
-
textarea_rows:1
|
70 |
-
});
|
71 |
-
|
72 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_mark_required").click( function(){
|
73 |
-
var thisid=this.getAttribute('id');
|
74 |
-
jQuery.ajax({
|
75 |
-
type:"POST",
|
76 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
77 |
-
data:"action=frm_mark_required&field="+thisid,
|
78 |
-
success:function(msg){
|
79 |
-
jQuery('#'+thisid).switchClass('frm_mark_required','frm_unmark_required');
|
80 |
-
}
|
81 |
-
});
|
82 |
-
});
|
83 |
-
|
84 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_unmark_required").click( function(){
|
85 |
-
var thisid=this.getAttribute('id');
|
86 |
-
jQuery.ajax({
|
87 |
-
type:"POST",
|
88 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
89 |
-
data:"action=frm_unmark_required&field="+thisid,
|
90 |
-
success:function(msg){
|
91 |
-
jQuery('#'+thisid).switchClass('frm_unmark_required','frm_mark_required');
|
92 |
-
}
|
93 |
-
});
|
94 |
-
});
|
95 |
-
|
96 |
-
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_add_field_option").click( function(){
|
97 |
-
var thisid=this.getAttribute('id');
|
98 |
-
jQuery.ajax({
|
99 |
-
type:"POST",
|
100 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
101 |
-
data:"action=frm_add_field_option&field="+thisid,
|
102 |
-
success:function(msg){
|
103 |
-
jQuery('#frm_add_'+thisid).before(msg);
|
104 |
-
}
|
105 |
-
});
|
106 |
-
return false;
|
107 |
});
|
108 |
});
|
109 |
</script>
|
1 |
<script>
|
2 |
+
jQuery(document).ready(function($){
|
3 |
+
jQuery('#frm_field_id_<?php echo $field['id']; ?>.ui-state-default').click(function(){
|
4 |
+
$('.frm-show-click').hide(); $(this).children(".frm-show-click").show();
|
5 |
+
$('.frm-show-hover').hide(); $(this).children(".frm-show-hover").show();
|
6 |
+
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
7 |
+
});
|
8 |
+
|
9 |
jQuery('#frm_field_id_<?php echo $field['id']; ?>.ui-state-default').hover(
|
10 |
+
function(){jQuery(this).children(".frm-show-hover").show();},
|
11 |
+
function(){if(jQuery(this).is('.selected')){}else{ jQuery(this).children(".frm-show-hover").hide();}}
|
12 |
);
|
13 |
|
14 |
+
$('#frm_form_editor_container #frm_field_id_<?php echo $field['id']; ?> .ui-accordion-header').addClass('ui-corner-all').spinDown();
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_show_hover').hide();
|
17 |
jQuery('#frm_field_id_<?php echo $field['id']; ?> .frm_single_option').hover(
|
18 |
+
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
19 |
+
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
20 |
);
|
21 |
|
22 |
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_option").editInPlace({
|
23 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
24 |
+
params:"action=frm_field_option_ipe", default_text:'(Blank)'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
});
|
26 |
|
27 |
+
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_label").editInPlace({
|
28 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
29 |
+
params:"action=frm_field_name_in_place_edit", value_required:"true"
|
30 |
+
});
|
|
|
|
|
31 |
|
32 |
+
jQuery("#frm_field_id_<?php echo $field['id']; ?> .frm_ipe_field_desc").editInPlace({
|
33 |
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
34 |
params:"action=frm_field_desc_in_place_edit",
|
35 |
+
default_text:"(Click here to add optional description or instructions)",
|
36 |
+
field_type:'textarea', textarea_rows:1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
});
|
38 |
});
|
39 |
</script>
|
classes/views/frm-forms/new-option-js.php
CHANGED
@@ -1,40 +1,15 @@
|
|
1 |
<script>
|
2 |
jQuery(document).ready(function(){
|
3 |
-
jQuery('#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .
|
4 |
jQuery('#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container.frm_single_option').hover(
|
5 |
-
function(){jQuery(this).children(".
|
6 |
-
function(){jQuery(this).children(".
|
7 |
);
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
default_text:'(Blank)'
|
14 |
-
});
|
15 |
-
|
16 |
-
jQuery("#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_ipe_field_option_select").editInPlace({
|
17 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
18 |
-
params:"action=frm_field_option_ipe",
|
19 |
-
show_buttons:true,
|
20 |
-
default_text:'(Blank)',
|
21 |
-
callback: function(original_element, html, original){
|
22 |
-
jQuery("#"+original_element+'_select').html("The updated text is: " + html);
|
23 |
-
return(html);
|
24 |
-
}
|
25 |
-
});
|
26 |
-
|
27 |
-
jQuery("#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_delete_field_option").click( function(){
|
28 |
-
var thisid=this.getAttribute('id');
|
29 |
-
jQuery.ajax({
|
30 |
-
type:"POST",
|
31 |
-
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
32 |
-
data:"action=frm_delete_field_option&field="+thisid,
|
33 |
-
success:function(msg){
|
34 |
-
jQuery('#'+thisid+'_container').hide('highlight');
|
35 |
-
}
|
36 |
-
});
|
37 |
-
return false;
|
38 |
});
|
39 |
});
|
40 |
</script>
|
1 |
<script>
|
2 |
jQuery(document).ready(function(){
|
3 |
+
jQuery('#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_single_show_hover').hide();
|
4 |
jQuery('#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container.frm_single_option').hover(
|
5 |
+
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
6 |
+
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
7 |
);
|
8 |
|
9 |
+
jQuery("#frm_delete_field_<?php echo $field['id']; ?>-<?php echo $opt_key ?>_container .frm_ipe_field_option").editInPlace({
|
10 |
+
url:"<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php",
|
11 |
+
params:"action=frm_field_option_ipe",
|
12 |
+
default_text:'(Blank)'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
});
|
14 |
});
|
15 |
</script>
|
classes/views/frm-forms/new-selection.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
<p>
|
9 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
10 |
or
|
11 |
-
<a href="<?php echo add_query_arg('action','new'
|
12 |
</p>
|
13 |
|
14 |
</div>
|
8 |
<p>
|
9 |
<?php FrmFormsHelper::get_template_dropdown($all_templates); ?>
|
10 |
or
|
11 |
+
<a href="<?php echo add_query_arg('action','new') ?>">Create New Form</a>
|
12 |
</p>
|
13 |
|
14 |
</div>
|
classes/views/frm-settings/form.php
CHANGED
@@ -6,17 +6,25 @@
|
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
9 |
-
|
10 |
<form name="frm_settings_form" method="post" action="">
|
11 |
<input type="hidden" name="action" value="process-form">
|
12 |
<?php wp_nonce_field('update-options'); ?>
|
13 |
|
14 |
<table class="form-table">
|
15 |
<tr class="form-field">
|
16 |
-
<td valign="top" width="
|
17 |
<td>
|
18 |
<?php FrmAppHelper::wp_pages_dropdown( $frm_settings->preview_page_id_str, $frm_settings->preview_page_id )?>
|
19 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
</tr>
|
21 |
|
22 |
<?php do_action('frm_settings_form', $frm_settings); ?>
|
6 |
|
7 |
<?php require(FRM_VIEWS_PATH.'/shared/nav.php'); ?>
|
8 |
|
|
|
9 |
<form name="frm_settings_form" method="post" action="">
|
10 |
<input type="hidden" name="action" value="process-form">
|
11 |
<?php wp_nonce_field('update-options'); ?>
|
12 |
|
13 |
<table class="form-table">
|
14 |
<tr class="form-field">
|
15 |
+
<td valign="top" width="200px"><?php _e('Preview Page', FRM_PLUGIN_NAME); ?>: </td>
|
16 |
<td>
|
17 |
<?php FrmAppHelper::wp_pages_dropdown( $frm_settings->preview_page_id_str, $frm_settings->preview_page_id )?>
|
18 |
</td>
|
19 |
+
</tr>
|
20 |
+
|
21 |
+
<tr class="form-field">
|
22 |
+
<td><?php _e('Styling', FRM_PLUGIN_NAME); ?>: </td>
|
23 |
+
<td>
|
24 |
+
<input type="checkbox" value="1" id="frm_custom_style" name="frm_custom_style" <?php checked($frm_settings->custom_style, 1) ?>>
|
25 |
+
<?php _e('Use Formidable styling settings for my forms', FRM_PLUGIN_NAME); ?>
|
26 |
+
<p class="description">You can override this setting on individual forms.</p>
|
27 |
+
</td>
|
28 |
</tr>
|
29 |
|
30 |
<?php do_action('frm_settings_form', $frm_settings); ?>
|
classes/views/shared/head.php
CHANGED
@@ -11,9 +11,9 @@ if (isset($css_file)){
|
|
11 |
if (isset($js_file)){
|
12 |
if (is_array($js_file)){
|
13 |
foreach ($js_file as $file)
|
14 |
-
echo '<script type="text/javascript" src="'.
|
15 |
}else{?>
|
16 |
-
<script type="text/javascript" src="<?php echo
|
17 |
<?php
|
18 |
}
|
19 |
}
|
11 |
if (isset($js_file)){
|
12 |
if (is_array($js_file)){
|
13 |
foreach ($js_file as $file)
|
14 |
+
echo '<script type="text/javascript" src="'. $file .'"></script>';
|
15 |
}else{?>
|
16 |
+
<script type="text/javascript" src="<?php echo $js_file; ?>"></script>
|
17 |
<?php
|
18 |
}
|
19 |
}
|
css/frm_admin.css
CHANGED
@@ -18,26 +18,30 @@ ul.pane li {padding: 0px; margin: 0px;}
|
|
18 |
width: 36px;
|
19 |
background: url(../images/icon_32.png) no-repeat top center;
|
20 |
}
|
21 |
-
.frmbutton.nodrag a{cursor:pointer;}
|
22 |
-
.frmbutton a{
|
23 |
-
cursor:move;
|
24 |
-
text-align:center;
|
25 |
-
background:#efefef url(../../../../wp-admin/images/gray-grad.png) top repeat-x;
|
26 |
-
color:#555; display:block;
|
27 |
-
width:240px;
|
28 |
-
text-decoration:none; padding:3px;
|
29 |
-
border:1px solid #dfdfdf; margin:5px 0;
|
30 |
-
}
|
31 |
-
.frmbutton a{background:#eaf3fa url(../../../../wp-admin/images/blue-grad.png) top repeat-x; color:#000;}
|
32 |
-
.frmbutton a:hover{background-position:bottom;}
|
33 |
-
|
34 |
-
.form-field input{width:auto;}
|
35 |
-
.frm_ipe_field_desc textarea{width:100%;}
|
36 |
|
37 |
.frm_form_builder{width:60%;}
|
|
|
|
|
38 |
#frm_form_options{width:250px;}
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
.frm_field_box{padding:5px;}
|
43 |
|
@@ -47,25 +51,416 @@ ul.pane li {padding: 0px; margin: 0px;}
|
|
47 |
.frm_spacer{float:left; width:16px; height:16px;}
|
48 |
.frm_charts object{background:transparent;}
|
49 |
|
50 |
-
.
|
51 |
-
.postbox h3{cursor:pointer;}
|
52 |
-
.postbox label{float:left; width:150px; text-align:right; padding-right:5px; clear:both;}
|
53 |
-
.postbox label.nofloat{clear:none; float:none; margin-left:10px;}
|
54 |
-
.edit_form_item .postbox, .edit_form_item .ui-icon-arrowthick-2-n-s, .edit_form_item .ui-icon-trash{display:none;}
|
55 |
#new_fields span.ui-icon{width:16px;}
|
56 |
|
57 |
-
|
58 |
-
.ui-icon-arrowthick-2-n-s{cursor:move;}
|
59 |
-
|
60 |
.frm_inactive_icon, .frm_required0{
|
61 |
opacity:.2;
|
62 |
filter:alpha(opacity=20);
|
63 |
}
|
64 |
-
|
65 |
.howto{font-weight:normal;}
|
66 |
|
67 |
.frm_10radio{margin-right:10px; text-align:center; float:left;}
|
68 |
|
69 |
-
#
|
70 |
-
#
|
71 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
width: 36px;
|
19 |
background: url(../images/icon_32.png) no-repeat top center;
|
20 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
.frm_form_builder{width:60%;}
|
23 |
+
.frm_form_builder a:hover{text-decoration:underline;}
|
24 |
+
|
25 |
#frm_form_options{width:250px;}
|
26 |
+
#frm_form_options .nodrag .ui-widget-header{margin-bottom:20px;}
|
27 |
+
#frm_form_options .nodrag .ui-widget-header a{cursor:pointer;}
|
28 |
+
#frm_form_options .ui-widget-header, #frm_form_options .button{text-align:center;}
|
29 |
+
#frm_form_options .button a{display:block;}
|
30 |
+
#frm_form_options .ui-widget-header a, #frm_form_options .button a{font-weight:normal; text-decoration:none;}
|
31 |
|
32 |
+
#poststuff h2.frm_ipe_form_name{
|
33 |
+
border:1px solid #dfdfdf; background-color:#fff; display:block; padding:0 5px; margin-top:0;
|
34 |
+
-moz-border-radius:4px; -webkit-border-radius:4px;
|
35 |
+
}
|
36 |
+
.frm_ipe_form_name input{
|
37 |
+
border:none; width:90%;
|
38 |
+
font-size:1.1em; background:transparent;
|
39 |
+
font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
40 |
+
}
|
41 |
+
|
42 |
+
.form-field input{width:auto;}
|
43 |
+
textarea.inplace_field{width:100%;}
|
44 |
+
.inplace_field{width:80%;}
|
45 |
|
46 |
.frm_field_box{padding:5px;}
|
47 |
|
51 |
.frm_spacer{float:left; width:16px; height:16px;}
|
52 |
.frm_charts object{background:transparent;}
|
53 |
|
54 |
+
.frm-show-hover, .frm_single_show_hover, .frm-show-click{display:none;}
|
|
|
|
|
|
|
|
|
55 |
#new_fields span.ui-icon{width:16px;}
|
56 |
|
|
|
|
|
|
|
57 |
.frm_inactive_icon, .frm_required0{
|
58 |
opacity:.2;
|
59 |
filter:alpha(opacity=20);
|
60 |
}
|
61 |
+
.frm-move{cursor:move;}
|
62 |
.howto{font-weight:normal;}
|
63 |
|
64 |
.frm_10radio{margin-right:10px; text-align:center; float:left;}
|
65 |
|
66 |
+
#frm_form_editor_container .ui-widget-content{display:none; padding:15px;}
|
67 |
+
#frm_form_editor_container .ui-widget-content label{float:left; width:170px; text-align:right; padding-right:5px; clear:both;}
|
68 |
+
#frm_form_editor_container .ui-widget-content label.nofloat{clear:none; float:none; margin-left:10px;}
|
69 |
+
|
70 |
+
|
71 |
+
#frm_form_editor_container .ui-accordion-header{cursor:pointer;}
|
72 |
+
#new_fields .ui-accordion-header{cursor:pointer; display:none;}
|
73 |
+
#frm_form_editor_container .ui-accordion-header .ui-icon{float:left;}
|
74 |
+
#frm_form_editor_container .ui-accordion-header a{padding:0 0.2em; font-weight:normal; display:inline; font-size:1em;}
|
75 |
+
#frm_form_editor_container .ui-accordion-header a:hover{text-decoration:none;}
|
76 |
+
#frm_form_editor_container .ui-accordion-header.ui-state-default{}
|
77 |
+
#frm_form_editor_container .ui-accordion-header.ui-state-active{display:block; border-bottom:none;}
|
78 |
+
#new_fields li.ui-state-default.selected .ui-accordion-header{display:block;}
|
79 |
+
|
80 |
+
#frm_form_options .ui-state-default,
|
81 |
+
#new_fields li.ui-state-default{
|
82 |
+
border:none;
|
83 |
+
font-weight:normal;
|
84 |
+
background-color:transparent; background-image:none;
|
85 |
+
margin-bottom:20px;
|
86 |
+
}
|
87 |
+
#frm_form_options .ui-state-default{color:#000;}
|
88 |
+
#new_fields li.ui-state-default{padding:6px; margin-bottom:10px;}
|
89 |
+
#new_fields li.ui-state-default:hover, #new_fields li.ui-state-default.selected{border:1px solid #fbcb09; padding:5px; background:#ffe;}
|
90 |
+
#new_fields li.ui-state-default.selected{background:#fdf5ce;}
|
91 |
+
|
92 |
+
|
93 |
+
/*hide elements if js is avail*/
|
94 |
+
.js .theme-group-content, .js #submitBtn, .js select.texture, .js #themeGallery, .js #help {
|
95 |
+
display: none;
|
96 |
+
}
|
97 |
+
|
98 |
+
#themeRoller {
|
99 |
+
font-family: Verdana, Arial, sans-serif;
|
100 |
+
font-size:100%;
|
101 |
+
background: #000;
|
102 |
+
width: 214px;
|
103 |
+
padding: 0 4px 4px 4px;
|
104 |
+
color: #fff;
|
105 |
+
border: 1px solid #222;
|
106 |
+
position: relative;
|
107 |
+
}
|
108 |
+
#frm_form_options #themeRoller{
|
109 |
+
background:transparent;
|
110 |
+
width:240px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.form-table td #themeRoller{
|
114 |
+
line-height:12px;
|
115 |
+
}
|
116 |
+
|
117 |
+
#themeRoller a:focus, div.content * {
|
118 |
+
outline: 0 !important;
|
119 |
+
}
|
120 |
+
|
121 |
+
/*corner radius in TR app elements*/
|
122 |
+
#themeRoller, #themeRoller .corner-all, #themeRoller input, #themeRoller select, #themeGallery a.download, #themeGallery a.edit, .texturePicker, .farbtastic, #getBookmarklet {-moz-border-radius: 4px !important; -webkit-border-radius: 4px !important; border-radius: 4px !important; }
|
123 |
+
#themeRoller .corner-bottom {-moz-border-radius-bottomleft: 4px !important; -webkit-border-bottom-left-radius: 4px !important; border-bottom-left-radius: 4px !important; -moz-border-radius-bottomright: 4px !important; -webkit-border-bottom-right-radius: 4px !important; border-bottom-right-radius: 4px !important; }
|
124 |
+
#themeRoller .corner-top {-moz-border-radius-topleft: 4px !important; -webkit-border-top-left-radius: 4px !important; border-top-left-radius: 4px !important; -moz-border-radius-topright: 4px !important; -webkit-border-top-right-radius: 4px !important; border-top-right-radius: 4px !important; }
|
125 |
+
|
126 |
+
#themeRoller fieldset {
|
127 |
+
border: 0;
|
128 |
+
padding: 0;
|
129 |
+
margin: 0;
|
130 |
+
clear: both;
|
131 |
+
display: block;
|
132 |
+
}
|
133 |
+
#themeRoller .icon{ width: 16px; height: 16px; display: block; text-indent: -999999px; overflow: hidden; }
|
134 |
+
|
135 |
+
|
136 |
+
/*TR Tabs structure*/
|
137 |
+
#rollerTabs {padding: 2px; margin: 0; font-size: 1em !important; background: none; border: none; font-weight: normal; font-family: Verdana, Arial, sans-serif; }
|
138 |
+
|
139 |
+
|
140 |
+
/*THEME GROUP SPINDOWNS*/
|
141 |
+
#themeRoller .theme-group {
|
142 |
+
margin: 1px 0;
|
143 |
+
width: 210px;
|
144 |
+
}
|
145 |
+
#frm_form_options #themeRoller .theme-group{
|
146 |
+
width:100%;
|
147 |
+
}
|
148 |
+
#themeRoller .theme-group-header {
|
149 |
+
cursor: pointer;
|
150 |
+
padding: .4em 0;
|
151 |
+
|
152 |
+
}
|
153 |
+
/*header states*/
|
154 |
+
#frm_form_options #themeRoller .theme-group .theme-group-content{background:transparent; color:#666;}
|
155 |
+
#themeRoller .theme-group .theme-group-header.state-default { border: 1px solid #222/*borderColorDefault*/; font-weight: normal; color: #aaaaaa/*fcDefault*/ !important; background: #111 url(http://static.jquery.com/ui/themeroller/images/app/bg_tr_group_headers.png) 0 50% repeat-x;}
|
156 |
+
#themeRoller .theme-group .theme-group-header.state-default a { color: #aaaaaa/*fcDefault*/; text-decoration: none; }
|
157 |
+
#themeRoller .theme-group .theme-group-header.state-active { border: 1px solid #444/*borderColorActive*/; border-bottom: 0 !important; background: #333 url(http://static.jquery.com/ui/themeroller/images/app/bg_tr_group_headers_active.png) 0 50% repeat-x; font-weight: normal/*fwDefault*/; color: #ffffff/*fcActive*/ !important; outline: none; }
|
158 |
+
#themeRoller .theme-group .theme-group-header.state-active a { color: #ffffff/*fcActive*/; outline: none; text-decoration: none; }
|
159 |
+
#themeRoller .theme-group .theme-group-content { border: 1px solid #444/*borderColorContent*/; background: #333 url(http://static.jquery.com/ui/themeroller/images/app/bg_tr_group_headers_content.png) 0 0 repeat-x/*bgContentRepeat*/; color: #ffffff/*fcContent*/; }
|
160 |
+
#themeRoller .theme-group .theme-group-header.state-hover { border: 1px solid #444/*borderColorHover*/; background: #1a1a1a url(http://static.jquery.com/ui/themeroller/images/app/bg_tr_group_headers_hover.png) 0 50% repeat-x; font-weight: normal/*fwDefault*/; color: #cccccc/*fcHover*/ !important; }
|
161 |
+
#themeRoller .theme-group .theme-group-header.state-hover a { color: #cccccc/*fcHover*/; text-decoration: none; }
|
162 |
+
#themeRoller .theme-group .theme-group-header span.icon {
|
163 |
+
float: left;
|
164 |
+
margin: -2px 3px 0 0;
|
165 |
+
background-image: url(http://static.jquery.com/ui/themeroller/images/app/tr_icons_white.png);
|
166 |
+
}
|
167 |
+
#themeRoller .state-active span.icon {
|
168 |
+
margin: -1px 2px 0 1px !important;
|
169 |
+
}
|
170 |
+
#themeRoller .theme-group .theme-group-header span.icon-triangle-1-e { background-position: -32px -16px; }
|
171 |
+
#themeRoller .theme-group .theme-group-header span.icon-triangle-1-s { background-position: -64px -16px; }
|
172 |
+
#themeRoller .theme-group .theme-group-header div.state-preview {
|
173 |
+
float: right;
|
174 |
+
padding: 1px 2px 2px;
|
175 |
+
font-size: 9px !important;
|
176 |
+
font-weight: normal !important;
|
177 |
+
margin: -2px 3px 0 0;
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
/*THEME GROUP CONTENT*/
|
183 |
+
#themeRoller .theme-group-content {
|
184 |
+
padding: 10px 5px 10px 13px;
|
185 |
+
border-top: 0 !important;
|
186 |
+
}
|
187 |
+
#themeRoller .theme-group-collapsed .theme-group-content {
|
188 |
+
display: none;
|
189 |
+
}
|
190 |
+
#themeRoller .theme-group h3 {
|
191 |
+
font-size: .8em;
|
192 |
+
font-weight: bold;
|
193 |
+
text-transform: uppercase;
|
194 |
+
}
|
195 |
+
|
196 |
+
/*form field groups*/
|
197 |
+
#themeRoller .field-group {
|
198 |
+
float: left;
|
199 |
+
width: 53px;
|
200 |
+
margin: 10px 4px 0 0;
|
201 |
+
}
|
202 |
+
#global-font .field-group,
|
203 |
+
#global-corners .field-group,
|
204 |
+
#themeRoller .field-group-background,
|
205 |
+
#themeRoller .field-group-opacity,
|
206 |
+
#Shadow .field-group {
|
207 |
+
margin: 4px 0 0;
|
208 |
+
clear: both;
|
209 |
+
float: none;
|
210 |
+
width: auto;
|
211 |
+
}
|
212 |
+
#themeRoller .field-group-border, #themeRoller .field-group-opacity, #themeRoller .field-group-corners {
|
213 |
+
clear: left;
|
214 |
+
}
|
215 |
+
|
216 |
+
/*form labels*/
|
217 |
+
#themeRoller .field-group label {
|
218 |
+
font-size: 1em;
|
219 |
+
margin: 6px 0 5px;
|
220 |
+
display: block;
|
221 |
+
}
|
222 |
+
#global-font .field-group label,
|
223 |
+
#global-corners .field-group label,
|
224 |
+
#themeRoller .field-group-opacity label{
|
225 |
+
float: left;
|
226 |
+
width: 60px;
|
227 |
+
margin: 0 4px 0 0;
|
228 |
+
text-align: right;
|
229 |
+
}
|
230 |
+
#global-font .field-group label {
|
231 |
+
width: 45px;
|
232 |
+
}
|
233 |
+
|
234 |
+
#themeRoller .field-group-opacity label {
|
235 |
+
width: auto;
|
236 |
+
text-align: left;
|
237 |
+
}
|
238 |
+
#Shadow .field-group-background label {
|
239 |
+
float: none;
|
240 |
+
width: auto;
|
241 |
+
text-align: left;
|
242 |
+
padding-bottom: 5px;
|
243 |
+
}
|
244 |
+
|
245 |
+
|
246 |
+
/*form inputs/selects */
|
247 |
+
#themeRoller input, #themeRoller select {
|
248 |
+
border: 1px solid #666;
|
249 |
+
background: #333;
|
250 |
+
color: #fff;
|
251 |
+
font-size: 1em;
|
252 |
+
padding: 2px;
|
253 |
+
}
|
254 |
+
#themeRoller select {
|
255 |
+
padding: 1px;
|
256 |
+
}
|
257 |
+
input.opacity, input.offset {
|
258 |
+
width: 20px;
|
259 |
+
float: left;
|
260 |
+
}
|
261 |
+
span.opacity-per {
|
262 |
+
float: left;
|
263 |
+
padding: 0 .2em;
|
264 |
+
}
|
265 |
+
#themeRoller input.hex {
|
266 |
+
width: 45px;
|
267 |
+
outline: 0;
|
268 |
+
}
|
269 |
+
.form-field .frm_full_width {
|
270 |
+
width: 120px;
|
271 |
+
}
|
272 |
+
|
273 |
+
input.cornerRadius {
|
274 |
+
width: 20px;
|
275 |
+
}
|
276 |
+
|
277 |
+
|
278 |
+
/*Custom form elements */
|
279 |
+
#themeRoller div.hasPicker {
|
280 |
+
position: static;
|
281 |
+
width: 48px;
|
282 |
+
padding: 1px;
|
283 |
+
margin: -2px 0 0 -2px;
|
284 |
+
border: 1px solid #333;
|
285 |
+
float: left;
|
286 |
+
}
|
287 |
+
#themeRoller div.picker-on {
|
288 |
+
background: #666;
|
289 |
+
border-color: #aaa;
|
290 |
+
border-bottom: #666;
|
291 |
+
}
|
292 |
+
/*pickers*/
|
293 |
+
#picker {
|
294 |
+
position: absolute;
|
295 |
+
left: 0;
|
296 |
+
top: auto;
|
297 |
+
width: 200px;
|
298 |
+
}
|
299 |
+
/*Texture Picker menus*/
|
300 |
+
.texturePicker {
|
301 |
+
width: 16px;
|
302 |
+
height: 16px;
|
303 |
+
float: left;
|
304 |
+
margin: 0 4px 0;
|
305 |
+
border: 1px solid #666;
|
306 |
+
}
|
307 |
+
.texturePicker a {
|
308 |
+
width: 18px;
|
309 |
+
height: 18px;
|
310 |
+
display: block;
|
311 |
+
cursor: pointer;
|
312 |
+
}
|
313 |
+
.texturePicker ul {
|
314 |
+
width: 80px;
|
315 |
+
margin: 0;
|
316 |
+
padding: .5em 5px;
|
317 |
+
list-style: none;
|
318 |
+
position: absolute;
|
319 |
+
top: 1.6em;
|
320 |
+
right: 0;
|
321 |
+
background: #222;
|
322 |
+
z-index: 999999;
|
323 |
+
border: 1px solid #444;
|
324 |
+
border-top: 0;
|
325 |
+
}
|
326 |
+
.texturePicker ul li {
|
327 |
+
float: left;
|
328 |
+
width: 20px;
|
329 |
+
}
|
330 |
+
.texturePicker ul li a {
|
331 |
+
color: #eee;
|
332 |
+
text-decoration: none;
|
333 |
+
display: block;
|
334 |
+
text-indent: -99999px;
|
335 |
+
border: 1px solid #222;
|
336 |
+
height: 1.5em;
|
337 |
+
}
|
338 |
+
.texturePicker ul li a:hover {
|
339 |
+
border: 1px solid #ccc;
|
340 |
+
}
|
341 |
+
.texturePicker ul li a:active {
|
342 |
+
border: 1px solid #eeeeee;
|
343 |
+
outline: 0 !important;
|
344 |
+
}
|
345 |
+
|
346 |
+
|
347 |
+
|
348 |
+
|
349 |
+
/*rounded corner warnings*/
|
350 |
+
a.cornerWarning { color: red !important; text-decoration: none; }
|
351 |
+
#cornerWarning {font-size: .9em; margin: 5px 0;}
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
+
/*Farbtastic styles*/
|
356 |
+
.farbtastic {
|
357 |
+
position: relative;
|
358 |
+
background: #555;
|
359 |
+
border: 1px solid #aaa;
|
360 |
+
top: 1px;
|
361 |
+
left: 0;
|
362 |
+
z-index: 99999999;
|
363 |
+
}
|
364 |
+
.farbtastic * {
|
365 |
+
position: absolute;
|
366 |
+
cursor: crosshair;
|
367 |
+
}
|
368 |
+
.farbtastic, .farbtastic .wheel {
|
369 |
+
width: 195px;
|
370 |
+
height: 195px;
|
371 |
+
}
|
372 |
+
.farbtastic .color, .farbtastic .overlay {
|
373 |
+
top: 47px;
|
374 |
+
left: 47px;
|
375 |
+
width: 101px;
|
376 |
+
height: 101px;
|
377 |
+
}
|
378 |
+
.farbtastic .wheel {
|
379 |
+
background: url(http://static.jquery.com/ui/themeroller/images/app/wheel.png) no-repeat;
|
380 |
+
width: 195px;
|
381 |
+
height: 195px;
|
382 |
+
}
|
383 |
+
.farbtastic .overlay {
|
384 |
+
background: url(http://static.jquery.com/ui/themeroller/images/app/mask.png) no-repeat;
|
385 |
+
}
|
386 |
+
.farbtastic .marker {
|
387 |
+
width: 17px;
|
388 |
+
height: 17px;
|
389 |
+
margin: -8px 0 0 -8px;
|
390 |
+
overflow: hidden;
|
391 |
+
background: url(http://static.jquery.com/ui/themeroller/images/app/marker.png) no-repeat;
|
392 |
+
}
|
393 |
+
|
394 |
+
/*COMPONENTS COLUMN*/
|
395 |
+
#components {
|
396 |
+
background: #fff;
|
397 |
+
padding: 15px;
|
398 |
+
float: right;
|
399 |
+
width: 680px;
|
400 |
+
}
|
401 |
+
|
402 |
+
#versionNotice {
|
403 |
+
margin: 20px 0;
|
404 |
+
border: 1px solid #333;
|
405 |
+
padding: 20px;
|
406 |
+
font-size: 1.2em;
|
407 |
+
background: #eee;
|
408 |
+
}
|
409 |
+
#compGroupA {
|
410 |
+
float: left;
|
411 |
+
width: 58%;
|
412 |
+
}
|
413 |
+
|
414 |
+
#compGroupB {
|
415 |
+
float: right;
|
416 |
+
width: 38%;
|
417 |
+
}
|
418 |
+
.demoHeaders {
|
419 |
+
font-size: 1.3em;
|
420 |
+
font-weight: normal;
|
421 |
+
margin: 2em 0 1em;
|
422 |
+
clear: both;
|
423 |
+
}
|
424 |
+
.demoHeaders span {
|
425 |
+
font-size: .8em;
|
426 |
+
}
|
427 |
+
|
428 |
+
|
429 |
+
#components #dialog_link {
|
430 |
+
padding: .4em 1em .4em 20px;
|
431 |
+
text-decoration: none;
|
432 |
+
position: relative;
|
433 |
+
}
|
434 |
+
#components #dialog_link span.ui-icon {
|
435 |
+
margin: 0 5px 0 0;
|
436 |
+
position: absolute;
|
437 |
+
left: .2em;
|
438 |
+
top: 50%;
|
439 |
+
margin-top: -8px;
|
440 |
+
zoom: 1;
|
441 |
+
}
|
442 |
+
|
443 |
+
|
444 |
+
|
445 |
+
|
446 |
+
ul#icons {margin: 0; padding: 0;}
|
447 |
+
ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
|
448 |
+
ul#icons span.ui-icon {float: left; margin: 0 4px;}
|
449 |
+
|
450 |
+
/* ---------------------------------------------------------------
|
451 |
+
Clearfix
|
452 |
+
--------------------------------------------------------------- */
|
453 |
+
.clearfix:after {
|
454 |
+
content: ".";
|
455 |
+
display: block;
|
456 |
+
height: 0;
|
457 |
+
clear: both;
|
458 |
+
visibility: hidden;
|
459 |
+
}
|
460 |
+
|
461 |
+
.clearfix {display: inline-block;}
|
462 |
+
|
463 |
+
/* Hides from IE-mac \*/
|
464 |
+
* html .clearfix {height: 1%;}
|
465 |
+
.clearfix {display: block;}
|
466 |
+
/* End hide from IE-mac */
|
css/frm_display.css
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
-
.frm_pos_top{display:block;}
|
2 |
-
.frm_pos_left{float:left; padding-right:10px;}
|
3 |
-
.frm_pos_none{display:none;}
|
4 |
-
.frm_10radio{margin-right:10px; text-align:center; float:left;}
|
5 |
-
.
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.with_frm_style .frm_pos_top{display:block;}
|
2 |
+
.with_frm_style .frm_pos_left{float:left; padding-right:10px; width:150px;}
|
3 |
+
.with_frm_style .frm_pos_none{display:none;}
|
4 |
+
.with_frm_style .frm_10radio{margin-right:10px; text-align:center; float:left;}
|
5 |
+
.with_frm_style .form-field{margin-top:15px;}
|
6 |
+
.with_frm_style .frm_blank_field input[type='text'], .with_frm_style .frm_blank_field textarea,
|
7 |
+
.with_frm_style .frm_blank_field select{border:1px solid red;}
|
8 |
+
.with_frm_style ul#frm_errors{list-style: square inside url(../images/error.png);}
|
9 |
+
.with_frm_style .frm_checkbox, .with_frm_style .frm_radio{display:block;}
|
10 |
+
.with_frm_style input[type="radio"],
|
11 |
+
.with_frm_style input[type="checkbox"]{width:auto;}
|
12 |
+
.with_frm_style fieldset{border:none; margin:0; padding:0;}
|
formidable.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
-
Version: 1.
|
6 |
Plugin URI: http://blog.strategy11.com/formidable-wordpress-plugin
|
7 |
Author URI: http://blog.strategy11.com
|
8 |
Author: Stephanie Wells
|
@@ -151,9 +151,9 @@ $frm_pro_field_selection = array(
|
|
151 |
'website' => 'Website/URL',
|
152 |
'image' => 'Image URL',
|
153 |
'10radio' => '1-10 radio',
|
154 |
-
'data' => 'Data from Entries'
|
155 |
//'multiple' => 'Multiple Select Box', //http://code.google.com/p/jquery-asmselect/
|
156 |
-
//'address' => 'Address'
|
157 |
//'city_selector' => 'US State/County/City selector',
|
158 |
//'full_name' => 'First and Last Name',
|
159 |
//'terms' => 'Terms of Use',// checkbox or show terms (integrate with Terms of use plugin)
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
+
Version: 1.01.04
|
6 |
Plugin URI: http://blog.strategy11.com/formidable-wordpress-plugin
|
7 |
Author URI: http://blog.strategy11.com
|
8 |
Author: Stephanie Wells
|
151 |
'website' => 'Website/URL',
|
152 |
'image' => 'Image URL',
|
153 |
'10radio' => '1-10 radio',
|
154 |
+
'data' => 'Data from Entries',
|
155 |
//'multiple' => 'Multiple Select Box', //http://code.google.com/p/jquery-asmselect/
|
156 |
+
//'address' => 'Address' //Address line 1, Address line 2, City, State/Providence, Postal Code, Select Country
|
157 |
//'city_selector' => 'US State/County/City selector',
|
158 |
//'full_name' => 'First and Last Name',
|
159 |
//'terms' => 'Terms of Use',// checkbox or show terms (integrate with Terms of use plugin)
|
images/duplicate.png
ADDED
Binary file
|
images/move.png
ADDED
Binary file
|
images/trash.png
ADDED
Binary file
|
js/jquery/jquery-ui-themepicker.js
CHANGED
@@ -1,3 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* jQuery plugin themeswitcher
|
2 |
---------------------------------------------------------------------*/
|
3 |
jQuery.fn.themeswitcher = function(settings){
|
@@ -55,7 +135,6 @@ jQuery.fn.themeswitcher = function(settings){
|
|
55 |
var cssLink = jQuery('<link href="'+locStr+'" type="text/css" rel="Stylesheet" class="ui-theme" />');
|
56 |
jQuery("head").append(cssLink);
|
57 |
|
58 |
-
|
59 |
if( jQuery("link.ui-theme").size() > 3){
|
60 |
jQuery("link.ui-theme:first").remove();
|
61 |
}
|
@@ -66,9 +145,9 @@ jQuery.fn.themeswitcher = function(settings){
|
|
66 |
var button_default = {
|
67 |
fontFamily: 'Trebuchet MS, Verdana, sans-serif',
|
68 |
fontSize: '11px',
|
69 |
-
color: '#
|
70 |
-
background: '#
|
71 |
-
border: '1px solid #
|
72 |
'-moz-border-radius': '4px',
|
73 |
'-webkit-border-radius': '4px',
|
74 |
textDecoration: 'none',
|
@@ -79,15 +158,9 @@ jQuery.fn.themeswitcher = function(settings){
|
|
79 |
outline: '0'
|
80 |
};
|
81 |
var button_hover = {
|
82 |
-
|
83 |
-
'background': '#f0f0f0',
|
84 |
-
cursor: 'pointer',
|
85 |
-
color: '#444'
|
86 |
};
|
87 |
var button_active = {
|
88 |
-
color: '#aaa',
|
89 |
-
background: '#000',
|
90 |
-
border: '1px solid #ccc',
|
91 |
borderBottom: 0,
|
92 |
'-moz-border-radius-bottomleft': 0,
|
93 |
'-webkit-border-bottom-left-radius': 0,
|
@@ -101,9 +174,7 @@ jQuery.fn.themeswitcher = function(settings){
|
|
101 |
//button css
|
102 |
button.css(button_default)
|
103 |
.hover(
|
104 |
-
function(){
|
105 |
-
jQuery(this).css(button_hover);
|
106 |
-
},
|
107 |
function(){
|
108 |
if( !switcherpane.is(':animated') && switcherpane.is(':hidden') ){ jQuery(this).css(button_default); }
|
109 |
}
|
@@ -120,7 +191,7 @@ jQuery.fn.themeswitcher = function(settings){
|
|
120 |
float: 'left',
|
121 |
fontFamily: 'Trebuchet MS, Verdana, sans-serif',
|
122 |
fontSize: '12px',
|
123 |
-
background: '#
|
124 |
color: '#fff',
|
125 |
padding: '8px 3px 3px',
|
126 |
border: '1px solid #ccc',
|
@@ -149,8 +220,8 @@ jQuery.fn.themeswitcher = function(settings){
|
|
149 |
},
|
150 |
function(){
|
151 |
jQuery(this).css({
|
152 |
-
'borderColor':'#
|
153 |
-
'background': '#
|
154 |
cursor: 'auto'
|
155 |
});
|
156 |
}
|
@@ -159,7 +230,7 @@ jQuery.fn.themeswitcher = function(settings){
|
|
159 |
height: '',
|
160 |
padding: '2px',
|
161 |
margin: '1px',
|
162 |
-
border: '1px solid #
|
163 |
'-moz-border-radius': '4px',
|
164 |
clear: 'left',
|
165 |
float: 'left'
|
@@ -180,8 +251,6 @@ jQuery.fn.themeswitcher = function(settings){
|
|
180 |
float: 'left',
|
181 |
margin: '3px 0'
|
182 |
}).end();
|
183 |
-
|
184 |
-
|
185 |
|
186 |
jQuery(this).append(button);
|
187 |
jQuery('body').append(switcherpane);
|
@@ -190,4 +259,454 @@ jQuery.fn.themeswitcher = function(settings){
|
|
190 |
switcherpane.find('a:contains('+ themeName +')').trigger('click');
|
191 |
|
192 |
return this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
};
|
1 |
+
//add js to html element for css selectors
|
2 |
+
document.documentElement.className = 'js';
|
3 |
+
|
4 |
+
//global for tracking open and focused toolbar panels on refresh
|
5 |
+
var openGroups = [];
|
6 |
+
var focusedEl = null;
|
7 |
+
|
8 |
+
//backbutton and hash bookmarks support
|
9 |
+
var hash = {
|
10 |
+
storedHash: '',
|
11 |
+
currentTabHash: '', //The hash that's only stored on a tab switch
|
12 |
+
cache: '',
|
13 |
+
interval: null,
|
14 |
+
listen: true, // listen to hash changes?
|
15 |
+
|
16 |
+
// start listening again
|
17 |
+
startListening: function() {
|
18 |
+
setTimeout(function(){hash.listen = true;}, 600);
|
19 |
+
},
|
20 |
+
// stop listening to hash changes
|
21 |
+
stopListening:function(){hash.listen = false;},
|
22 |
+
//check if hash has changed
|
23 |
+
checkHashChange:function(){
|
24 |
+
var locStr = hash.currHash();
|
25 |
+
if(hash.storedHash != locStr) {
|
26 |
+
if(hash.listen == true) hash.refreshToHash(); ////update was made by back button
|
27 |
+
hash.storedHash = locStr;
|
28 |
+
}
|
29 |
+
if(!hash.interval) hash.interval = setInterval(hash.checkHashChange, 500);
|
30 |
+
},
|
31 |
+
|
32 |
+
//refresh to a certain hash
|
33 |
+
refreshToHash: function(locStr) {
|
34 |
+
if(locStr) var newHash = true;
|
35 |
+
locStr = locStr || hash.currHash();
|
36 |
+
updateCSS(locStr);
|
37 |
+
// remember which groups are open
|
38 |
+
openGroups = [];
|
39 |
+
jQuery('div.theme-group-content').each(function(i){
|
40 |
+
if(jQuery(this).is(':visible')){openGroups.push(i);}
|
41 |
+
});
|
42 |
+
|
43 |
+
// remember any focused element
|
44 |
+
focusedEl = null;
|
45 |
+
jQuery('form input, form select, form .texturePicker').each(function(i){
|
46 |
+
if(jQuery(this).is('.focus')){focusedEl = i;}
|
47 |
+
});
|
48 |
+
|
49 |
+
// reload tab
|
50 |
+
jQuery('#rollerTabs').tabs('url', 0, '/themeroller/_rollyourown.php?'+ locStr);
|
51 |
+
jQuery('#rollerTabs').tabs('load', 0);
|
52 |
+
|
53 |
+
// if the hash is passed
|
54 |
+
if(newHash){ hash.updateHash(locStr, true); }
|
55 |
+
},
|
56 |
+
|
57 |
+
updateHash: function(locStr, ignore) {
|
58 |
+
if(ignore == true){ hash.stopListening(); }
|
59 |
+
window.location.hash = locStr;
|
60 |
+
if(ignore == true){
|
61 |
+
hash.storedHash = locStr;
|
62 |
+
hash.startListening();
|
63 |
+
}
|
64 |
+
|
65 |
+
},
|
66 |
+
|
67 |
+
clean: function(locStr){return locStr.replace(/%23/g, "").replace(/[\?#]+/g, "");},
|
68 |
+
|
69 |
+
currHash: function(){return hash.clean(window.location.hash);},
|
70 |
+
|
71 |
+
currSearch: function(){return hash.clean(window.location.search);},
|
72 |
+
|
73 |
+
init: function(){
|
74 |
+
hash.storedHash = '';
|
75 |
+
hash.checkHashChange();
|
76 |
+
}
|
77 |
+
};
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
/* jQuery plugin themeswitcher
|
82 |
---------------------------------------------------------------------*/
|
83 |
jQuery.fn.themeswitcher = function(settings){
|
135 |
var cssLink = jQuery('<link href="'+locStr+'" type="text/css" rel="Stylesheet" class="ui-theme" />');
|
136 |
jQuery("head").append(cssLink);
|
137 |
|
|
|
138 |
if( jQuery("link.ui-theme").size() > 3){
|
139 |
jQuery("link.ui-theme:first").remove();
|
140 |
}
|
145 |
var button_default = {
|
146 |
fontFamily: 'Trebuchet MS, Verdana, sans-serif',
|
147 |
fontSize: '11px',
|
148 |
+
color: '#fff',
|
149 |
+
background: '#333',
|
150 |
+
border: '1px solid #666',
|
151 |
'-moz-border-radius': '4px',
|
152 |
'-webkit-border-radius': '4px',
|
153 |
textDecoration: 'none',
|
158 |
outline: '0'
|
159 |
};
|
160 |
var button_hover = {
|
161 |
+
cursor: 'pointer'
|
|
|
|
|
|
|
162 |
};
|
163 |
var button_active = {
|
|
|
|
|
|
|
164 |
borderBottom: 0,
|
165 |
'-moz-border-radius-bottomleft': 0,
|
166 |
'-webkit-border-bottom-left-radius': 0,
|
174 |
//button css
|
175 |
button.css(button_default)
|
176 |
.hover(
|
177 |
+
function(){jQuery(this).css(button_hover);},
|
|
|
|
|
178 |
function(){
|
179 |
if( !switcherpane.is(':animated') && switcherpane.is(':hidden') ){ jQuery(this).css(button_default); }
|
180 |
}
|
191 |
float: 'left',
|
192 |
fontFamily: 'Trebuchet MS, Verdana, sans-serif',
|
193 |
fontSize: '12px',
|
194 |
+
background: '#333',
|
195 |
color: '#fff',
|
196 |
padding: '8px 3px 3px',
|
197 |
border: '1px solid #ccc',
|
220 |
},
|
221 |
function(){
|
222 |
jQuery(this).css({
|
223 |
+
'borderColor':'#333',
|
224 |
+
'background': '#333',
|
225 |
cursor: 'auto'
|
226 |
});
|
227 |
}
|
230 |
height: '',
|
231 |
padding: '2px',
|
232 |
margin: '1px',
|
233 |
+
border: '1px solid #333',
|
234 |
'-moz-border-radius': '4px',
|
235 |
clear: 'left',
|
236 |
float: 'left'
|
251 |
float: 'left',
|
252 |
margin: '3px 0'
|
253 |
}).end();
|
|
|
|
|
254 |
|
255 |
jQuery(this).append(button);
|
256 |
jQuery('body').append(switcherpane);
|
259 |
switcherpane.find('a:contains('+ themeName +')').trigger('click');
|
260 |
|
261 |
return this;
|
262 |
+
};
|
263 |
+
|
264 |
+
jQuery.fn.spinDown = function() {
|
265 |
+
return this.click(function() {
|
266 |
+
var $this = jQuery(this);
|
267 |
+
$this.next().slideToggle(100);
|
268 |
+
$this.prev().toggleClass('not-active');
|
269 |
+
$this.find('.icon').toggleClass('icon-triangle-1-s').end().toggleClass('state-active');
|
270 |
+
//jQuery('li.ui-state-default .ui-state-active').removeClass('ui-state-active');
|
271 |
+
$this.find('.ui-icon').toggleClass('ui-icon-triangle-1-s').end().toggleClass('ui-state-active');
|
272 |
+
if($this.is('.corner-all')) { $this.removeClass('corner-all').addClass('corner-top'); }
|
273 |
+
else if($this.is('.corner-top')) { $this.removeClass('corner-top').addClass('corner-all'); }
|
274 |
+
if($this.is('.ui-corner-all')) { $this.removeClass('ui-corner-all').addClass('ui-corner-top'); }
|
275 |
+
else if($this.is('.ui-corner-top')) { $this.removeClass('ui-corner-top').addClass('ui-corner-all'); }
|
276 |
+
return false;
|
277 |
+
});
|
278 |
+
};
|
279 |
+
|
280 |
+
// validation for hex inputs
|
281 |
+
jQuery.fn.validHex = function() {
|
282 |
+
return this.each(function() {
|
283 |
+
var value = jQuery(this).val();
|
284 |
+
value = value.replace(/[^#a-fA-F0-9]/g, ''); // non [#a-f0-9]
|
285 |
+
if(value.match(/#/g) && value.match(/#/g).length > 1) value = value.replace(/#/g, ''); // ##
|
286 |
+
if(value.indexOf('#') == -1) value = '#'+value; // no #
|
287 |
+
if(value.length > 7) value = value.substr(0,7); // too many chars
|
288 |
+
jQuery(this).val(value);
|
289 |
+
});
|
290 |
+
};
|
291 |
+
|
292 |
+
//color pickers setup (sets bg color of inputs)
|
293 |
+
jQuery.fn.applyFarbtastic = function() {
|
294 |
+
return this.each(function() {
|
295 |
+
jQuery('<div/>').farbtastic(this).remove();
|
296 |
+
});
|
297 |
+
};
|
298 |
+
|
299 |
+
|
300 |
+
//function called after a change event in the form
|
301 |
+
function formChange(){
|
302 |
+
var locStr = jQuery('form[name="frm_settings_form"]').serialize();
|
303 |
+
locStr = hash.clean(locStr);
|
304 |
+
updateCSS(locStr);
|
305 |
+
hash.updateHash(locStr, true);
|
306 |
+
};
|
307 |
+
|
308 |
+
jQuery(document).ready(function($){
|
309 |
+
// hover class toggles in app panel
|
310 |
+
jQuery('.state-default').hover(
|
311 |
+
function(){ jQuery(this).addClass('state-hover'); },
|
312 |
+
function(){ jQuery(this).removeClass('state-hover'); }
|
313 |
+
);
|
314 |
+
|
315 |
+
$("#datepicker_sample").datepicker();
|
316 |
+
|
317 |
+
$('div.theme-group .theme-group-header').addClass('corner-all').spinDown();
|
318 |
+
$('#frm_form_editor_container .ui-accordion-header').addClass('ui-corner-all').spinDown();
|
319 |
+
|
320 |
+
// focus and blur classes in form
|
321 |
+
$('input, select').focus(function(){
|
322 |
+
$('input.focus, select.focus').removeClass('focus');
|
323 |
+
$(this).addClass('focus');
|
324 |
+
}).blur(function(){ $(this).removeClass('focus');});
|
325 |
+
|
326 |
+
// change event in form
|
327 |
+
$('form[name="frm_settings_form"]').bind('change', function() {
|
328 |
+
formChange();
|
329 |
+
return false;
|
330 |
+
});
|
331 |
+
|
332 |
+
// hex inputs
|
333 |
+
$('input.hex').validHex().keyup(function() {$(this).validHex();})
|
334 |
+
.click(function(){
|
335 |
+
$(this).addClass('focus');
|
336 |
+
$('#picker').remove();
|
337 |
+
$('div.picker-on').removeClass('picker-on');
|
338 |
+
$('div.texturePicker ul:visible').hide(0).parent().css('position', 'static');
|
339 |
+
$(this).after('<div id="picker"></div>').parent().addClass('picker-on');
|
340 |
+
$('#picker').farbtastic(this);
|
341 |
+
return false;
|
342 |
+
})
|
343 |
+
.wrap('<div class="hasPicker"></div>')
|
344 |
+
.applyFarbtastic();
|
345 |
+
|
346 |
+
$('body').click(function() {
|
347 |
+
$('div.picker-on').removeClass('picker-on');
|
348 |
+
$('#picker').remove();
|
349 |
+
$('input.focus, select.focus').removeClass('focus');
|
350 |
+
$('div.texturePicker ul:visible').hide().parent().css('position', 'static');
|
351 |
+
});
|
352 |
+
|
353 |
+
// texture pickers from select menus
|
354 |
+
$('select.texture').each(function() {
|
355 |
+
|
356 |
+
$(this).after('<div class="texturePicker"><a href="#"></a><ul></ul></div>');
|
357 |
+
var texturePicker = $(this).next();
|
358 |
+
var a = texturePicker.find('a');
|
359 |
+
var ul = texturePicker.find('ul');
|
360 |
+
var sIndex = texturePicker.prev().get(0).selectedIndex;
|
361 |
+
|
362 |
+
// scrape options
|
363 |
+
$(this).find('option').each(function(){
|
364 |
+
ul.append('<li class="'+ $(this).attr('value') +'" data-texturewidth="16" data-textureheight="16" style="background: #555555 url('+$(this).attr('value')+') 50% 50% no-repeat"><a href="#" title="'+ $(this).text() +'">'+ $(this).text() +'</a></li>');
|
365 |
+
if($(this).get(0).index == sIndex){texturePicker.attr('title',$(this).text()).css('background', '#555555 url('+$(this).attr('value')+') 50% 50% no-repeat');}
|
366 |
+
});
|
367 |
+
|
368 |
+
ul.find('li').click(function() {
|
369 |
+
texturePicker.prev().get(0).selectedIndex = texturePicker.prev().find('option[value='+ $(this).attr('class') +']').get(0).index;
|
370 |
+
texturePicker.attr('title',$(this).text()).css('background', '#555555 url('+$(this).attr('class')+') 50% 50% no-repeat');
|
371 |
+
//ul.fadeOut(100);
|
372 |
+
formChange();
|
373 |
+
return false;
|
374 |
+
});
|
375 |
+
|
376 |
+
// hide the menu and select el
|
377 |
+
ul.hide();
|
378 |
+
|
379 |
+
// show/hide of menus
|
380 |
+
texturePicker.click(function() {
|
381 |
+
$(this).addClass('focus');
|
382 |
+
$('#picker').remove();
|
383 |
+
var showIt;
|
384 |
+
if(ul.is(':hidden')){showIt = true;}
|
385 |
+
$('div.texturePicker ul:visible').hide().parent().css('position', 'static');
|
386 |
+
if(showIt == true){
|
387 |
+
texturePicker.css('position', 'relative');
|
388 |
+
ul.show();
|
389 |
+
}
|
390 |
+
return false;
|
391 |
+
});
|
392 |
+
});
|
393 |
+
});
|
394 |
+
|
395 |
+
|
396 |
+
|
397 |
+
// $Id: farbtastic.js,v 1.2 2007/01/08 22:53:01 unconed Exp $
|
398 |
+
// Farbtastic 1.2
|
399 |
+
|
400 |
+
jQuery.fn.farbtastic = function (callback) {
|
401 |
+
jQuery.farbtastic(this, callback);
|
402 |
+
return this;
|
403 |
+
};
|
404 |
+
|
405 |
+
jQuery.farbtastic = function (container, callback) {
|
406 |
+
var container = jQuery(container).get(0);
|
407 |
+
return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
|
408 |
+
};
|
409 |
+
|
410 |
+
jQuery._farbtastic = function (container, callback) {
|
411 |
+
// Store farbtastic object
|
412 |
+
var fb = this;
|
413 |
+
|
414 |
+
// Insert markup
|
415 |
+
jQuery(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
|
416 |
+
var e = jQuery('.farbtastic', container);
|
417 |
+
fb.wheel = jQuery('.wheel', container).get(0);
|
418 |
+
// Dimensions
|
419 |
+
fb.radius = 84;
|
420 |
+
fb.square = 100;
|
421 |
+
fb.width = 194;
|
422 |
+
|
423 |
+
// Fix background PNGs in IE6
|
424 |
+
if (navigator.appVersion.match(/MSIE [0-6]\./)) {
|
425 |
+
jQuery('*', e).each(function () {
|
426 |
+
if (this.currentStyle.backgroundImage != 'none') {
|
427 |
+
var image = this.currentStyle.backgroundImage;
|
428 |
+
image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
|
429 |
+
jQuery(this).css({
|
430 |
+
'backgroundImage': 'none',
|
431 |
+
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
|
432 |
+
});
|
433 |
+
}
|
434 |
+
});
|
435 |
+
}
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Link to the given element(s) or callback.
|
439 |
+
*/
|
440 |
+
fb.linkTo = function (callback) {
|
441 |
+
// Unbind previous nodes
|
442 |
+
if (typeof fb.callback == 'object'){jQuery(fb.callback).unbind('keyup', fb.updateValue);}
|
443 |
+
|
444 |
+
// Reset color
|
445 |
+
fb.color = null;
|
446 |
+
|
447 |
+
// Bind callback or elements
|
448 |
+
if (typeof callback == 'function'){fb.callback = callback;}
|
449 |
+
else if (typeof callback == 'object' || typeof callback == 'string') {
|
450 |
+
fb.callback = jQuery(callback);
|
451 |
+
fb.callback.bind('keyup', fb.updateValue);
|
452 |
+
if (fb.callback.get(0).value){fb.setColor(fb.callback.get(0).value);}
|
453 |
+
}
|
454 |
+
return this;
|
455 |
+
};
|
456 |
+
fb.updateValue = function (event) {
|
457 |
+
if (this.value && this.value != fb.color){fb.setColor(this.value);}
|
458 |
+
};
|
459 |
+
|
460 |
+
/**
|
461 |
+
* Change color with HTML syntax #123456
|
462 |
+
*/
|
463 |
+
fb.setColor = function (color) {
|
464 |
+
var unpack = fb.unpack(color);
|
465 |
+
if (fb.color != color && unpack) {
|
466 |
+
fb.color = color;
|
467 |
+
fb.rgb = unpack;
|
468 |
+
fb.hsl = fb.RGBToHSL(fb.rgb);
|
469 |
+
fb.updateDisplay();
|
470 |
+
}
|
471 |
+
return this;
|
472 |
+
};
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Change color with HSL triplet [0..1, 0..1, 0..1]
|
476 |
+
*/
|
477 |
+
fb.setHSL = function (hsl) {
|
478 |
+
fb.hsl = hsl;
|
479 |
+
fb.rgb = fb.HSLToRGB(hsl);
|
480 |
+
fb.color = fb.pack(fb.rgb);
|
481 |
+
fb.updateDisplay();
|
482 |
+
return this;
|
483 |
+
};
|
484 |
+
|
485 |
+
/////////////////////////////////////////////////////
|
486 |
+
|
487 |
+
/**
|
488 |
+
* Retrieve the coordinates of the given event relative to the center
|
489 |
+
* of the widget.
|
490 |
+
*/
|
491 |
+
fb.widgetCoords = function (event) {
|
492 |
+
var x, y;
|
493 |
+
var el = event.target || event.srcElement;
|
494 |
+
var reference = fb.wheel;
|
495 |
+
|
496 |
+
if (typeof event.offsetX != 'undefined') {
|
497 |
+
// Use offset coordinates and find common offsetParent
|
498 |
+
var pos = { x: event.offsetX, y: event.offsetY };
|
499 |
+
|
500 |
+
// Send the coordinates upwards through the offsetParent chain.
|
501 |
+
var e = el;
|
502 |
+
while (e) {
|
503 |
+
e.mouseX = pos.x;
|
504 |
+
e.mouseY = pos.y;
|
505 |
+
pos.x += e.offsetLeft;
|
506 |
+
pos.y += e.offsetTop;
|
507 |
+
e = e.offsetParent;
|
508 |
+
};
|
509 |
+
|
510 |
+
// Look for the coordinates starting from the wheel widget.
|
511 |
+
var e = reference;
|
512 |
+
var offset = { x: 0, y: 0 };
|
513 |
+
while (e) {
|
514 |
+
if (typeof e.mouseX != 'undefined') {
|
515 |
+
x = e.mouseX - offset.x;
|
516 |
+
y = e.mouseY - offset.y;
|
517 |
+
break;
|
518 |
+
}
|
519 |
+
offset.x += e.offsetLeft;
|
520 |
+
offset.y += e.offsetTop;
|
521 |
+
e = e.offsetParent;
|
522 |
+
}
|
523 |
+
|
524 |
+
// Reset stored coordinates
|
525 |
+
e = el;
|
526 |
+
while (e) {
|
527 |
+
e.mouseX = undefined;
|
528 |
+
e.mouseY = undefined;
|
529 |
+
e = e.offsetParent;
|
530 |
+
}
|
531 |
+
}
|
532 |
+
else {
|
533 |
+
// Use absolute coordinates
|
534 |
+
var pos = fb.absolutePosition(reference);
|
535 |
+
x = (event.pageX || 0*(event.clientX + jQuery('html').get(0).scrollLeft)) - pos.x;
|
536 |
+
y = (event.pageY || 0*(event.clientY + jQuery('html').get(0).scrollTop)) - pos.y;
|
537 |
+
}
|
538 |
+
// Subtract distance to middle
|
539 |
+
return { x: x - fb.width / 2, y: y - fb.width / 2 };
|
540 |
+
};
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Mousedown handler
|
544 |
+
*/
|
545 |
+
fb.mousedown = function (event) {
|
546 |
+
// Capture mouse
|
547 |
+
if (!document.dragging) {
|
548 |
+
jQuery(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
|
549 |
+
document.dragging = true;
|
550 |
+
};
|
551 |
+
|
552 |
+
// Check which area is being dragged
|
553 |
+
var pos = fb.widgetCoords(event);
|
554 |
+
fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
|
555 |
+
|
556 |
+
// Process
|
557 |
+
fb.mousemove(event);
|
558 |
+
return false;
|
559 |
+
};
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Mousemove handler
|
563 |
+
*/
|
564 |
+
fb.mousemove = function (event) {
|
565 |
+
// Get coordinates relative to color picker center
|
566 |
+
var pos = fb.widgetCoords(event);
|
567 |
+
|
568 |
+
// Set new HSL parameters
|
569 |
+
if (fb.circleDrag) {
|
570 |
+
var hue = Math.atan2(pos.x, -pos.y) / 6.28;
|
571 |
+
if (hue < 0) hue += 1;
|
572 |
+
fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
|
573 |
+
}else{
|
574 |
+
var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
|
575 |
+
var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
|
576 |
+
fb.setHSL([fb.hsl[0], sat, lum]);
|
577 |
+
}
|
578 |
+
return false;
|
579 |
+
};
|
580 |
+
|
581 |
+
/**
|
582 |
+
* Mouseup handler
|
583 |
+
*/
|
584 |
+
fb.mouseup = function () {
|
585 |
+
// Uncapture mouse
|
586 |
+
jQuery(document).unbind('mousemove', fb.mousemove);
|
587 |
+
jQuery(document).unbind('mouseup', fb.mouseup);
|
588 |
+
document.dragging = false;
|
589 |
+
formChange();
|
590 |
+
};
|
591 |
+
|
592 |
+
/**
|
593 |
+
* Update the markers and styles
|
594 |
+
*/
|
595 |
+
fb.updateDisplay = function () {
|
596 |
+
// Markers
|
597 |
+
var angle = fb.hsl[0] * 6.28;
|
598 |
+
jQuery('.h-marker', e).css({
|
599 |
+
left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
|
600 |
+
top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
|
601 |
+
});
|
602 |
+
|
603 |
+
jQuery('.sl-marker', e).css({
|
604 |
+
left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
|
605 |
+
top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
|
606 |
+
});
|
607 |
+
|
608 |
+
// Saturation/Luminance gradient
|
609 |
+
jQuery('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
|
610 |
+
|
611 |
+
// Linked elements or callback
|
612 |
+
if (typeof fb.callback == 'object') {
|
613 |
+
// Set background/foreground color
|
614 |
+
jQuery(fb.callback).css({
|
615 |
+
backgroundColor: fb.color,
|
616 |
+
color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
|
617 |
+
});
|
618 |
+
|
619 |
+
// Change linked value
|
620 |
+
jQuery(fb.callback).each(function() {
|
621 |
+
if (this.value && this.value != fb.color){this.value = fb.color;}
|
622 |
+
});
|
623 |
+
}else if (typeof fb.callback == 'function'){fb.callback.call(fb, fb.color);}
|
624 |
+
};
|
625 |
+
|
626 |
+
/**
|
627 |
+
* Get absolute position of element
|
628 |
+
*/
|
629 |
+
fb.absolutePosition = function (el) {
|
630 |
+
var r = { x: el.offsetLeft, y: el.offsetTop };
|
631 |
+
// Resolve relative to offsetParent
|
632 |
+
if (el.offsetParent) {
|
633 |
+
var tmp = fb.absolutePosition(el.offsetParent);
|
634 |
+
r.x += tmp.x;
|
635 |
+
r.y += tmp.y;
|
636 |
+
}
|
637 |
+
return r;
|
638 |
+
};
|
639 |
+
|
640 |
+
/* Various color utility functions */
|
641 |
+
fb.pack = function (rgb) {
|
642 |
+
var r = Math.round(rgb[0] * 255);
|
643 |
+
var g = Math.round(rgb[1] * 255);
|
644 |
+
var b = Math.round(rgb[2] * 255);
|
645 |
+
return '#' + (r < 16 ? '0' : '') + r.toString(16) +
|
646 |
+
(g < 16 ? '0' : '') + g.toString(16) +
|
647 |
+
(b < 16 ? '0' : '') + b.toString(16);
|
648 |
+
};
|
649 |
+
|
650 |
+
fb.unpack = function (color) {
|
651 |
+
if (color.length == 7) {
|
652 |
+
return [parseInt('0x' + color.substring(1, 3)) / 255,
|
653 |
+
parseInt('0x' + color.substring(3, 5)) / 255,
|
654 |
+
parseInt('0x' + color.substring(5, 7)) / 255];
|
655 |
+
}
|
656 |
+
else if (color.length == 4) {
|
657 |
+
return [parseInt('0x' + color.substring(1, 2)) / 15,
|
658 |
+
parseInt('0x' + color.substring(2, 3)) / 15,
|
659 |
+
parseInt('0x' + color.substring(3, 4)) / 15];
|
660 |
+
}
|
661 |
+
};
|
662 |
+
|
663 |
+
fb.HSLToRGB = function (hsl) {
|
664 |
+
var m1, m2, r, g, b;
|
665 |
+
var h = hsl[0], s = hsl[1], l = hsl[2];
|
666 |
+
m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
|
667 |
+
m1 = l * 2 - m2;
|
668 |
+
return [this.hueToRGB(m1, m2, h+0.33333),
|
669 |
+
this.hueToRGB(m1, m2, h),
|
670 |
+
this.hueToRGB(m1, m2, h-0.33333)];
|
671 |
+
};
|
672 |
+
|
673 |
+
fb.hueToRGB = function (m1, m2, h) {
|
674 |
+
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
|
675 |
+
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
|
676 |
+
if (h * 2 < 1) return m2;
|
677 |
+
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
|
678 |
+
return m1;
|
679 |
+
};
|
680 |
+
|
681 |
+
fb.RGBToHSL = function (rgb) {
|
682 |
+
var min, max, delta, h, s, l;
|
683 |
+
var r = rgb[0], g = rgb[1], b = rgb[2];
|
684 |
+
min = Math.min(r, Math.min(g, b));
|
685 |
+
max = Math.max(r, Math.max(g, b));
|
686 |
+
delta = max - min;
|
687 |
+
l = (min + max) / 2;
|
688 |
+
s = 0;
|
689 |
+
if (l > 0 && l < 1) {
|
690 |
+
s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
|
691 |
+
}
|
692 |
+
h = 0;
|
693 |
+
if (delta > 0) {
|
694 |
+
if (max == r && max != g) h += (g - b) / delta;
|
695 |
+
if (max == g && max != b) h += (2 + (b - r) / delta);
|
696 |
+
if (max == b && max != r) h += (4 + (r - g) / delta);
|
697 |
+
h /= 6;
|
698 |
+
}
|
699 |
+
return [h, s, l];
|
700 |
+
};
|
701 |
+
|
702 |
+
// Install mousedown handler (the others are set on the document on-demand)
|
703 |
+
jQuery('*', e).mousedown(fb.mousedown);
|
704 |
+
|
705 |
+
// Init color
|
706 |
+
fb.setColor('#000000');
|
707 |
+
|
708 |
+
// Set linked elements/callback
|
709 |
+
if (callback) {
|
710 |
+
fb.linkTo(callback);
|
711 |
+
}
|
712 |
};
|
js/jquery/jquery.editinplace.js
CHANGED
@@ -126,6 +126,8 @@ jQuery.fn.editInPlace = function(options) {
|
|
126 |
|
127 |
if(!editing)
|
128 |
{
|
|
|
|
|
129 |
editing = true;
|
130 |
|
131 |
//save original text - for cancellation functionality
|
@@ -185,7 +187,7 @@ jQuery.fn.editInPlace = function(options) {
|
|
185 |
|
186 |
var this_elem = jQuery(this);
|
187 |
|
188 |
-
var new_html =
|
189 |
|
190 |
/* set saving message */
|
191 |
if(settings.saving_image != ""){
|
@@ -267,7 +269,7 @@ jQuery.fn.editInPlace = function(options) {
|
|
267 |
}
|
268 |
|
269 |
/* hit esc key */
|
270 |
-
|
271 |
if (event.keyCode == 27) {
|
272 |
cancelAction();
|
273 |
}
|
126 |
|
127 |
if(!editing)
|
128 |
{
|
129 |
+
jQuery('.inplace_field').blur();
|
130 |
+
|
131 |
editing = true;
|
132 |
|
133 |
//save original text - for cancellation functionality
|
187 |
|
188 |
var this_elem = jQuery(this);
|
189 |
|
190 |
+
var new_html = encodeURIComponent((this_elem.is('form')) ? this_elem.children(0).val() : this_elem.parent().children(0).val());
|
191 |
|
192 |
/* set saving message */
|
193 |
if(settings.saving_image != ""){
|
269 |
}
|
270 |
|
271 |
/* hit esc key */
|
272 |
+
jQuery(document).keyup(function(event){
|
273 |
if (event.keyCode == 27) {
|
274 |
cancelAction();
|
275 |
}
|
js/jquery/jquery.editinplace.packed.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
jQuery.fn.editInPlace=function(options){var settings={url:"",params:"",field_type:"text",select_options:"",textarea_cols:"25",textarea_rows:"10",bg_over:"#
|
2 |
if(settings.saving_image!=""){var loading_image=new Image();loading_image.src=settings.saving_image;}
|
3 |
String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};String.prototype.escape_html=function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");};return this.each(function(){if(jQuery(this).html()=="")jQuery(this).html(settings.default_text);var editing=false;var original_element=jQuery(this);var click_count=0;jQuery(this).mouseover(function(){jQuery(this).css("background",settings.bg_over);}).mouseout(function(){jQuery(this).css("background",settings.bg_out);}).click(function(){click_count++;if(!editing)
|
4 |
-
{editing=true;var original_html=jQuery(this).html();var buttons_code=(settings.show_buttons)?settings.save_button+' '+settings.cancel_button:'';if(original_html==settings.default_text)jQuery(this).html('');if(settings.field_type=="textarea")
|
5 |
{var use_field_type='<textarea name="inplace_value" class="inplace_field" rows="'+settings.textarea_rows+'" cols="'+settings.textarea_cols+'">'+jQuery(this).text().trim().escape_html()+'</textarea>';}
|
6 |
else if(settings.field_type=="text")
|
7 |
{var use_field_type='<input type="text" name="inplace_value" class="inplace_field" value="'+
|
@@ -14,11 +14,11 @@ if(click_count==1)
|
|
14 |
{function cancelAction()
|
15 |
{editing=false;click_count=0;original_element.css("background",settings.bg_out);original_element.html(original_html);return false;}
|
16 |
function saveAction()
|
17 |
-
{original_element.css("background",settings.bg_out);var this_elem=jQuery(this);var new_html=
|
18 |
original_element.html(saving_message);if(settings.params!=""){settings.params="&"+settings.params;}
|
19 |
if(settings.callback){html=settings.callback(original_element.attr("id"),new_html,original_html,settings.params);editing=false;click_count=0;if(html){original_element.html(html||new_html);}else{alert("Failed to save value: "+new_html);original_element.html(original_html);}}else if(settings.value_required&&(new_html==""||new_html==undefined)){editing=false;click_count=0;original_element.html(original_html);alert("Error: You must enter a value to save this field");}else{jQuery.ajax({url:settings.url,type:"POST",data:settings.update_value+'='+new_html+'&'+settings.element_id+'='+original_element.attr("id")+settings.params+'&'+settings.original_html+'='+original_html,dataType:"html",complete:function(request){editing=false;click_count=0;},success:function(html){var new_text=html||settings.default_text;original_element.html(new_text);if(settings.success)settings.success(html,original_element);},error:function(request){original_element.html(original_html);if(settings.error)settings.error(request,original_element);}});}
|
20 |
return false;}
|
21 |
original_element.children("form").children(".inplace_field").focus().select();original_element.children("form").children(".inplace_cancel").click(cancelAction);original_element.children("form").children(".inplace_save").click(saveAction);if(!settings.show_buttons){if(settings.on_blur=="save")
|
22 |
original_element.children("form").children(".inplace_field").blur(saveAction);else
|
23 |
original_element.children("form").children(".inplace_field").blur(cancelAction);}
|
24 |
-
|
1 |
+
jQuery.fn.editInPlace=function(options){var settings={url:"",params:"",field_type:"text",select_options:"",textarea_cols:"25",textarea_rows:"10",bg_over:"#ff9",bg_out:"transparent",saving_text:"Saving...",saving_image:"",default_text:"(Click here to add text)",select_text:"Choose new value",value_required:null,element_id:"element_id",update_value:"update_value",original_html:"original_html",save_button:'<button class="inplace_save">Save</button>',cancel_button:'<button class="inplace_cancel">Cancel</button>',show_buttons:false,on_blur:"save",callback:null,success:null,error:function(request){alert("Failed to save value: "+request.responseText||'Unspecified Error');}};if(options){jQuery.extend(settings,options);}
|
2 |
if(settings.saving_image!=""){var loading_image=new Image();loading_image.src=settings.saving_image;}
|
3 |
String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};String.prototype.escape_html=function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");};return this.each(function(){if(jQuery(this).html()=="")jQuery(this).html(settings.default_text);var editing=false;var original_element=jQuery(this);var click_count=0;jQuery(this).mouseover(function(){jQuery(this).css("background",settings.bg_over);}).mouseout(function(){jQuery(this).css("background",settings.bg_out);}).click(function(){click_count++;if(!editing)
|
4 |
+
{jQuery('.inplace_field').blur();editing=true;var original_html=jQuery(this).html();var buttons_code=(settings.show_buttons)?settings.save_button+' '+settings.cancel_button:'';if(original_html==settings.default_text)jQuery(this).html('');if(settings.field_type=="textarea")
|
5 |
{var use_field_type='<textarea name="inplace_value" class="inplace_field" rows="'+settings.textarea_rows+'" cols="'+settings.textarea_cols+'">'+jQuery(this).text().trim().escape_html()+'</textarea>';}
|
6 |
else if(settings.field_type=="text")
|
7 |
{var use_field_type='<input type="text" name="inplace_value" class="inplace_field" value="'+
|
14 |
{function cancelAction()
|
15 |
{editing=false;click_count=0;original_element.css("background",settings.bg_out);original_element.html(original_html);return false;}
|
16 |
function saveAction()
|
17 |
+
{original_element.css("background",settings.bg_out);var this_elem=jQuery(this);var new_html=encodeURIComponent((this_elem.is('form'))?this_elem.children(0).val():this_elem.parent().children(0).val());if(settings.saving_image!=""){var saving_message='<img src="'+settings.saving_image+'" alt="Saving..." />';}else{var saving_message=settings.saving_text;}
|
18 |
original_element.html(saving_message);if(settings.params!=""){settings.params="&"+settings.params;}
|
19 |
if(settings.callback){html=settings.callback(original_element.attr("id"),new_html,original_html,settings.params);editing=false;click_count=0;if(html){original_element.html(html||new_html);}else{alert("Failed to save value: "+new_html);original_element.html(original_html);}}else if(settings.value_required&&(new_html==""||new_html==undefined)){editing=false;click_count=0;original_element.html(original_html);alert("Error: You must enter a value to save this field");}else{jQuery.ajax({url:settings.url,type:"POST",data:settings.update_value+'='+new_html+'&'+settings.element_id+'='+original_element.attr("id")+settings.params+'&'+settings.original_html+'='+original_html,dataType:"html",complete:function(request){editing=false;click_count=0;},success:function(html){var new_text=html||settings.default_text;original_element.html(new_text);if(settings.success)settings.success(html,original_element);},error:function(request){original_element.html(original_html);if(settings.error)settings.error(request,original_element);}});}
|
20 |
return false;}
|
21 |
original_element.children("form").children(".inplace_field").focus().select();original_element.children("form").children(".inplace_cancel").click(cancelAction);original_element.children("form").children(".inplace_save").click(saveAction);if(!settings.show_buttons){if(settings.on_blur=="save")
|
22 |
original_element.children("form").children(".inplace_field").blur(saveAction);else
|
23 |
original_element.children("form").children(".inplace_field").blur(cancelAction);}
|
24 |
+
jQuery(document).keyup(function(event){if(event.keyCode==27){cancelAction();}});original_element.children("form").submit(saveAction);}});});};
|
js/json2.js
DELETED
@@ -1,461 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
http://www.JSON.org/json2.js
|
3 |
-
2008-03-24
|
4 |
-
|
5 |
-
Public Domain.
|
6 |
-
|
7 |
-
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
8 |
-
|
9 |
-
See http://www.JSON.org/js.html
|
10 |
-
|
11 |
-
This file creates a global JSON object containing three methods: stringify,
|
12 |
-
parse, and quote.
|
13 |
-
|
14 |
-
|
15 |
-
JSON.stringify(value, replacer, space)
|
16 |
-
value any JavaScript value, usually an object or array.
|
17 |
-
|
18 |
-
replacer an optional parameter that determines how object
|
19 |
-
values are stringified for objects without a toJSON
|
20 |
-
method. It can be a function or an array.
|
21 |
-
|
22 |
-
space an optional parameter that specifies the indentation
|
23 |
-
of nested structures. If it is omitted, the text will
|
24 |
-
be packed without extra whitespace. If it is a number,
|
25 |
-
it will specify the number of spaces to indent at each
|
26 |
-
level. If it is a string (such as '\t'), it contains the
|
27 |
-
characters used to indent at each level.
|
28 |
-
|
29 |
-
This method produces a JSON text from a JavaScript value.
|
30 |
-
|
31 |
-
When an object value is found, if the object contains a toJSON
|
32 |
-
method, its toJSON method will be called and the result will be
|
33 |
-
stringified. A toJSON method does not serialize: it returns the
|
34 |
-
value represented by the name/value pair that should be serialized,
|
35 |
-
or undefined if nothing should be serialized. The toJSON method will
|
36 |
-
be passed the key associated with the value, and this will be bound
|
37 |
-
to the object holding the key.
|
38 |
-
|
39 |
-
This is the toJSON method added to Dates:
|
40 |
-
|
41 |
-
function toJSON(key) {
|
42 |
-
return this.getUTCFullYear() + '-' +
|
43 |
-
f(this.getUTCMonth() + 1) + '-' +
|
44 |
-
f(this.getUTCDate()) + 'T' +
|
45 |
-
f(this.getUTCHours()) + ':' +
|
46 |
-
f(this.getUTCMinutes()) + ':' +
|
47 |
-
f(this.getUTCSeconds()) + 'Z';
|
48 |
-
}
|
49 |
-
|
50 |
-
You can provide an optional replacer method. It will be passed the
|
51 |
-
key and value of each member, with this bound to the containing
|
52 |
-
object. The value that is returned from your method will be
|
53 |
-
serialized. If your method returns undefined, then the member will
|
54 |
-
be excluded from the serialization.
|
55 |
-
|
56 |
-
If no replacer parameter is provided, then a default replacer
|
57 |
-
will be used:
|
58 |
-
|
59 |
-
function replacer(key, value) {
|
60 |
-
return Object.hasOwnProperty.call(this, key) ?
|
61 |
-
value : undefined;
|
62 |
-
}
|
63 |
-
|
64 |
-
The default replacer is passed the key and value for each item in
|
65 |
-
the structure. It excludes inherited members.
|
66 |
-
|
67 |
-
If the replacer parameter is an array, then it will be used to
|
68 |
-
select the members to be serialized. It filters the results such
|
69 |
-
that only members with keys listed in the replacer array are
|
70 |
-
stringified.
|
71 |
-
|
72 |
-
Values that do not have JSON representaions, such as undefined or
|
73 |
-
functions, will not be serialized. Such values in objects will be
|
74 |
-
dropped; in arrays they will be replaced with null. You can use
|
75 |
-
a replacer function to replace those with JSON values.
|
76 |
-
JSON.stringify(undefined) returns undefined.
|
77 |
-
|
78 |
-
The optional space parameter produces a stringification of the value
|
79 |
-
that is filled with line breaks and indentation to make it easier to
|
80 |
-
read.
|
81 |
-
|
82 |
-
If the space parameter is a non-empty string, then that string will
|
83 |
-
be used for indentation. If the space parameter is a number, then
|
84 |
-
then indentation will be that many spaces.
|
85 |
-
|
86 |
-
Example:
|
87 |
-
|
88 |
-
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
89 |
-
// text is '["e",{"pluribus":"unum"}]'
|
90 |
-
|
91 |
-
|
92 |
-
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
93 |
-
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
94 |
-
|
95 |
-
|
96 |
-
JSON.parse(text, reviver)
|
97 |
-
This method parses a JSON text to produce an object or array.
|
98 |
-
It can throw a SyntaxError exception.
|
99 |
-
|
100 |
-
The optional reviver parameter is a function that can filter and
|
101 |
-
transform the results. It receives each of the keys and values,
|
102 |
-
and its return value is used instead of the original value.
|
103 |
-
If it returns what it received, then the structure is not modified.
|
104 |
-
If it returns undefined then the member is deleted.
|
105 |
-
|
106 |
-
Example:
|
107 |
-
|
108 |
-
// Parse the text. Values that look like ISO date strings will
|
109 |
-
// be converted to Date objects.
|
110 |
-
|
111 |
-
myData = JSON.parse(text, function (key, value) {
|
112 |
-
var a;
|
113 |
-
if (typeof value === 'string') {
|
114 |
-
a =
|
115 |
-
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
116 |
-
if (a) {
|
117 |
-
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
118 |
-
+a[5], +a[6]));
|
119 |
-
}
|
120 |
-
}
|
121 |
-
return value;
|
122 |
-
});
|
123 |
-
|
124 |
-
|
125 |
-
JSON.quote(text)
|
126 |
-
This method wraps a string in quotes, escaping some characters
|
127 |
-
as needed.
|
128 |
-
|
129 |
-
|
130 |
-
This is a reference implementation. You are free to copy, modify, or
|
131 |
-
redistribute.
|
132 |
-
|
133 |
-
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
|
134 |
-
CODE INTO YOUR PAGES.
|
135 |
-
*/
|
136 |
-
|
137 |
-
/*jslint regexp: true, forin: true, evil: true */
|
138 |
-
|
139 |
-
/*global JSON */
|
140 |
-
|
141 |
-
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
142 |
-
call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
|
143 |
-
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
|
144 |
-
parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
|
145 |
-
test, toJSON, toString
|
146 |
-
*/
|
147 |
-
|
148 |
-
if (!this.JSON) {
|
149 |
-
|
150 |
-
// Create a JSON object only if one does not already exist. We create the
|
151 |
-
// object in a closure to avoid global variables.
|
152 |
-
|
153 |
-
JSON = function () {
|
154 |
-
|
155 |
-
function f(n) { // Format integers to have at least two digits.
|
156 |
-
return n < 10 ? '0' + n : n;
|
157 |
-
}
|
158 |
-
|
159 |
-
Date.prototype.toJSON = function () {
|
160 |
-
|
161 |
-
// Eventually, this method will be based on the date.toISOString method.
|
162 |
-
|
163 |
-
return this.getUTCFullYear() + '-' +
|
164 |
-
f(this.getUTCMonth() + 1) + '-' +
|
165 |
-
f(this.getUTCDate()) + 'T' +
|
166 |
-
f(this.getUTCHours()) + ':' +
|
167 |
-
f(this.getUTCMinutes()) + ':' +
|
168 |
-
f(this.getUTCSeconds()) + 'Z';
|
169 |
-
};
|
170 |
-
|
171 |
-
|
172 |
-
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
|
173 |
-
gap,
|
174 |
-
indent,
|
175 |
-
meta = { // table of character substitutions
|
176 |
-
'\b': '\\b',
|
177 |
-
'\t': '\\t',
|
178 |
-
'\n': '\\n',
|
179 |
-
'\f': '\\f',
|
180 |
-
'\r': '\\r',
|
181 |
-
'"' : '\\"',
|
182 |
-
'\\': '\\\\'
|
183 |
-
},
|
184 |
-
rep;
|
185 |
-
|
186 |
-
|
187 |
-
function quote(string) {
|
188 |
-
|
189 |
-
// If the string contains no control characters, no quote characters, and no
|
190 |
-
// backslash characters, then we can safely slap some quotes around it.
|
191 |
-
// Otherwise we must also replace the offending characters with safe escape
|
192 |
-
// sequences.
|
193 |
-
|
194 |
-
return escapeable.test(string) ?
|
195 |
-
'"' + string.replace(escapeable, function (a) {
|
196 |
-
var c = meta[a];
|
197 |
-
if (typeof c === 'string') {
|
198 |
-
return c;
|
199 |
-
}
|
200 |
-
c = a.charCodeAt();
|
201 |
-
return '\\u00' + Math.floor(c / 16).toString(16) +
|
202 |
-
(c % 16).toString(16);
|
203 |
-
}) + '"' :
|
204 |
-
'"' + string + '"';
|
205 |
-
}
|
206 |
-
|
207 |
-
|
208 |
-
function str(key, holder) {
|
209 |
-
|
210 |
-
// Produce a string from holder[key].
|
211 |
-
|
212 |
-
var i, // The loop counter.
|
213 |
-
k, // The member key.
|
214 |
-
v, // The member value.
|
215 |
-
length,
|
216 |
-
mind = gap,
|
217 |
-
partial,
|
218 |
-
value = holder[key];
|
219 |
-
|
220 |
-
// If the value has a toJSON method, call it to obtain a replacement value.
|
221 |
-
|
222 |
-
if (value && typeof value === 'object' &&
|
223 |
-
typeof value.toJSON === 'function') {
|
224 |
-
value = value.toJSON(key);
|
225 |
-
}
|
226 |
-
|
227 |
-
// If we were called with a replacer function, then call the replacer to
|
228 |
-
// obtain a replacement value.
|
229 |
-
|
230 |
-
if (typeof rep === 'function') {
|
231 |
-
value = rep.call(holder, key, value);
|
232 |
-
}
|
233 |
-
|
234 |
-
// What happens next depends on the value's type.
|
235 |
-
|
236 |
-
switch (typeof value) {
|
237 |
-
case 'string':
|
238 |
-
return quote(value);
|
239 |
-
|
240 |
-
case 'number':
|
241 |
-
|
242 |
-
// JSON numbers must be finite. Encode non-finite numbers as null.
|
243 |
-
|
244 |
-
return isFinite(value) ? String(value) : 'null';
|
245 |
-
|
246 |
-
case 'boolean':
|
247 |
-
case 'null':
|
248 |
-
|
249 |
-
// If the value is a boolean or null, convert it to a string. Note:
|
250 |
-
// typeof null does not produce 'null'. The case is included here in
|
251 |
-
// the remote chance that this gets fixed someday.
|
252 |
-
|
253 |
-
return String(value);
|
254 |
-
|
255 |
-
// If the type is 'object', we might be dealing with an object or an array or
|
256 |
-
// null.
|
257 |
-
|
258 |
-
case 'object':
|
259 |
-
|
260 |
-
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
261 |
-
// so watch out for that case.
|
262 |
-
|
263 |
-
if (!value) {
|
264 |
-
return 'null';
|
265 |
-
}
|
266 |
-
|
267 |
-
// Make an array to hold the partial results of stringifying this object value.
|
268 |
-
|
269 |
-
gap += indent;
|
270 |
-
partial = [];
|
271 |
-
|
272 |
-
// If the object has a dontEnum length property, we'll treat it as an array.
|
273 |
-
|
274 |
-
if (typeof value.length === 'number' &&
|
275 |
-
!(value.propertyIsEnumerable('length'))) {
|
276 |
-
|
277 |
-
// The object is an array. Stringify every element. Use null as a placeholder
|
278 |
-
// for non-JSON values.
|
279 |
-
|
280 |
-
length = value.length;
|
281 |
-
for (i = 0; i < length; i += 1) {
|
282 |
-
partial[i] = str(i, value) || 'null';
|
283 |
-
}
|
284 |
-
|
285 |
-
// Join all of the elements together, separated with commas, and wrap them in
|
286 |
-
// brackets.
|
287 |
-
|
288 |
-
v = partial.length === 0 ? '[]' :
|
289 |
-
gap ? '[\n' + gap + partial.join(',\n' + gap) +
|
290 |
-
'\n' + mind + ']' :
|
291 |
-
'[' + partial.join(',') + ']';
|
292 |
-
gap = mind;
|
293 |
-
return v;
|
294 |
-
}
|
295 |
-
|
296 |
-
// If the replacer is an array, use it to select the members to be stringified.
|
297 |
-
|
298 |
-
if (typeof rep === 'object') {
|
299 |
-
length = rep.length;
|
300 |
-
for (i = 0; i < length; i += 1) {
|
301 |
-
k = rep[i];
|
302 |
-
if (typeof k === 'string') {
|
303 |
-
v = str(k, value, rep);
|
304 |
-
if (v) {
|
305 |
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
306 |
-
}
|
307 |
-
}
|
308 |
-
}
|
309 |
-
} else {
|
310 |
-
|
311 |
-
// Otherwise, iterate through all of the keys in the object.
|
312 |
-
|
313 |
-
for (k in value) {
|
314 |
-
v = str(k, value, rep);
|
315 |
-
if (v) {
|
316 |
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
317 |
-
}
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
// Join all of the member texts together, separated with commas,
|
322 |
-
// and wrap them in braces.
|
323 |
-
|
324 |
-
v = partial.length === 0 ? '{}' :
|
325 |
-
gap ? '{\n' + gap + partial.join(',\n' + gap) +
|
326 |
-
'\n' + mind + '}' :
|
327 |
-
'{' + partial.join(',') + '}';
|
328 |
-
gap = mind;
|
329 |
-
return v;
|
330 |
-
}
|
331 |
-
}
|
332 |
-
|
333 |
-
|
334 |
-
// Return the JSON object containing the stringify, parse, and quote methods.
|
335 |
-
|
336 |
-
return {
|
337 |
-
stringify: function (value, replacer, space) {
|
338 |
-
|
339 |
-
// The stringify method takes a value and an optional replacer, and an optional
|
340 |
-
// space parameter, and returns a JSON text. The replacer can be a function
|
341 |
-
// that can replace values, or an array of strings that will select the keys.
|
342 |
-
// A default replacer method can be provided. Use of the space parameter can
|
343 |
-
// produce text that is more easily readable.
|
344 |
-
|
345 |
-
var i;
|
346 |
-
gap = '';
|
347 |
-
indent = '';
|
348 |
-
if (space) {
|
349 |
-
|
350 |
-
// If the space parameter is a number, make an indent string containing that
|
351 |
-
// many spaces.
|
352 |
-
|
353 |
-
if (typeof space === 'number') {
|
354 |
-
for (i = 0; i < space; i += 1) {
|
355 |
-
indent += ' ';
|
356 |
-
}
|
357 |
-
|
358 |
-
// If the space parameter is a string, it will be used as the indent string.
|
359 |
-
|
360 |
-
} else if (typeof space === 'string') {
|
361 |
-
indent = space;
|
362 |
-
}
|
363 |
-
}
|
364 |
-
|
365 |
-
// If there is no replacer parameter, use the default replacer.
|
366 |
-
|
367 |
-
if (!replacer) {
|
368 |
-
rep = function (key, value) {
|
369 |
-
if (!Object.hasOwnProperty.call(this, key)) {
|
370 |
-
return undefined;
|
371 |
-
}
|
372 |
-
return value;
|
373 |
-
};
|
374 |
-
|
375 |
-
// The replacer can be a function or an array. Otherwise, throw an error.
|
376 |
-
|
377 |
-
} else if (typeof replacer === 'function' ||
|
378 |
-
(typeof replacer === 'object' &&
|
379 |
-
typeof replacer.length === 'number')) {
|
380 |
-
rep = replacer;
|
381 |
-
} else {
|
382 |
-
throw new Error('JSON.stringify');
|
383 |
-
}
|
384 |
-
|
385 |
-
// Make a fake root object containing our value under the key of ''.
|
386 |
-
// Return the result of stringifying the value.
|
387 |
-
|
388 |
-
return str('', {'': value});
|
389 |
-
},
|
390 |
-
|
391 |
-
|
392 |
-
parse: function (text, reviver) {
|
393 |
-
|
394 |
-
// The parse method takes a text and an optional reviver function, and returns
|
395 |
-
// a JavaScript value if the text is a valid JSON text.
|
396 |
-
|
397 |
-
var j;
|
398 |
-
|
399 |
-
function walk(holder, key) {
|
400 |
-
|
401 |
-
// The walk method is used to recursively walk the resulting structure so
|
402 |
-
// that modifications can be made.
|
403 |
-
|
404 |
-
var k, v, value = holder[key];
|
405 |
-
if (value && typeof value === 'object') {
|
406 |
-
for (k in value) {
|
407 |
-
if (Object.hasOwnProperty.call(value, k)) {
|
408 |
-
v = walk(value, k);
|
409 |
-
if (v !== undefined) {
|
410 |
-
value[k] = v;
|
411 |
-
} else {
|
412 |
-
delete value[k];
|
413 |
-
}
|
414 |
-
}
|
415 |
-
}
|
416 |
-
}
|
417 |
-
return reviver.call(holder, key, value);
|
418 |
-
}
|
419 |
-
|
420 |
-
|
421 |
-
// Parsing happens in three stages. In the first stage, we run the text against
|
422 |
-
// regular expressions that look for non-JSON patterns. We are especially
|
423 |
-
// concerned with '()' and 'new' because they can cause invocation, and '='
|
424 |
-
// because it can cause mutation. But just to be safe, we want to reject all
|
425 |
-
// unexpected forms.
|
426 |
-
|
427 |
-
// We split the first stage into 4 regexp operations in order to work around
|
428 |
-
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
429 |
-
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
430 |
-
// replace all simple value tokens with ']' characters. Third, we delete all
|
431 |
-
// open brackets that follow a colon or comma or that begin the text. Finally,
|
432 |
-
// we look to see that the remaining characters are only whitespace or ']' or
|
433 |
-
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
434 |
-
|
435 |
-
if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
436 |
-
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
437 |
-
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
438 |
-
|
439 |
-
// In the second stage we use the eval function to compile the text into a
|
440 |
-
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
441 |
-
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
442 |
-
// in parens to eliminate the ambiguity.
|
443 |
-
|
444 |
-
j = eval('(' + text + ')');
|
445 |
-
|
446 |
-
// In the optional third stage, we recursively walk the new structure, passing
|
447 |
-
// each name/value pair to a reviver function for possible transformation.
|
448 |
-
|
449 |
-
return typeof reviver === 'function' ?
|
450 |
-
walk({'': j}, '') : j;
|
451 |
-
}
|
452 |
-
|
453 |
-
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
454 |
-
|
455 |
-
throw new SyntaxError('JSON.parse');
|
456 |
-
},
|
457 |
-
|
458 |
-
quote: quote
|
459 |
-
};
|
460 |
-
}();
|
461 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/list-items.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
jQuery('.form_item_actions').hide();
|
3 |
jQuery('.edit_form_item').hover(
|
4 |
function(){jQuery(this).children(".form_item_actions").show();},
|
@@ -32,32 +32,20 @@ jQuery(document).ready(function(){
|
|
32 |
}
|
33 |
});
|
34 |
|
35 |
-
|
36 |
-
jQuery('.trigger').toggle(
|
37 |
-
function(){jQuery(this).addClass("active");},
|
38 |
-
function(){jQuery(this).removeClass("active");}
|
39 |
-
);
|
40 |
-
jQuery('.trigger').click(function(){jQuery(this).next(".toggle_container").slideToggle("slow");});
|
41 |
-
|
42 |
-
jQuery('.ui-icon-trash.frm_delete_field_option').hide();
|
43 |
jQuery('.frm_single_option').hover(
|
44 |
-
function(){jQuery(this).children(".
|
45 |
-
function(){jQuery(this).children(".
|
46 |
);
|
47 |
|
48 |
-
jQuery('.
|
49 |
-
jQuery(
|
50 |
-
jQuery('.
|
51 |
-
jQuery('.ui-state-default').hover(
|
52 |
-
function(){
|
53 |
-
jQuery(this).children(".ui-icon-trash").show();
|
54 |
-
jQuery(this).children(".ui-icon-arrowthick-2-n-s").show();
|
55 |
-
jQuery(this).children(".postbox").show();
|
56 |
-
},
|
57 |
-
function(){
|
58 |
-
jQuery(this).children(".ui-icon-trash").hide();
|
59 |
-
jQuery(this).children(".ui-icon-arrowthick-2-n-s").hide();
|
60 |
-
jQuery(this).children(".postbox").hide();
|
61 |
-
}
|
62 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
});
|
1 |
+
jQuery(document).ready(function($){
|
2 |
jQuery('.form_item_actions').hide();
|
3 |
jQuery('.edit_form_item').hover(
|
4 |
function(){jQuery(this).children(".form_item_actions").show();},
|
32 |
}
|
33 |
});
|
34 |
|
35 |
+
jQuery('.frm_single_show_hover').hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
jQuery('.frm_single_option').hover(
|
37 |
+
function(){jQuery(this).children(".frm_single_show_hover").show(); jQuery(this).children(".frm_spacer").hide();},
|
38 |
+
function(){jQuery(this).children(".frm_single_show_hover").hide(); jQuery(this).children(".frm_spacer").show();}
|
39 |
);
|
40 |
|
41 |
+
jQuery('li.ui-state-default').hover(
|
42 |
+
function(){jQuery(this).children(".frm-show-hover").show();},
|
43 |
+
function(){if(jQuery(this).is('.selected')){}else{ jQuery(this).children(".frm-show-hover").hide();}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
);
|
45 |
+
|
46 |
+
jQuery('li.ui-state-default').click(function(){
|
47 |
+
$('.frm-show-click').hide(); $(this).children(".frm-show-click").show();
|
48 |
+
$('.frm-show-hover').hide(); $(this).children(".frm-show-hover").show();
|
49 |
+
$('li.ui-state-default.selected').removeClass('selected'); $(this).addClass('selected');
|
50 |
+
});
|
51 |
});
|
js/nicedit.js
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
/* NicEdit - Micro Inline WYSIWYG
|
2 |
-
* Copyright 2007-2008 Brian Kirchoff
|
3 |
-
*
|
4 |
-
* NicEdit is distributed under the terms of the MIT license
|
5 |
-
* For more information visit http://nicedit.com/
|
6 |
-
* Do not remove this copyright message
|
7 |
-
*/
|
8 |
-
var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
|
9 |
-
|
10 |
-
var nicEditorConfig = bkClass.extend({
|
11 |
-
buttons : {
|
12 |
-
'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
|
13 |
-
'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
|
14 |
-
'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
|
15 |
-
'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
|
16 |
-
'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
|
17 |
-
'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
|
18 |
-
'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
|
19 |
-
'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
|
20 |
-
'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
|
21 |
-
'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
|
22 |
-
'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
|
23 |
-
'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
|
24 |
-
'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
|
25 |
-
'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
|
26 |
-
'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
|
27 |
-
'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
|
28 |
-
},
|
29 |
-
iconsPath : 'http://js.nicedit.com/nicEditIcons-latest.gif',
|
30 |
-
buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
|
31 |
-
iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26,"upload":27}
|
32 |
-
|
33 |
-
});
|
34 |
-
;
|
35 |
-
var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:(parseInt(B.getStyle("width"))||B.clientWidth)+"px"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
|
36 |
-
var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};newX=parseInt(G.getStyle("width"))||G.clientWidth;newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A){return null}return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
|
37 |
-
var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
|
38 |
-
var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
|
39 |
-
var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
|
40 |
-
var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
|
41 |
-
|
42 |
-
|
43 |
-
var nicPaneOptions = { };
|
44 |
-
|
45 |
-
var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
|
46 |
-
|
47 |
-
|
48 |
-
var nicSelectOptions = {
|
49 |
-
buttons : {
|
50 |
-
'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
|
51 |
-
'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
|
52 |
-
'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
|
53 |
-
}
|
54 |
-
};
|
55 |
-
|
56 |
-
var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1 (8pt)",2:"2 (10pt)",3:"3 (12pt)",4:"4 (14pt)",5:"5 (18pt)",6:"6 (24pt)"},init:function(){this.setDisplay("Font Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1"},init:function(){this.setDisplay("Font Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
|
57 |
-
|
58 |
-
var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
|
59 |
-
|
60 |
-
var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
|
61 |
-
|
62 |
-
|
63 |
-
var nicLinkOptions = {
|
64 |
-
buttons : {
|
65 |
-
'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
|
66 |
-
'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
|
67 |
-
}
|
68 |
-
};
|
69 |
-
|
70 |
-
var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
|
71 |
-
|
72 |
-
|
73 |
-
var nicColorOptions = {
|
74 |
-
buttons : {
|
75 |
-
'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
|
76 |
-
'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
|
77 |
-
}
|
78 |
-
};
|
79 |
-
|
80 |
-
var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
|
81 |
-
|
82 |
-
|
83 |
-
var nicImageOptions = {
|
84 |
-
buttons : {
|
85 |
-
'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
|
86 |
-
}
|
87 |
-
|
88 |
-
};
|
89 |
-
|
90 |
-
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
|
91 |
-
|
92 |
-
|
93 |
-
var nicSaveOptions = {
|
94 |
-
buttons : {
|
95 |
-
'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
|
96 |
-
}
|
97 |
-
};
|
98 |
-
|
99 |
-
var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
|
100 |
-
|
101 |
-
var nicXHTML=bkClass.extend({stripAttributes:["_moz_dirty","_moz_resizing","_extended"],noShort:["style","title","script","textarea","a"],cssReplace:{"font-weight:bold;":"strong","font-style:italic;":"em"},sizes:{1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large"},construct:function(A){this.ne=A;if(this.ne.options.xhtml){A.addEvent("get",this.cleanup.closure(this))}},cleanup:function(A){var B=A.getElm();var C=this.toXHTML(B);A.content=C},toXHTML:function(C,A,L){var G="";var O="";var P="";var I=C.nodeType;var Q=C.nodeName.toLowerCase();var N=C.hasChildNodes&&C.hasChildNodes();var B=new Array();switch(I){case 1:var H=C.attributes;switch(Q){case"b":Q="strong";break;case"i":Q="em";break;case"font":Q="span";break}if(A){for(var F=0;F<H.length;F++){var K=H[F];var M=K.nodeName.toLowerCase();var D=K.nodeValue;if(!K.specified||!D||bkLib.inArray(this.stripAttributes,M)||typeof (D)=="function"){continue}switch(M){case"style":var J=D.replace(/ /g,"");for(itm in this.cssReplace){if(J.indexOf(itm)!=-1){B.push(this.cssReplace[itm]);J=J.replace(itm,"")}}P+=J;D="";break;case"class":D=D.replace("Apple-style-span","");break;case"size":P+="font-size:"+this.sizes[D]+";";D="";break}if(D){O+=" "+M+'="'+D+'"'}}if(P){O+=' style="'+P+'"'}for(var F=0;F<B.length;F++){G+="<"+B[F]+">"}if(O==""&&Q=="span"){A=false}if(A){G+="<"+Q;if(Q!="br"){G+=O}}}if(!N&&!bkLib.inArray(this.noShort,M)){if(A){G+=" />"}}else{if(A){G+=">"}for(var F=0;F<C.childNodes.length;F++){var E=this.toXHTML(C.childNodes[F],true,true);if(E){G+=E}}}if(A&&N){G+="</"+Q+">"}for(var F=0;F<B.length;F++){G+="</"+B[F]+">"}break;case 3:G+=C.nodeValue;break}return G}});nicEditors.registerPlugin(nicXHTML);
|
102 |
-
|
103 |
-
var nicCodeOptions = {
|
104 |
-
buttons : {
|
105 |
-
'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'}
|
106 |
-
}
|
107 |
-
|
108 |
-
};
|
109 |
-
|
110 |
-
var nicCodeButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"":{type:"title",txt:"Edit HTML"},code:{type:"content",value:this.ne.selectedInstance.getContent(),style:{width:"340px",height:"200px"}}})},submit:function(B){var A=this.inputs.code.value;this.ne.selectedInstance.setContent(A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
|
111 |
-
var nicBBCode=bkClass.extend({construct:function(A){this.ne=A;if(this.ne.options.bbCode){A.addEvent("get",this.bbGet.closure(this));A.addEvent("set",this.bbSet.closure(this));var B=this.ne.loadedPlugins;for(itm in B){if(B[itm].toXHTML){this.xhtml=B[itm]}}}},bbGet:function(A){var B=this.xhtml.toXHTML(A.getElm());A.content=this.toBBCode(B)},bbSet:function(A){A.content=this.fromBBCode(A.content)},toBBCode:function(B){function A(D,C){B=B.replace(D,C)}A(/\n/gi,"");A(/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]");A(/<em>(.*?)<\/em>/gi,"[i]$1[/i]");A(/<span.*?style="text-decoration:underline;">(.*?)<\/span>/gi,"[u]$1[/u]");A(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]");A(/<li>(.*?)<\/li>/gi,"[*]$1[]");A(/<ol>(.*?)<\/ol>/gi,"[list=1]$1[/list]");A(/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]");A(/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");A(/<br.*?>/gi,"\n");A(/<.*?>.*?<\/.*?>/gi,"");return B},fromBBCode:function(A){function B(D,C){A=A.replace(D,C)}B(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>");B(/\[i\](.*?)\[\/i\]/gi,"<em>$1</em>");B(/\[u\](.*?)\[\/u\]/gi,'<span style="text-decoration:underline;">$1</span>');B(/\[list\](.*?)\[\/list\]/gi,"<ul>$1</ul>");B(/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>");B(/\[\*\](.*?)\[\/\*\]/gi,"<li>$1</li>");B(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');B(/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');B(/\n/gi,"<br />");return A}});nicEditors.registerPlugin(nicBBCode);
|
112 |
-
var nicUploadOptions = {
|
113 |
-
buttons : {
|
114 |
-
'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
|
115 |
-
}
|
116 |
-
|
117 |
-
};
|
118 |
-
var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:"http://files.nicedit.com/",addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.myID=Math.round(Math.random()*Math.pow(10,15));this.requestInterval=1000;this.uri=this.ne.options.uploadURI||this.nicURI;nicUploadButton.lastPlugin=this;this.myFrame=new bkElement("iframe").setAttributes({width:"100%",height:"100px",frameBorder:0,scrolling:"no"}).setStyle({border:0}).appendTo(this.pane.pane);this.progressWrapper=new bkElement("div").setStyle({display:"none",width:"100%",height:"20px",border:"1px solid #ccc"}).appendTo(this.pane.pane);this.progress=new bkElement("div").setStyle({width:"0%",height:"20px",backgroundColor:"#ccc"}).setContent(" ").appendTo(this.progressWrapper);setTimeout(this.addForm.closure(this),50)},addForm:function(){var A=this.myDoc=this.myFrame.contentWindow.document;A.open();A.write("<html><body>");A.write('<form method="post" action="'+this.uri+"?id="+this.myID+'" enctype="multipart/form-data">');A.write('<input type="hidden" name="APC_UPLOAD_PROGRESS" value="'+this.myID+'" />');if(this.uri==this.nicURI){A.write('<div style="position: absolute; margin-left: 160px;"><img src="http://imageshack.us/img/imageshack.png" width="30" style="float: left;" /><div style="float: left; margin-left: 5px; font-size: 10px;">Hosted by<br /><a href="http://www.imageshack.us/" target="_blank">ImageShack</a></div></div>')}A.write('<div style="font-size: 14px; font-weight: bold; padding-top: 5px;">Insert an Image</div>');A.write('<input name="nicImage" type="file" style="margin-top: 10px;" />');A.write("</form>");A.write("</body></html>");A.close();this.myBody=A.body;this.myForm=$BK(this.myBody.getElementsByTagName("form")[0]);this.myInput=$BK(this.myBody.getElementsByTagName("input")[1]).addEvent("change",this.startUpload.closure(this));this.myStatus=new bkElement("div",this.myDoc).setStyle({textAlign:"center",fontSize:"14px"}).appendTo(this.myBody)},startUpload:function(){this.myForm.setStyle({display:"none"});this.myStatus.setContent('<img src="http://files.nicedit.com/ajax-loader.gif" style="float: right; margin-right: 40px;" /><strong>Uploading...</strong><br />Please wait');this.myForm.submit();setTimeout(this.makeRequest.closure(this),this.requestInterval)},makeRequest:function(){if(this.pane&&this.pane.pane){nicUploadButton.lastPlugin=this;var A=new bkElement("script").setAttributes({type:"text/javascript",src:this.uri+"?check="+this.myID+"&rand="+Math.round(Math.random()*Math.pow(10,15))}).addEvent("load",function(){A.parentNode.removeChild(A)}).appendTo(document.getElementsByTagName("head")[0]);if(this.requestInterval){setTimeout(this.makeRequest.closure(this),this.requestInterval)}}},setProgress:function(A){this.progressWrapper.setStyle({display:"block"});this.progress.setStyle({width:A+"%"})},update:function(C){if(C==false){this.progressWrapper.setStyle({display:"none"})}else{if(C.url){this.setProgress(100);this.requestInterval=false;if(!this.im){this.ne.selectedInstance.restoreRng();var B="javascript:nicImTemp();";this.ne.nicCommand("insertImage",B);this.im=this.findElm("IMG","src",B)}var A=parseInt(this.ne.selectedInstance.elm.getStyle("width"));if(this.im){this.im.setAttributes({src:C.url,width:(A&&C.width)?Math.min(A,C.width):""})}this.removePane()}else{if(C.error){this.requestInterval=false;this.setProgress(100);alert("There was an error uploading your image ("+C.error+").");this.removePane()}else{if(C.noprogress){this.progressWrapper.setStyle({display:"none"});if(this.uri.indexOf("http:")==-1||this.uri.indexOf(window.location.host)!=-1){this.requestInterval=false}}else{this.setProgress(Math.round((C.current/C.total)*75));if(C.interval){this.requestInterval=C.interval}}}}}}});nicUploadButton.statusCb=function(A){nicUploadButton.lastPlugin.update(A)};nicEditors.registerPlugin(nicPlugin,nicUploadOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/JSON.php
DELETED
@@ -1,806 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Converts to and from JSON format.
|
6 |
-
*
|
7 |
-
* JSON (JavaScript Object Notation) is a lightweight data-interchange
|
8 |
-
* format. It is easy for humans to read and write. It is easy for machines
|
9 |
-
* to parse and generate. It is based on a subset of the JavaScript
|
10 |
-
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
|
11 |
-
* This feature can also be found in Python. JSON is a text format that is
|
12 |
-
* completely language independent but uses conventions that are familiar
|
13 |
-
* to programmers of the C-family of languages, including C, C++, C#, Java,
|
14 |
-
* JavaScript, Perl, TCL, and many others. These properties make JSON an
|
15 |
-
* ideal data-interchange language.
|
16 |
-
*
|
17 |
-
* This package provides a simple encoder and decoder for JSON notation. It
|
18 |
-
* is intended for use with client-side Javascript applications that make
|
19 |
-
* use of HTTPRequest to perform server communication functions - data can
|
20 |
-
* be encoded into JSON notation for use in a client-side javascript, or
|
21 |
-
* decoded from incoming Javascript requests. JSON format is native to
|
22 |
-
* Javascript, and can be directly eval()'ed with no further parsing
|
23 |
-
* overhead
|
24 |
-
*
|
25 |
-
* All strings should be in ASCII or UTF-8 format!
|
26 |
-
*
|
27 |
-
* LICENSE: Redistribution and use in source and binary forms, with or
|
28 |
-
* without modification, are permitted provided that the following
|
29 |
-
* conditions are met: Redistributions of source code must retain the
|
30 |
-
* above copyright notice, this list of conditions and the following
|
31 |
-
* disclaimer. Redistributions in binary form must reproduce the above
|
32 |
-
* copyright notice, this list of conditions and the following disclaimer
|
33 |
-
* in the documentation and/or other materials provided with the
|
34 |
-
* distribution.
|
35 |
-
*
|
36 |
-
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
37 |
-
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
38 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
39 |
-
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
40 |
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
41 |
-
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
42 |
-
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
43 |
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
44 |
-
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
45 |
-
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
46 |
-
* DAMAGE.
|
47 |
-
*
|
48 |
-
* @category
|
49 |
-
* @package Services_JSON
|
50 |
-
* @author Michal Migurski <mike-json@teczno.com>
|
51 |
-
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
52 |
-
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
53 |
-
* @copyright 2005 Michal Migurski
|
54 |
-
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
|
55 |
-
* @license http://www.opensource.org/licenses/bsd-license.php
|
56 |
-
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
57 |
-
*/
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Marker constant for Services_JSON::decode(), used to flag stack state
|
61 |
-
*/
|
62 |
-
define('SERVICES_JSON_SLICE', 1);
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Marker constant for Services_JSON::decode(), used to flag stack state
|
66 |
-
*/
|
67 |
-
define('SERVICES_JSON_IN_STR', 2);
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Marker constant for Services_JSON::decode(), used to flag stack state
|
71 |
-
*/
|
72 |
-
define('SERVICES_JSON_IN_ARR', 3);
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Marker constant for Services_JSON::decode(), used to flag stack state
|
76 |
-
*/
|
77 |
-
define('SERVICES_JSON_IN_OBJ', 4);
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Marker constant for Services_JSON::decode(), used to flag stack state
|
81 |
-
*/
|
82 |
-
define('SERVICES_JSON_IN_CMT', 5);
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Behavior switch for Services_JSON::decode()
|
86 |
-
*/
|
87 |
-
define('SERVICES_JSON_LOOSE_TYPE', 16);
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Behavior switch for Services_JSON::decode()
|
91 |
-
*/
|
92 |
-
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Converts to and from JSON format.
|
96 |
-
*
|
97 |
-
* Brief example of use:
|
98 |
-
*
|
99 |
-
* <code>
|
100 |
-
* // create a new instance of Services_JSON
|
101 |
-
* $json = new Services_JSON();
|
102 |
-
*
|
103 |
-
* // convert a complexe value to JSON notation, and send it to the browser
|
104 |
-
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
|
105 |
-
* $output = $json->encode($value);
|
106 |
-
*
|
107 |
-
* print($output);
|
108 |
-
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
|
109 |
-
*
|
110 |
-
* // accept incoming POST data, assumed to be in JSON notation
|
111 |
-
* $input = file_get_contents('php://input', 1000000);
|
112 |
-
* $value = $json->decode($input);
|
113 |
-
* </code>
|
114 |
-
*/
|
115 |
-
class Services_JSON
|
116 |
-
{
|
117 |
-
/**
|
118 |
-
* constructs a new JSON instance
|
119 |
-
*
|
120 |
-
* @param int $use object behavior flags; combine with boolean-OR
|
121 |
-
*
|
122 |
-
* possible values:
|
123 |
-
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
124 |
-
* "{...}" syntax creates associative arrays
|
125 |
-
* instead of objects in decode().
|
126 |
-
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
127 |
-
* Values which can't be encoded (e.g. resources)
|
128 |
-
* appear as NULL instead of throwing errors.
|
129 |
-
* By default, a deeply-nested resource will
|
130 |
-
* bubble up with an error, so all return values
|
131 |
-
* from encode() should be checked with isError()
|
132 |
-
*/
|
133 |
-
function Services_JSON($use = 0)
|
134 |
-
{
|
135 |
-
$this->use = $use;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* convert a string from one UTF-16 char to one UTF-8 char
|
140 |
-
*
|
141 |
-
* Normally should be handled by mb_convert_encoding, but
|
142 |
-
* provides a slower PHP-only method for installations
|
143 |
-
* that lack the multibye string extension.
|
144 |
-
*
|
145 |
-
* @param string $utf16 UTF-16 character
|
146 |
-
* @return string UTF-8 character
|
147 |
-
* @access private
|
148 |
-
*/
|
149 |
-
function utf162utf8($utf16)
|
150 |
-
{
|
151 |
-
// oh please oh please oh please oh please oh please
|
152 |
-
if(function_exists('mb_convert_encoding')) {
|
153 |
-
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
154 |
-
}
|
155 |
-
|
156 |
-
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
157 |
-
|
158 |
-
switch(true) {
|
159 |
-
case ((0x7F & $bytes) == $bytes):
|
160 |
-
// this case should never be reached, because we are in ASCII range
|
161 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
162 |
-
return chr(0x7F & $bytes);
|
163 |
-
|
164 |
-
case (0x07FF & $bytes) == $bytes:
|
165 |
-
// return a 2-byte UTF-8 character
|
166 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
167 |
-
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
168 |
-
. chr(0x80 | ($bytes & 0x3F));
|
169 |
-
|
170 |
-
case (0xFFFF & $bytes) == $bytes:
|
171 |
-
// return a 3-byte UTF-8 character
|
172 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
173 |
-
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
174 |
-
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
175 |
-
. chr(0x80 | ($bytes & 0x3F));
|
176 |
-
}
|
177 |
-
|
178 |
-
// ignoring UTF-32 for now, sorry
|
179 |
-
return '';
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* convert a string from one UTF-8 char to one UTF-16 char
|
184 |
-
*
|
185 |
-
* Normally should be handled by mb_convert_encoding, but
|
186 |
-
* provides a slower PHP-only method for installations
|
187 |
-
* that lack the multibye string extension.
|
188 |
-
*
|
189 |
-
* @param string $utf8 UTF-8 character
|
190 |
-
* @return string UTF-16 character
|
191 |
-
* @access private
|
192 |
-
*/
|
193 |
-
function utf82utf16($utf8)
|
194 |
-
{
|
195 |
-
// oh please oh please oh please oh please oh please
|
196 |
-
if(function_exists('mb_convert_encoding')) {
|
197 |
-
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
198 |
-
}
|
199 |
-
|
200 |
-
switch(strlen($utf8)) {
|
201 |
-
case 1:
|
202 |
-
// this case should never be reached, because we are in ASCII range
|
203 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
204 |
-
return $utf8;
|
205 |
-
|
206 |
-
case 2:
|
207 |
-
// return a UTF-16 character from a 2-byte UTF-8 char
|
208 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
209 |
-
return chr(0x07 & (ord($utf8{0}) >> 2))
|
210 |
-
. chr((0xC0 & (ord($utf8{0}) << 6))
|
211 |
-
| (0x3F & ord($utf8{1})));
|
212 |
-
|
213 |
-
case 3:
|
214 |
-
// return a UTF-16 character from a 3-byte UTF-8 char
|
215 |
-
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
216 |
-
return chr((0xF0 & (ord($utf8{0}) << 4))
|
217 |
-
| (0x0F & (ord($utf8{1}) >> 2)))
|
218 |
-
. chr((0xC0 & (ord($utf8{1}) << 6))
|
219 |
-
| (0x7F & ord($utf8{2})));
|
220 |
-
}
|
221 |
-
|
222 |
-
// ignoring UTF-32 for now, sorry
|
223 |
-
return '';
|
224 |
-
}
|
225 |
-
|
226 |
-
/**
|
227 |
-
* encodes an arbitrary variable into JSON format
|
228 |
-
*
|
229 |
-
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
230 |
-
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
231 |
-
* if var is a strng, note that encode() always expects it
|
232 |
-
* to be in ASCII or UTF-8 format!
|
233 |
-
*
|
234 |
-
* @return mixed JSON string representation of input var or an error if a problem occurs
|
235 |
-
* @access public
|
236 |
-
*/
|
237 |
-
function encode($var)
|
238 |
-
{
|
239 |
-
switch (gettype($var)) {
|
240 |
-
case 'boolean':
|
241 |
-
return $var ? 'true' : 'false';
|
242 |
-
|
243 |
-
case 'NULL':
|
244 |
-
return 'null';
|
245 |
-
|
246 |
-
case 'integer':
|
247 |
-
return (int) $var;
|
248 |
-
|
249 |
-
case 'double':
|
250 |
-
case 'float':
|
251 |
-
return (float) $var;
|
252 |
-
|
253 |
-
case 'string':
|
254 |
-
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
|
255 |
-
$ascii = '';
|
256 |
-
$strlen_var = strlen($var);
|
257 |
-
|
258 |
-
/*
|
259 |
-
* Iterate over every character in the string,
|
260 |
-
* escaping with a slash or encoding to UTF-8 where necessary
|
261 |
-
*/
|
262 |
-
for ($c = 0; $c < $strlen_var; ++$c) {
|
263 |
-
|
264 |
-
$ord_var_c = ord($var{$c});
|
265 |
-
|
266 |
-
switch (true) {
|
267 |
-
case $ord_var_c == 0x08:
|
268 |
-
$ascii .= '\b';
|
269 |
-
break;
|
270 |
-
case $ord_var_c == 0x09:
|
271 |
-
$ascii .= '\t';
|
272 |
-
break;
|
273 |
-
case $ord_var_c == 0x0A:
|
274 |
-
$ascii .= '\n';
|
275 |
-
break;
|
276 |
-
case $ord_var_c == 0x0C:
|
277 |
-
$ascii .= '\f';
|
278 |
-
break;
|
279 |
-
case $ord_var_c == 0x0D:
|
280 |
-
$ascii .= '\r';
|
281 |
-
break;
|
282 |
-
|
283 |
-
case $ord_var_c == 0x22:
|
284 |
-
case $ord_var_c == 0x2F:
|
285 |
-
case $ord_var_c == 0x5C:
|
286 |
-
// double quote, slash, slosh
|
287 |
-
$ascii .= '\\'.$var{$c};
|
288 |
-
break;
|
289 |
-
|
290 |
-
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
|
291 |
-
// characters U-00000000 - U-0000007F (same as ASCII)
|
292 |
-
$ascii .= $var{$c};
|
293 |
-
break;
|
294 |
-
|
295 |
-
case (($ord_var_c & 0xE0) == 0xC0):
|
296 |
-
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
297 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
298 |
-
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
|
299 |
-
$c += 1;
|
300 |
-
$utf16 = $this->utf82utf16($char);
|
301 |
-
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
302 |
-
break;
|
303 |
-
|
304 |
-
case (($ord_var_c & 0xF0) == 0xE0):
|
305 |
-
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
306 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
307 |
-
$char = pack('C*', $ord_var_c,
|
308 |
-
ord($var{$c + 1}),
|
309 |
-
ord($var{$c + 2}));
|
310 |
-
$c += 2;
|
311 |
-
$utf16 = $this->utf82utf16($char);
|
312 |
-
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
313 |
-
break;
|
314 |
-
|
315 |
-
case (($ord_var_c & 0xF8) == 0xF0):
|
316 |
-
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
317 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
318 |
-
$char = pack('C*', $ord_var_c,
|
319 |
-
ord($var{$c + 1}),
|
320 |
-
ord($var{$c + 2}),
|
321 |
-
ord($var{$c + 3}));
|
322 |
-
$c += 3;
|
323 |
-
$utf16 = $this->utf82utf16($char);
|
324 |
-
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
325 |
-
break;
|
326 |
-
|
327 |
-
case (($ord_var_c & 0xFC) == 0xF8):
|
328 |
-
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
329 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
330 |
-
$char = pack('C*', $ord_var_c,
|
331 |
-
ord($var{$c + 1}),
|
332 |
-
ord($var{$c + 2}),
|
333 |
-
ord($var{$c + 3}),
|
334 |
-
ord($var{$c + 4}));
|
335 |
-
$c += 4;
|
336 |
-
$utf16 = $this->utf82utf16($char);
|
337 |
-
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
338 |
-
break;
|
339 |
-
|
340 |
-
case (($ord_var_c & 0xFE) == 0xFC):
|
341 |
-
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
342 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
343 |
-
$char = pack('C*', $ord_var_c,
|
344 |
-
ord($var{$c + 1}),
|
345 |
-
ord($var{$c + 2}),
|
346 |
-
ord($var{$c + 3}),
|
347 |
-
ord($var{$c + 4}),
|
348 |
-
ord($var{$c + 5}));
|
349 |
-
$c += 5;
|
350 |
-
$utf16 = $this->utf82utf16($char);
|
351 |
-
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
352 |
-
break;
|
353 |
-
}
|
354 |
-
}
|
355 |
-
|
356 |
-
return '"'.$ascii.'"';
|
357 |
-
|
358 |
-
case 'array':
|
359 |
-
/*
|
360 |
-
* As per JSON spec if any array key is not an integer
|
361 |
-
* we must treat the the whole array as an object. We
|
362 |
-
* also try to catch a sparsely populated associative
|
363 |
-
* array with numeric keys here because some JS engines
|
364 |
-
* will create an array with empty indexes up to
|
365 |
-
* max_index which can cause memory issues and because
|
366 |
-
* the keys, which may be relevant, will be remapped
|
367 |
-
* otherwise.
|
368 |
-
*
|
369 |
-
* As per the ECMA and JSON specification an object may
|
370 |
-
* have any string as a property. Unfortunately due to
|
371 |
-
* a hole in the ECMA specification if the key is a
|
372 |
-
* ECMA reserved word or starts with a digit the
|
373 |
-
* parameter is only accessible using ECMAScript's
|
374 |
-
* bracket notation.
|
375 |
-
*/
|
376 |
-
|
377 |
-
// treat as a JSON object
|
378 |
-
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
379 |
-
$properties = array_map(array($this, 'name_value'),
|
380 |
-
array_keys($var),
|
381 |
-
array_values($var));
|
382 |
-
|
383 |
-
foreach($properties as $property) {
|
384 |
-
if(Services_JSON::isError($property)) {
|
385 |
-
return $property;
|
386 |
-
}
|
387 |
-
}
|
388 |
-
|
389 |
-
return '{' . join(',', $properties) . '}';
|
390 |
-
}
|
391 |
-
|
392 |
-
// treat it like a regular array
|
393 |
-
$elements = array_map(array($this, 'encode'), $var);
|
394 |
-
|
395 |
-
foreach($elements as $element) {
|
396 |
-
if(Services_JSON::isError($element)) {
|
397 |
-
return $element;
|
398 |
-
}
|
399 |
-
}
|
400 |
-
|
401 |
-
return '[' . join(',', $elements) . ']';
|
402 |
-
|
403 |
-
case 'object':
|
404 |
-
$vars = get_object_vars($var);
|
405 |
-
|
406 |
-
$properties = array_map(array($this, 'name_value'),
|
407 |
-
array_keys($vars),
|
408 |
-
array_values($vars));
|
409 |
-
|
410 |
-
foreach($properties as $property) {
|
411 |
-
if(Services_JSON::isError($property)) {
|
412 |
-
return $property;
|
413 |
-
}
|
414 |
-
}
|
415 |
-
|
416 |
-
return '{' . join(',', $properties) . '}';
|
417 |
-
|
418 |
-
default:
|
419 |
-
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
|
420 |
-
? 'null'
|
421 |
-
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
|
422 |
-
}
|
423 |
-
}
|
424 |
-
|
425 |
-
/**
|
426 |
-
* array-walking function for use in generating JSON-formatted name-value pairs
|
427 |
-
*
|
428 |
-
* @param string $name name of key to use
|
429 |
-
* @param mixed $value reference to an array element to be encoded
|
430 |
-
*
|
431 |
-
* @return string JSON-formatted name-value pair, like '"name":value'
|
432 |
-
* @access private
|
433 |
-
*/
|
434 |
-
function name_value($name, $value)
|
435 |
-
{
|
436 |
-
$encoded_value = $this->encode($value);
|
437 |
-
|
438 |
-
if(Services_JSON::isError($encoded_value)) {
|
439 |
-
return $encoded_value;
|
440 |
-
}
|
441 |
-
|
442 |
-
return $this->encode(strval($name)) . ':' . $encoded_value;
|
443 |
-
}
|
444 |
-
|
445 |
-
/**
|
446 |
-
* reduce a string by removing leading and trailing comments and whitespace
|
447 |
-
*
|
448 |
-
* @param $str string string value to strip of comments and whitespace
|
449 |
-
*
|
450 |
-
* @return string string value stripped of comments and whitespace
|
451 |
-
* @access private
|
452 |
-
*/
|
453 |
-
function reduce_string($str)
|
454 |
-
{
|
455 |
-
$str = preg_replace(array(
|
456 |
-
|
457 |
-
// eliminate single line comments in '// ...' form
|
458 |
-
'#^\s*//(.+)$#m',
|
459 |
-
|
460 |
-
// eliminate multi-line comments in '/* ... */' form, at start of string
|
461 |
-
'#^\s*/\*(.+)\*/#Us',
|
462 |
-
|
463 |
-
// eliminate multi-line comments in '/* ... */' form, at end of string
|
464 |
-
'#/\*(.+)\*/\s*$#Us'
|
465 |
-
|
466 |
-
), '', $str);
|
467 |
-
|
468 |
-
// eliminate extraneous space
|
469 |
-
return trim($str);
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* decodes a JSON string into appropriate variable
|
474 |
-
*
|
475 |
-
* @param string $str JSON-formatted string
|
476 |
-
*
|
477 |
-
* @return mixed number, boolean, string, array, or object
|
478 |
-
* corresponding to given JSON input string.
|
479 |
-
* See argument 1 to Services_JSON() above for object-output behavior.
|
480 |
-
* Note that decode() always returns strings
|
481 |
-
* in ASCII or UTF-8 format!
|
482 |
-
* @access public
|
483 |
-
*/
|
484 |
-
function decode($str)
|
485 |
-
{
|
486 |
-
$str = $this->reduce_string($str);
|
487 |
-
|
488 |
-
switch (strtolower($str)) {
|
489 |
-
case 'true':
|
490 |
-
return true;
|
491 |
-
|
492 |
-
case 'false':
|
493 |
-
return false;
|
494 |
-
|
495 |
-
case 'null':
|
496 |
-
return null;
|
497 |
-
|
498 |
-
default:
|
499 |
-
$m = array();
|
500 |
-
|
501 |
-
if (is_numeric($str)) {
|
502 |
-
// Lookie-loo, it's a number
|
503 |
-
|
504 |
-
// This would work on its own, but I'm trying to be
|
505 |
-
// good about returning integers where appropriate:
|
506 |
-
// return (float)$str;
|
507 |
-
|
508 |
-
// Return float or int, as appropriate
|
509 |
-
return ((float)$str == (integer)$str)
|
510 |
-
? (integer)$str
|
511 |
-
: (float)$str;
|
512 |
-
|
513 |
-
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
514 |
-
// STRINGS RETURNED IN UTF-8 FORMAT
|
515 |
-
$delim = substr($str, 0, 1);
|
516 |
-
$chrs = substr($str, 1, -1);
|
517 |
-
$utf8 = '';
|
518 |
-
$strlen_chrs = strlen($chrs);
|
519 |
-
|
520 |
-
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
521 |
-
|
522 |
-
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
523 |
-
$ord_chrs_c = ord($chrs{$c});
|
524 |
-
|
525 |
-
switch (true) {
|
526 |
-
case $substr_chrs_c_2 == '\b':
|
527 |
-
$utf8 .= chr(0x08);
|
528 |
-
++$c;
|
529 |
-
break;
|
530 |
-
case $substr_chrs_c_2 == '\t':
|
531 |
-
$utf8 .= chr(0x09);
|
532 |
-
++$c;
|
533 |
-
break;
|
534 |
-
case $substr_chrs_c_2 == '\n':
|
535 |
-
$utf8 .= chr(0x0A);
|
536 |
-
++$c;
|
537 |
-
break;
|
538 |
-
case $substr_chrs_c_2 == '\f':
|
539 |
-
$utf8 .= chr(0x0C);
|
540 |
-
++$c;
|
541 |
-
break;
|
542 |
-
case $substr_chrs_c_2 == '\r':
|
543 |
-
$utf8 .= chr(0x0D);
|
544 |
-
++$c;
|
545 |
-
break;
|
546 |
-
|
547 |
-
case $substr_chrs_c_2 == '\\"':
|
548 |
-
case $substr_chrs_c_2 == '\\\'':
|
549 |
-
case $substr_chrs_c_2 == '\\\\':
|
550 |
-
case $substr_chrs_c_2 == '\\/':
|
551 |
-
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
|
552 |
-
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
|
553 |
-
$utf8 .= $chrs{++$c};
|
554 |
-
}
|
555 |
-
break;
|
556 |
-
|
557 |
-
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
|
558 |
-
// single, escaped unicode character
|
559 |
-
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
|
560 |
-
. chr(hexdec(substr($chrs, ($c + 4), 2)));
|
561 |
-
$utf8 .= $this->utf162utf8($utf16);
|
562 |
-
$c += 5;
|
563 |
-
break;
|
564 |
-
|
565 |
-
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
566 |
-
$utf8 .= $chrs{$c};
|
567 |
-
break;
|
568 |
-
|
569 |
-
case ($ord_chrs_c & 0xE0) == 0xC0:
|
570 |
-
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
571 |
-
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
572 |
-
$utf8 .= substr($chrs, $c, 2);
|
573 |
-
++$c;
|
574 |
-
break;
|
575 |
-
|
576 |
-
case ($ord_chrs_c & 0xF0) == 0xE0:
|
577 |
-
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
578 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
579 |
-
$utf8 .= substr($chrs, $c, 3);
|
580 |
-
$c += 2;
|
581 |
-
break;
|
582 |
-
|
583 |
-
case ($ord_chrs_c & 0xF8) == 0xF0:
|
584 |
-
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
585 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
586 |
-
$utf8 .= substr($chrs, $c, 4);
|
587 |
-
$c += 3;
|
588 |
-
break;
|
589 |
-
|
590 |
-
case ($ord_chrs_c & 0xFC) == 0xF8:
|
591 |
-
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
592 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
593 |
-
$utf8 .= substr($chrs, $c, 5);
|
594 |
-
$c += 4;
|
595 |
-
break;
|
596 |
-
|
597 |
-
case ($ord_chrs_c & 0xFE) == 0xFC:
|
598 |
-
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
599 |
-
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
600 |
-
$utf8 .= substr($chrs, $c, 6);
|
601 |
-
$c += 5;
|
602 |
-
break;
|
603 |
-
|
604 |
-
}
|
605 |
-
|
606 |
-
}
|
607 |
-
|
608 |
-
return $utf8;
|
609 |
-
|
610 |
-
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
611 |
-
// array, or object notation
|
612 |
-
|
613 |
-
if ($str{0} == '[') {
|
614 |
-
$stk = array(SERVICES_JSON_IN_ARR);
|
615 |
-
$arr = array();
|
616 |
-
} else {
|
617 |
-
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
618 |
-
$stk = array(SERVICES_JSON_IN_OBJ);
|
619 |
-
$obj = array();
|
620 |
-
} else {
|
621 |
-
$stk = array(SERVICES_JSON_IN_OBJ);
|
622 |
-
$obj = new stdClass();
|
623 |
-
}
|
624 |
-
}
|
625 |
-
|
626 |
-
array_push($stk, array('what' => SERVICES_JSON_SLICE,
|
627 |
-
'where' => 0,
|
628 |
-
'delim' => false));
|
629 |
-
|
630 |
-
$chrs = substr($str, 1, -1);
|
631 |
-
$chrs = $this->reduce_string($chrs);
|
632 |
-
|
633 |
-
if ($chrs == '') {
|
634 |
-
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
635 |
-
return $arr;
|
636 |
-
|
637 |
-
} else {
|
638 |
-
return $obj;
|
639 |
-
|
640 |
-
}
|
641 |
-
}
|
642 |
-
|
643 |
-
//print("\nparsing {$chrs}\n");
|
644 |
-
|
645 |
-
$strlen_chrs = strlen($chrs);
|
646 |
-
|
647 |
-
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
648 |
-
|
649 |
-
$top = end($stk);
|
650 |
-
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
651 |
-
|
652 |
-
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
|
653 |
-
// found a comma that is not inside a string, array, etc.,
|
654 |
-
// OR we've reached the end of the character list
|
655 |
-
$slice = substr($chrs, $top['where'], ($c - $top['where']));
|
656 |
-
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
|
657 |
-
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
658 |
-
|
659 |
-
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
660 |
-
// we are in an array, so just push an element onto the stack
|
661 |
-
array_push($arr, $this->decode($slice));
|
662 |
-
|
663 |
-
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
664 |
-
// we are in an object, so figure
|
665 |
-
// out the property name and set an
|
666 |
-
// element in an associative array,
|
667 |
-
// for now
|
668 |
-
$parts = array();
|
669 |
-
|
670 |
-
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
671 |
-
// "name":value pair
|
672 |
-
$key = $this->decode($parts[1]);
|
673 |
-
$val = $this->decode($parts[2]);
|
674 |
-
|
675 |
-
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
676 |
-
$obj[$key] = $val;
|
677 |
-
} else {
|
678 |
-
$obj->$key = $val;
|
679 |
-
}
|
680 |
-
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
681 |
-
// name:value pair, where name is unquoted
|
682 |
-
$key = $parts[1];
|
683 |
-
$val = $this->decode($parts[2]);
|
684 |
-
|
685 |
-
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
686 |
-
$obj[$key] = $val;
|
687 |
-
} else {
|
688 |
-
$obj->$key = $val;
|
689 |
-
}
|
690 |
-
}
|
691 |
-
|
692 |
-
}
|
693 |
-
|
694 |
-
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
695 |
-
// found a quote, and we are not inside a string
|
696 |
-
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
697 |
-
//print("Found start of string at {$c}\n");
|
698 |
-
|
699 |
-
} elseif (($chrs{$c} == $top['delim']) &&
|
700 |
-
($top['what'] == SERVICES_JSON_IN_STR) &&
|
701 |
-
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
702 |
-
// found a quote, we're in a string, and it's not escaped
|
703 |
-
// we know that it's not escaped becase there is _not_ an
|
704 |
-
// odd number of backslashes at the end of the string so far
|
705 |
-
array_pop($stk);
|
706 |
-
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
707 |
-
|
708 |
-
} elseif (($chrs{$c} == '[') &&
|
709 |
-
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
710 |
-
// found a left-bracket, and we are in an array, object, or slice
|
711 |
-
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
712 |
-
//print("Found start of array at {$c}\n");
|
713 |
-
|
714 |
-
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
715 |
-
// found a right-bracket, and we're in an array
|
716 |
-
array_pop($stk);
|
717 |
-
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
718 |
-
|
719 |
-
} elseif (($chrs{$c} == '{') &&
|
720 |
-
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
721 |
-
// found a left-brace, and we are in an array, object, or slice
|
722 |
-
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
723 |
-
//print("Found start of object at {$c}\n");
|
724 |
-
|
725 |
-
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
726 |
-
// found a right-brace, and we're in an object
|
727 |
-
array_pop($stk);
|
728 |
-
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
729 |
-
|
730 |
-
} elseif (($substr_chrs_c_2 == '/*') &&
|
731 |
-
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
732 |
-
// found a comment start, and we are in an array, object, or slice
|
733 |
-
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
734 |
-
$c++;
|
735 |
-
//print("Found start of comment at {$c}\n");
|
736 |
-
|
737 |
-
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
738 |
-
// found a comment end, and we're in one now
|
739 |
-
array_pop($stk);
|
740 |
-
$c++;
|
741 |
-
|
742 |
-
for ($i = $top['where']; $i <= $c; ++$i)
|
743 |
-
$chrs = substr_replace($chrs, ' ', $i, 1);
|
744 |
-
|
745 |
-
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
746 |
-
|
747 |
-
}
|
748 |
-
|
749 |
-
}
|
750 |
-
|
751 |
-
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
752 |
-
return $arr;
|
753 |
-
|
754 |
-
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
755 |
-
return $obj;
|
756 |
-
|
757 |
-
}
|
758 |
-
|
759 |
-
}
|
760 |
-
}
|
761 |
-
}
|
762 |
-
|
763 |
-
/**
|
764 |
-
* @todo Ultimately, this should just call PEAR::isError()
|
765 |
-
*/
|
766 |
-
function isError($data, $code = null)
|
767 |
-
{
|
768 |
-
if (class_exists('pear')) {
|
769 |
-
return PEAR::isError($data, $code);
|
770 |
-
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
|
771 |
-
is_subclass_of($data, 'services_json_error'))) {
|
772 |
-
return true;
|
773 |
-
}
|
774 |
-
|
775 |
-
return false;
|
776 |
-
}
|
777 |
-
}
|
778 |
-
|
779 |
-
if (class_exists('PEAR_Error')) {
|
780 |
-
|
781 |
-
class Services_JSON_Error extends PEAR_Error
|
782 |
-
{
|
783 |
-
function Services_JSON_Error($message = 'unknown error', $code = null,
|
784 |
-
$mode = null, $options = null, $userinfo = null)
|
785 |
-
{
|
786 |
-
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
787 |
-
}
|
788 |
-
}
|
789 |
-
|
790 |
-
} else {
|
791 |
-
|
792 |
-
/**
|
793 |
-
* @todo Ultimately, this class shall be descended from PEAR_Error
|
794 |
-
*/
|
795 |
-
class Services_JSON_Error
|
796 |
-
{
|
797 |
-
function Services_JSON_Error($message = 'unknown error', $code = null,
|
798 |
-
$mode = null, $options = null, $userinfo = null)
|
799 |
-
{
|
800 |
-
|
801 |
-
}
|
802 |
-
}
|
803 |
-
|
804 |
-
}
|
805 |
-
|
806 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/README.txt
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
Open Flash Chart - PHP libraries. These help create data files for Open Flash Chart.
|
2 |
-
Copyright (C) 2007
|
3 |
-
|
4 |
-
This library is free software; you can redistribute it and/or
|
5 |
-
modify it under the terms of the GNU Lesser General Public
|
6 |
-
License as published by the Free Software Foundation; either
|
7 |
-
version 2.1 of the License, or (at your option) any later version.
|
8 |
-
|
9 |
-
This library is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12 |
-
Lesser General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU Lesser General Public
|
15 |
-
License along with this library; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/dot_base.php
DELETED
@@ -1,231 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* A private class. All the other line-dots inherit from this.
|
5 |
-
* Gives them all some common methods.
|
6 |
-
*/
|
7 |
-
class dot_base
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* @param $type string
|
11 |
-
* @param $value integer
|
12 |
-
*/
|
13 |
-
function dot_base($type, $value=null)
|
14 |
-
{
|
15 |
-
$this->type = $type;
|
16 |
-
if( isset( $value ) )
|
17 |
-
$this->value( $value );
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* For line charts that only require a Y position
|
22 |
-
* for each point.
|
23 |
-
* @param $value as integer, the Y position
|
24 |
-
*/
|
25 |
-
function value( $value )
|
26 |
-
{
|
27 |
-
$this->value = $value;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* For scatter charts that require an X and Y position for
|
32 |
-
* each point.
|
33 |
-
*
|
34 |
-
* @param $x as integer
|
35 |
-
* @param $y as integer
|
36 |
-
*/
|
37 |
-
function position( $x, $y )
|
38 |
-
{
|
39 |
-
$this->x = $x;
|
40 |
-
$this->y = $y;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @param $colour is a string, HEX colour, e.g. '#FF0000' red
|
45 |
-
*/
|
46 |
-
function colour($colour)
|
47 |
-
{
|
48 |
-
$this->colour = $colour;
|
49 |
-
return $this;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* The tooltip for this dot.
|
54 |
-
*/
|
55 |
-
function tooltip( $tip )
|
56 |
-
{
|
57 |
-
$this->tip = $tip;
|
58 |
-
return $this;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @param $size is an integer. Size of the dot.
|
63 |
-
*/
|
64 |
-
function size($size)
|
65 |
-
{
|
66 |
-
$tmp = 'dot-size';
|
67 |
-
$this->$tmp = $size;
|
68 |
-
return $this;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* a private method
|
73 |
-
*/
|
74 |
-
function type( $type )
|
75 |
-
{
|
76 |
-
$this->type = $type;
|
77 |
-
return $this;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @param $size is an integer. The size of the hollow 'halo' around the dot that masks the line.
|
82 |
-
*/
|
83 |
-
function halo_size( $size )
|
84 |
-
{
|
85 |
-
$tmp = 'halo-size';
|
86 |
-
$this->$tmp = $size;
|
87 |
-
return $this;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* @param $do as string. One of three options (examples):
|
92 |
-
* - "http://example.com" - browse to this URL
|
93 |
-
* - "https://example.com" - browse to this URL
|
94 |
-
* - "trace:message" - print this message in the FlashDevelop debug pane
|
95 |
-
* - all other strings will be called as Javascript functions, so a string "hello_world"
|
96 |
-
* will call the JS function "hello_world(index)". It passes in the index of the
|
97 |
-
* point.
|
98 |
-
*/
|
99 |
-
function on_click( $do )
|
100 |
-
{
|
101 |
-
$tmp = 'on-click';
|
102 |
-
$this->$tmp = $do;
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Draw a hollow dot
|
108 |
-
*/
|
109 |
-
class hollow_dot extends dot_base
|
110 |
-
{
|
111 |
-
function hollow_dot($value=null)
|
112 |
-
{
|
113 |
-
parent::dot_base( 'hollow-dot', $value );
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Draw a star
|
119 |
-
*/
|
120 |
-
class star extends dot_base
|
121 |
-
{
|
122 |
-
/**
|
123 |
-
* The constructor, takes an optional $value
|
124 |
-
*/
|
125 |
-
function star($value=null)
|
126 |
-
{
|
127 |
-
parent::dot_base( 'star', $value );
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @param $angle is an integer.
|
132 |
-
*/
|
133 |
-
function rotation($angle)
|
134 |
-
{
|
135 |
-
$this->rotation = $angle;
|
136 |
-
return $this;
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* @param $is_hollow is a boolean.
|
141 |
-
*/
|
142 |
-
function hollow($is_hollow)
|
143 |
-
{
|
144 |
-
$this->hollow = $is_hollow;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Draw a 'bow tie' shape.
|
150 |
-
*/
|
151 |
-
class bow extends dot_base
|
152 |
-
{
|
153 |
-
/**
|
154 |
-
* The constructor, takes an optional $value
|
155 |
-
*/
|
156 |
-
function bow($value=null)
|
157 |
-
{
|
158 |
-
parent::dot_base( 'bow', $value );
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Rotate the anchor object.
|
163 |
-
* @param $angle is an integer.
|
164 |
-
*/
|
165 |
-
function rotation($angle)
|
166 |
-
{
|
167 |
-
$this->rotation = $angle;
|
168 |
-
return $this;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* An <i><b>n</b></i> sided shape.
|
174 |
-
*/
|
175 |
-
class anchor extends dot_base
|
176 |
-
{
|
177 |
-
/**
|
178 |
-
* The constructor, takes an optional $value
|
179 |
-
*/
|
180 |
-
function anchor($value=null)
|
181 |
-
{
|
182 |
-
parent::dot_base( 'anchor', $value );
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Rotate the anchor object.
|
187 |
-
* @param $angle is an integer.
|
188 |
-
*/
|
189 |
-
function rotation($angle)
|
190 |
-
{
|
191 |
-
$this->rotation = $angle;
|
192 |
-
return $this;
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* @param $sides is an integer. Number of sides this shape has.
|
197 |
-
*/
|
198 |
-
function sides($sides)
|
199 |
-
{
|
200 |
-
$this->sides = $sides;
|
201 |
-
return $this;
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* A simple dot
|
207 |
-
*/
|
208 |
-
class dot extends dot_base
|
209 |
-
{
|
210 |
-
/**
|
211 |
-
* The constructor, takes an optional $value
|
212 |
-
*/
|
213 |
-
function dot($value=null)
|
214 |
-
{
|
215 |
-
parent::dot_base( 'dot', $value );
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* A simple dot
|
221 |
-
*/
|
222 |
-
class solid_dot extends dot_base
|
223 |
-
{
|
224 |
-
/**
|
225 |
-
* The constructor, takes an optional $value
|
226 |
-
*/
|
227 |
-
function solid_dot($value=null)
|
228 |
-
{
|
229 |
-
parent::dot_base( 'solid-dot', $value );
|
230 |
-
}
|
231 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/json_format.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Pretty print some JSON
|
4 |
-
function json_format($json)
|
5 |
-
{
|
6 |
-
$tab = " ";
|
7 |
-
$new_json = "";
|
8 |
-
$indent_level = 0;
|
9 |
-
$in_string = false;
|
10 |
-
|
11 |
-
/*
|
12 |
-
commented out by monk.e.boy 22nd May '08
|
13 |
-
because my web server is PHP4, and
|
14 |
-
json_* are PHP5 functions...
|
15 |
-
|
16 |
-
$json_obj = json_decode($json);
|
17 |
-
|
18 |
-
if($json_obj === false)
|
19 |
-
return false;
|
20 |
-
|
21 |
-
$json = json_encode($json_obj);
|
22 |
-
*/
|
23 |
-
$len = strlen($json);
|
24 |
-
|
25 |
-
for($c = 0; $c < $len; $c++)
|
26 |
-
{
|
27 |
-
$char = $json[$c];
|
28 |
-
switch($char)
|
29 |
-
{
|
30 |
-
case '{':
|
31 |
-
case '[':
|
32 |
-
if(!$in_string)
|
33 |
-
{
|
34 |
-
$new_json .= $char . "\n" . str_repeat($tab, $indent_level+1);
|
35 |
-
$indent_level++;
|
36 |
-
}
|
37 |
-
else
|
38 |
-
{
|
39 |
-
$new_json .= $char;
|
40 |
-
}
|
41 |
-
break;
|
42 |
-
case '}':
|
43 |
-
case ']':
|
44 |
-
if(!$in_string)
|
45 |
-
{
|
46 |
-
$indent_level--;
|
47 |
-
$new_json .= "\n" . str_repeat($tab, $indent_level) . $char;
|
48 |
-
}
|
49 |
-
else
|
50 |
-
{
|
51 |
-
$new_json .= $char;
|
52 |
-
}
|
53 |
-
break;
|
54 |
-
case ',':
|
55 |
-
if(!$in_string)
|
56 |
-
{
|
57 |
-
$new_json .= ",\n" . str_repeat($tab, $indent_level);
|
58 |
-
}
|
59 |
-
else
|
60 |
-
{
|
61 |
-
$new_json .= $char;
|
62 |
-
}
|
63 |
-
break;
|
64 |
-
case ':':
|
65 |
-
if(!$in_string)
|
66 |
-
{
|
67 |
-
$new_json .= ": ";
|
68 |
-
}
|
69 |
-
else
|
70 |
-
{
|
71 |
-
$new_json .= $char;
|
72 |
-
}
|
73 |
-
break;
|
74 |
-
case '"':
|
75 |
-
if($c > 0 && $json[$c-1] != '\\')
|
76 |
-
{
|
77 |
-
$in_string = !$in_string;
|
78 |
-
}
|
79 |
-
default:
|
80 |
-
$new_json .= $char;
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
return $new_json;
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_area_base.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* inherits from line
|
5 |
-
*/
|
6 |
-
class area extends line
|
7 |
-
{
|
8 |
-
function area()
|
9 |
-
{
|
10 |
-
$this->type = "area";
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* the fill colour
|
15 |
-
*/
|
16 |
-
function set_fill_colour( $colour )
|
17 |
-
{
|
18 |
-
$this->fill = $colour;
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* sugar: see set_fill_colour
|
23 |
-
*/
|
24 |
-
function fill_colour( $colour )
|
25 |
-
{
|
26 |
-
$this->set_fill_colour( $colour );
|
27 |
-
return $this;
|
28 |
-
}
|
29 |
-
|
30 |
-
function set_fill_alpha( $alpha )
|
31 |
-
{
|
32 |
-
$tmp = "fill-alpha";
|
33 |
-
$this->$tmp = $alpha;
|
34 |
-
}
|
35 |
-
|
36 |
-
function set_loop()
|
37 |
-
{
|
38 |
-
$this->loop = true;
|
39 |
-
}
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_area_hollow.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class area_hollow extends area_base
|
4 |
-
{
|
5 |
-
function area_hollow()
|
6 |
-
{
|
7 |
-
$this->type = "area_hollow";
|
8 |
-
parent::area_base();
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_area_line.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class area_line extends area_base
|
4 |
-
{
|
5 |
-
function area_line()
|
6 |
-
{
|
7 |
-
$this->type = "area_line";
|
8 |
-
parent::area_base();
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_arrow.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class ofc_arrow
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
*@param $x as number. Start x position
|
7 |
-
*@param $y as number. Start y position
|
8 |
-
*@param $a as number. End x position
|
9 |
-
*@param $b as number. End y position
|
10 |
-
*@param $colour as string.
|
11 |
-
*@param $barb_length as number. Length of the barbs in pixels.
|
12 |
-
*/
|
13 |
-
function ofc_arrow($x, $y, $a, $b, $colour, $barb_length=10)
|
14 |
-
{
|
15 |
-
$this->type = "arrow";
|
16 |
-
$this->start = array("x"=>$x, "y"=>$y);
|
17 |
-
$this->end = array("x"=>$a, "y"=>$b);
|
18 |
-
$this->colour($colour);
|
19 |
-
$this->{"barb-length"} = $barb_length;
|
20 |
-
}
|
21 |
-
|
22 |
-
function colour( $colour )
|
23 |
-
{
|
24 |
-
$this->colour = $colour;
|
25 |
-
return $this;
|
26 |
-
}
|
27 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_value
|
6 |
-
{
|
7 |
-
function bar_value( $top, $bottom=null )
|
8 |
-
{
|
9 |
-
$this->top = $top;
|
10 |
-
|
11 |
-
if( isset( $bottom ) )
|
12 |
-
$this->bottom = $bottom;
|
13 |
-
}
|
14 |
-
|
15 |
-
function set_colour( $colour )
|
16 |
-
{
|
17 |
-
$this->colour = $colour;
|
18 |
-
}
|
19 |
-
|
20 |
-
function set_tooltip( $tip )
|
21 |
-
{
|
22 |
-
$this->tip = $tip;
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
class bar extends bar_base
|
27 |
-
{
|
28 |
-
function bar()
|
29 |
-
{
|
30 |
-
$this->type = "bar";
|
31 |
-
parent::bar_base();
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_3d.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_3d_value
|
6 |
-
{
|
7 |
-
function bar_3d_value( $top )
|
8 |
-
{
|
9 |
-
$this->top = $top;
|
10 |
-
}
|
11 |
-
|
12 |
-
function set_colour( $colour )
|
13 |
-
{
|
14 |
-
$this->colour = $colour;
|
15 |
-
}
|
16 |
-
|
17 |
-
function set_tooltip( $tip )
|
18 |
-
{
|
19 |
-
$this->tip = $tip;
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_base.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/* this is a base class */
|
4 |
-
|
5 |
-
class bar_base
|
6 |
-
{
|
7 |
-
function bar_base(){}
|
8 |
-
|
9 |
-
/**
|
10 |
-
* @param $text as string the key text
|
11 |
-
* @param $size as integer, size in pixels
|
12 |
-
*/
|
13 |
-
function set_key( $text, $size )
|
14 |
-
{
|
15 |
-
$this->text = $text;
|
16 |
-
$tmp = 'font-size';
|
17 |
-
$this->$tmp = $size;
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* syntatical sugar.
|
22 |
-
*/
|
23 |
-
function key( $text, $size )
|
24 |
-
{
|
25 |
-
$this->set_key( $text, $size );
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @param $v as an array, a mix of:
|
30 |
-
* - a bar_value class. You can use this to customise the paramters of each bar.
|
31 |
-
* - integer. This is the Y position of the top of the bar.
|
32 |
-
*/
|
33 |
-
function set_values( $v )
|
34 |
-
{
|
35 |
-
$this->values = $v;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* see set_values
|
40 |
-
*/
|
41 |
-
function append_value( $v )
|
42 |
-
{
|
43 |
-
$this->values[] = $v;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @param $colour as string, a HEX colour, e.g. '#ff0000' red
|
48 |
-
*/
|
49 |
-
function set_colour( $colour )
|
50 |
-
{
|
51 |
-
$this->colour = $colour;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
*syntatical sugar
|
56 |
-
*/
|
57 |
-
function colour( $colour )
|
58 |
-
{
|
59 |
-
$this->set_colour( $colour );
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* @param $alpha as real number (range 0 to 1), e.g. 0.5 is half transparent
|
64 |
-
*/
|
65 |
-
function set_alpha( $alpha )
|
66 |
-
{
|
67 |
-
$this->alpha = $alpha;
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* @param $tip as string, the tip to show. May contain various magic variables.
|
72 |
-
*/
|
73 |
-
function set_tooltip( $tip )
|
74 |
-
{
|
75 |
-
$this->tip = $tip;
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
*@param $on_show as line_on_show object
|
80 |
-
*/
|
81 |
-
function set_on_show($on_show)
|
82 |
-
{
|
83 |
-
$this->{'on-show'} = $on_show;
|
84 |
-
}
|
85 |
-
|
86 |
-
function set_on_click( $text )
|
87 |
-
{
|
88 |
-
$tmp = 'on-click';
|
89 |
-
$this->$tmp = $text;
|
90 |
-
}
|
91 |
-
|
92 |
-
function attach_to_right_y_axis()
|
93 |
-
{
|
94 |
-
$this->axis = 'right';
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_filled.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_filled_value extends bar_value
|
6 |
-
{
|
7 |
-
function bar_filled_value( $top, $bottom=null )
|
8 |
-
{
|
9 |
-
parent::bar_value( $top, $bottom );
|
10 |
-
}
|
11 |
-
|
12 |
-
function set_outline_colour( $outline_colour )
|
13 |
-
{
|
14 |
-
$tmp = 'outline-colour';
|
15 |
-
$this->$tmp = $outline_colour;
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
class bar_filled extends bar_base
|
20 |
-
{
|
21 |
-
function bar_filled( $colour=null, $outline_colour=null )
|
22 |
-
{
|
23 |
-
$this->type = "bar_filled";
|
24 |
-
parent::bar_base();
|
25 |
-
|
26 |
-
if( isset( $colour ) )
|
27 |
-
$this->set_colour( $colour );
|
28 |
-
|
29 |
-
if( isset( $outline_colour ) )
|
30 |
-
$this->set_outline_colour( $outline_colour );
|
31 |
-
}
|
32 |
-
|
33 |
-
function set_outline_colour( $outline_colour )
|
34 |
-
{
|
35 |
-
$tmp = 'outline-colour';
|
36 |
-
$this->$tmp = $outline_colour;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_glass.php
DELETED
@@ -1,131 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_on_show
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
*@param $type as string. Can be any one of:
|
9 |
-
* - 'pop-up'
|
10 |
-
* - 'drop'
|
11 |
-
* - 'fade-in'
|
12 |
-
* - 'grow-up'
|
13 |
-
* - 'grow-down'
|
14 |
-
* - 'pop'
|
15 |
-
*
|
16 |
-
* @param $cascade as float. Cascade in seconds
|
17 |
-
* @param $delay as float. Delay before animation starts in seconds.
|
18 |
-
*/
|
19 |
-
function __construct($type, $cascade, $delay)
|
20 |
-
{
|
21 |
-
$this->type = $type;
|
22 |
-
$this->cascade = (float)$cascade;
|
23 |
-
$this->delay = (float)$delay;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
class bar_value
|
28 |
-
{
|
29 |
-
/**
|
30 |
-
* @param $top as integer. The Y value of the top of the bar
|
31 |
-
* @param OPTIONAL $bottom as integer. The Y value of the bottom of the bar, defaults to Y min.
|
32 |
-
*/
|
33 |
-
function bar_value( $top, $bottom=null )
|
34 |
-
{
|
35 |
-
$this->top = $top;
|
36 |
-
|
37 |
-
if( isset( $bottom ) )
|
38 |
-
$this->bottom = $bottom;
|
39 |
-
}
|
40 |
-
|
41 |
-
function set_colour( $colour )
|
42 |
-
{
|
43 |
-
$this->colour = $colour;
|
44 |
-
}
|
45 |
-
|
46 |
-
function set_tooltip( $tip )
|
47 |
-
{
|
48 |
-
$this->tip = $tip;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
class bar extends bar_base
|
53 |
-
{
|
54 |
-
function bar()
|
55 |
-
{
|
56 |
-
$this->type = "bar";
|
57 |
-
parent::bar_base();
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
class bar_glass extends bar_base
|
62 |
-
{
|
63 |
-
function bar_glass()
|
64 |
-
{
|
65 |
-
$this->type = "bar_glass";
|
66 |
-
parent::bar_base();
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
class bar_cylinder extends bar_base
|
71 |
-
{
|
72 |
-
function bar_cylinder()
|
73 |
-
{
|
74 |
-
$this->type = "bar_cylinder";
|
75 |
-
parent::bar_base();
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
class bar_cylinder_outline extends bar_base
|
80 |
-
{
|
81 |
-
function bar_cylinder_outline()
|
82 |
-
{
|
83 |
-
$this->type = "bar_cylinder_outline";
|
84 |
-
parent::bar_base();
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
class bar_rounded_glass extends bar_base
|
89 |
-
{
|
90 |
-
function bar_rounded_glass()
|
91 |
-
{
|
92 |
-
$this->type = "bar_round_glass";
|
93 |
-
parent::bar_base();
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
class bar_round extends bar_base
|
98 |
-
{
|
99 |
-
function bar_round()
|
100 |
-
{
|
101 |
-
$this->type = "bar_round";
|
102 |
-
parent::bar_base();
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
class bar_dome extends bar_base
|
107 |
-
{
|
108 |
-
function bar_dome()
|
109 |
-
{
|
110 |
-
$this->type = "bar_dome";
|
111 |
-
parent::bar_base();
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
class bar_round3d extends bar_base
|
116 |
-
{
|
117 |
-
function bar_round3d()
|
118 |
-
{
|
119 |
-
$this->type = "bar_round3d";
|
120 |
-
parent::bar_base();
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
class bar_3d extends bar_base
|
125 |
-
{
|
126 |
-
function bar_3d()
|
127 |
-
{
|
128 |
-
$this->type = "bar_3d";
|
129 |
-
parent::bar_base();
|
130 |
-
}
|
131 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_sketch.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_sketch extends bar_base
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
* @param $colour as string, HEX colour e.g. '#00ff00'
|
9 |
-
* @param $outline_colour as string, HEX colour e.g. '#ff0000'
|
10 |
-
* @param $fun_factor as integer, range 0 to 10. 0,1 and 2 are pretty boring.
|
11 |
-
* 4 to 6 is a bit fun, 7 and above is lots of fun.
|
12 |
-
*/
|
13 |
-
function bar_sketch( $colour, $outline_colour, $fun_factor )
|
14 |
-
{
|
15 |
-
$this->type = "bar_sketch";
|
16 |
-
parent::bar_base();
|
17 |
-
|
18 |
-
$this->set_colour( $colour );
|
19 |
-
$this->set_outline_colour( $outline_colour );
|
20 |
-
$this->offset = $fun_factor;
|
21 |
-
}
|
22 |
-
|
23 |
-
function set_outline_colour( $outline_colour )
|
24 |
-
{
|
25 |
-
$tmp = 'outline-colour';
|
26 |
-
$this->$tmp = $outline_colour;
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_bar_stack.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class bar_stack extends bar_base
|
6 |
-
{
|
7 |
-
function bar_stack()
|
8 |
-
{
|
9 |
-
$this->type = "bar_stack";
|
10 |
-
parent::bar_base();
|
11 |
-
}
|
12 |
-
|
13 |
-
function append_stack( $v )
|
14 |
-
{
|
15 |
-
$this->append_value( $v );
|
16 |
-
}
|
17 |
-
|
18 |
-
// an array of HEX colours strings
|
19 |
-
// e.g. array( '#ff0000', '#00ff00' );
|
20 |
-
function set_colours( $colours )
|
21 |
-
{
|
22 |
-
$this->colours = $colours;
|
23 |
-
}
|
24 |
-
|
25 |
-
// an array of bar_stack_value
|
26 |
-
function set_keys( $keys )
|
27 |
-
{
|
28 |
-
$this->keys = $keys;
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
class bar_stack_value
|
33 |
-
{
|
34 |
-
function bar_stack_value( $val, $colour )
|
35 |
-
{
|
36 |
-
$this->val = $val;
|
37 |
-
$this->colour = $colour;
|
38 |
-
}
|
39 |
-
|
40 |
-
function set_tooltip( $tip )
|
41 |
-
{
|
42 |
-
$this->tip = $tip;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
class bar_stack_key
|
47 |
-
{
|
48 |
-
function bar_stack_key( $colour, $text, $font_size )
|
49 |
-
{
|
50 |
-
$this->colour = $colour;
|
51 |
-
$this->text = $text;
|
52 |
-
$tmp = 'font-size';
|
53 |
-
$this->$tmp = $font_size;
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_candle.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class candle_value
|
6 |
-
{
|
7 |
-
/**
|
8 |
-
*
|
9 |
-
*/
|
10 |
-
function candle_value( $high, $open, $close, $low )
|
11 |
-
{
|
12 |
-
$this->high = $high;
|
13 |
-
$this->top = $open;
|
14 |
-
$this->bottom = $close;
|
15 |
-
$this->low = $low;
|
16 |
-
}
|
17 |
-
|
18 |
-
function set_colour( $colour )
|
19 |
-
{
|
20 |
-
$this->colour = $colour;
|
21 |
-
}
|
22 |
-
|
23 |
-
function set_tooltip( $tip )
|
24 |
-
{
|
25 |
-
$this->tip = $tip;
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
class candle extends bar_base
|
30 |
-
{
|
31 |
-
function candle($colour, $negative_colour=null)
|
32 |
-
{
|
33 |
-
$this->type = "candle";
|
34 |
-
parent::bar_base();
|
35 |
-
|
36 |
-
$this->set_colour( $colour );
|
37 |
-
if(!is_null($negative_colour))
|
38 |
-
$this->{'negative-colour'} = $negative_colour;
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_hbar.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class hbar_value
|
4 |
-
{
|
5 |
-
function hbar_value( $left, $right=null )
|
6 |
-
{
|
7 |
-
if( isset( $right ) )
|
8 |
-
{
|
9 |
-
$this->left = $left;
|
10 |
-
$this->right = $right;
|
11 |
-
}
|
12 |
-
else
|
13 |
-
$this->right = $left;
|
14 |
-
}
|
15 |
-
|
16 |
-
function set_colour( $colour )
|
17 |
-
{
|
18 |
-
$this->colour = $colour;
|
19 |
-
}
|
20 |
-
|
21 |
-
function set_tooltip( $tip )
|
22 |
-
{
|
23 |
-
$this->tip = $tip;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
class hbar
|
28 |
-
{
|
29 |
-
function hbar( $colour )
|
30 |
-
{
|
31 |
-
$this->type = "hbar";
|
32 |
-
$this->values = array();
|
33 |
-
$this->set_colour( $colour );
|
34 |
-
}
|
35 |
-
|
36 |
-
function append_value( $v )
|
37 |
-
{
|
38 |
-
$this->values[] = $v;
|
39 |
-
}
|
40 |
-
|
41 |
-
function set_values( $v )
|
42 |
-
{
|
43 |
-
foreach( $v as $val )
|
44 |
-
$this->append_value( new hbar_value( $val ) );
|
45 |
-
}
|
46 |
-
|
47 |
-
function set_colour( $colour )
|
48 |
-
{
|
49 |
-
$this->colour = $colour;
|
50 |
-
}
|
51 |
-
|
52 |
-
function set_key( $text, $size )
|
53 |
-
{
|
54 |
-
$this->text = $text;
|
55 |
-
$tmp = 'font-size';
|
56 |
-
$this->$tmp = $size;
|
57 |
-
}
|
58 |
-
|
59 |
-
function set_tooltip( $tip )
|
60 |
-
{
|
61 |
-
$this->tip = $tip;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_line.php
DELETED
@@ -1,157 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class line_on_show
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
*@param $type as string. Can be any one of:
|
7 |
-
* - 'pop-up'
|
8 |
-
* - 'explode'
|
9 |
-
* - 'mid-slide'
|
10 |
-
* - 'drop'
|
11 |
-
* - 'fade-in'
|
12 |
-
* - 'shrink-in'
|
13 |
-
*
|
14 |
-
* @param $cascade as float. Cascade in seconds
|
15 |
-
* @param $delay as float. Delay before animation starts in seconds.
|
16 |
-
*/
|
17 |
-
function __construct($type, $cascade, $delay)
|
18 |
-
{
|
19 |
-
$this->type = $type;
|
20 |
-
$this->cascade = (float)$cascade;
|
21 |
-
$this->delay = (float)$delay;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
class line
|
26 |
-
{
|
27 |
-
function line()
|
28 |
-
{
|
29 |
-
$this->type = "line";
|
30 |
-
$this->values = array();
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Set the default dot that all the real
|
35 |
-
* dots inherit their properties from. If you set the
|
36 |
-
* default dot to be red, all values in your chart that
|
37 |
-
* do not specify a colour will be red. Same for all the
|
38 |
-
* other attributes such as tooltip, on-click, size etc...
|
39 |
-
*
|
40 |
-
* @param $style as any class that inherits base_dot
|
41 |
-
*/
|
42 |
-
function set_default_dot_style( $style )
|
43 |
-
{
|
44 |
-
$tmp = 'dot-style';
|
45 |
-
$this->$tmp = $style;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @param $v as array, can contain any combination of:
|
50 |
-
* - integer, Y position of the point
|
51 |
-
* - any class that inherits from dot_base
|
52 |
-
* - <b>null</b>
|
53 |
-
*/
|
54 |
-
function set_values( $v )
|
55 |
-
{
|
56 |
-
$this->values = $v;
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Append a value to the line.
|
61 |
-
*
|
62 |
-
* @param mixed $v
|
63 |
-
*/
|
64 |
-
function append_value($v)
|
65 |
-
{
|
66 |
-
$this->values[] = $v;
|
67 |
-
}
|
68 |
-
|
69 |
-
function set_width( $width )
|
70 |
-
{
|
71 |
-
$this->width = $width;
|
72 |
-
}
|
73 |
-
|
74 |
-
function set_colour( $colour )
|
75 |
-
{
|
76 |
-
$this->colour = $colour;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* sytnatical sugar for set_colour
|
81 |
-
*/
|
82 |
-
function colour( $colour )
|
83 |
-
{
|
84 |
-
$this->set_colour( $colour );
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
-
function set_halo_size( $size )
|
89 |
-
{
|
90 |
-
$tmp = 'halo-size';
|
91 |
-
$this->$tmp = $size;
|
92 |
-
}
|
93 |
-
|
94 |
-
function set_key( $text, $font_size )
|
95 |
-
{
|
96 |
-
$this->text = $text;
|
97 |
-
$tmp = 'font-size';
|
98 |
-
$this->$tmp = $font_size;
|
99 |
-
}
|
100 |
-
|
101 |
-
function set_tooltip( $tip )
|
102 |
-
{
|
103 |
-
$this->tip = $tip;
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* @param $text as string. A javascript function name as a string. The chart will
|
108 |
-
* try to call this function, it will pass the chart id as the only parameter into
|
109 |
-
* this function. E.g:
|
110 |
-
*
|
111 |
-
*/
|
112 |
-
function set_on_click( $text )
|
113 |
-
{
|
114 |
-
$tmp = 'on-click';
|
115 |
-
$this->$tmp = $text;
|
116 |
-
}
|
117 |
-
|
118 |
-
function loop()
|
119 |
-
{
|
120 |
-
$this->loop = true;
|
121 |
-
}
|
122 |
-
|
123 |
-
function line_style( $s )
|
124 |
-
{
|
125 |
-
$tmp = "line-style";
|
126 |
-
$this->$tmp = $s;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Sets the text for the line.
|
131 |
-
*
|
132 |
-
* @param string $text
|
133 |
-
*/
|
134 |
-
function set_text($text)
|
135 |
-
{
|
136 |
-
$this->text = $text;
|
137 |
-
}
|
138 |
-
|
139 |
-
function attach_to_right_y_axis()
|
140 |
-
{
|
141 |
-
$this->axis = 'right';
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
*@param $on_show as line_on_show object
|
146 |
-
*/
|
147 |
-
function set_on_show($on_show)
|
148 |
-
{
|
149 |
-
$this->{'on-show'} = $on_show;
|
150 |
-
}
|
151 |
-
|
152 |
-
function on_show($on_show)
|
153 |
-
{
|
154 |
-
$this->set_on_show($on_show);
|
155 |
-
return $this;
|
156 |
-
}
|
157 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_line_base.php
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class line_base
|
4 |
-
{
|
5 |
-
function line_base()
|
6 |
-
{
|
7 |
-
$this->type = "line";
|
8 |
-
$this->text = "Page views";
|
9 |
-
$tmp = 'font-size';
|
10 |
-
$this->$tmp = 10;
|
11 |
-
|
12 |
-
$this->values = array();
|
13 |
-
}
|
14 |
-
|
15 |
-
function set_values( $v )
|
16 |
-
{
|
17 |
-
$this->values = $v;
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Append a value to the line.
|
22 |
-
*
|
23 |
-
* @param mixed $v
|
24 |
-
*/
|
25 |
-
function append_value($v)
|
26 |
-
{
|
27 |
-
$this->values[] = $v;
|
28 |
-
}
|
29 |
-
|
30 |
-
function set_width( $width )
|
31 |
-
{
|
32 |
-
$this->width = $width;
|
33 |
-
}
|
34 |
-
|
35 |
-
function set_colour( $colour )
|
36 |
-
{
|
37 |
-
$this->colour = $colour;
|
38 |
-
}
|
39 |
-
|
40 |
-
function set_dot_size( $size )
|
41 |
-
{
|
42 |
-
$tmp = 'dot-size';
|
43 |
-
$this->$tmp = $size;
|
44 |
-
}
|
45 |
-
|
46 |
-
function set_halo_size( $size )
|
47 |
-
{
|
48 |
-
$tmp = 'halo-size';
|
49 |
-
$this->$tmp = $size;
|
50 |
-
}
|
51 |
-
|
52 |
-
function set_key( $text, $font_size )
|
53 |
-
{
|
54 |
-
$this->text = $text;
|
55 |
-
$tmp = 'font-size';
|
56 |
-
$this->$tmp = $font_size;
|
57 |
-
}
|
58 |
-
|
59 |
-
function set_tooltip( $tip )
|
60 |
-
{
|
61 |
-
$this->tip = $tip;
|
62 |
-
}
|
63 |
-
|
64 |
-
function set_on_click( $text )
|
65 |
-
{
|
66 |
-
$tmp = 'on-click';
|
67 |
-
$this->$tmp = $text;
|
68 |
-
}
|
69 |
-
|
70 |
-
function loop()
|
71 |
-
{
|
72 |
-
$this->loop = true;
|
73 |
-
}
|
74 |
-
|
75 |
-
function line_style( $s )
|
76 |
-
{
|
77 |
-
$tmp = "line-style";
|
78 |
-
$this->$tmp = $s;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Sets the text for the line.
|
83 |
-
*
|
84 |
-
* @param string $text
|
85 |
-
*/
|
86 |
-
function set_text($text)
|
87 |
-
{
|
88 |
-
$this->text = $text;
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_line_dot.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class dot_value
|
4 |
-
{
|
5 |
-
function dot_value( $value, $colour )
|
6 |
-
{
|
7 |
-
$this->value = $value;
|
8 |
-
$this->colour = $colour;
|
9 |
-
}
|
10 |
-
|
11 |
-
function set_colour( $colour )
|
12 |
-
{
|
13 |
-
$this->colour = $colour;
|
14 |
-
}
|
15 |
-
|
16 |
-
function set_size( $size )
|
17 |
-
{
|
18 |
-
$this->size = $size;
|
19 |
-
}
|
20 |
-
|
21 |
-
function set_tooltip( $tip )
|
22 |
-
{
|
23 |
-
$this->tip = $tip;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
class line_dot extends line_base
|
28 |
-
{
|
29 |
-
function line_dot()
|
30 |
-
{
|
31 |
-
$this->type = "line_dot";
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_line_hollow.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class line_hollow extends line_base
|
4 |
-
{
|
5 |
-
function line_hollow()
|
6 |
-
{
|
7 |
-
$this->type = "line_hollow";
|
8 |
-
}
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_line_style.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class line_style
|
4 |
-
{
|
5 |
-
function line_style($on, $off)
|
6 |
-
{
|
7 |
-
$this->style = "dash";
|
8 |
-
$this->on = $on;
|
9 |
-
$this->off = $off;
|
10 |
-
}
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_menu.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class ofc_menu_item
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* @param $text as string. The menu item text.
|
7 |
-
* @param $javascript_function_name as string. The javascript function name, the
|
8 |
-
* js function takes one parameter, the chart ID. See ofc_menu_item_camera for
|
9 |
-
* some example code.
|
10 |
-
*/
|
11 |
-
function ofc_menu_item($text, $javascript_function_name)
|
12 |
-
{
|
13 |
-
$this->type = "text";
|
14 |
-
$this->text = $text;
|
15 |
-
$tmp = 'javascript-function';
|
16 |
-
$this->$tmp = $javascript_function_name;
|
17 |
-
}
|
18 |
-
}
|
19 |
-
|
20 |
-
class ofc_menu_item_camera
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @param $text as string. The menu item text.
|
24 |
-
* @param $javascript_function_name as string. The javascript function name, the
|
25 |
-
* js function takes one parameter, the chart ID. So for example, our js function
|
26 |
-
* could look like this:
|
27 |
-
*
|
28 |
-
* function save_image( chart_id )
|
29 |
-
* {
|
30 |
-
* alert( chart_id );
|
31 |
-
* }
|
32 |
-
*
|
33 |
-
* to make a menu item call this: ofc_menu_item_camera('Save chart', 'save_image');
|
34 |
-
*/
|
35 |
-
function ofc_menu_item_camera($text, $javascript_function_name)
|
36 |
-
{
|
37 |
-
$this->type = "camera-icon";
|
38 |
-
$this->text = $text;
|
39 |
-
$tmp = 'javascript-function';
|
40 |
-
$this->$tmp = $javascript_function_name;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
class ofc_menu
|
45 |
-
{
|
46 |
-
function ofc_menu($colour, $outline_colour)
|
47 |
-
{
|
48 |
-
$this->colour = $colour;
|
49 |
-
$this->outline_colour = $outline_colour;
|
50 |
-
}
|
51 |
-
|
52 |
-
function values($values)
|
53 |
-
{
|
54 |
-
$this->values = $values;
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_pie.php
DELETED
@@ -1,257 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class pie_value
|
4 |
-
{
|
5 |
-
function pie_value( $value, $label )
|
6 |
-
{
|
7 |
-
$this->value = $value;
|
8 |
-
$this->label = $label;
|
9 |
-
}
|
10 |
-
|
11 |
-
function set_colour( $colour )
|
12 |
-
{
|
13 |
-
$this->colour = $colour;
|
14 |
-
}
|
15 |
-
|
16 |
-
function set_label( $label, $label_colour, $font_size )
|
17 |
-
{
|
18 |
-
$this->label = $label;
|
19 |
-
|
20 |
-
$tmp = 'label-colour';
|
21 |
-
$this->$tmp = $label_colour;
|
22 |
-
|
23 |
-
$tmp = 'font-size';
|
24 |
-
$this->$tmp = $font_size;
|
25 |
-
|
26 |
-
}
|
27 |
-
|
28 |
-
function set_tooltip( $tip )
|
29 |
-
{
|
30 |
-
$this->tip = $tip;
|
31 |
-
}
|
32 |
-
|
33 |
-
function on_click( $event )
|
34 |
-
{
|
35 |
-
$tmp = 'on-click';
|
36 |
-
$this->$tmp = $event;
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
/**
|
41 |
-
* An object that inherits from base_pie_animation
|
42 |
-
*/
|
43 |
-
function add_animation( $animation )
|
44 |
-
{
|
45 |
-
if( !isset( $this->animate ) )
|
46 |
-
$this->animate = array();
|
47 |
-
|
48 |
-
$this->animate[] = $animation;
|
49 |
-
|
50 |
-
return $this;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
class base_pie_animation{}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* fade the pie slice from $alpha (pie set_alpha) to 100% opaque.
|
58 |
-
*/
|
59 |
-
class pie_fade extends base_pie_animation
|
60 |
-
{
|
61 |
-
function pie_fade()
|
62 |
-
{
|
63 |
-
$this->type="fade";
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Bounce the pie slice out a little
|
69 |
-
*/
|
70 |
-
class pie_bounce extends base_pie_animation
|
71 |
-
{
|
72 |
-
/**
|
73 |
-
* @param $distance as integer, distance to bounce in pixels
|
74 |
-
*/
|
75 |
-
function pie_bounce( $distance )
|
76 |
-
{
|
77 |
-
$this->type="bounce";
|
78 |
-
$this->distance = $distance;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Make a pie chart and fill it with pie slices
|
84 |
-
*/
|
85 |
-
class pie
|
86 |
-
{
|
87 |
-
function pie()
|
88 |
-
{
|
89 |
-
$this->type = 'pie';
|
90 |
-
}
|
91 |
-
|
92 |
-
function set_colours( $colours )
|
93 |
-
{
|
94 |
-
$this->colours = $colours;
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Sugar wrapped around set_colours
|
99 |
-
*/
|
100 |
-
function colours( $colours )
|
101 |
-
{
|
102 |
-
$this->set_colours( $colours );
|
103 |
-
return $this;
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* @param $alpha as float (0-1) 0.75 = 3/4 visible
|
108 |
-
*/
|
109 |
-
function set_alpha( $alpha )
|
110 |
-
{
|
111 |
-
$this->alpha = $alpha;
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
*sugar wrapped set_alpha
|
116 |
-
**/
|
117 |
-
function alpha( $alpha )
|
118 |
-
{
|
119 |
-
$this->set_alpha( $alpha );
|
120 |
-
return $this;
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* @param $v as array containing one of
|
125 |
-
* - null
|
126 |
-
* - real or integer number
|
127 |
-
* - a pie_value object
|
128 |
-
*/
|
129 |
-
function set_values( $v )
|
130 |
-
{
|
131 |
-
$this->values = $v;
|
132 |
-
}
|
133 |
-
|
134 |
-
/**
|
135 |
-
* sugar for set_values
|
136 |
-
*/
|
137 |
-
function values( $v )
|
138 |
-
{
|
139 |
-
$this->set_values( $v );
|
140 |
-
return $this;
|
141 |
-
}
|
142 |
-
|
143 |
-
/**
|
144 |
-
* HACK to keep old code working.
|
145 |
-
*/
|
146 |
-
function set_animate( $bool )
|
147 |
-
{
|
148 |
-
if( $bool )
|
149 |
-
$this->add_animation( new pie_fade() );
|
150 |
-
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* An object that inherits from base_pie_animation
|
155 |
-
*/
|
156 |
-
function add_animation( $animation )
|
157 |
-
{
|
158 |
-
if( !isset( $this->animate ) )
|
159 |
-
$this->animate = array();
|
160 |
-
|
161 |
-
$this->animate[] = $animation;
|
162 |
-
|
163 |
-
return $this;
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* @param $angle as real number
|
168 |
-
*/
|
169 |
-
function set_start_angle( $angle )
|
170 |
-
{
|
171 |
-
$tmp = 'start-angle';
|
172 |
-
$this->$tmp = $angle;
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* sugar for set_start_angle
|
177 |
-
*/
|
178 |
-
function start_angle($angle)
|
179 |
-
{
|
180 |
-
$this->set_start_angle( $angle );
|
181 |
-
return $this;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* @param $tip as string. The tooltip text. May contain magic varibles
|
186 |
-
*/
|
187 |
-
function set_tooltip( $tip )
|
188 |
-
{
|
189 |
-
$this->tip = $tip;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* sugar for set_tooltip
|
194 |
-
*/
|
195 |
-
function tooltip( $tip )
|
196 |
-
{
|
197 |
-
$this->set_tooltip( $tip );
|
198 |
-
return $this;
|
199 |
-
}
|
200 |
-
|
201 |
-
function set_gradient_fill()
|
202 |
-
{
|
203 |
-
$tmp = 'gradient-fill';
|
204 |
-
$this->$tmp = true;
|
205 |
-
}
|
206 |
-
|
207 |
-
function gradient_fill()
|
208 |
-
{
|
209 |
-
$this->set_gradient_fill();
|
210 |
-
return $this;
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* By default each label is the same colour as the slice,
|
215 |
-
* but you can ovveride that behaviour using this method.
|
216 |
-
*
|
217 |
-
* @param $label_colour as string HEX colour;
|
218 |
-
*/
|
219 |
-
function set_label_colour( $label_colour )
|
220 |
-
{
|
221 |
-
$tmp = 'label-colour';
|
222 |
-
$this->$tmp = $label_colour;
|
223 |
-
}
|
224 |
-
|
225 |
-
function label_colour( $label_colour )
|
226 |
-
{
|
227 |
-
$this->set_label_colour( $label_colour );
|
228 |
-
return $this;
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Turn off the labels
|
233 |
-
*/
|
234 |
-
function set_no_labels()
|
235 |
-
{
|
236 |
-
$tmp = 'no-labels';
|
237 |
-
$this->$tmp = true;
|
238 |
-
}
|
239 |
-
|
240 |
-
function on_click( $event )
|
241 |
-
{
|
242 |
-
$tmp = 'on-click';
|
243 |
-
$this->$tmp = $event;
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Fix the radius of the pie chart. Take a look at the magic variable #radius#
|
248 |
-
* for helping figure out what radius to set it to.
|
249 |
-
*
|
250 |
-
* @param $radius as number
|
251 |
-
*/
|
252 |
-
function radius( $radius )
|
253 |
-
{
|
254 |
-
$this->radius = $radius;
|
255 |
-
return $this;
|
256 |
-
}
|
257 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_radar_axis.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class radar_axis
|
4 |
-
{
|
5 |
-
function radar_axis( $max )
|
6 |
-
{
|
7 |
-
$this->set_max( $max );
|
8 |
-
}
|
9 |
-
|
10 |
-
function set_max( $max )
|
11 |
-
{
|
12 |
-
$this->max = $max;
|
13 |
-
}
|
14 |
-
|
15 |
-
function set_steps( $steps )
|
16 |
-
{
|
17 |
-
$this->steps = $steps;
|
18 |
-
}
|
19 |
-
|
20 |
-
function set_stroke( $s )
|
21 |
-
{
|
22 |
-
$this->stroke = $s;
|
23 |
-
}
|
24 |
-
|
25 |
-
function set_colour( $colour )
|
26 |
-
{
|
27 |
-
$this->colour = $colour;
|
28 |
-
}
|
29 |
-
|
30 |
-
function set_grid_colour( $colour )
|
31 |
-
{
|
32 |
-
$tmp = 'grid-colour';
|
33 |
-
$this->$tmp = $colour;
|
34 |
-
}
|
35 |
-
|
36 |
-
function set_labels( $labels )
|
37 |
-
{
|
38 |
-
$this->labels = $labels;
|
39 |
-
}
|
40 |
-
|
41 |
-
function set_spoke_labels( $labels )
|
42 |
-
{
|
43 |
-
$tmp = 'spoke-labels';
|
44 |
-
$this->$tmp = $labels;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_radar_axis_labels.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class radar_axis_labels
|
4 |
-
{
|
5 |
-
// $labels : array
|
6 |
-
function radar_axis_labels( $labels )
|
7 |
-
{
|
8 |
-
$this->labels = $labels;
|
9 |
-
}
|
10 |
-
|
11 |
-
function set_colour( $colour )
|
12 |
-
{
|
13 |
-
$this->colour = $colour;
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_radar_spoke_labels.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class radar_spoke_labels
|
4 |
-
{
|
5 |
-
// $labels : array
|
6 |
-
function radar_spoke_labels( $labels )
|
7 |
-
{
|
8 |
-
$this->labels = $labels;
|
9 |
-
}
|
10 |
-
|
11 |
-
function set_colour( $colour )
|
12 |
-
{
|
13 |
-
$this->colour = $colour;
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_scatter.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class scatter_value
|
4 |
-
{
|
5 |
-
function scatter_value( $x, $y, $dot_size=-1 )
|
6 |
-
{
|
7 |
-
$this->x = $x;
|
8 |
-
$this->y = $y;
|
9 |
-
|
10 |
-
if( $dot_size > 0 )
|
11 |
-
{
|
12 |
-
$tmp = 'dot-size';
|
13 |
-
$this->$tmp = $dot_size;
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
class scatter
|
19 |
-
{
|
20 |
-
function scatter( $colour )
|
21 |
-
{
|
22 |
-
$this->type = "scatter";
|
23 |
-
$this->set_colour( $colour );
|
24 |
-
}
|
25 |
-
|
26 |
-
function set_colour( $colour )
|
27 |
-
{
|
28 |
-
$this->colour = $colour;
|
29 |
-
}
|
30 |
-
|
31 |
-
function set_default_dot_style( $style )
|
32 |
-
{
|
33 |
-
$tmp = 'dot-style';
|
34 |
-
$this->$tmp = $style;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* @param $v as array, can contain any combination of:
|
39 |
-
* - integer, Y position of the point
|
40 |
-
* - any class that inherits from scatter_value
|
41 |
-
* - <b>null</b>
|
42 |
-
*/
|
43 |
-
function set_values( $values )
|
44 |
-
{
|
45 |
-
$this->values = $values;
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_scatter_line.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class scatter_line
|
4 |
-
{
|
5 |
-
function scatter_line( $colour, $width )
|
6 |
-
{
|
7 |
-
$this->type = "scatter_line";
|
8 |
-
$this->set_colour( $colour );
|
9 |
-
$this->set_width( $width );
|
10 |
-
}
|
11 |
-
|
12 |
-
function set_default_dot_style( $style )
|
13 |
-
{
|
14 |
-
$tmp = 'dot-style';
|
15 |
-
$this->$tmp = $style;
|
16 |
-
}
|
17 |
-
|
18 |
-
function set_colour( $colour )
|
19 |
-
{
|
20 |
-
$this->colour = $colour;
|
21 |
-
}
|
22 |
-
|
23 |
-
function set_width( $width )
|
24 |
-
{
|
25 |
-
$this->width = $width;
|
26 |
-
}
|
27 |
-
|
28 |
-
function set_values( $values )
|
29 |
-
{
|
30 |
-
$this->values = $values;
|
31 |
-
}
|
32 |
-
|
33 |
-
function set_step_horizontal()
|
34 |
-
{
|
35 |
-
$this->stepgraph = 'horizontal';
|
36 |
-
}
|
37 |
-
|
38 |
-
function set_step_vertical()
|
39 |
-
{
|
40 |
-
$this->stepgraph = 'vertical';
|
41 |
-
}
|
42 |
-
|
43 |
-
function set_key( $text, $font_size )
|
44 |
-
{
|
45 |
-
$this->text = $text;
|
46 |
-
$tmp = 'font-size';
|
47 |
-
$this->$tmp = $font_size;
|
48 |
-
}
|
49 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_shape.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class shape_point
|
4 |
-
{
|
5 |
-
function shape_point( $x, $y )
|
6 |
-
{
|
7 |
-
$this->x = $x;
|
8 |
-
$this->y = $y;
|
9 |
-
}
|
10 |
-
}
|
11 |
-
|
12 |
-
class shape
|
13 |
-
{
|
14 |
-
function shape( $colour )
|
15 |
-
{
|
16 |
-
$this->type = "shape";
|
17 |
-
$this->colour = $colour;
|
18 |
-
$this->values = array();
|
19 |
-
}
|
20 |
-
|
21 |
-
function append_value( $p )
|
22 |
-
{
|
23 |
-
$this->values[] = $p;
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_sugar.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Sugar: to make stars easier sometimes
|
5 |
-
*/
|
6 |
-
class s_star extends star
|
7 |
-
{
|
8 |
-
/**
|
9 |
-
* I use this wrapper for default dot types,
|
10 |
-
* it just makes the code easier to read.
|
11 |
-
*/
|
12 |
-
function s_star($colour, $size)
|
13 |
-
{
|
14 |
-
parent::star();
|
15 |
-
$this->colour($colour)->size($size);
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
class s_box extends anchor
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* I use this wrapper for default dot types,
|
23 |
-
* it just makes the code easier to read.
|
24 |
-
*/
|
25 |
-
function s_box($colour, $size)
|
26 |
-
{
|
27 |
-
parent::anchor();
|
28 |
-
$this->colour($colour)->size($size)->rotation(45)->sides(4);
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
class s_hollow_dot extends hollow_dot
|
33 |
-
{
|
34 |
-
/**
|
35 |
-
* I use this wrapper for default dot types,
|
36 |
-
* it just makes the code easier to read.
|
37 |
-
*/
|
38 |
-
function s_hollow_dot($colour, $size)
|
39 |
-
{
|
40 |
-
parent::hollow_dot();
|
41 |
-
$this->colour($colour)->size($size);
|
42 |
-
}
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_tags.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class ofc_tags
|
4 |
-
{
|
5 |
-
function ofc_tags()
|
6 |
-
{
|
7 |
-
$this->type = "tags";
|
8 |
-
$this->values = array();
|
9 |
-
}
|
10 |
-
|
11 |
-
function colour( $colour )
|
12 |
-
{
|
13 |
-
$this->colour = $colour;
|
14 |
-
return $this;
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
*@param $font as string. e.g. "Verdana"
|
19 |
-
*@param $size as integer. Size in px
|
20 |
-
*/
|
21 |
-
function font($font, $size)
|
22 |
-
{
|
23 |
-
$this->font = $font;
|
24 |
-
$this->{'font-size'} = $size;
|
25 |
-
return $this;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
*@param $x as integer. Size of x padding in px
|
30 |
-
*@param $y as integer. Size of y padding in px
|
31 |
-
*/
|
32 |
-
function padding($x, $y)
|
33 |
-
{
|
34 |
-
$this->{"pad-x"} = $x;
|
35 |
-
$this->{"pad-y"} = $y;
|
36 |
-
return $this;
|
37 |
-
}
|
38 |
-
|
39 |
-
function rotate($angle)
|
40 |
-
{
|
41 |
-
$this->rotate($angle);
|
42 |
-
return $this;
|
43 |
-
}
|
44 |
-
|
45 |
-
function align_x_center()
|
46 |
-
{
|
47 |
-
$this->{"align-x"} = "center";
|
48 |
-
return $this;
|
49 |
-
}
|
50 |
-
|
51 |
-
function align_x_left()
|
52 |
-
{
|
53 |
-
$this->{"align-x"} = "left";
|
54 |
-
return $this;
|
55 |
-
}
|
56 |
-
|
57 |
-
function align_x_right()
|
58 |
-
{
|
59 |
-
$this->{"align-x"} = "right";
|
60 |
-
return $this;
|
61 |
-
}
|
62 |
-
|
63 |
-
function align_y_above()
|
64 |
-
{
|
65 |
-
$this->{"align-y"} = "above";
|
66 |
-
return $this;
|
67 |
-
}
|
68 |
-
|
69 |
-
function align_y_below()
|
70 |
-
{
|
71 |
-
$this->{"align-y"} = "below";
|
72 |
-
return $this;
|
73 |
-
}
|
74 |
-
|
75 |
-
function align_y_center()
|
76 |
-
{
|
77 |
-
$this->{"align-y"} = "center";
|
78 |
-
return $this;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* This can contain some HTML, e.g:
|
83 |
-
* - "More <a href="javascript:alert(12);">info</a>"
|
84 |
-
* - "<a href="http://teethgrinder.co.uk">ofc</a>"
|
85 |
-
*/
|
86 |
-
function text($text)
|
87 |
-
{
|
88 |
-
$this->text = $text;
|
89 |
-
return $this;
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* This works, but to get the mouse pointer to change
|
94 |
-
* to a little hand you need to use "<a href="">stuff</a>"-- see text()
|
95 |
-
*/
|
96 |
-
function on_click($on_click)
|
97 |
-
{
|
98 |
-
$this->{'on-click'} = $on_click;
|
99 |
-
return $this;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
*@param $bold boolean.
|
104 |
-
*@param $underline boolean.
|
105 |
-
*@param $border boolean.
|
106 |
-
*@prarm $alpha real (0 to 1.0)
|
107 |
-
*/
|
108 |
-
function style($bold, $underline, $border, $alpha )
|
109 |
-
{
|
110 |
-
$this->bold = $bold;
|
111 |
-
$this->border = $underline;
|
112 |
-
$this->underline = $border;
|
113 |
-
$this->alpha = $alpha;
|
114 |
-
return $this;
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
*@param $tag as ofc_tag
|
119 |
-
*/
|
120 |
-
function append_tag($tag)
|
121 |
-
{
|
122 |
-
$this->values[] = $tag;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
class ofc_tag extends ofc_tags
|
127 |
-
{
|
128 |
-
function ofc_tag($x, $y)
|
129 |
-
{
|
130 |
-
$this->x = $x;
|
131 |
-
$this->y = $y;
|
132 |
-
}
|
133 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_title.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Set the title of a chart, make one of these and pass it into
|
5 |
-
* open_flash_chart set_title
|
6 |
-
*/
|
7 |
-
class title
|
8 |
-
{
|
9 |
-
function title( $text='' )
|
10 |
-
{
|
11 |
-
$this->text = $text;
|
12 |
-
}
|
13 |
-
|
14 |
-
/**
|
15 |
-
* A css string. Can optionally contain:
|
16 |
-
* - font-size
|
17 |
-
* - font-family
|
18 |
-
* - font-weight
|
19 |
-
* - color
|
20 |
-
* - background-color
|
21 |
-
* - text-align
|
22 |
-
* - margin
|
23 |
-
* - margin-left
|
24 |
-
* - margin-right
|
25 |
-
* - margin-top
|
26 |
-
* - margin-bottom
|
27 |
-
* - padding
|
28 |
-
* - padding-left
|
29 |
-
* - padding-right
|
30 |
-
* - padding-top
|
31 |
-
* - padding-bottom
|
32 |
-
* just like the css we use all the time :-)
|
33 |
-
*/
|
34 |
-
function set_style( $css )
|
35 |
-
{
|
36 |
-
$this->style = $css;
|
37 |
-
//"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}";
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_tooltip.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once 'ofc_bar_base.php';
|
4 |
-
|
5 |
-
class tooltip
|
6 |
-
{
|
7 |
-
function tooltip(){}
|
8 |
-
|
9 |
-
/**
|
10 |
-
* @param $shadow as boolean. Enable drop shadow.
|
11 |
-
*/
|
12 |
-
function set_shadow( $shadow )
|
13 |
-
{
|
14 |
-
$this->shadow = $shadow;
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @param $stroke as integer, border width in pixels (e.g. 5 )
|
19 |
-
*/
|
20 |
-
function set_stroke( $stroke )
|
21 |
-
{
|
22 |
-
$this->stroke = $stroke;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param $colour as string, HEX colour e.g. '#0000ff'
|
27 |
-
*/
|
28 |
-
function set_colour( $colour )
|
29 |
-
{
|
30 |
-
$this->colour = $colour;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @param $bg as string, HEX colour e.g. '#0000ff'
|
35 |
-
*/
|
36 |
-
function set_background_colour( $bg )
|
37 |
-
{
|
38 |
-
$this->background = $bg;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @param $style as string. A css style.
|
43 |
-
*/
|
44 |
-
function set_title_style( $style )
|
45 |
-
{
|
46 |
-
$this->title = $style;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @param $style as string. A css style.
|
51 |
-
*/
|
52 |
-
function set_body_style( $style )
|
53 |
-
{
|
54 |
-
$this->body = $style;
|
55 |
-
}
|
56 |
-
|
57 |
-
function set_proximity()
|
58 |
-
{
|
59 |
-
$this->mouse = 1;
|
60 |
-
}
|
61 |
-
|
62 |
-
function set_hover()
|
63 |
-
{
|
64 |
-
$this->mouse = 2;
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_upload_image.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
//
|
4 |
-
// In Open Flash Chart -> save_image debug mode, you
|
5 |
-
// will see the 'echo' text in a new window.
|
6 |
-
//
|
7 |
-
|
8 |
-
/*
|
9 |
-
|
10 |
-
print_r( $_GET );
|
11 |
-
print_r( $_POST );
|
12 |
-
print_r( $_FILES );
|
13 |
-
|
14 |
-
print_r( $GLOBALS );
|
15 |
-
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
|
16 |
-
|
17 |
-
*/
|
18 |
-
|
19 |
-
|
20 |
-
// default path for the image to be stored //
|
21 |
-
$default_path = '../tmp-upload-images/';
|
22 |
-
|
23 |
-
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
|
24 |
-
|
25 |
-
// full path to the saved image including filename //
|
26 |
-
$destination = $default_path . basename( $_GET[ 'name' ] );
|
27 |
-
|
28 |
-
echo 'Saving your image to: '. $destination;
|
29 |
-
// print_r( $_POST );
|
30 |
-
// print_r( $_SERVER );
|
31 |
-
// echo $HTTP_RAW_POST_DATA;
|
32 |
-
|
33 |
-
//
|
34 |
-
// POST data is usually string data, but we are passing a RAW .png
|
35 |
-
// so PHP is a bit confused and $_POST is empty. But it has saved
|
36 |
-
// the raw bits into $HTTP_RAW_POST_DATA
|
37 |
-
//
|
38 |
-
|
39 |
-
$jfh = fopen($destination, 'w') or die("can't open file");
|
40 |
-
fwrite($jfh, $HTTP_RAW_POST_DATA);
|
41 |
-
fclose($jfh);
|
42 |
-
|
43 |
-
//
|
44 |
-
// LOOK:
|
45 |
-
//
|
46 |
-
exit();
|
47 |
-
|
48 |
-
|
49 |
-
//
|
50 |
-
// PHP5:
|
51 |
-
//
|
52 |
-
|
53 |
-
|
54 |
-
// default path for the image to be stored //
|
55 |
-
$default_path = 'tmp-upload-images/';
|
56 |
-
|
57 |
-
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
|
58 |
-
|
59 |
-
// full path to the saved image including filename //
|
60 |
-
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
|
61 |
-
|
62 |
-
// move the image into the specified directory //
|
63 |
-
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
|
64 |
-
echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
|
65 |
-
} else {
|
66 |
-
echo "FILE UPLOAD FAILED";
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_x_axis.php
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class x_axis
|
4 |
-
{
|
5 |
-
function x_axis(){}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param $stroke as integer, with of the line and ticks
|
9 |
-
*/
|
10 |
-
function set_stroke( $stroke )
|
11 |
-
{
|
12 |
-
$this->stroke = $stroke;
|
13 |
-
}
|
14 |
-
|
15 |
-
function stroke( $stroke )
|
16 |
-
{
|
17 |
-
$this->set_stroke( $stroke );
|
18 |
-
return $this;
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
*@param $colour as string HEX colour
|
23 |
-
*@param $grid_colour as string HEX colour
|
24 |
-
*/
|
25 |
-
function set_colours( $colour, $grid_colour )
|
26 |
-
{
|
27 |
-
$this->set_colour( $colour );
|
28 |
-
$this->set_grid_colour( $grid_colour );
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
*@param $colour as string HEX colour
|
33 |
-
*/
|
34 |
-
function set_colour( $colour )
|
35 |
-
{
|
36 |
-
$this->colour = $colour;
|
37 |
-
}
|
38 |
-
|
39 |
-
function colour( $colour )
|
40 |
-
{
|
41 |
-
$this->set_colour($colour);
|
42 |
-
return $this;
|
43 |
-
}
|
44 |
-
|
45 |
-
function set_tick_height( $height )
|
46 |
-
{
|
47 |
-
$tmp = 'tick-height';
|
48 |
-
$this->$tmp = $height;
|
49 |
-
}
|
50 |
-
|
51 |
-
function tick_height( $height )
|
52 |
-
{
|
53 |
-
$this->set_tick_height($height);
|
54 |
-
return $this;
|
55 |
-
}
|
56 |
-
|
57 |
-
function set_grid_colour( $colour )
|
58 |
-
{
|
59 |
-
$tmp = 'grid-colour';
|
60 |
-
$this->$tmp = $colour;
|
61 |
-
}
|
62 |
-
|
63 |
-
function grid_colour( $colour )
|
64 |
-
{
|
65 |
-
$this->set_grid_colour($colour);
|
66 |
-
return $this;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @param $o is a boolean. If true, the X axis start half a step in
|
71 |
-
* This defaults to True
|
72 |
-
*/
|
73 |
-
function set_offset( $o )
|
74 |
-
{
|
75 |
-
$this->offset = $o?true:false;
|
76 |
-
}
|
77 |
-
|
78 |
-
function offset( $o )
|
79 |
-
{
|
80 |
-
$this->set_offset($o);
|
81 |
-
return $this;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* @param $steps as integer. Which grid lines and ticks are visible.
|
86 |
-
*/
|
87 |
-
function set_steps( $steps )
|
88 |
-
{
|
89 |
-
$this->steps = $steps;
|
90 |
-
}
|
91 |
-
|
92 |
-
function steps( $steps )
|
93 |
-
{
|
94 |
-
$this->set_steps($steps);
|
95 |
-
return $this;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* @param $val as an integer, the height in pixels of the 3D bar. Mostly
|
100 |
-
* used for the 3D bar chart.
|
101 |
-
*/
|
102 |
-
function set_3d( $val )
|
103 |
-
{
|
104 |
-
$tmp = '3d';
|
105 |
-
$this->$tmp = $val;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @param $x_axis_labels as an x_axis_labels object
|
110 |
-
* Use this to customize the labels (colour, font, etc...)
|
111 |
-
*/
|
112 |
-
function set_labels( $x_axis_labels )
|
113 |
-
{
|
114 |
-
//$this->labels = $v;
|
115 |
-
$this->labels = $x_axis_labels;
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Sugar syntax: helper function to make the examples simpler.
|
120 |
-
* @param $a is an array of labels
|
121 |
-
*/
|
122 |
-
function set_labels_from_array( $a )
|
123 |
-
{
|
124 |
-
$x_axis_labels = new x_axis_labels();
|
125 |
-
$x_axis_labels->set_labels( $a );
|
126 |
-
$this->labels = $x_axis_labels;
|
127 |
-
|
128 |
-
if( isset( $this->steps ) )
|
129 |
-
$x_axis_labels->set_steps( $this->steps );
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* min and max.
|
134 |
-
*/
|
135 |
-
function set_range( $min, $max )
|
136 |
-
{
|
137 |
-
$this->min = $min;
|
138 |
-
$this->max = $max;
|
139 |
-
}
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_x_axis_label.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* x_axis_label see x_axis_labels
|
5 |
-
*/
|
6 |
-
class x_axis_label
|
7 |
-
{
|
8 |
-
function x_axis_label( $text, $colour, $size, $rotate )
|
9 |
-
{
|
10 |
-
$this->set_text( $text );
|
11 |
-
$this->set_colour( $colour );
|
12 |
-
$this->set_size( $size );
|
13 |
-
$this->set_rotate( $rotate );
|
14 |
-
}
|
15 |
-
|
16 |
-
function set_text( $text )
|
17 |
-
{
|
18 |
-
$this->text = $text;
|
19 |
-
}
|
20 |
-
|
21 |
-
function set_colour( $colour )
|
22 |
-
{
|
23 |
-
$this->colour = $colour;
|
24 |
-
}
|
25 |
-
|
26 |
-
function set_size( $size )
|
27 |
-
{
|
28 |
-
$this->size = $size;
|
29 |
-
}
|
30 |
-
|
31 |
-
function set_rotate( $rotate )
|
32 |
-
{
|
33 |
-
$this->rotate = $rotate;
|
34 |
-
}
|
35 |
-
|
36 |
-
function set_vertical()
|
37 |
-
{
|
38 |
-
$this->rotate = "vertical";
|
39 |
-
}
|
40 |
-
|
41 |
-
function set_visible()
|
42 |
-
{
|
43 |
-
$this->visible = true;
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_x_axis_labels.php
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class x_axis_labels
|
4 |
-
{
|
5 |
-
function x_axis_labels(){}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param $steps which labels are generated
|
9 |
-
*/
|
10 |
-
function set_steps( $steps )
|
11 |
-
{
|
12 |
-
$this->steps = $steps;
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @param $steps as integer which labels are visible
|
17 |
-
*/
|
18 |
-
function visible_steps( $steps )
|
19 |
-
{
|
20 |
-
$this->{"visible-steps"} = $steps;
|
21 |
-
return $this;
|
22 |
-
}
|
23 |
-
|
24 |
-
/**
|
25 |
-
*
|
26 |
-
* @param $labels as an array of [x_axis_label or string]
|
27 |
-
*/
|
28 |
-
function set_labels( $labels )
|
29 |
-
{
|
30 |
-
$this->labels = $labels;
|
31 |
-
}
|
32 |
-
|
33 |
-
function set_colour( $colour )
|
34 |
-
{
|
35 |
-
$this->colour = $colour;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* font size in pixels
|
40 |
-
*/
|
41 |
-
function set_size( $size )
|
42 |
-
{
|
43 |
-
$this->size = $size;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* rotate labels
|
48 |
-
*/
|
49 |
-
function set_vertical()
|
50 |
-
{
|
51 |
-
$this->rotate = 270;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* @param @angle as real. The angle of the text.
|
56 |
-
*/
|
57 |
-
function rotate( $angle )
|
58 |
-
{
|
59 |
-
$this->rotate = $angle;
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* @param $text as string. Replace and magic variables with actual x axis position.
|
64 |
-
*/
|
65 |
-
function text( $text )
|
66 |
-
{
|
67 |
-
$this->text = $text;
|
68 |
-
}
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_x_legend.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class x_legend
|
4 |
-
{
|
5 |
-
function x_legend( $text='' )
|
6 |
-
{
|
7 |
-
$this->text = $text;
|
8 |
-
}
|
9 |
-
|
10 |
-
function set_style( $css )
|
11 |
-
{
|
12 |
-
$this->style = $css;
|
13 |
-
//"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}";
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_axis.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class y_axis extends y_axis_base
|
4 |
-
{
|
5 |
-
function y_axis(){}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param $colour as string. The grid are the lines inside the chart.
|
9 |
-
* HEX colour, e.g. '#ff0000'
|
10 |
-
*/
|
11 |
-
function set_grid_colour( $colour )
|
12 |
-
{
|
13 |
-
$tmp = 'grid-colour';
|
14 |
-
$this->$tmp = $colour;
|
15 |
-
}
|
16 |
-
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_axis_base.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class y_axis_base
|
4 |
-
{
|
5 |
-
function y_axis_base(){}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param $s as integer, thickness of the Y axis line
|
9 |
-
*/
|
10 |
-
function set_stroke( $s )
|
11 |
-
{
|
12 |
-
$this->stroke = $s;
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @param $val as integer. The length of the ticks in pixels
|
17 |
-
*/
|
18 |
-
function set_tick_length( $val )
|
19 |
-
{
|
20 |
-
$tmp = 'tick-length';
|
21 |
-
$this->$tmp = $val;
|
22 |
-
}
|
23 |
-
|
24 |
-
function set_colours( $colour, $grid_colour )
|
25 |
-
{
|
26 |
-
$this->set_colour( $colour );
|
27 |
-
$this->set_grid_colour( $grid_colour );
|
28 |
-
}
|
29 |
-
|
30 |
-
function set_colour( $colour )
|
31 |
-
{
|
32 |
-
$this->colour = $colour;
|
33 |
-
}
|
34 |
-
|
35 |
-
function set_grid_colour( $colour )
|
36 |
-
{
|
37 |
-
$tmp = 'grid-colour';
|
38 |
-
$this->$tmp = $colour;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Set min and max values, also (optionally) set the steps value.
|
43 |
-
* You can reverse the chart by setting min larger than max, e.g. min = 10
|
44 |
-
* and max = 0.
|
45 |
-
*
|
46 |
-
* @param $min as integer
|
47 |
-
* @param $max as integer
|
48 |
-
* @param $steps as integer.
|
49 |
-
*/
|
50 |
-
function set_range( $min, $max, $steps=1 )
|
51 |
-
{
|
52 |
-
$this->min = $min;
|
53 |
-
$this->max = $max;
|
54 |
-
$this->set_steps( $steps );
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Sugar for set_range
|
59 |
-
*/
|
60 |
-
function range( $min, $max, $steps=1 )
|
61 |
-
{
|
62 |
-
$this->set_range( $min, $max, $steps );
|
63 |
-
return $this;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @param $off as Boolean. If true the Y axis is nudged up half a step.
|
68 |
-
*/
|
69 |
-
function set_offset( $off )
|
70 |
-
{
|
71 |
-
$this->offset = $off?1:0;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @param $y_axis_labels as an y_axis_labels object
|
76 |
-
* Use this to customize the labels (colour, font, etc...)
|
77 |
-
*/
|
78 |
-
function set_labels( $y_axis_labels )
|
79 |
-
{
|
80 |
-
$this->labels = $y_axis_labels;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Pass in some text for each label. This can contain magic variables "#val#" which
|
85 |
-
* will get replaced with the value for that Y axis label. Useful for:
|
86 |
-
* - "�#val#"
|
87 |
-
* - "#val#%"
|
88 |
-
* - "#val# million"
|
89 |
-
*
|
90 |
-
* @param $text as string.
|
91 |
-
*/
|
92 |
-
function set_label_text( $text )
|
93 |
-
{
|
94 |
-
$tmp = new y_axis_labels();
|
95 |
-
$tmp->set_text( $text );
|
96 |
-
$this->labels = $tmp;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @param $steps as integer.
|
101 |
-
*
|
102 |
-
* Only show every $steps label, e.g. every 10th
|
103 |
-
*/
|
104 |
-
function set_steps( $steps )
|
105 |
-
{
|
106 |
-
$this->steps = $steps;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Make the labels show vertical
|
111 |
-
*/
|
112 |
-
function set_vertical()
|
113 |
-
{
|
114 |
-
$this->rotate = "vertical";
|
115 |
-
}
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_axis_label.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* y_axis_label see y_axis_labels
|
5 |
-
*/
|
6 |
-
class y_axis_label
|
7 |
-
{
|
8 |
-
function y_axis_label( $y, $text)
|
9 |
-
{
|
10 |
-
$this->y = $y;
|
11 |
-
$this->set_text( $text );
|
12 |
-
}
|
13 |
-
|
14 |
-
function set_text( $text )
|
15 |
-
{
|
16 |
-
$this->text = $text;
|
17 |
-
}
|
18 |
-
|
19 |
-
function set_colour( $colour )
|
20 |
-
{
|
21 |
-
$this->colour = $colour;
|
22 |
-
}
|
23 |
-
|
24 |
-
function set_size( $size )
|
25 |
-
{
|
26 |
-
$this->size = $size;
|
27 |
-
}
|
28 |
-
|
29 |
-
function set_rotate( $rotate )
|
30 |
-
{
|
31 |
-
$this->rotate = $rotate;
|
32 |
-
}
|
33 |
-
|
34 |
-
function set_vertical()
|
35 |
-
{
|
36 |
-
$this->rotate = "vertical";
|
37 |
-
}
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_axis_labels.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class y_axis_labels
|
4 |
-
{
|
5 |
-
function y_axis_labels(){}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param $steps which labels are generated
|
9 |
-
*/
|
10 |
-
function set_steps( $steps )
|
11 |
-
{
|
12 |
-
$this->steps = $steps;
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
*
|
17 |
-
* @param $labels as an array of [y_axis_label or string]
|
18 |
-
*/
|
19 |
-
function set_labels( $labels )
|
20 |
-
{
|
21 |
-
$this->labels = $labels;
|
22 |
-
}
|
23 |
-
|
24 |
-
function set_colour( $colour )
|
25 |
-
{
|
26 |
-
$this->colour = $colour;
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* font size in pixels
|
31 |
-
*/
|
32 |
-
function set_size( $size )
|
33 |
-
{
|
34 |
-
$this->size = $size;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* rotate labels
|
39 |
-
*/
|
40 |
-
function set_vertical()
|
41 |
-
{
|
42 |
-
$this->rotate = 270;
|
43 |
-
}
|
44 |
-
|
45 |
-
function rotate( $angle )
|
46 |
-
{
|
47 |
-
$this->rotate = $angle;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @param $text default text that all labels inherit
|
52 |
-
*/
|
53 |
-
function set_text( $text )
|
54 |
-
{
|
55 |
-
$this->text = $text;
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_axis_right.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class y_axis_right extends y_axis_base
|
4 |
-
{
|
5 |
-
function y_axis_right(){}
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/ofc_y_legend.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class y_legend
|
4 |
-
{
|
5 |
-
function y_legend( $text='' )
|
6 |
-
{
|
7 |
-
$this->text = $text;
|
8 |
-
}
|
9 |
-
|
10 |
-
function set_style( $css )
|
11 |
-
{
|
12 |
-
$this->style = $css;
|
13 |
-
//"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}";
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/open-flash-chart-object.php
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function open_flash_chart_object_str( $width, $height, $url, $use_swfobject=true, $base='' )
|
4 |
-
{
|
5 |
-
//
|
6 |
-
// return the HTML as a string
|
7 |
-
//
|
8 |
-
return _ofc( $width, $height, $url, $use_swfobject, $base );
|
9 |
-
}
|
10 |
-
|
11 |
-
function open_flash_chart_object( $width, $height, $url, $use_swfobject=true, $base='' )
|
12 |
-
{
|
13 |
-
//
|
14 |
-
// stream the HTML into the page
|
15 |
-
//
|
16 |
-
echo _ofc( $width, $height, $url, $use_swfobject, $base );
|
17 |
-
}
|
18 |
-
|
19 |
-
function _ofc( $width, $height, $url, $use_swfobject, $base )
|
20 |
-
{
|
21 |
-
//
|
22 |
-
// I think we may use swfobject for all browsers,
|
23 |
-
// not JUST for IE...
|
24 |
-
//
|
25 |
-
//$ie = strstr(getenv('HTTP_USER_AGENT'), 'MSIE');
|
26 |
-
|
27 |
-
//
|
28 |
-
// escape the & and stuff:
|
29 |
-
//
|
30 |
-
$url = urlencode($url);
|
31 |
-
|
32 |
-
//
|
33 |
-
// output buffer
|
34 |
-
//
|
35 |
-
$out = array();
|
36 |
-
|
37 |
-
//
|
38 |
-
// check for http or https:
|
39 |
-
//
|
40 |
-
if (isset ($_SERVER['HTTPS']))
|
41 |
-
{
|
42 |
-
if (strtoupper ($_SERVER['HTTPS']) == 'ON')
|
43 |
-
{
|
44 |
-
$protocol = 'https';
|
45 |
-
}
|
46 |
-
else
|
47 |
-
{
|
48 |
-
$protocol = 'http';
|
49 |
-
}
|
50 |
-
}
|
51 |
-
else
|
52 |
-
{
|
53 |
-
$protocol = 'http';
|
54 |
-
}
|
55 |
-
|
56 |
-
//
|
57 |
-
// if there are more than one charts on the
|
58 |
-
// page, give each a different ID
|
59 |
-
//
|
60 |
-
global $open_flash_chart_seqno;
|
61 |
-
$obj_id = 'chart';
|
62 |
-
$div_name = 'flashcontent';
|
63 |
-
|
64 |
-
//$out[] = '<script type="text/javascript" src="'. $base .'js/ofc.js"></script>';
|
65 |
-
|
66 |
-
if( !isset( $open_flash_chart_seqno ) )
|
67 |
-
{
|
68 |
-
$open_flash_chart_seqno = 1;
|
69 |
-
$out[] = '<script type="text/javascript" src="'. $base .'js/swfobject.js"></script>';
|
70 |
-
}
|
71 |
-
else
|
72 |
-
{
|
73 |
-
$open_flash_chart_seqno++;
|
74 |
-
$obj_id .= '_'. $open_flash_chart_seqno;
|
75 |
-
$div_name .= '_'. $open_flash_chart_seqno;
|
76 |
-
}
|
77 |
-
|
78 |
-
if( $use_swfobject )
|
79 |
-
{
|
80 |
-
// Using library for auto-enabling Flash object on IE, disabled-Javascript proof
|
81 |
-
$out[] = '<div id="'. $div_name .'"></div>';
|
82 |
-
$out[] = '<script type="text/javascript">';
|
83 |
-
$out[] = 'var so = new SWFObject("'. $base .'open-flash-chart.swf", "'. $obj_id .'", "'. $width . '", "' . $height . '", "9", "#FFFFFF");';
|
84 |
-
|
85 |
-
$out[] = 'so.addVariable("data-file", "'. $url . '");';
|
86 |
-
|
87 |
-
$out[] = 'so.addParam("allowScriptAccess", "always" );//"sameDomain");';
|
88 |
-
$out[] = 'so.write("'. $div_name .'");';
|
89 |
-
$out[] = '</script>';
|
90 |
-
$out[] = '<noscript>';
|
91 |
-
}
|
92 |
-
|
93 |
-
$out[] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' . $protocol . '://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
|
94 |
-
$out[] = 'width="' . $width . '" height="' . $height . '" id="ie_'. $obj_id .'" align="middle">';
|
95 |
-
$out[] = '<param name="allowScriptAccess" value="sameDomain" />';
|
96 |
-
$out[] = '<param name="movie" value="'. $base .'open-flash-chart.swf?data='. $url .'" />';
|
97 |
-
$out[] = '<param name="quality" value="high" />';
|
98 |
-
$out[] = '<param name="bgcolor" value="#FFFFFF" />';
|
99 |
-
$out[] = '<embed src="'. $base .'open-flash-chart.swf?data=' . $url .'" quality="high" bgcolor="#FFFFFF" width="'. $width .'" height="'. $height .'" name="'. $obj_id .'" align="middle" allowScriptAccess="sameDomain" ';
|
100 |
-
$out[] = 'type="application/x-shockwave-flash" pluginspage="' . $protocol . '://www.macromedia.com/go/getflashplayer" id="'. $obj_id .'"/>';
|
101 |
-
$out[] = '</object>';
|
102 |
-
|
103 |
-
if ( $use_swfobject ) {
|
104 |
-
$out[] = '</noscript>';
|
105 |
-
}
|
106 |
-
|
107 |
-
return implode("\n",$out);
|
108 |
-
}
|
109 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/ofc-library/open-flash-chart.php
DELETED
@@ -1,178 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// var_dump(debug_backtrace());
|
4 |
-
|
5 |
-
//
|
6 |
-
// Omar Kilani's php C extension for encoding JSON has been incorporated in stock PHP since 5.2.0
|
7 |
-
// http://www.aurore.net/projects/php-json/
|
8 |
-
//
|
9 |
-
// -- Marcus Engene
|
10 |
-
//
|
11 |
-
if (! function_exists('json_encode'))
|
12 |
-
{
|
13 |
-
include_once 'JSON.php';
|
14 |
-
}
|
15 |
-
|
16 |
-
include_once 'json_format.php';
|
17 |
-
|
18 |
-
// ofc classes
|
19 |
-
include_once 'ofc_title.php';
|
20 |
-
include_once 'ofc_y_axis_base.php';
|
21 |
-
include_once 'ofc_y_axis.php';
|
22 |
-
include_once 'ofc_y_axis_right.php';
|
23 |
-
include_once 'ofc_y_axis_labels.php';
|
24 |
-
include_once 'ofc_y_axis_label.php';
|
25 |
-
include_once 'ofc_x_axis.php';
|
26 |
-
|
27 |
-
|
28 |
-
include_once 'ofc_pie.php';
|
29 |
-
//include_once 'ofc_bar.php';
|
30 |
-
include_once 'ofc_bar_glass.php';
|
31 |
-
include_once 'ofc_bar_filled.php';
|
32 |
-
include_once 'ofc_bar_stack.php';
|
33 |
-
//include_once 'ofc_bar_3d.php';
|
34 |
-
include_once 'ofc_hbar.php';
|
35 |
-
include_once 'ofc_line_base.php';
|
36 |
-
include_once 'ofc_line.php';
|
37 |
-
//include_once 'ofc_line_dot.php';
|
38 |
-
//include_once 'ofc_line_hollow.php';
|
39 |
-
include_once 'ofc_candle.php';
|
40 |
-
include_once 'ofc_area_base.php';
|
41 |
-
include_once 'ofc_tags.php';
|
42 |
-
include_once 'ofc_arrow.php';
|
43 |
-
//include_once 'ofc_area_hollow.php';
|
44 |
-
//include_once 'ofc_area_line.php';
|
45 |
-
|
46 |
-
include_once 'ofc_x_legend.php';
|
47 |
-
include_once 'ofc_y_legend.php';
|
48 |
-
include_once 'ofc_bar_sketch.php';
|
49 |
-
include_once 'ofc_scatter.php';
|
50 |
-
include_once 'ofc_scatter_line.php';
|
51 |
-
include_once 'ofc_x_axis_labels.php';
|
52 |
-
include_once 'ofc_x_axis_label.php';
|
53 |
-
include_once 'ofc_tooltip.php';
|
54 |
-
include_once 'ofc_shape.php';
|
55 |
-
include_once 'ofc_radar_axis.php';
|
56 |
-
include_once 'ofc_radar_axis_labels.php';
|
57 |
-
include_once 'ofc_radar_spoke_labels.php';
|
58 |
-
include_once 'ofc_line_style.php';
|
59 |
-
|
60 |
-
include_once 'dot_base.php';
|
61 |
-
include_once 'ofc_menu.php';
|
62 |
-
|
63 |
-
class open_flash_chart
|
64 |
-
{
|
65 |
-
function open_flash_chart()
|
66 |
-
{
|
67 |
-
//$this->title = new title( "Many data lines" );
|
68 |
-
$this->elements = array();
|
69 |
-
}
|
70 |
-
|
71 |
-
function set_title( $t )
|
72 |
-
{
|
73 |
-
$this->title = $t;
|
74 |
-
}
|
75 |
-
|
76 |
-
function set_x_axis( $x )
|
77 |
-
{
|
78 |
-
$this->x_axis = $x;
|
79 |
-
}
|
80 |
-
|
81 |
-
function set_y_axis( $y )
|
82 |
-
{
|
83 |
-
$this->y_axis = $y;
|
84 |
-
}
|
85 |
-
|
86 |
-
function add_y_axis( $y )
|
87 |
-
{
|
88 |
-
$this->y_axis = $y;
|
89 |
-
}
|
90 |
-
|
91 |
-
function set_y_axis_right( $y )
|
92 |
-
{
|
93 |
-
$this->y_axis_right = $y;
|
94 |
-
}
|
95 |
-
|
96 |
-
function add_element( $e )
|
97 |
-
{
|
98 |
-
$this->elements[] = $e;
|
99 |
-
}
|
100 |
-
|
101 |
-
function set_x_legend( $x )
|
102 |
-
{
|
103 |
-
$this->x_legend = $x;
|
104 |
-
}
|
105 |
-
|
106 |
-
function set_y_legend( $y )
|
107 |
-
{
|
108 |
-
$this->y_legend = $y;
|
109 |
-
}
|
110 |
-
|
111 |
-
function set_bg_colour( $colour )
|
112 |
-
{
|
113 |
-
$this->bg_colour = $colour;
|
114 |
-
}
|
115 |
-
|
116 |
-
function set_radar_axis( $radar )
|
117 |
-
{
|
118 |
-
$this->radar_axis = $radar;
|
119 |
-
}
|
120 |
-
|
121 |
-
function set_tooltip( $tooltip )
|
122 |
-
{
|
123 |
-
$this->tooltip = $tooltip;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* This is a bit funky :(
|
128 |
-
*
|
129 |
-
* @param $num_decimals as integer. Truncate the decimals to $num_decimals, e.g. set it
|
130 |
-
* to 5 and 3.333333333 will display as 3.33333. 2.0 will display as 2 (or 2.00000 - see below)
|
131 |
-
* @param $is_fixed_num_decimals_forced as boolean. If true it will pad the decimals.
|
132 |
-
* @param $is_decimal_separator_comma as boolean
|
133 |
-
* @param $is_thousand_separator_disabled as boolean
|
134 |
-
*
|
135 |
-
* This needs a bit of love and attention
|
136 |
-
*/
|
137 |
-
function set_number_format($num_decimals, $is_fixed_num_decimals_forced, $is_decimal_separator_comma, $is_thousand_separator_disabled )
|
138 |
-
{
|
139 |
-
$this->num_decimals = $num_decimals;
|
140 |
-
$this->is_fixed_num_decimals_forced = $is_fixed_num_decimals_forced;
|
141 |
-
$this->is_decimal_separator_comma = $is_decimal_separator_comma;
|
142 |
-
$this->is_thousand_separator_disabled = $is_thousand_separator_disabled;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* This is experimental and will change as we make it work
|
147 |
-
*
|
148 |
-
* @param $m as ofc_menu
|
149 |
-
*/
|
150 |
-
function set_menu($m)
|
151 |
-
{
|
152 |
-
$this->menu = $m;
|
153 |
-
}
|
154 |
-
|
155 |
-
function toString()
|
156 |
-
{
|
157 |
-
if (function_exists('json_encode'))
|
158 |
-
{
|
159 |
-
return json_encode($this);
|
160 |
-
}
|
161 |
-
else
|
162 |
-
{
|
163 |
-
$json = new Services_JSON();
|
164 |
-
return $json->encode( $this );
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
function toPrettyString()
|
169 |
-
{
|
170 |
-
return json_format( $this->toString() );
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
//
|
177 |
-
// there is no PHP end tag so we don't mess the headers up!
|
178 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/open-flash-chart.swf
DELETED
Binary file
|
js/swfobject.js
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
|
2 |
-
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
3 |
-
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
4 |
-
*/
|
5 |
-
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,28 +2,34 @@
|
|
2 |
Contributors: sswells
|
3 |
Donate link: http://blog.strategy11.com/donate
|
4 |
Tags: WPMU, form, builder, drag, drop, widget, sidebar, Post, posts, page, wordpress, plugin, template, contact, contact form, captcha, email, database, save, admin, akismet, AJAX, links, javascript, jquery, theme, spam, content, image, images, poll, survey, feedback
|
5 |
-
Requires at least: 2.
|
6 |
-
Tested up to: 2.9.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
-
Quickly and easily build forms with a simple drag-and-drop interface.
|
10 |
|
11 |
== Description ==
|
12 |
-
Quickly and easily build forms with a simple drag-and-drop interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
= Features =
|
15 |
-
* Integrates with
|
16 |
* Shortcode [formidable id=x] for use in pages, posts, or text widgets for WordPress version 2.8 and above.
|
17 |
* Alternatively use `<?php echo FrmEntriesController::show_form(2, $key = '', $title=true, $description=true); ?>` in your template
|
18 |
* Customize most HTML when editing the form (code for editing HTML when creating the form is soon to follow... and documentation too)
|
19 |
* Create forms from existing templates or add your own
|
20 |
-
* Direct links available with and without integration with your current theme
|
21 |
* Select an email address to send form responses under "Advanced Form Options"
|
22 |
* Input default data into form fields with the option to clear when clicked
|
23 |
* Saves responses to the database for future retrieval, reports, and display in [Formidable Pro](http://formidablepro.com/ "Formidable Pro")
|
24 |
* PHP ninjas can display data in templates using functions in FrmApiController. However, there is currently no documentation for these functions.
|
25 |
|
26 |
-
|
27 |
Feedback and requests are welcome.
|
28 |
|
29 |
== Installation ==
|
@@ -42,11 +48,51 @@ Feedback and requests are welcome.
|
|
42 |
[Formidable FAQs](http://blog.strategy11.com/formidable-faqs/ "Formidable FAQs")
|
43 |
|
44 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
= 1.0.12 =
|
46 |
* Validated HTML markup for front-end form
|
47 |
* Simplified the way a default template is created so it will also get updated with any changes
|
48 |
* Really fixed the after HTML field this time
|
49 |
* Changed option to email form to default to admin's email address instead of blank
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
= 1.0.11 =
|
52 |
* Added a selectable shortcode on the forms listing page
|
2 |
Contributors: sswells
|
3 |
Donate link: http://blog.strategy11.com/donate
|
4 |
Tags: WPMU, form, builder, drag, drop, widget, sidebar, Post, posts, page, wordpress, plugin, template, contact, contact form, captcha, email, database, save, admin, akismet, AJAX, links, javascript, jquery, theme, spam, content, image, images, poll, survey, feedback
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 2.9.2
|
7 |
+
Stable tag: 1.01.04
|
8 |
|
9 |
+
Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
|
10 |
|
11 |
== Description ==
|
12 |
+
Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
|
13 |
+
There are dozens of form-building plugins out there to create forms, but most are confusing and overly complicated. With Formidable, it is easy to create forms within a simple drag-and-drop interface. You can construct custom forms or generate them from a template. Shortcodes can be used as well as spam catching services.
|
14 |
+
|
15 |
+
= Upgrade to Formidable Pro =
|
16 |
+
|
17 |
+
Formidable Pro is an upgrade to Formidable with more form fields, flexibility, and power. Learn more at:
|
18 |
+
|
19 |
+
http://formidablepro.com
|
20 |
|
21 |
= Features =
|
22 |
+
* Integrates with WP reCAPTCHA and Akismet for Spam control
|
23 |
* Shortcode [formidable id=x] for use in pages, posts, or text widgets for WordPress version 2.8 and above.
|
24 |
* Alternatively use `<?php echo FrmEntriesController::show_form(2, $key = '', $title=true, $description=true); ?>` in your template
|
25 |
* Customize most HTML when editing the form (code for editing HTML when creating the form is soon to follow... and documentation too)
|
26 |
* Create forms from existing templates or add your own
|
27 |
+
* Direct links available for previews and emailing surveys with and without integration with your current theme. Make these links pretty with [Pretty Link](http://blog.strategy11.com/prettylink "Pretty Link") integration
|
28 |
* Select an email address to send form responses under "Advanced Form Options"
|
29 |
* Input default data into form fields with the option to clear when clicked
|
30 |
* Saves responses to the database for future retrieval, reports, and display in [Formidable Pro](http://formidablepro.com/ "Formidable Pro")
|
31 |
* PHP ninjas can display data in templates using functions in FrmApiController. However, there is currently no documentation for these functions.
|
32 |
|
|
|
33 |
Feedback and requests are welcome.
|
34 |
|
35 |
== Installation ==
|
48 |
[Formidable FAQs](http://blog.strategy11.com/formidable-faqs/ "Formidable FAQs")
|
49 |
|
50 |
== Changelog ==
|
51 |
+
= 1.01.04 =
|
52 |
+
* Updated in-place edit to work with more characters and function without the save buttons
|
53 |
+
* Fixed bug causing several form options to be lost when the form name or description was edited without also clicking update for the whole form
|
54 |
+
* Made more user interface modifications
|
55 |
+
* PRO: Added dynamic default values for GET/POST variables
|
56 |
+
* PRO: Added shortcode for fetching field-wide calculations `[frm-stats id=5 type=(count, total, average, or median)]`
|
57 |
+
* PRO: Added icon link to duplicate an individual field
|
58 |
+
* PRO: Increased the WPMU efficiency so the templates are only updated if the database version is changed
|
59 |
+
* PRO: Added functionality to the 'Data From Entries' field to use another observed 'Data From Entries' field to join a third form
|
60 |
+
* PRO: Fixed admin entry searches to start on first page of results if search was submitted from a higher page
|
61 |
+
|
62 |
+
= 1.01.03 =
|
63 |
+
* Fixed bug preventing field options from showing on a newly-added field
|
64 |
+
* PRO: Added option to activate Pro sitewide for WPMU
|
65 |
+
* PRO: Added option to copy forms and entry displays to other blogs in WPMU
|
66 |
+
* PRO: Fixed checkbox bug when editing an entry
|
67 |
+
|
68 |
+
= 1.01.02 =
|
69 |
+
* Updated the form builder page with a little more simplicity and less clutter
|
70 |
+
* PRO: Added a warning message if Pro is not activated
|
71 |
+
|
72 |
+
= 1.01.01 =
|
73 |
+
* Fixed bug preventing stylesheet override on individual forms
|
74 |
+
* PRO: Backed out pretty permalinks
|
75 |
+
* PRO: Fixed bug duplicating displayed data
|
76 |
+
|
77 |
+
= 1.01.0 =
|
78 |
+
* Added checkboxes to optionally include default stylesheet
|
79 |
+
* Completely validated HTML this time (hopefully)
|
80 |
+
* PRO: Added a FREAKING AWESOME form styling editor
|
81 |
+
* PRO: Made the link to view entries pretty if default permalinks are not in use
|
82 |
+
* PRO: Fixed bug preventing external shortcodes from getting replaced when custom displayed data is not inserted automatically
|
83 |
+
* PRO: Added shortcode for front-end search
|
84 |
+
|
85 |
= 1.0.12 =
|
86 |
* Validated HTML markup for front-end form
|
87 |
* Simplified the way a default template is created so it will also get updated with any changes
|
88 |
* Really fixed the after HTML field this time
|
89 |
* Changed option to email form to default to admin's email address instead of blank
|
90 |
+
* PRO: Ability to switch from one field type to another
|
91 |
+
* PRO: Finished the 'Data from Entries' field
|
92 |
+
* PRO: Added the first overall report (daily submissions)
|
93 |
+
* PRO: Added two new form templates (more to come of course)
|
94 |
+
* PRO: Editable Submit button and Success message for editing entries
|
95 |
+
* PRO: Added option to sort by most fields when creating/editing the custom display settings
|
96 |
|
97 |
= 1.0.11 =
|
98 |
* Added a selectable shortcode on the forms listing page
|