Completed
Push — master ( 958e8c...19bf32 )
by Kevin
22:25 queued 11:01
created
modules/contrib/privatemsg/privatemsg_filter/privatemsg_filter.admin.inc 4 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -9,39 +9,39 @@  discard block
 block discarded – undo
9 9
  * Display a list of tags to administer them.
10 10
  */
11 11
 function privatemsg_tags_admin() {
12
-  drupal_set_title(t('Tags'));
12
+    drupal_set_title(t('Tags'));
13 13
 
14
-  $header = array(
14
+    $header = array(
15 15
     'tag' => array(
16
-      'data'    => t('Tag'),
17
-      'field'   => 'tag',
18
-      'class'   => 'privatemsg-filter-header-tag',
19
-      'sort'    => 'asc',
20
-      '#weight' => -40,
16
+        'data'    => t('Tag'),
17
+        'field'   => 'tag',
18
+        'class'   => 'privatemsg-filter-header-tag',
19
+        'sort'    => 'asc',
20
+        '#weight' => -40,
21 21
     ),
22 22
     'usage' => array(
23
-      'data'    => t('Usage'),
24
-      'field'   => 'count',
25
-      'class'   => 'privatemsg-filter-header-usage',
26
-      '#weight' => -30,
23
+        'data'    => t('Usage'),
24
+        'field'   => 'count',
25
+        'class'   => 'privatemsg-filter-header-usage',
26
+        '#weight' => -30,
27 27
     ),
28 28
     'public' => array(
29
-      'data'    => t('Public'),
30
-      'field'   => 'public',
31
-      'class'   => 'privatemsg-filter-header-public',
32
-      '#weight' => -20,
29
+        'data'    => t('Public'),
30
+        'field'   => 'public',
31
+        'class'   => 'privatemsg-filter-header-public',
32
+        '#weight' => -20,
33 33
     ),
34 34
     'operations' => array(
35
-      'data'    => t('Operations'),
36
-      'class'   => 'privatemsg-filter-header-operations',
37
-      '#weight' => -10,
35
+        'data'    => t('Operations'),
36
+        'class'   => 'privatemsg-filter-header-operations',
37
+        '#weight' => -10,
38 38
     ),
39
-  );
40
-  $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'));
41
-  $result = pager_query($query['query'] . tablesort_sql($header), 100);
39
+    );
40
+    $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'));
41
+    $result = pager_query($query['query'] . tablesort_sql($header), 100);
42 42
 
43
-  $rows = array();
44
-  while ($tag = db_fetch_array($result)) {
43
+    $rows = array();
44
+    while ($tag = db_fetch_array($result)) {
45 45
     $row = array();
46 46
     $row['tag'] = check_plain($tag['tag']);
47 47
     $row['count'] = $tag['count'];
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
     $row['operations'] .= ' ' . l(t('delete'), 'admin/settings/messages/tags/delete/' . $tag['tag_id']);
51 51
 
52 52
     $rows[] = $row;
53
-  }
53
+    }
54 54
 
55
-  if (empty($rows)) {
55
+    if (empty($rows)) {
56 56
     // Display a message if now tags are available.
57 57
     $rows[] = array(array('data' => t('No tags available.'), 'colspan' => count($header)));
58
-  }
58
+    }
59 59
 
60
-  return theme('table', $header, $rows) . theme('pager');
60
+    return theme('table', $header, $rows) . theme('pager');
61 61
 }
62 62
 
63 63
 /**
@@ -70,36 +70,36 @@  discard block
 block discarded – undo
70 70
  *   new tag form.
71 71
  */
72 72
 function privatemsg_tags_form(&$form_state, $tag_id = NULL) {
73
-  $form = array();
73
+    $form = array();
74 74
 
75
-  if ($tag_id) {
75
+    if ($tag_id) {
76 76
     $tag = db_fetch_array(db_query('SELECT * from {pm_tags} pmt WHERE pmt.tag_id = %d', $tag_id));
77 77
     $form['tag_id'] = array(
78
-      '#value' => $tag_id,
79
-      '#type' => 'value',
78
+        '#value' => $tag_id,
79
+        '#type' => 'value',
80 80
     );
81 81
     drupal_set_title(t('Edit @tag', array('@tag' => $tag['tag'])));
82
-  }
82
+    }
83 83
 
84
-  $form['tag'] = array(
84
+    $form['tag'] = array(
85 85
     '#title' => t('Name'),
86 86
     '#type' => 'textfield',
87 87
     '#default_value' => empty($tag_id) ? NULL : $tag['tag'],
88
-  );
88
+    );
89 89
 
90
-  $form['public'] = array(
90
+    $form['public'] = array(
91 91
     '#title' => t('Public'),
92 92
     '#type' => 'checkbox',
93 93
     '#default_value' => empty($tag_id) ? TRUE : $tag['public'],
94 94
     '#description' => t('Public tags are visible for all users, private tags are only visible if they use them.'),
95
-  );
95
+    );
96 96
 
97
-  $form['submit'] = array(
97
+    $form['submit'] = array(
98 98
     '#value' => empty($tag_id) ? t('Create tag') : t('Save tag'),
99 99
     '#type'  => 'submit',
100
-  );
100
+    );
101 101
 
102
-  return $form;
102
+    return $form;
103 103
 }
104 104
 
105 105
 /**
@@ -108,34 +108,34 @@  discard block
 block discarded – undo
108 108
  * Make sure that a tag name is unique.
109 109
  */
110 110
 function privatemsg_tags_form_validate($form, &$form_state) {
111
-  $tag_id = isset($form_state['values']['tag_id']) ? $form_state['values']['tag_id'] : 0;
112
-  if ($tag_id) {
111
+    $tag_id = isset($form_state['values']['tag_id']) ? $form_state['values']['tag_id'] : 0;
112
+    if ($tag_id) {
113 113
     // We are editing an existing tag, exclude the current tag from the search.
114 114
     $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s' AND tag_id <> %d", $form_state['values']['tag'], $tag_id));
115
-  }
116
-  else {
115
+    }
116
+    else {
117 117
     $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s'", $form_state['values']['tag']));
118
-  }
119
-  if ($exists) {
118
+    }
119
+    if ($exists) {
120 120
     form_set_error('tag', t('Tag already exists, choose a different name.'));
121
-  }
121
+    }
122 122
 }
123 123
 
124 124
 /**
125 125
  * Form submit handler for add/edit forms.
126 126
  */
127 127
 function privatemsg_tags_form_submit($form, &$form_state) {
128
-  if (!empty($form_state['values']['tag_id'])) {
128
+    if (!empty($form_state['values']['tag_id'])) {
129 129
     // Tag already exists, update the existing tag.
130 130
     db_query("UPDATE {pm_tags} SET tag = '%s', public = %d WHERE tag_id = %d", $form_state['values']['tag'], $form_state['values']['public'], $form_state['values']['tag_id']);
131 131
     drupal_set_message(t('Tag updated.'));
132 132
     $form_state['redirect'] = 'admin/settings/messages/tags';
133
-  }
134
-  else {
133
+    }
134
+    else {
135 135
     // Tag does not yet exist, create a new one.
136 136
     db_query("INSERT INTO {pm_tags} (tag, public) VALUES ('%s', %d)", $form_state['values']['tag'], $form_state['values']['public']);
137 137
     drupal_set_message(t('Tag created.'));
138
-  }
138
+    }
139 139
 }
140 140
 
141 141
 /**
@@ -145,28 +145,28 @@  discard block
 block discarded – undo
145 145
  *   Id of the tag that should be deleted.
146 146
  */
147 147
 function privatemsg_filter_tags_delete(&$form_state, $tag_id) {
148
-  $form['tag_id'] = array(
148
+    $form['tag_id'] = array(
149 149
     '#type' => 'value',
150 150
     '#value' => $tag_id,
151
-  );
152
-  return confirm_form($form,
151
+    );
152
+    return confirm_form($form,
153 153
     t('Are you sure you want to delete?'),
154 154
     isset($_GET['destination']) ? $_GET['destination'] : 'admin/settings/messages/tags',
155 155
     t('This action cannot be undone.'),
156 156
     t('Delete'),
157 157
     t('Cancel')
158
-  );
158
+    );
159 159
 }
160 160
 
161 161
 /**
162 162
  * Submit handler for the confirm delete form.
163 163
  */
164 164
 function privatemsg_filter_tags_delete_submit($form, &$form_state) {
165
-  if ($form_state['values']['confirm']) {
165
+    if ($form_state['values']['confirm']) {
166 166
     db_query('DELETE FROM {pm_tags} WHERE tag_id = %d', $form_state['values']['tag_id']);
167 167
     db_query('DELETE FROM {pm_tags_index} WHERE tag_id = %d', $form_state['values']['tag_id']);
168 168
 
169 169
     drupal_set_message(t('Tag has been deleted'));
170
-  }
171
-  $form_state['redirect'] = 'admin/settings/messages/tags';
170
+    }
171
+    $form_state['redirect'] = 'admin/settings/messages/tags';
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     ),
39 39
   );
40 40
   $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'));
41
-  $result = pager_query($query['query'] . tablesort_sql($header), 100);
41
+  $result = pager_query($query['query'].tablesort_sql($header), 100);
42 42
 
43 43
   $rows = array();
44 44
   while ($tag = db_fetch_array($result)) {
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     $row['tag'] = check_plain($tag['tag']);
47 47
     $row['count'] = $tag['count'];
48 48
     $row['public'] = $tag['public'] ? t('Yes') : '-';
49
-    $row['operations'] = l(t('edit'), 'admin/settings/messages/tags/edit/' . $tag['tag_id']);
50
-    $row['operations'] .= ' ' . l(t('delete'), 'admin/settings/messages/tags/delete/' . $tag['tag_id']);
49
+    $row['operations'] = l(t('edit'), 'admin/settings/messages/tags/edit/'.$tag['tag_id']);
50
+    $row['operations'] .= ' '.l(t('delete'), 'admin/settings/messages/tags/delete/'.$tag['tag_id']);
51 51
 
52 52
     $rows[] = $row;
53 53
   }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     $rows[] = array(array('data' => t('No tags available.'), 'colspan' => count($header)));
58 58
   }
59 59
 
60
-  return theme('table', $header, $rows) . theme('pager');
60
+  return theme('table', $header, $rows).theme('pager');
61 61
 }
62 62
 
63 63
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,8 +112,7 @@  discard block
 block discarded – undo
112 112
   if ($tag_id) {
113 113
     // We are editing an existing tag, exclude the current tag from the search.
114 114
     $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s' AND tag_id <> %d", $form_state['values']['tag'], $tag_id));
115
-  }
116
-  else {
115
+  } else {
117 116
     $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s'", $form_state['values']['tag']));
118 117
   }
119 118
   if ($exists) {
@@ -130,8 +129,7 @@  discard block
 block discarded – undo
130 129
     db_query("UPDATE {pm_tags} SET tag = '%s', public = %d WHERE tag_id = %d", $form_state['values']['tag'], $form_state['values']['public'], $form_state['values']['tag_id']);
131 130
     drupal_set_message(t('Tag updated.'));
132 131
     $form_state['redirect'] = 'admin/settings/messages/tags';
133
-  }
134
-  else {
132
+  } else {
135 133
     // Tag does not yet exist, create a new one.
136 134
     db_query("INSERT INTO {pm_tags} (tag, public) VALUES ('%s', %d)", $form_state['values']['tag'], $form_state['values']['public']);
137 135
     drupal_set_message(t('Tag created.'));
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  *   Tag Id if an edit form should be displayed, NULL for a create
70 70
  *   new tag form.
71 71
  */
72
-function privatemsg_tags_form(&$form_state, $tag_id = NULL) {
72
+function privatemsg_tags_form(&$form_state, $tag_id = null) {
73 73
   $form = array();
74 74
 
75 75
   if ($tag_id) {
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
   $form['tag'] = array(
85 85
     '#title' => t('Name'),
86 86
     '#type' => 'textfield',
87
-    '#default_value' => empty($tag_id) ? NULL : $tag['tag'],
87
+    '#default_value' => empty($tag_id) ? null : $tag['tag'],
88 88
   );
89 89
 
90 90
   $form['public'] = array(
91 91
     '#title' => t('Public'),
92 92
     '#type' => 'checkbox',
93
-    '#default_value' => empty($tag_id) ? TRUE : $tag['public'],
93
+    '#default_value' => empty($tag_id) ? true : $tag['public'],
94 94
     '#description' => t('Public tags are visible for all users, private tags are only visible if they use them.'),
95 95
   );
96 96
 
Please login to merge, or discard this patch.
boinc/modules/contrib/privatemsg/privatemsg_filter/privatemsg_filter.module 5 patches
Indentation   +314 added lines, -314 removed lines patch added patch discarded remove patch
@@ -9,34 +9,34 @@  discard block
 block discarded – undo
9 9
  * Implements hook_perm().
10 10
  */
11 11
 function privatemsg_filter_perm() {
12
-  return array(
12
+    return array(
13 13
     'filter private messages',
14 14
     'tag private messages',
15 15
     'create private message tags',
16
-  );
16
+    );
17 17
 }
18 18
 
19 19
 /**
20 20
  * Implements hook_menu().
21 21
  */
22 22
 function privatemsg_filter_menu() {
23
-  $items['admin/settings/messages/filter'] = array(
23
+    $items['admin/settings/messages/filter'] = array(
24 24
     'title'            => 'Filter',
25 25
     'description'      => 'Configure filter settings.',
26 26
     'page callback'    => 'drupal_get_form',
27 27
     'page arguments'   => array('privatemsg_filter_admin'),
28 28
     'access arguments' => array('administer privatemsg settings'),
29 29
     'type'             => MENU_LOCAL_TASK,
30
-  );
31
-  $items['admin/settings/messages/tags'] = array(
30
+    );
31
+    $items['admin/settings/messages/tags'] = array(
32 32
     'title'            => 'Tags',
33 33
     'description'      => 'Configure tags.',
34 34
     'page callback'    => 'privatemsg_tags_admin',
35 35
     'access arguments' => array('administer privatemsg settings'),
36 36
     'type'             => MENU_LOCAL_TASK,
37 37
     'file'             => 'privatemsg_filter.admin.inc',
38
-  );
39
-  $items['admin/settings/messages/tags/list'] = array(
38
+    );
39
+    $items['admin/settings/messages/tags/list'] = array(
40 40
     'title'            => 'List',
41 41
     'description'      => 'Configure tags.',
42 42
     'page callback'    => 'privatemsg_tags_admin',
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
     'type'             => MENU_DEFAULT_LOCAL_TASK,
45 45
     'file'             => 'privatemsg_filter.admin.inc',
46 46
     'weight'           => -10,
47
-  );
48
-  $items['admin/settings/messages/tags/add'] = array(
47
+    );
48
+    $items['admin/settings/messages/tags/add'] = array(
49 49
     'title'            => 'Add',
50 50
     'description'      => 'Configure tags.',
51 51
     'page callback'    => 'drupal_get_form',
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
     'access arguments' => array('administer privatemsg settings'),
54 54
     'type'             => MENU_LOCAL_TASK,
55 55
     'file'             => 'privatemsg_filter.admin.inc',
56
-  );
57
-  $items['admin/settings/messages/tags/edit/%'] = array(
56
+    );
57
+    $items['admin/settings/messages/tags/edit/%'] = array(
58 58
     'title'            => 'Add',
59 59
     'description'      => 'Configure tags.',
60 60
     'page callback'    => 'drupal_get_form',
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
     'access arguments' => array('administer privatemsg settings'),
63 63
     'type'             => MENU_CALLBACK,
64 64
     'file'             => 'privatemsg_filter.admin.inc',
65
-  );
66
-  $items['admin/settings/messages/tags/delete/%'] = array(
65
+    );
66
+    $items['admin/settings/messages/tags/delete/%'] = array(
67 67
     'title'            => 'Add',
68 68
     'description'      => 'Configure tags.',
69 69
     'page callback'    => 'drupal_get_form',
@@ -71,62 +71,62 @@  discard block
 block discarded – undo
71 71
     'access arguments' => array('administer privatemsg settings'),
72 72
     'type'             => MENU_CALLBACK,
73 73
     'file'             => 'privatemsg_filter.admin.inc',
74
-  );
75
-  $items['messages/inbox'] = array(
74
+    );
75
+    $items['messages/inbox'] = array(
76 76
     'title'            => 'Inbox',
77 77
     'page callback'    => 'drupal_get_form',
78 78
     'page arguments'   => array('privatemsg_list', 'inbox'),
79 79
     'access callback'  => 'privatemsg_user_access',
80 80
     'type'             => variable_get('privatemsg_filter_default_list', 0) ? MENU_LOCAL_TASK : MENU_DEFAULT_LOCAL_TASK,
81 81
     'weight'           => -15,
82
-  );
83
-  $items['messages/sent'] = array(
82
+    );
83
+    $items['messages/sent'] = array(
84 84
     'title'            => 'Sent messages',
85 85
     'page callback'    => 'drupal_get_form',
86 86
     'page arguments'   => array('privatemsg_list', 'sent'),
87 87
     'access callback'  => 'privatemsg_user_access',
88 88
     'type'             => MENU_LOCAL_TASK,
89 89
     'weight'           => -12,
90
-  );
91
-  $items['messages/filter/user-name-autocomplete'] = array(
90
+    );
91
+    $items['messages/filter/user-name-autocomplete'] = array(
92 92
     'page callback'    => 'privatemsg_user_name_autocomplete',
93 93
     'access callback'  => 'privatemsg_user_access',
94 94
     'access arguments' => array('write privatemsg'),
95 95
     'type'             => MENU_CALLBACK,
96
-  );
97
-  $items['messages/filter/tag-autocomplete'] = array(
96
+    );
97
+    $items['messages/filter/tag-autocomplete'] = array(
98 98
     'page callback'    => 'privatemsg_filter_tags_autocomplete',
99 99
     'access callback'  => 'privatemsg_user_access',
100 100
     'access arguments' => array('tag private messages'),
101 101
     'type'             => MENU_CALLBACK,
102 102
     'weight'           => -10,
103
-  );
104
-  return $items;
103
+    );
104
+    return $items;
105 105
 }
106 106
 
107 107
 /**
108 108
  * Implements hook_menu_alter().
109 109
  */
110 110
 function privatemsg_filter_menu_alter(&$items) {
111
-  // Rename messages to "All messages".
112
-  $items['messages/list']['title'] = 'All messages';
111
+    // Rename messages to "All messages".
112
+    $items['messages/list']['title'] = 'All messages';
113 113
 
114
-  if (variable_get('privatemsg_filter_default_list', 0) == 0) {
114
+    if (variable_get('privatemsg_filter_default_list', 0) == 0) {
115 115
     // Change default argument of /messages to inbox. and set the task to MENU_LOCAL_TASK.
116 116
     $items['messages']['page arguments'] = array('privatemsg_list', 'inbox');
117 117
     $items['messages/list']['type'] = MENU_LOCAL_TASK;
118
-  }
118
+    }
119 119
 }
120 120
 
121 121
 function privatemsg_filter_admin() {
122
-  $form = array();
122
+    $form = array();
123 123
 
124
-  $form['privatemsg_filter_searchbody'] = array(
124
+    $form['privatemsg_filter_searchbody'] = array(
125 125
     '#type'          => 'checkbox',
126 126
     '#title'         => t('Search message body'),
127 127
     '#description'   => t('WARNING: turning on this feature will slow down search performance by a large factor. Gets worse as your messages database increases.'),
128 128
     '#default_value' => variable_get('privatemsg_filter_searchbody', FALSE),
129
-  );
129
+    );
130 130
 
131 131
     $form['privatemsg_filter_tagfield_weight'] = array(
132 132
     '#type'          => 'textfield',
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
     '#description'   => t('Use higher values to push the form lower down the page, lower or negative values to raise it higher.'),
135 135
     '#size'          => 4,
136 136
     '#default_value' => variable_get('privatemsg_filter_tagfield_weight', 10),
137
-  );
137
+    );
138 138
 
139
-  return system_settings_form($form);
139
+    return system_settings_form($form);
140 140
 }
141 141
 
142 142
 /**
@@ -145,26 +145,26 @@  discard block
 block discarded – undo
145 145
  * Add a filter widget to the message listing pages.
146 146
  */
147 147
 function privatemsg_filter_form_private_message_settings_alter(&$form, $form_state) {
148
-  $form['privatemsg_listing']['privatemsg_filter_default_list'] = array(
148
+    $form['privatemsg_listing']['privatemsg_filter_default_list'] = array(
149 149
     '#type' => 'radios',
150 150
     '#default_value' => variable_get('privatemsg_filter_default_list', 0),
151 151
     '#options' => array(t('Inbox'), t('All messages')),
152 152
     '#title' => t('Choose the default list option'),
153 153
     '#description' => t('Choose which of the two lists are shown by default when following the messages link.'),
154
-  );
155
-  // Add tags to the list of possible columns.
156
-  $form['privatemsg_listing']['privatemsg_display_fields']['#options']['tags'] = t('Tags');
154
+    );
155
+    // Add tags to the list of possible columns.
156
+    $form['privatemsg_listing']['privatemsg_display_fields']['#options']['tags'] = t('Tags');
157 157
 
158
-  $form['#submit'][] = 'privatemsg_filter_settings_submit';
158
+    $form['#submit'][] = 'privatemsg_filter_settings_submit';
159 159
 }
160 160
 
161 161
 /**
162 162
  * Rebuilding the menu if necessary.
163 163
  */
164 164
 function privatemsg_filter_settings_submit($form, &$form_state) {
165
-  if ($form['privatemsg_listing']['privatemsg_filter_default_list']['#default_value'] != $form_state['values']['privatemsg_filter_default_list']) {
165
+    if ($form['privatemsg_listing']['privatemsg_filter_default_list']['#default_value'] != $form_state['values']['privatemsg_filter_default_list']) {
166 166
     menu_rebuild();
167
-  }
167
+    }
168 168
 }
169 169
 
170 170
 /**
@@ -174,33 +174,33 @@  discard block
 block discarded – undo
174 174
  *   A single tag or an array of tags.
175 175
  */
176 176
 function privatemsg_filter_create_tags($tags) {
177
-  if (!is_array($tags)) {
177
+    if (!is_array($tags)) {
178 178
     $tags = array($tags);
179
-  }
179
+    }
180 180
 
181
-  $tag_ids = array();
181
+    $tag_ids = array();
182 182
 
183
-  foreach ($tags as $tag) {
183
+    foreach ($tags as $tag) {
184 184
     $tag = trim($tag);
185 185
     if (empty($tag)) {
186
-      // Do not save a blank tag.
187
-      continue;
186
+        // Do not save a blank tag.
187
+        continue;
188 188
     }
189 189
 
190 190
     // Check if the tag already exists and only create the tag if it does not.
191 191
     $tag_id = db_result(db_query("SELECT tag_id FROM {pm_tags} WHERE tag = '%s'", $tag));
192 192
     if (empty($tag_id) && privatemsg_user_access('create private message tags')) {
193
-      db_query("INSERT INTO {pm_tags} (tag) VALUES ('%s')", $tag);
194
-      $tag_id = db_last_insert_id('pm_tags', 'tag_id');
193
+        db_query("INSERT INTO {pm_tags} (tag) VALUES ('%s')", $tag);
194
+        $tag_id = db_last_insert_id('pm_tags', 'tag_id');
195 195
     }
196 196
     elseif (empty($tag_id)) {
197
-      // The user does not have permission to create new tags - disregard this tag and move onto the next.
198
-      drupal_set_message(t('Tag %tag was ignored because you do not have permission to create new tags.', array('%tag' => $tag)));
199
-      continue;
197
+        // The user does not have permission to create new tags - disregard this tag and move onto the next.
198
+        drupal_set_message(t('Tag %tag was ignored because you do not have permission to create new tags.', array('%tag' => $tag)));
199
+        continue;
200 200
     }
201 201
     $tag_ids[] = $tag_id;
202
-  }
203
-  return $tag_ids;
202
+    }
203
+    return $tag_ids;
204 204
 }
205 205
 
206 206
 /**
@@ -212,21 +212,21 @@  discard block
 block discarded – undo
212 212
  *   Id of the tag.
213 213
  */
214 214
 function privatemsg_filter_add_tags($threads, $tag_id, $account = NULL) {
215
-  if (!is_array($threads)) {
215
+    if (!is_array($threads)) {
216 216
     $threads = array($threads);
217
-  }
218
-  if (empty($account)) {
217
+    }
218
+    if (empty($account)) {
219 219
     global $user;
220 220
     $account = drupal_clone($user);
221
-  }
221
+    }
222 222
 
223
-  foreach ($threads as $thread) {
223
+    foreach ($threads as $thread) {
224 224
     // Make sure that we don't add a tag to a thread twice,
225 225
     // only insert if there is no such tag yet.
226 226
     if (db_result(db_query('SELECT COUNT(*) FROM {pm_tags_index} WHERE tag_id = %d AND (uid = %d AND thread_id = %d)', $tag_id, $account->uid, $thread)) == 0) {
227
-      db_query('INSERT INTO {pm_tags_index} (tag_id, uid, thread_id) VALUES (%d, %d, %d)', $tag_id, $account->uid, $thread);
227
+        db_query('INSERT INTO {pm_tags_index} (tag_id, uid, thread_id) VALUES (%d, %d, %d)', $tag_id, $account->uid, $thread);
228
+    }
228 229
     }
229
-  }
230 230
 }
231 231
 
232 232
 /**
@@ -238,238 +238,238 @@  discard block
 block discarded – undo
238 238
  *   Id of the tag - set to NULL to remove all tags.
239 239
  */
240 240
 function privatemsg_filter_remove_tags($threads, $tag_id = NULL, $account = NULL) {
241
-  if (!is_array($threads)) {
241
+    if (!is_array($threads)) {
242 242
     $threads = array($threads);
243
-  }
244
-  if (empty($account)) {
243
+    }
244
+    if (empty($account)) {
245 245
     global $user;
246 246
     $account = drupal_clone($user);
247
-  }
247
+    }
248 248
 
249
-  if (is_null($tag_id)) {
249
+    if (is_null($tag_id)) {
250 250
     // Delete all tag mapping.
251 251
     foreach ($threads as $thread) {
252
-      db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d', $account->uid, $thread);
252
+        db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d', $account->uid, $thread);
253
+    }
253 254
     }
254
-  }
255
-  else {
255
+    else {
256 256
     // Delete tag mapping for the specified tag.
257 257
     foreach ($threads as $thread) {
258
-      db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d AND tag_id = %d', $account->uid, $thread, $tag_id);
258
+        db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d AND tag_id = %d', $account->uid, $thread, $tag_id);
259
+    }
259 260
     }
260
-  }
261 261
 }
262 262
 
263 263
 function privatemsg_filter_get_filter($account) {
264
-  $filter = array();
265
-  if (isset($_GET['tags'])) {
264
+    $filter = array();
265
+    if (isset($_GET['tags'])) {
266 266
     $_GET['tags'] = urldecode($_GET['tags']);
267 267
     $tag_data = privatemsg_filter_get_tags_data($account);
268 268
     foreach (explode(',', $_GET['tags']) as $tag) {
269
-      if (isset($tag_data[$tag])) {
269
+        if (isset($tag_data[$tag])) {
270 270
         $filter['tags'][$tag] = $tag;
271
-      }
272
-      elseif (in_array($tag, $tag_data)) {
271
+        }
272
+        elseif (in_array($tag, $tag_data)) {
273 273
         $filter['tags'][array_search($tag, $tag_data)] = array_search($tag, $tag_data);
274
-      }
274
+        }
275
+    }
275 276
     }
276
-  }
277 277
 
278
-  if (isset($_GET['author'])) {
278
+    if (isset($_GET['author'])) {
279 279
     list($filter['author']) = _privatemsg_parse_userstring($_GET['author']);
280
-  }
280
+    }
281 281
 
282
-  if (isset($_GET['search'])) {
282
+    if (isset($_GET['search'])) {
283 283
     $filter['search'] = $_GET['search'];
284
-  }
284
+    }
285 285
 
286
-  if (!empty($filter)) {
286
+    if (!empty($filter)) {
287 287
     return $filter;
288
-  }
288
+    }
289 289
 
290
-  if (!empty($_SESSION['privatemsg_filter'])) {
290
+    if (!empty($_SESSION['privatemsg_filter'])) {
291 291
     return $_SESSION['privatemsg_filter'];
292
-  }
292
+    }
293 293
 
294 294
 }
295 295
 
296 296
 function privatemsg_filter_get_tags_data($account) {
297
-  static $tag_data;
297
+    static $tag_data;
298 298
 
299
-  if (is_array($tag_data)) {
299
+    if (is_array($tag_data)) {
300 300
     return $tag_data;
301
-  }
301
+    }
302 302
 
303
-  // Only show the tags that a user have used.
304
-  $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'), $account);
305
-  $results = db_query($query['query']);
303
+    // Only show the tags that a user have used.
304
+    $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'), $account);
305
+    $results = db_query($query['query']);
306 306
 
307
-  $tag_data = array();
308
-  while ($result = db_fetch_object($results)) {
307
+    $tag_data = array();
308
+    while ($result = db_fetch_object($results)) {
309 309
     $tag_data[$result->tag_id] = $result->tag;
310
-  }
311
-  return $tag_data;
310
+    }
311
+    return $tag_data;
312 312
 }
313 313
 
314 314
 function privatemsg_filter_dropdown(&$form_state, $account) {
315 315
 
316
-  drupal_add_css(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg_filter.css');
316
+    drupal_add_css(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg_filter.css');
317 317
 
318
-  $form['filter'] = array(
318
+    $form['filter'] = array(
319 319
     '#type' => 'fieldset',
320 320
     '#title' => t('Filter messages'),
321 321
     '#collapsible' => TRUE,
322 322
     '#collapsed' => TRUE,
323
-  );
324
-  $form['filter']['search'] = array(
323
+    );
324
+    $form['filter']['search'] = array(
325 325
     '#type' => 'textfield',
326 326
     '#title' => variable_get('privatemsg_filter_searchbody', FALSE) ? t('Search messages') : t('Search subjects'),
327 327
     '#weight' => -20
328
-  );
328
+    );
329 329
 
330
-  $form['filter']['author'] = array(
330
+    $form['filter']['author'] = array(
331 331
     '#type'               => 'textfield',
332 332
     '#title'              => t('Participants'),
333 333
     '#description'        => t('Separate multiple names with commas.'),
334 334
     '#weight'             => -5,
335 335
     '#size'               => 50,
336 336
     '#autocomplete_path'  => 'messages/filter/user-name-autocomplete',
337
-  );
337
+    );
338 338
 
339
-  // Only show form if the user has some messages tagged.
340
-  if (count($tag_data = privatemsg_filter_get_tags_data($account))) {
339
+    // Only show form if the user has some messages tagged.
340
+    if (count($tag_data = privatemsg_filter_get_tags_data($account))) {
341 341
     $form['filter']['tags'] = array(
342
-      '#type' => 'select',
343
-      '#title' => t('Tags'),
344
-      '#options' => $tag_data,
345
-      '#multiple' => TRUE,
346
-      '#size' => 5,
347
-      '#weight' => 0
348
-    );
349
-  }
342
+        '#type' => 'select',
343
+        '#title' => t('Tags'),
344
+        '#options' => $tag_data,
345
+        '#multiple' => TRUE,
346
+        '#size' => 5,
347
+        '#weight' => 0
348
+    );
349
+    }
350 350
     $form['filter']['submit'] = array(
351
-      '#type'     => 'submit',
352
-      '#value'    => t('Filter'),
353
-      '#prefix'   => '<div id="privatemsg-filter-buttons">',
354
-      '#weight'   => 10,
355
-      '#submit'   => array('privatemsg_filter_dropdown_submit'),
351
+        '#type'     => 'submit',
352
+        '#value'    => t('Filter'),
353
+        '#prefix'   => '<div id="privatemsg-filter-buttons">',
354
+        '#weight'   => 10,
355
+        '#submit'   => array('privatemsg_filter_dropdown_submit'),
356 356
     );
357 357
 
358 358
     $form['filter']['save'] = array(
359
-      '#type'     => 'submit',
360
-      '#value'    => t('Save filter'),
361
-      '#suffix'   => '</div>',
362
-      '#weight'   => 11,
363
-      '#submit'   => array('privatemsg_filter_dropdown_submit'),
359
+        '#type'     => 'submit',
360
+        '#value'    => t('Save filter'),
361
+        '#suffix'   => '</div>',
362
+        '#weight'   => 11,
363
+        '#submit'   => array('privatemsg_filter_dropdown_submit'),
364 364
     );
365 365
 
366 366
     if ($filter = privatemsg_filter_get_filter($account)) {
367
-      privatemsg_filter_dropdown_set_active($form, $filter);
367
+        privatemsg_filter_dropdown_set_active($form, $filter);
368 368
     }
369 369
 
370 370
     return $form;
371 371
 }
372 372
 
373 373
 function privatemsg_filter_dropdown_set_active(&$form, $filter) {
374
-  $form['filter']['#title'] = t('Filter messages (active)');
375
-  $form['filter']['#collapsed'] = FALSE;
374
+    $form['filter']['#title'] = t('Filter messages (active)');
375
+    $form['filter']['#collapsed'] = FALSE;
376 376
 
377
-  if (isset($filter['author'])) {
377
+    if (isset($filter['author'])) {
378 378
     $string = '';
379 379
     foreach ($filter['author'] as $author) {
380
-      $string .= $author->name . ', ';
380
+        $string .= $author->name . ', ';
381 381
     }
382 382
     $form['filter']['author']['#default_value'] = $string;
383
-  }
384
-  if (isset($filter['tags'])) {
383
+    }
384
+    if (isset($filter['tags'])) {
385 385
     $form['filter']['tags']['#default_value'] = $filter['tags'];
386
-  }
387
-  if (isset($filter['search'])) {
386
+    }
387
+    if (isset($filter['search'])) {
388 388
     $form['filter']['search']['#default_value'] = $filter['search'];
389
-  }
390
-
391
-  $form['filter']['reset'] = array(
392
-      '#type'     => 'submit',
393
-      '#value'    => t('Reset'),
394
-      '#suffix'   => '</div>',
395
-      '#weight'   => 12,
396
-      '#submit'   => array('privatemsg_filter_dropdown_submit'),
397
-  );
398
-  unset($form['filter']['save']['#suffix']);
389
+    }
390
+
391
+    $form['filter']['reset'] = array(
392
+        '#type'     => 'submit',
393
+        '#value'    => t('Reset'),
394
+        '#suffix'   => '</div>',
395
+        '#weight'   => 12,
396
+        '#submit'   => array('privatemsg_filter_dropdown_submit'),
397
+    );
398
+    unset($form['filter']['save']['#suffix']);
399 399
 }
400 400
 
401 401
 function privatemsg_filter_dropdown_submit($form, &$form_state) {
402 402
 
403
-  if (!empty($form_state['values']['author'])) {
403
+    if (!empty($form_state['values']['author'])) {
404 404
     list($form_state['values']['author']) = _privatemsg_parse_userstring($form_state['values']['author']);
405
-  }
405
+    }
406 406
 
407
-  switch ($form_state['values']['op']) {
407
+    switch ($form_state['values']['op']) {
408 408
     case t('Save filter'):
409 409
       $filter = array();
410
-      if (!empty($form_state['values']['tags'])) {
410
+        if (!empty($form_state['values']['tags'])) {
411 411
         $filter['tags'] = $form_state['values']['tags'];
412
-      }
413
-      if (!empty($form_state['values']['author'])) {
412
+        }
413
+        if (!empty($form_state['values']['author'])) {
414 414
         $filter['author'] = $form_state['values']['author'];
415
-      }
416
-      if (!empty($form_state['values']['search'])) {
415
+        }
416
+        if (!empty($form_state['values']['search'])) {
417 417
         $filter['search'] = $form_state['values']['search'];
418
-      }
419
-      $_SESSION['privatemsg_filter'] = $filter;
420
-      break;
418
+        }
419
+        $_SESSION['privatemsg_filter'] = $filter;
420
+        break;
421 421
     case t('Filter'):
422 422
       drupal_goto($_GET['q'], privatemsg_filter_create_get_query($form_state['values']));
423
-      return;
424
-      break;
423
+        return;
424
+        break;
425 425
     case t('Reset'):
426 426
       $_SESSION['privatemsg_filter'] = array();
427
-      break;
428
-  }
429
-  $form_state['redirect'] = $_GET['q'];
427
+        break;
428
+    }
429
+    $form_state['redirect'] = $_GET['q'];
430 430
 }
431 431
 
432 432
 function privatemsg_filter_create_get_query($filter) {
433
-  $query = array();
434
-  if (isset($filter['tags']) && !empty($filter['tags'])) {
433
+    $query = array();
434
+    if (isset($filter['tags']) && !empty($filter['tags'])) {
435 435
     $ids = array();
436 436
     foreach ($filter['tags'] as $tag) {
437
-      if ((int)$tag > 0) {
437
+        if ((int)$tag > 0) {
438 438
         $ids[] = $tag;
439
-      }
440
-      else {
439
+        }
440
+        else {
441 441
         $query['tags'][] = $tag;
442
-      }
442
+        }
443 443
     }
444 444
     $sql = 'SELECT pmt.tag FROM {pm_tags} pmt WHERE pmt.tag_id IN ('. implode(', ', $filter['tags']) .')';
445 445
     $result = db_query($sql);
446 446
     while ($row = db_fetch_object($result)) {
447
-      $query['tags'][] = $row->tag;
447
+        $query['tags'][] = $row->tag;
448 448
     }
449 449
 
450 450
     if (isset($query['tags'])) {
451
-      $query['tags'] = implode(',', $query['tags']);
451
+        $query['tags'] = implode(',', $query['tags']);
452
+    }
452 453
     }
453
-  }
454 454
 
455
-  if (isset($filter['author']) && !empty($filter['author'])) {
455
+    if (isset($filter['author']) && !empty($filter['author'])) {
456 456
     foreach ($filter['author'] as $author) {
457
-      if (is_object($author) && isset($author->uid) && isset($author->name)) {
457
+        if (is_object($author) && isset($author->uid) && isset($author->name)) {
458 458
         $query['author'][] = $author->name;
459
-      }
460
-      elseif ($author_obj = user_load($author)) {
459
+        }
460
+        elseif ($author_obj = user_load($author)) {
461 461
         $query['author'][] = $author_obj->name;
462
-      }
462
+        }
463 463
     }
464 464
     if (isset($query['author'])) {
465
-      $query['author'] = implode(',', $query['author']);
465
+        $query['author'] = implode(',', $query['author']);
466
+    }
466 467
     }
467
-  }
468 468
 
469
-  if (isset($filter['search']) && !empty($filter['search'])) {
469
+    if (isset($filter['search']) && !empty($filter['search'])) {
470 470
     $query['search'] = $filter['search'];
471
-  }
472
-  return $query;
471
+    }
472
+    return $query;
473 473
 }
474 474
 
475 475
 /**
@@ -478,14 +478,14 @@  discard block
 block discarded – undo
478 478
  * Adds a filter widget to the message listing pages.
479 479
  */
480 480
 function privatemsg_filter_form_privatemsg_list_alter(&$form, $form_state) {
481
-  global $user;
481
+    global $user;
482 482
 
483
-  if (privatemsg_user_access('filter private messages') && !empty($form['#data'])) {
483
+    if (privatemsg_user_access('filter private messages') && !empty($form['#data'])) {
484 484
     $form += privatemsg_filter_dropdown($form_state, $form['#account']);
485
-  }
485
+    }
486 486
 
487
-  $fields = array_filter(variable_get('privatemsg_display_fields', array('participants')));
488
-  if (in_array('tags', $fields)) {
487
+    $fields = array_filter(variable_get('privatemsg_display_fields', array('participants')));
488
+    if (in_array('tags', $fields)) {
489 489
     // Load thread id's of the current list.
490 490
     $threads = array_keys($form['#data']);
491 491
 
@@ -495,21 +495,21 @@  discard block
 block discarded – undo
495 495
     // Add them to #data
496 496
     $result = db_query($query['query']);
497 497
     while ($tag = db_fetch_array($result)) {
498
-      $form['#data'][$tag['thread_id']]['tags'][$tag['tag_id']] = $tag['tag'];
498
+        $form['#data'][$tag['thread_id']]['tags'][$tag['tag_id']] = $tag['tag'];
499
+    }
499 500
     }
500
-  }
501 501
 
502
-  $tags = privatemsg_filter_get_tags_data($user);
503
-  if (privatemsg_user_access('tag private messages') && !empty($tags) && !empty($form['#data'])) {
502
+    $tags = privatemsg_filter_get_tags_data($user);
503
+    if (privatemsg_user_access('tag private messages') && !empty($tags) && !empty($form['#data'])) {
504 504
     $options = array();
505 505
     $options[] = t('Apply tag...');
506 506
     foreach ($tags as $tag_id => $tag) {
507
-      $options[$tag_id] = $tag;
507
+        $options[$tag_id] = $tag;
508 508
     }
509 509
     $form['actions']['tag-add'] = array(
510
-      '#type'          => 'select',
511
-      '#options'       => $options,
512
-      '#default_value' => 0,
510
+        '#type'          => 'select',
511
+        '#options'       => $options,
512
+        '#default_value' => 0,
513 513
     );
514 514
     $form['actions']['tag-add-submit'] = array(
515 515
         '#prefix'     => '<div class="privatemsg-tag-add-submit">',
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
     );
522 522
     $options[0] = t('Remove Tag...');
523 523
     $form['actions']['tag-remove'] = array(
524
-      '#type'          => 'select',
525
-      '#options'       => $options,
526
-      '#default_value' => 0,
524
+        '#type'          => 'select',
525
+        '#options'       => $options,
526
+        '#default_value' => 0,
527 527
     );
528 528
     $form['actions']['tag-remove-submit'] = array(
529 529
         '#prefix'     => '<div class="privatemsg-tag-remove-submit">',
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
     // JS for hiding the submit buttons.
538 538
     drupal_add_js(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg-filter-list.js');
539
-  }
539
+    }
540 540
 }
541 541
 
542 542
 /**
@@ -545,12 +545,12 @@  discard block
 block discarded – undo
545 545
  * @see theme_privatemsg_list_header()
546 546
  */
547 547
 function phptemplate_privatemsg_list_header__tags() {
548
-   return array(
548
+    return array(
549 549
     'data' => t('Tags'),
550 550
     'key' => 'tags',
551 551
     'class' => 'privatemsg-header-tags',
552 552
     '#weight' => -42,
553
-  );
553
+    );
554 554
 }
555 555
 
556 556
 
@@ -560,48 +560,48 @@  discard block
 block discarded – undo
560 560
  * @see theme_privatemsg_list_field()
561 561
  */
562 562
 function phptemplate_privatemsg_list_field__tags($thread) {
563
-  if (!empty($thread['tags'])) {
563
+    if (!empty($thread['tags'])) {
564 564
     $tags = array();
565 565
 
566 566
     foreach ($thread['tags'] as $tag_id => $tag) {
567
-      $tags[] = l(strlen($tag) > 15 ? substr($tag, 0, 13) . '...' : $tag, 'messages', array(
567
+        $tags[] = l(strlen($tag) > 15 ? substr($tag, 0, 13) . '...' : $tag, 'messages', array(
568 568
         'attributes' => array('title' => $tag),
569 569
         'query' => array('tags' => $tag)
570
-      ));
570
+        ));
571 571
     }
572 572
     return array(
573
-      'data'  => implode(', ', $tags),
574
-      'class' => 'privatemsg-list-tags',
573
+        'data'  => implode(', ', $tags),
574
+        'class' => 'privatemsg-list-tags',
575 575
     );
576
-  }
576
+    }
577 577
 }
578 578
 
579 579
 /**
580 580
  * Form callback for adding a tag to threads.
581 581
  */
582 582
 function privatemsg_filter_add_tag_submit($form, &$form_state) {
583
-  $operation = array(
583
+    $operation = array(
584 584
     'callback' => 'privatemsg_filter_add_tags',
585 585
     'callback arguments' => array('tag_id' => $form_state['values']['tag-add']),
586 586
     'undo callback' => 'privatemsg_filter_remove_tags',
587 587
     'undo callback arguments' => array('tag_id' => $form_state['values']['tag-add']),
588
-  );
589
-  drupal_set_message(t('The selected conversations have been tagged.'));
590
-  privatemsg_operation_execute($operation, $form_state['values']['threads']);
588
+    );
589
+    drupal_set_message(t('The selected conversations have been tagged.'));
590
+    privatemsg_operation_execute($operation, $form_state['values']['threads']);
591 591
 }
592 592
 
593 593
 /**
594 594
  * Form callback for removing a tag to threads.
595 595
  */
596 596
 function privatemsg_filter_remove_tag_submit($form, &$form_state) {
597
-  $operation = array(
597
+    $operation = array(
598 598
     'callback' => 'privatemsg_filter_remove_tags',
599 599
     'callback arguments' => array('tag_id' => $form_state['values']['tag-remove']),
600 600
     'undo callback' => 'privatemsg_filter_add_tags',
601 601
     'undo callback arguments' => array('tag_id' => $form_state['values']['tag-remove']),
602
-  );
603
-  drupal_set_message(t('The tag has been removed from the selected conversations.'));
604
-  privatemsg_operation_execute($operation, $form_state['values']['threads']);
602
+    );
603
+    drupal_set_message(t('The tag has been removed from the selected conversations.'));
604
+    privatemsg_operation_execute($operation, $form_state['values']['threads']);
605 605
 }
606 606
 
607 607
 /**
@@ -609,114 +609,114 @@  discard block
 block discarded – undo
609 609
  */
610 610
 function privatemsg_filter_privatemsg_sql_list_alter(&$fragments, $account, $argument) {
611 611
 
612
-  // Check if its a filtered view.
613
-  if ($argument == 'sent') {
612
+    // Check if its a filtered view.
613
+    if ($argument == 'sent') {
614 614
     $fragments['where'][]       = "pm.author = %d";
615 615
     $fragments['query_args']['where'][]   = $account->uid;
616
-  }
617
-  if ($argument == 'inbox') {
616
+    }
617
+    if ($argument == 'inbox') {
618 618
     $fragments['having'][]       = '((SELECT pmf.author FROM {pm_message} pmf WHERE pmf.mid = pmi.thread_id) = %d AND COUNT(pmi.thread_id) > 1) OR (SELECT COUNT(*) FROM {pm_message} pmf INNER JOIN {pm_index} pmif ON (pmf.mid = pmif.mid) WHERE pmif.thread_id = pmi.thread_id AND pmf.author <> %d) > 0';
619 619
     $fragments['query_args']['having'][]   = $account->uid;
620 620
     $fragments['query_args']['having'][]   = $account->uid;
621
-  }
621
+    }
622 622
 
623
-  // Filter the message listing by any set tags.
624
-  if ($filter = privatemsg_filter_get_filter($account)) {
623
+    // Filter the message listing by any set tags.
624
+    if ($filter = privatemsg_filter_get_filter($account)) {
625 625
     $count = 0;
626 626
     if (isset($filter['tags']) && !empty($filter['tags'])) {
627
-      foreach ($filter['tags'] as $tag) {
627
+        foreach ($filter['tags'] as $tag) {
628 628
         $fragments['inner_join'][]  = "INNER JOIN {pm_tags_index} pmti$count ON (pmti$count.thread_id = pmi.thread_id AND pmti$count.uid = pmi.uid)";
629 629
         $fragments['where'][]       = "pmti$count.tag_id = %d";
630 630
         $fragments['query_args']['where'][]   = $tag;
631 631
         $count++;
632
-      }
632
+        }
633 633
     }
634 634
 
635 635
     if (isset($filter['author']) && !empty($filter['author'])) {
636
-      foreach ($filter['author'] as $author) {
636
+        foreach ($filter['author'] as $author) {
637 637
         $fragments['inner_join'][]  = "INNER JOIN {pm_index} pmi$count ON (pmi$count.mid = pm.mid)";
638 638
         $fragments['where'][]       = "pmi$count.uid = %d";
639 639
         $fragments['query_args']['where'][]   = $author->uid;
640 640
         $count++;
641
-      }
641
+        }
642 642
     }
643 643
 
644 644
     if (isset($filter['search']) && !empty($filter['search'])) {
645
-      if (variable_get('privatemsg_filter_searchbody', FALSE)) {
645
+        if (variable_get('privatemsg_filter_searchbody', FALSE)) {
646 646
         $fragments['where'][]       = "pm.subject LIKE '%s' OR pm.body LIKE '%s'";
647 647
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
648 648
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
649
-      }
650
-      else {
649
+        }
650
+        else {
651 651
         $fragments['where'][]       = "pm.subject LIKE '%s'";
652 652
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
653
-      }
653
+        }
654
+    }
654 655
     }
655
-  }
656 656
 }
657 657
 
658 658
 /**
659 659
  * Hook into the view messages page to add a form for tagging purposes.
660 660
  */
661 661
 function privatemsg_filter_privatemsg_view_messages_alter(&$content, $thread) {
662
-  if (count($thread['messages']) > 0) {
662
+    if (count($thread['messages']) > 0) {
663 663
     $content['tags']['#value'] = drupal_get_form('privatemsg_filter_form');
664 664
     $content['tags']['#weight'] = variable_get('privatemsg_filter_tagfield_weight', 10);
665
-  }
665
+    }
666 666
 }
667 667
 
668 668
 /**
669 669
  * Form to show and allow modification of tagging information of a conversation.
670 670
  */
671 671
 function privatemsg_filter_form(&$form_state) {
672
-  global $user;
673
-  $thread_id = arg(2);
674
-
675
-  // Get a list of current tags for this thread
676
-  $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'), $user, array($thread_id));
677
-  $results = db_query($query['query']);
678
-  $count = db_result(db_query($query['count']));
679
-  $tags = '';
680
-  while ($tag = db_fetch_array($results)) {
672
+    global $user;
673
+    $thread_id = arg(2);
674
+
675
+    // Get a list of current tags for this thread
676
+    $query = _privatemsg_assemble_query(array('tags', 'privatemsg_filter'), $user, array($thread_id));
677
+    $results = db_query($query['query']);
678
+    $count = db_result(db_query($query['count']));
679
+    $tags = '';
680
+    while ($tag = db_fetch_array($results)) {
681 681
     $tags .= $tag['tag'] . ', ';
682
-  }
682
+    }
683 683
 
684
-  $form['tags'] = array(
684
+    $form['tags'] = array(
685 685
     '#type' => 'fieldset',
686 686
     '#title' => t('Tags'),
687 687
     '#access' => privatemsg_user_access('tag private messages'),
688 688
     '#collapsible' => TRUE,
689 689
     '#collapsed' => empty($count) ? TRUE : FALSE,
690
-  );
691
-  $form['tags']['user_id'] = array(
690
+    );
691
+    $form['tags']['user_id'] = array(
692 692
     '#type' => 'value',
693 693
     '#value' => $user->uid,
694
-  );
695
-  $form['tags']['thread_id'] = array(
694
+    );
695
+    $form['tags']['thread_id'] = array(
696 696
     '#type' => 'value',
697 697
     '#value' => $thread_id,
698
-  );
698
+    );
699 699
 
700
-  $form['tags']['tags'] = array(
700
+    $form['tags']['tags'] = array(
701 701
     '#type'               => 'textfield',
702 702
     '#title'              => t('Tags for this conversation'),
703 703
     '#description'        => t('Separate multiple tags with commas.'),
704 704
     '#size'               => 50,
705 705
     '#default_value'      => $tags,
706 706
     '#autocomplete_path'  => 'messages/filter/tag-autocomplete',
707
-  );
707
+    );
708 708
 
709
-  $form['tags']['submit'] = array(
709
+    $form['tags']['submit'] = array(
710 710
     '#type'     => 'submit',
711 711
     '#value'    => t('Tag this conversation'),
712 712
     '#submit'   => array('privatemsg_filter_form_submit'),
713
-  );
713
+    );
714 714
 
715
-  return $form;
715
+    return $form;
716 716
 }
717 717
 
718 718
 function privatemsg_filter_form_submit($form, &$form_state) {
719
-  if (isset($form_state['values']['submit'])) {
719
+    if (isset($form_state['values']['submit'])) {
720 720
     $tags = explode(',', $form_state['values']['tags']);
721 721
 
722 722
     // Step 1 - Delete all tag mapping. I cannot think of a better way to remove tags that are no longer in the textfield, so ideas welcome.
@@ -727,10 +727,10 @@  discard block
 block discarded – undo
727 727
 
728 728
     // Step 3 - Save all the tagging data.
729 729
     foreach ($tag_ids as $tag_id) {
730
-      privatemsg_filter_add_tags($form_state['values']['thread_id'], $tag_id);
730
+        privatemsg_filter_add_tags($form_state['values']['thread_id'], $tag_id);
731 731
     }
732 732
     drupal_set_message(t('Tagging information has been saved.'));
733
-  }
733
+    }
734 734
 }
735 735
 
736 736
 /**
@@ -741,28 +741,28 @@  discard block
 block discarded – undo
741 741
  */
742 742
 function privatemsg_filter_tags_autocomplete($string) {
743 743
 
744
-  // 1: Parse $string and build a list of tags.
745
-  $tags = array();
746
-  $fragments = explode(',', $string);
747
-  foreach ($fragments as $index => $tag) {
744
+    // 1: Parse $string and build a list of tags.
745
+    $tags = array();
746
+    $fragments = explode(',', $string);
747
+    foreach ($fragments as $index => $tag) {
748 748
     $tag = trim($tag);
749 749
     $tags[$tag] = $tag;
750
-  }
750
+    }
751 751
 
752
-  // 2: Find the next tag suggestion.
753
-  $fragment = array_pop($tags);
754
-  $matches = array();
755
-  if (!empty($fragment)) {
752
+    // 2: Find the next tag suggestion.
753
+    $fragment = array_pop($tags);
754
+    $matches = array();
755
+    if (!empty($fragment)) {
756 756
     $query = _privatemsg_assemble_query(array('tags_autocomplete', 'privatemsg_filter'), $fragment, $tags);
757 757
     $result = db_query_range($query['query'], $fragment, 0, 10);
758 758
     $prefix = count($tags) ? implode(", ", $tags) .", " : '';
759 759
     // 3: Build proper suggestions and print.
760 760
     while ($tag = db_fetch_object($result)) {
761
-      $matches[$prefix . $tag->tag .", "] = $tag->tag;
761
+        $matches[$prefix . $tag->tag .", "] = $tag->tag;
762 762
     }
763
-  }
764
-  // convert to object to prevent drupal bug, see http://drupal.org/node/175361
765
-  drupal_json((object)$matches);
763
+    }
764
+    // convert to object to prevent drupal bug, see http://drupal.org/node/175361
765
+    drupal_json((object)$matches);
766 766
 }
767 767
 
768 768
 /**
@@ -781,19 +781,19 @@  discard block
 block discarded – undo
781 781
  *   Array of names that are already part of the autocomplete field.
782 782
  */
783 783
 function privatemsg_filter_privatemsg_sql_autocomplete_alter(&$fragments, $search, $names) {
784
-  global $user;
785
-  // arg(1) is an additional URL argument passed to the URL when only
786
-  // users that are listed as recipient for threads of that user should be
787
-  // displayed.
788
-  // @todo: Check if these results can be grouped to avoid unecessary loops.
789
-  if (arg(1) == 'filter') {
784
+    global $user;
785
+    // arg(1) is an additional URL argument passed to the URL when only
786
+    // users that are listed as recipient for threads of that user should be
787
+    // displayed.
788
+    // @todo: Check if these results can be grouped to avoid unecessary loops.
789
+    if (arg(1) == 'filter') {
790 790
     // JOIN on index entries where the to be selected user is a recipient.
791 791
     $fragments['inner_join'][] = 'INNER JOIN {pm_index} pip ON pip.uid = u.uid';
792 792
     // JOIN on rows where the current user is the recipient and that have the
793 793
     // same mid as those above.
794 794
     $fragments['inner_join'][] = 'INNER JOIN {pm_index} piu ON piu.uid = %d AND pip.mid = piu.mid';
795 795
     $fragments['query_args']['join'][] = $user->uid;
796
-  }
796
+    }
797 797
 }
798 798
 
799 799
 /**
@@ -809,19 +809,19 @@  discard block
 block discarded – undo
809 809
  *   Limit the number of tags *per thread*.
810 810
  */
811 811
 function privatemsg_filter_sql_tags(&$fragments, $user = NULL, $threads = NULL, $limit = NULL) {
812
-  $fragments['primary_table'] = '{pm_tags} t';
813
-  $fragments['select'][] = 't.tag';
814
-  $fragments['select'][] = 't.tag_id';
815
-  $fragments['select'][] = 't.public';
812
+    $fragments['primary_table'] = '{pm_tags} t';
813
+    $fragments['select'][] = 't.tag';
814
+    $fragments['select'][] = 't.tag_id';
815
+    $fragments['select'][] = 't.public';
816 816
 
817
-  if (!empty($threads)) {
817
+    if (!empty($threads)) {
818 818
     // If the tag list needs to be for specific threads.
819 819
     $fragments['select'][] = 'ti.thread_id';
820 820
     $fragments['inner_join'][]  = 'INNER JOIN {pm_tags_index} ti on ti.tag_id = t.tag_id';
821 821
     $fragments['where'][] = 'ti.thread_id IN (' . db_placeholders($threads) . ')';
822 822
     $fragments['query_args']['where'] += $threads;
823
-  }
824
-  else {
823
+    }
824
+    else {
825 825
     // Tag usage counter is only used when we select all tags.
826 826
     $fragments['select'][]      = 'COUNT(ti.thread_id) as count';
827 827
     // LEFT JOIN so that unused tags are displayed too.
@@ -829,33 +829,33 @@  discard block
 block discarded – undo
829 829
     $fragments['group_by'][]    = 't.tag_id';
830 830
     $fragments['group_by'][]    = 't.tag';
831 831
     $fragments['group_by'][]    = 't.public';
832
-  }
833
-  if (!empty($user)) {
832
+    }
833
+    if (!empty($user)) {
834 834
     $fragments['where'][]       = 'ti.uid = %d';
835 835
     $fragments['query_args']['where'][] = $user->uid;
836
-  }
837
-
838
-  // Only select n tags per thread (ordered per tag_id), see
839
-  // http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/.
840
-  //
841
-  // It does select how many tags for that thread/uid combination exist that
842
-  // have a lower tag_id and does only select those that have less than $limit.
843
-  //
844
-  // This should only have a very minor performance impact as most users won't
845
-  // tag a thread with 1000 different tags.
846
-  //
847
-  if ($limit) {
836
+    }
837
+
838
+    // Only select n tags per thread (ordered per tag_id), see
839
+    // http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/.
840
+    //
841
+    // It does select how many tags for that thread/uid combination exist that
842
+    // have a lower tag_id and does only select those that have less than $limit.
843
+    //
844
+    // This should only have a very minor performance impact as most users won't
845
+    // tag a thread with 1000 different tags.
846
+    //
847
+    if ($limit) {
848 848
     $fragments['where'][] = '(SELECT count(*) FROM {pm_tags_index} AS pmtic
849 849
                               WHERE pmtic.thread_id = ti.thread_id
850 850
                               AND pmtic.uid = ti.uid
851 851
                               AND pmtic.tag_id < ti.tag_id) < %d';
852 852
     $fragments['query_args']['where'][] = $limit;
853
-  }
854
-  elseif (!empty($threads) || !empty($user)) {
853
+    }
854
+    elseif (!empty($threads) || !empty($user)) {
855 855
     // Only add a sort when we are not loading the tags for the admin page.
856 856
     // Sorting is handled through tablesort_sql() then.
857 857
     $fragments['order_by'][] = 't.tag ASC';
858
-  }
858
+    }
859 859
 }
860 860
 
861 861
 /**
@@ -869,25 +869,25 @@  discard block
 block discarded – undo
869 869
  *   Array of tags not to be used as suggestions.
870 870
  */
871 871
 function privatemsg_filter_sql_tags_autocomplete(&$fragments, $search, $tags) {
872
-  global $user;
873
-
874
-  $fragments['primary_table'] = '{pm_tags} pmt';
875
-  $fragments['select'][] = 'pmt.tag';
876
-  $fragments['where'][] = "pmt.tag LIKE '%s'";
877
-  // Escape % to get through the placeholder replacement.
878
-  $fragments['query_args']['where'][] = $search .'%%';
879
-  if (!empty($tags)) {
872
+    global $user;
873
+
874
+    $fragments['primary_table'] = '{pm_tags} pmt';
875
+    $fragments['select'][] = 'pmt.tag';
876
+    $fragments['where'][] = "pmt.tag LIKE '%s'";
877
+    // Escape % to get through the placeholder replacement.
878
+    $fragments['query_args']['where'][] = $search .'%%';
879
+    if (!empty($tags)) {
880 880
     // Exclude tags.
881 881
     $fragments['where'][] = "pmt.tag NOT IN (". db_placeholders($tags, 'text') .")";
882 882
     $fragments['query_args']['where'] += $tags;
883
-  }
884
-  // LEFT JOIN to be able to load public, unused tags.
885
-  $fragments['inner_join'][]  = 'LEFT JOIN {pm_tags_index} pmti ON pmt.tag_id = pmti.tag_id AND pmti.uid = %d';
886
-  $fragments['query_args']['join'][] = $user->uid;
887
-  // Autocomplete should only display Tags used by that user or public tags.
888
-  // This is done to avoid information disclosure as part of tag names.
889
-  $fragments['where'][] = '(pmti.uid IS NOT NULL OR pmt.public = 1)';
890
-  $fragments['order_by'][] = 'pmt.tag ASC';
883
+    }
884
+    // LEFT JOIN to be able to load public, unused tags.
885
+    $fragments['inner_join'][]  = 'LEFT JOIN {pm_tags_index} pmti ON pmt.tag_id = pmti.tag_id AND pmti.uid = %d';
886
+    $fragments['query_args']['join'][] = $user->uid;
887
+    // Autocomplete should only display Tags used by that user or public tags.
888
+    // This is done to avoid information disclosure as part of tag names.
889
+    $fragments['where'][] = '(pmti.uid IS NOT NULL OR pmt.public = 1)';
890
+    $fragments['order_by'][] = 'pmt.tag ASC';
891 891
 }
892 892
 
893 893
 /**
@@ -898,10 +898,10 @@  discard block
 block discarded – undo
898 898
  * Implement hook_user().
899 899
  */
900 900
 function privatemsg_filter_user($op, &$edit, &$account, $category = NULL) {
901
-  switch ($op) {
902
-      case 'delete':
901
+    switch ($op) {
902
+        case 'delete':
903 903
       // Delete tag information of that user.
904 904
       db_query("DELETE FROM {pm_tags_index} WHERE uid = %d", $account->uid, $account->uid);
905
-      break;
906
-  }
905
+        break;
906
+    }
907 907
 }
Please login to merge, or discard this patch.
Switch Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -405,26 +405,26 @@  discard block
 block discarded – undo
405 405
   }
406 406
 
407 407
   switch ($form_state['values']['op']) {
408
-    case t('Save filter'):
409
-      $filter = array();
410
-      if (!empty($form_state['values']['tags'])) {
411
-        $filter['tags'] = $form_state['values']['tags'];
412
-      }
413
-      if (!empty($form_state['values']['author'])) {
414
-        $filter['author'] = $form_state['values']['author'];
415
-      }
416
-      if (!empty($form_state['values']['search'])) {
417
-        $filter['search'] = $form_state['values']['search'];
418
-      }
419
-      $_SESSION['privatemsg_filter'] = $filter;
420
-      break;
421
-    case t('Filter'):
422
-      drupal_goto($_GET['q'], privatemsg_filter_create_get_query($form_state['values']));
423
-      return;
424
-      break;
425
-    case t('Reset'):
426
-      $_SESSION['privatemsg_filter'] = array();
427
-      break;
408
+  case t('Save filter'):
409
+    $filter = array();
410
+    if (!empty($form_state['values']['tags'])) {
411
+      $filter['tags'] = $form_state['values']['tags'];
412
+    }
413
+    if (!empty($form_state['values']['author'])) {
414
+      $filter['author'] = $form_state['values']['author'];
415
+    }
416
+    if (!empty($form_state['values']['search'])) {
417
+      $filter['search'] = $form_state['values']['search'];
418
+    }
419
+    $_SESSION['privatemsg_filter'] = $filter;
420
+    break;
421
+  case t('Filter'):
422
+    drupal_goto($_GET['q'], privatemsg_filter_create_get_query($form_state['values']));
423
+    return;
424
+    break;
425
+  case t('Reset'):
426
+    $_SESSION['privatemsg_filter'] = array();
427
+    break;
428 428
   }
429 429
   $form_state['redirect'] = $_GET['q'];
430 430
 }
@@ -899,9 +899,9 @@  discard block
 block discarded – undo
899 899
  */
900 900
 function privatemsg_filter_user($op, &$edit, &$account, $category = NULL) {
901 901
   switch ($op) {
902
-      case 'delete':
903
-      // Delete tag information of that user.
904
-      db_query("DELETE FROM {pm_tags_index} WHERE uid = %d", $account->uid, $account->uid);
905
-      break;
902
+  case 'delete':
903
+  // Delete tag information of that user.
904
+  db_query("DELETE FROM {pm_tags_index} WHERE uid = %d", $account->uid, $account->uid);
905
+  break;
906 906
   }
907 907
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 function privatemsg_filter_dropdown(&$form_state, $account) {
315 315
 
316
-  drupal_add_css(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg_filter.css');
316
+  drupal_add_css(drupal_get_path('module', 'privatemsg_filter').'/privatemsg_filter.css');
317 317
 
318 318
   $form['filter'] = array(
319 319
     '#type' => 'fieldset',
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
   if (isset($filter['author'])) {
378 378
     $string = '';
379 379
     foreach ($filter['author'] as $author) {
380
-      $string .= $author->name . ', ';
380
+      $string .= $author->name.', ';
381 381
     }
382 382
     $form['filter']['author']['#default_value'] = $string;
383 383
   }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         $query['tags'][] = $tag;
442 442
       }
443 443
     }
444
-    $sql = 'SELECT pmt.tag FROM {pm_tags} pmt WHERE pmt.tag_id IN ('. implode(', ', $filter['tags']) .')';
444
+    $sql = 'SELECT pmt.tag FROM {pm_tags} pmt WHERE pmt.tag_id IN ('.implode(', ', $filter['tags']).')';
445 445
     $result = db_query($sql);
446 446
     while ($row = db_fetch_object($result)) {
447 447
       $query['tags'][] = $row->tag;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
     );
536 536
 
537 537
     // JS for hiding the submit buttons.
538
-    drupal_add_js(drupal_get_path('module', 'privatemsg_filter') .'/privatemsg-filter-list.js');
538
+    drupal_add_js(drupal_get_path('module', 'privatemsg_filter').'/privatemsg-filter-list.js');
539 539
   }
540 540
 }
541 541
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     $tags = array();
565 565
 
566 566
     foreach ($thread['tags'] as $tag_id => $tag) {
567
-      $tags[] = l(strlen($tag) > 15 ? substr($tag, 0, 13) . '...' : $tag, 'messages', array(
567
+      $tags[] = l(strlen($tag) > 15 ? substr($tag, 0, 13).'...' : $tag, 'messages', array(
568 568
         'attributes' => array('title' => $tag),
569 569
         'query' => array('tags' => $tag)
570 570
       ));
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
 
612 612
   // Check if its a filtered view.
613 613
   if ($argument == 'sent') {
614
-    $fragments['where'][]       = "pm.author = %d";
615
-    $fragments['query_args']['where'][]   = $account->uid;
614
+    $fragments['where'][] = "pm.author = %d";
615
+    $fragments['query_args']['where'][] = $account->uid;
616 616
   }
617 617
   if ($argument == 'inbox') {
618
-    $fragments['having'][]       = '((SELECT pmf.author FROM {pm_message} pmf WHERE pmf.mid = pmi.thread_id) = %d AND COUNT(pmi.thread_id) > 1) OR (SELECT COUNT(*) FROM {pm_message} pmf INNER JOIN {pm_index} pmif ON (pmf.mid = pmif.mid) WHERE pmif.thread_id = pmi.thread_id AND pmf.author <> %d) > 0';
618
+    $fragments['having'][] = '((SELECT pmf.author FROM {pm_message} pmf WHERE pmf.mid = pmi.thread_id) = %d AND COUNT(pmi.thread_id) > 1) OR (SELECT COUNT(*) FROM {pm_message} pmf INNER JOIN {pm_index} pmif ON (pmf.mid = pmif.mid) WHERE pmif.thread_id = pmi.thread_id AND pmf.author <> %d) > 0';
619 619
     $fragments['query_args']['having'][]   = $account->uid;
620 620
     $fragments['query_args']['having'][]   = $account->uid;
621 621
   }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
       foreach ($filter['tags'] as $tag) {
628 628
         $fragments['inner_join'][]  = "INNER JOIN {pm_tags_index} pmti$count ON (pmti$count.thread_id = pmi.thread_id AND pmti$count.uid = pmi.uid)";
629 629
         $fragments['where'][]       = "pmti$count.tag_id = %d";
630
-        $fragments['query_args']['where'][]   = $tag;
630
+        $fragments['query_args']['where'][] = $tag;
631 631
         $count++;
632 632
       }
633 633
     }
@@ -636,20 +636,20 @@  discard block
 block discarded – undo
636 636
       foreach ($filter['author'] as $author) {
637 637
         $fragments['inner_join'][]  = "INNER JOIN {pm_index} pmi$count ON (pmi$count.mid = pm.mid)";
638 638
         $fragments['where'][]       = "pmi$count.uid = %d";
639
-        $fragments['query_args']['where'][]   = $author->uid;
639
+        $fragments['query_args']['where'][] = $author->uid;
640 640
         $count++;
641 641
       }
642 642
     }
643 643
 
644 644
     if (isset($filter['search']) && !empty($filter['search'])) {
645 645
       if (variable_get('privatemsg_filter_searchbody', FALSE)) {
646
-        $fragments['where'][]       = "pm.subject LIKE '%s' OR pm.body LIKE '%s'";
647
-        $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
648
-        $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
646
+        $fragments['where'][] = "pm.subject LIKE '%s' OR pm.body LIKE '%s'";
647
+        $fragments['query_args']['where'][]    = '%%'.$filter['search'].'%%';
648
+        $fragments['query_args']['where'][]    = '%%'.$filter['search'].'%%';
649 649
       }
650 650
       else {
651
-        $fragments['where'][]       = "pm.subject LIKE '%s'";
652
-        $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
651
+        $fragments['where'][] = "pm.subject LIKE '%s'";
652
+        $fragments['query_args']['where'][] = '%%'.$filter['search'].'%%';
653 653
       }
654 654
     }
655 655
   }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
   $count = db_result(db_query($query['count']));
679 679
   $tags = '';
680 680
   while ($tag = db_fetch_array($results)) {
681
-    $tags .= $tag['tag'] . ', ';
681
+    $tags .= $tag['tag'].', ';
682 682
   }
683 683
 
684 684
   $form['tags'] = array(
@@ -755,10 +755,10 @@  discard block
 block discarded – undo
755 755
   if (!empty($fragment)) {
756 756
     $query = _privatemsg_assemble_query(array('tags_autocomplete', 'privatemsg_filter'), $fragment, $tags);
757 757
     $result = db_query_range($query['query'], $fragment, 0, 10);
758
-    $prefix = count($tags) ? implode(", ", $tags) .", " : '';
758
+    $prefix = count($tags) ? implode(", ", $tags).", " : '';
759 759
     // 3: Build proper suggestions and print.
760 760
     while ($tag = db_fetch_object($result)) {
761
-      $matches[$prefix . $tag->tag .", "] = $tag->tag;
761
+      $matches[$prefix.$tag->tag.", "] = $tag->tag;
762 762
     }
763 763
   }
764 764
   // convert to object to prevent drupal bug, see http://drupal.org/node/175361
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
   if (!empty($threads)) {
818 818
     // If the tag list needs to be for specific threads.
819 819
     $fragments['select'][] = 'ti.thread_id';
820
-    $fragments['inner_join'][]  = 'INNER JOIN {pm_tags_index} ti on ti.tag_id = t.tag_id';
821
-    $fragments['where'][] = 'ti.thread_id IN (' . db_placeholders($threads) . ')';
820
+    $fragments['inner_join'][] = 'INNER JOIN {pm_tags_index} ti on ti.tag_id = t.tag_id';
821
+    $fragments['where'][] = 'ti.thread_id IN ('.db_placeholders($threads).')';
822 822
     $fragments['query_args']['where'] += $threads;
823 823
   }
824 824
   else {
@@ -875,14 +875,14 @@  discard block
 block discarded – undo
875 875
   $fragments['select'][] = 'pmt.tag';
876 876
   $fragments['where'][] = "pmt.tag LIKE '%s'";
877 877
   // Escape % to get through the placeholder replacement.
878
-  $fragments['query_args']['where'][] = $search .'%%';
878
+  $fragments['query_args']['where'][] = $search.'%%';
879 879
   if (!empty($tags)) {
880 880
     // Exclude tags.
881
-    $fragments['where'][] = "pmt.tag NOT IN (". db_placeholders($tags, 'text') .")";
881
+    $fragments['where'][] = "pmt.tag NOT IN (".db_placeholders($tags, 'text').")";
882 882
     $fragments['query_args']['where'] += $tags;
883 883
   }
884 884
   // LEFT JOIN to be able to load public, unused tags.
885
-  $fragments['inner_join'][]  = 'LEFT JOIN {pm_tags_index} pmti ON pmt.tag_id = pmti.tag_id AND pmti.uid = %d';
885
+  $fragments['inner_join'][] = 'LEFT JOIN {pm_tags_index} pmti ON pmt.tag_id = pmti.tag_id AND pmti.uid = %d';
886 886
   $fragments['query_args']['join'][] = $user->uid;
887 887
   // Autocomplete should only display Tags used by that user or public tags.
888 888
   // This is done to avoid information disclosure as part of tag names.
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -192,8 +192,7 @@  discard block
 block discarded – undo
192 192
     if (empty($tag_id) && privatemsg_user_access('create private message tags')) {
193 193
       db_query("INSERT INTO {pm_tags} (tag) VALUES ('%s')", $tag);
194 194
       $tag_id = db_last_insert_id('pm_tags', 'tag_id');
195
-    }
196
-    elseif (empty($tag_id)) {
195
+    } elseif (empty($tag_id)) {
197 196
       // The user does not have permission to create new tags - disregard this tag and move onto the next.
198 197
       drupal_set_message(t('Tag %tag was ignored because you do not have permission to create new tags.', array('%tag' => $tag)));
199 198
       continue;
@@ -251,8 +250,7 @@  discard block
 block discarded – undo
251 250
     foreach ($threads as $thread) {
252 251
       db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d', $account->uid, $thread);
253 252
     }
254
-  }
255
-  else {
253
+  } else {
256 254
     // Delete tag mapping for the specified tag.
257 255
     foreach ($threads as $thread) {
258 256
       db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d AND tag_id = %d', $account->uid, $thread, $tag_id);
@@ -268,8 +266,7 @@  discard block
 block discarded – undo
268 266
     foreach (explode(',', $_GET['tags']) as $tag) {
269 267
       if (isset($tag_data[$tag])) {
270 268
         $filter['tags'][$tag] = $tag;
271
-      }
272
-      elseif (in_array($tag, $tag_data)) {
269
+      } elseif (in_array($tag, $tag_data)) {
273 270
         $filter['tags'][array_search($tag, $tag_data)] = array_search($tag, $tag_data);
274 271
       }
275 272
     }
@@ -436,8 +433,7 @@  discard block
 block discarded – undo
436 433
     foreach ($filter['tags'] as $tag) {
437 434
       if ((int)$tag > 0) {
438 435
         $ids[] = $tag;
439
-      }
440
-      else {
436
+      } else {
441 437
         $query['tags'][] = $tag;
442 438
       }
443 439
     }
@@ -456,8 +452,7 @@  discard block
 block discarded – undo
456 452
     foreach ($filter['author'] as $author) {
457 453
       if (is_object($author) && isset($author->uid) && isset($author->name)) {
458 454
         $query['author'][] = $author->name;
459
-      }
460
-      elseif ($author_obj = user_load($author)) {
455
+      } elseif ($author_obj = user_load($author)) {
461 456
         $query['author'][] = $author_obj->name;
462 457
       }
463 458
     }
@@ -646,8 +641,7 @@  discard block
 block discarded – undo
646 641
         $fragments['where'][]       = "pm.subject LIKE '%s' OR pm.body LIKE '%s'";
647 642
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
648 643
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
649
-      }
650
-      else {
644
+      } else {
651 645
         $fragments['where'][]       = "pm.subject LIKE '%s'";
652 646
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
653 647
       }
@@ -820,8 +814,7 @@  discard block
 block discarded – undo
820 814
     $fragments['inner_join'][]  = 'INNER JOIN {pm_tags_index} ti on ti.tag_id = t.tag_id';
821 815
     $fragments['where'][] = 'ti.thread_id IN (' . db_placeholders($threads) . ')';
822 816
     $fragments['query_args']['where'] += $threads;
823
-  }
824
-  else {
817
+  } else {
825 818
     // Tag usage counter is only used when we select all tags.
826 819
     $fragments['select'][]      = 'COUNT(ti.thread_id) as count';
827 820
     // LEFT JOIN so that unused tags are displayed too.
@@ -850,8 +843,7 @@  discard block
 block discarded – undo
850 843
                               AND pmtic.uid = ti.uid
851 844
                               AND pmtic.tag_id < ti.tag_id) < %d';
852 845
     $fragments['query_args']['where'][] = $limit;
853
-  }
854
-  elseif (!empty($threads) || !empty($user)) {
846
+  } elseif (!empty($threads) || !empty($user)) {
855 847
     // Only add a sort when we are not loading the tags for the admin page.
856 848
     // Sorting is handled through tablesort_sql() then.
857 849
     $fragments['order_by'][] = 't.tag ASC';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     '#type'          => 'checkbox',
126 126
     '#title'         => t('Search message body'),
127 127
     '#description'   => t('WARNING: turning on this feature will slow down search performance by a large factor. Gets worse as your messages database increases.'),
128
-    '#default_value' => variable_get('privatemsg_filter_searchbody', FALSE),
128
+    '#default_value' => variable_get('privatemsg_filter_searchbody', false),
129 129
   );
130 130
 
131 131
     $form['privatemsg_filter_tagfield_weight'] = array(
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
  * @param $tag_id
212 212
  *   Id of the tag.
213 213
  */
214
-function privatemsg_filter_add_tags($threads, $tag_id, $account = NULL) {
214
+function privatemsg_filter_add_tags($threads, $tag_id, $account = null) {
215 215
   if (!is_array($threads)) {
216 216
     $threads = array($threads);
217 217
   }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
  * @param $tag_id
238 238
  *   Id of the tag - set to NULL to remove all tags.
239 239
  */
240
-function privatemsg_filter_remove_tags($threads, $tag_id = NULL, $account = NULL) {
240
+function privatemsg_filter_remove_tags($threads, $tag_id = null, $account = null) {
241 241
   if (!is_array($threads)) {
242 242
     $threads = array($threads);
243 243
   }
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
   $form['filter'] = array(
319 319
     '#type' => 'fieldset',
320 320
     '#title' => t('Filter messages'),
321
-    '#collapsible' => TRUE,
322
-    '#collapsed' => TRUE,
321
+    '#collapsible' => true,
322
+    '#collapsed' => true,
323 323
   );
324 324
   $form['filter']['search'] = array(
325 325
     '#type' => 'textfield',
326
-    '#title' => variable_get('privatemsg_filter_searchbody', FALSE) ? t('Search messages') : t('Search subjects'),
326
+    '#title' => variable_get('privatemsg_filter_searchbody', false) ? t('Search messages') : t('Search subjects'),
327 327
     '#weight' => -20
328 328
   );
329 329
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
       '#type' => 'select',
343 343
       '#title' => t('Tags'),
344 344
       '#options' => $tag_data,
345
-      '#multiple' => TRUE,
345
+      '#multiple' => true,
346 346
       '#size' => 5,
347 347
       '#weight' => 0
348 348
     );
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
 function privatemsg_filter_dropdown_set_active(&$form, $filter) {
374 374
   $form['filter']['#title'] = t('Filter messages (active)');
375
-  $form['filter']['#collapsed'] = FALSE;
375
+  $form['filter']['#collapsed'] = false;
376 376
 
377 377
   if (isset($filter['author'])) {
378 378
     $string = '';
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
     }
643 643
 
644 644
     if (isset($filter['search']) && !empty($filter['search'])) {
645
-      if (variable_get('privatemsg_filter_searchbody', FALSE)) {
645
+      if (variable_get('privatemsg_filter_searchbody', false)) {
646 646
         $fragments['where'][]       = "pm.subject LIKE '%s' OR pm.body LIKE '%s'";
647 647
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
648 648
         $fragments['query_args']['where'][]    = '%%'. $filter['search'] .'%%';
@@ -685,8 +685,8 @@  discard block
 block discarded – undo
685 685
     '#type' => 'fieldset',
686 686
     '#title' => t('Tags'),
687 687
     '#access' => privatemsg_user_access('tag private messages'),
688
-    '#collapsible' => TRUE,
689
-    '#collapsed' => empty($count) ? TRUE : FALSE,
688
+    '#collapsible' => true,
689
+    '#collapsed' => empty($count) ? true : false,
690 690
   );
691 691
   $form['tags']['user_id'] = array(
692 692
     '#type' => 'value',
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
  * @param $limit
809 809
  *   Limit the number of tags *per thread*.
810 810
  */
811
-function privatemsg_filter_sql_tags(&$fragments, $user = NULL, $threads = NULL, $limit = NULL) {
811
+function privatemsg_filter_sql_tags(&$fragments, $user = null, $threads = null, $limit = null) {
812 812
   $fragments['primary_table'] = '{pm_tags} t';
813 813
   $fragments['select'][] = 't.tag';
814 814
   $fragments['select'][] = 't.tag_id';
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 /**
898 898
  * Implement hook_user().
899 899
  */
900
-function privatemsg_filter_user($op, &$edit, &$account, $category = NULL) {
900
+function privatemsg_filter_user($op, &$edit, &$account, $category = null) {
901 901
   switch ($op) {
902 902
       case 'delete':
903 903
       // Delete tag information of that user.
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/privatemsg/privatemsg.theme.inc 4 patches
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
  * @see theme_privatemsg_list_field()
76 76
  */
77 77
 function phptemplate_privatemsg_list_field__participants($thread) {
78
-  $participants = _privatemsg_generate_user_array($thread['participants'], -4);
79
-  $field = array();
80
-  $field['data'] = _privatemsg_format_participants($participants, 3, TRUE);
81
-  $field['class'] = 'privatemsg-list-participants';
82
-  return $field;
78
+    $participants = _privatemsg_generate_user_array($thread['participants'], -4);
79
+    $field = array();
80
+    $field['data'] = _privatemsg_format_participants($participants, 3, TRUE);
81
+    $field['class'] = 'privatemsg-list-participants';
82
+    return $field;
83 83
 }
84 84
 
85 85
 /**
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
  * @see theme_privatemsg_list_field()
89 89
  */
90 90
 function phptemplate_privatemsg_list_field__subject($thread) {
91
-  $field = array();
92
-  $options = array();
93
-  $is_new = '';
94
-  if (!empty($thread['is_new'])) {
91
+    $field = array();
92
+    $options = array();
93
+    $is_new = '';
94
+    if (!empty($thread['is_new'])) {
95 95
     $is_new = theme_mark(MARK_NEW);
96 96
     $options['fragment'] = 'new';
97
-  }
98
-  $field['data'] = l($thread['subject'], 'messages/view/' . $thread['thread_id'], $options) . $is_new;
99
-  $field['class'] = 'privatemsg-list-subject';
100
-  return $field;
97
+    }
98
+    $field['data'] = l($thread['subject'], 'messages/view/' . $thread['thread_id'], $options) . $is_new;
99
+    $field['class'] = 'privatemsg-list-subject';
100
+    return $field;
101 101
 }
102 102
 
103 103
 /**
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
  * @see theme_privatemsg_list_field()
107 107
  */
108 108
 function phptemplate_privatemsg_list_field__count($thread) {
109
-  $field = array();
110
-  $field['data'] = $thread['count'];
111
-  $options = array();
112
-  if (!empty($thread['is_new']) && $thread['is_new'] < $thread['count']) {
109
+    $field = array();
110
+    $field['data'] = $thread['count'];
111
+    $options = array();
112
+    if (!empty($thread['is_new']) && $thread['is_new'] < $thread['count']) {
113 113
     $options['fragment'] = 'new';
114 114
     $field['data'] .= '<br />' . l((format_plural($thread['is_new'], '(1 new)', '(@count new)')), 'messages/view/' . $thread['thread_id'], $options);
115
-  }
116
-  $field['class'] = 'privatemsg-list-count';
117
-  return $field;
115
+    }
116
+    $field['class'] = 'privatemsg-list-count';
117
+    return $field;
118 118
 }
119 119
 
120 120
 /**
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
  * @see theme_privatemsg_list_field()
124 124
  */
125 125
 function phptemplate_privatemsg_list_field__last_updated($thread) {
126
-  $field = array();
127
-  $field['data'] = format_date($thread['last_updated'], 'small');
128
-  $field['class'] = 'privatemsg-list-date';
129
-  return $field;
126
+    $field = array();
127
+    $field['data'] = format_date($thread['last_updated'], 'small');
128
+    $field['class'] = 'privatemsg-list-date';
129
+    return $field;
130 130
 }
131 131
 
132 132
 /**
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
  * @see theme_privatemsg_list_field()
136 136
  */
137 137
 function phptemplate_privatemsg_list_field__thread_started($thread) {
138
-  $field = array();
139
-  $field['data'] = format_date($thread['thread_started'], 'small');
140
-  $field['class'] = 'privatemsg-list-date-started';
141
-  return $field;
138
+    $field = array();
139
+    $field['data'] = format_date($thread['thread_started'], 'small');
140
+    $field['class'] = 'privatemsg-list-date-started';
141
+    return $field;
142 142
 }
143 143
 
144 144
 /**
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
  * @see theme_privatemsg_list_header()
163 163
  */
164 164
 function phptemplate_privatemsg_list_header__subject() {
165
-  return array(
165
+    return array(
166 166
     'data'    => t('Subject'),
167 167
     'field'   => 'subject',
168 168
     'key'     => 'subject',
169 169
     'class'   => 'privatemsg-header-subject',
170 170
     '#weight' => -40,
171
-  );
171
+    );
172 172
 }
173 173
 
174 174
 /**
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
  * @see theme_privatemsg_list_header()
178 178
  */
179 179
 function phptemplate_privatemsg_list_header__count() {
180
-  return array(
180
+    return array(
181 181
     'data'    => t('Messages'),
182 182
     'key'     => 'count',
183 183
     'class'   => 'privatemsg-header-count',
184 184
     '#weight' => -25,
185
-  );
185
+    );
186 186
 }
187 187
 
188 188
 /**
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
  * @see theme_privatemsg_list_header()
192 192
  */
193 193
 function phptemplate_privatemsg_list_header__participants() {
194
-  return array(
194
+    return array(
195 195
     'data'    => t('Participants'),
196 196
     'key'     => 'participants',
197 197
     'class'   => 'privatemsg-header-participants',
198 198
     '#weight' => -30,
199
-  );
199
+    );
200 200
 }
201 201
 
202 202
 /**
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
  * @see theme_privatemsg_list_header()
206 206
  */
207 207
 function phptemplate_privatemsg_list_header__last_updated() {
208
-  return array(
208
+    return array(
209 209
     'data'    => t('Last Updated'),
210 210
     'field'   => 'last_updated',
211 211
     'key'     => 'last_updated',
212 212
     'sort'    => 'desc',
213 213
     'class'   => 'privatemsg-header-lastupdated',
214 214
     '#weight' => -20,
215
-  );
215
+    );
216 216
 }
217 217
 
218 218
 /**
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
  * @see theme_privatemsg_list_header()
222 222
  */
223 223
 function phptemplate_privatemsg_list_header__thread_started() {
224
-  return array(
224
+    return array(
225 225
     'data'    => t('Started'),
226 226
     'field'   => 'thread_started',
227 227
     'key'     => 'thread_started',
228 228
     'class'   => 'privatemsg-header-threadstarted',
229 229
     '#weight' => -15,
230
-  );
230
+    );
231 231
 }
232 232
 
233 233
 /**
@@ -237,70 +237,70 @@  discard block
 block discarded – undo
237 237
  * by the header and field theme patterns.
238 238
  */
239 239
 function theme_privatemsg_list($form) {
240
-  $has_posts = !empty($form['#data']);
240
+    $has_posts = !empty($form['#data']);
241 241
 
242
-  drupal_add_css(drupal_get_path('module', 'privatemsg') .'/styles/privatemsg-list.css');
242
+    drupal_add_css(drupal_get_path('module', 'privatemsg') .'/styles/privatemsg-list.css');
243 243
 
244
-  // Load the table columns.
245
-  $columns = array_merge(array('subject', 'last_updated'), array_filter(variable_get('privatemsg_display_fields', array('participants'))));
244
+    // Load the table columns.
245
+    $columns = array_merge(array('subject', 'last_updated'), array_filter(variable_get('privatemsg_display_fields', array('participants'))));
246 246
 
247
-  // Load the themed list headers based on the available data.
248
-  $headers = _privatemsg_list_headers(!empty($form['#data']), $columns);
249
-  // sort the headers array based on the #weight property.
250
-  usort($headers, 'element_sort');
247
+    // Load the themed list headers based on the available data.
248
+    $headers = _privatemsg_list_headers(!empty($form['#data']), $columns);
249
+    // sort the headers array based on the #weight property.
250
+    usort($headers, 'element_sort');
251 251
 
252
-  $themed_rows = array();
253
-  // Check if there is atleast a single thread.
254
-  if ($has_posts) {
252
+    $themed_rows = array();
253
+    // Check if there is atleast a single thread.
254
+    if ($has_posts) {
255 255
     foreach ($form['#data'] as $thread_id => $data) {
256
-      // Theme the row.
257
-      $row = _privatemsg_list_thread($data);
258
-      $data = array();
259
-      // Render the checkbox.
260
-      $data[] = array('data' => drupal_render($form['threads'][$thread_id]), 'class' => 'privatemsg-list-select');
256
+        // Theme the row.
257
+        $row = _privatemsg_list_thread($data);
258
+        $data = array();
259
+        // Render the checkbox.
260
+        $data[] = array('data' => drupal_render($form['threads'][$thread_id]), 'class' => 'privatemsg-list-select');
261 261
 
262
-      // Store the #rows data in the same order as the header is, the key property of the header refers to the field that belongs to it.
263
-      foreach ($headers as $header) {
262
+        // Store the #rows data in the same order as the header is, the key property of the header refers to the field that belongs to it.
263
+        foreach ($headers as $header) {
264 264
         if (!empty($header['key'])) {
265
-          if (isset($row['data'][$header['key']])) {
265
+            if (isset($row['data'][$header['key']])) {
266 266
             $data[] = $row['data'][$header['key']];
267
-          }
268
-          else {
267
+            }
268
+            else {
269 269
             // Store a empty value so that the order is still correct.
270 270
             $data[] = '';
271
-          }
271
+            }
272
+        }
272 273
         }
273
-      }
274
-      // Replace the data
275
-      $row['data'] = $data;
276
-      $themed_rows[] = $row;
274
+        // Replace the data
275
+        $row['data'] = $data;
276
+        $themed_rows[] = $row;
277 277
     }
278
-  }
279
-  else {
278
+    }
279
+    else {
280 280
     // Display a message if now messages are available.
281 281
     $themed_rows[] = array(array('data' => t('No messages available.'), 'colspan' => count($headers)));
282
-  }
282
+    }
283 283
 
284
-  // Remove any data in header that we don't need anymore.
285
-  foreach ($headers as $id => $header) {
284
+    // Remove any data in header that we don't need anymore.
285
+    foreach ($headers as $id => $header) {
286 286
     unset($headers[$id]['key']);
287 287
     unset($headers[$id]['#weight']);
288
-  }
288
+    }
289 289
 
290
-  // Theme the table, pass all generated information to the table theme function.
291
-  $form['list'] = array('#value' => theme('table', $headers, $themed_rows, array('class' => 'privatemsg-list')), '#weight' => 5);
292
-  return drupal_render($form);
290
+    // Theme the table, pass all generated information to the table theme function.
291
+    $form['list'] = array('#value' => theme('table', $headers, $themed_rows, array('class' => 'privatemsg-list')), '#weight' => 5);
292
+    return drupal_render($form);
293 293
 }
294 294
 
295 295
 /**
296 296
  * Theme a block which displays the number of new messages a user has.
297 297
  */
298 298
 function theme_privatemsg_new_block($count) {
299
-  $text = format_plural($count, 'You have a new message, click here to read it',
299
+    $text = format_plural($count, 'You have a new message, click here to read it',
300 300
                         'You have @count new messages, click here to read them',
301 301
                         array('@count' => $count));
302 302
 
303
-  return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link')));
303
+    return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link')));
304 304
 }
305 305
 
306 306
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     $is_new = theme_mark(MARK_NEW);
96 96
     $options['fragment'] = 'new';
97 97
   }
98
-  $field['data'] = l($thread['subject'], 'messages/view/' . $thread['thread_id'], $options) . $is_new;
98
+  $field['data'] = l($thread['subject'], 'messages/view/'.$thread['thread_id'], $options).$is_new;
99 99
   $field['class'] = 'privatemsg-list-subject';
100 100
   return $field;
101 101
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
   $options = array();
112 112
   if (!empty($thread['is_new']) && $thread['is_new'] < $thread['count']) {
113 113
     $options['fragment'] = 'new';
114
-    $field['data'] .= '<br />' . l((format_plural($thread['is_new'], '(1 new)', '(@count new)')), 'messages/view/' . $thread['thread_id'], $options);
114
+    $field['data'] .= '<br />'.l((format_plural($thread['is_new'], '(1 new)', '(@count new)')), 'messages/view/'.$thread['thread_id'], $options);
115 115
   }
116 116
   $field['class'] = 'privatemsg-list-count';
117 117
   return $field;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 function theme_privatemsg_list($form) {
240 240
   $has_posts = !empty($form['#data']);
241 241
 
242
-  drupal_add_css(drupal_get_path('module', 'privatemsg') .'/styles/privatemsg-list.css');
242
+  drupal_add_css(drupal_get_path('module', 'privatemsg').'/styles/privatemsg-list.css');
243 243
 
244 244
   // Load the table columns.
245 245
   $columns = array_merge(array('subject', 'last_updated'), array_filter(variable_get('privatemsg_display_fields', array('participants'))));
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -264,8 +264,7 @@  discard block
 block discarded – undo
264 264
         if (!empty($header['key'])) {
265 265
           if (isset($row['data'][$header['key']])) {
266 266
             $data[] = $row['data'][$header['key']];
267
-          }
268
-          else {
267
+          } else {
269 268
             // Store a empty value so that the order is still correct.
270 269
             $data[] = '';
271 270
           }
@@ -275,8 +274,7 @@  discard block
 block discarded – undo
275 274
       $row['data'] = $data;
276 275
       $themed_rows[] = $row;
277 276
     }
278
-  }
279
-  else {
277
+  } else {
280 278
     // Display a message if now messages are available.
281 279
     $themed_rows[] = array(array('data' => t('No messages available.'), 'colspan' => count($headers)));
282 280
   }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 function phptemplate_privatemsg_list_field__participants($thread) {
78 78
   $participants = _privatemsg_generate_user_array($thread['participants'], -4);
79 79
   $field = array();
80
-  $field['data'] = _privatemsg_format_participants($participants, 3, TRUE);
80
+  $field['data'] = _privatemsg_format_participants($participants, 3, true);
81 81
   $field['class'] = 'privatemsg-list-participants';
82 82
   return $field;
83 83
 }
Please login to merge, or discard this patch.
sites/default/boinc/modules/node_comment_block/node_comment_block.module 3 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,45 +9,45 @@  discard block
 block discarded – undo
9 9
  * Implements hook_block() for Drupal 6 compatibility
10 10
  */
11 11
 function node_comment_block_block($op = 'list', $delta = 0, $edit = array()) {
12
-  switch ($op) {
13
-  case 'view':
12
+    switch ($op) {
13
+    case 'view':
14 14
     //$block = node_comment_block_block_view($delta);
15 15
     $block = array();
16 16
     if ($delta == 'node_comments') {
17
-      if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
17
+        if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
18 18
         $node = node_load($nid);
19 19
         if ($node->comment !== 0) {
20
-          $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
21
-          $block['content'] = '';
22
-          if ($node->comment) {
20
+            $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
21
+            $block['content'] = '';
22
+            if ($node->comment) {
23 23
             $block['content'] .= comment_render($node);
24
-          }
24
+            }
25
+        }
25 26
         }
26
-      }
27 27
     }
28 28
     break;
29
-  case 'list':
29
+    case 'list':
30 30
     $blocks = node_comment_block_block_info();
31 31
     return $blocks;
32 32
     break;
33
-  default:
33
+    default:
34 34
   }
35
-  return $block;
35
+    return $block;
36 36
 }
37 37
 
38 38
 /**
39 39
  * Port Drupal 7 render() function to Drupal 6
40 40
  */
41 41
 function render(&$element) {
42
-  if (is_array($element)) {
42
+    if (is_array($element)) {
43 43
     show($element);
44 44
     return drupal_render($element);
45
-  }
46
-  else {
45
+    }
46
+    else {
47 47
     // Safe-guard for inappropriate use of render() on flat variables: return
48 48
     // the variable as-is.
49 49
     return $element;
50
-  }
50
+    }
51 51
 }
52 52
 
53 53
 
@@ -56,50 +56,50 @@  discard block
 block discarded – undo
56 56
  * Implements hook_block_info().
57 57
  */
58 58
 function node_comment_block_block_info() {
59
-  $blocks['node_comments'] = array(
59
+    $blocks['node_comments'] = array(
60 60
     'info' => t('Node comments'),
61
-  );
61
+    );
62 62
 
63
-  return $blocks;
63
+    return $blocks;
64 64
 }
65 65
 
66 66
 /**
67 67
  * Implements hook_block_view().
68 68
  */
69 69
 function node_comment_block_block_view($delta = '') {
70
-  $block = array();
70
+    $block = array();
71 71
 
72
-  if ($delta == 'node_comments') {
72
+    if ($delta == 'node_comments') {
73 73
     if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
74
-      $node = node_load($nid);
74
+        $node = node_load($nid);
75 75
 
76
-      if ($node->comment !== 0) {
76
+        if ($node->comment !== 0) {
77 77
         $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
78 78
         $block['content'] = '';
79 79
 
80 80
         $node = node_view($node);
81 81
 
82 82
         if ($node['comments']) {
83
-          $block['content'] .= render($node['comments']);
83
+            $block['content'] .= render($node['comments']);
84
+        }
84 85
         }
85
-      }
86 86
     }
87
-  }
87
+    }
88 88
 
89
-  return $block;
89
+    return $block;
90 90
 }
91 91
 
92 92
 /**
93 93
  * Implements hook_preprocess_HOOK() for nodes.
94 94
  */
95 95
 function node_comment_block_preprocess_node(&$variables) {
96
-  $node = $variables['node'];
97
-  // Only hide standard comments for news content
98
-  if ($variables['type'] == 'news') {
96
+    $node = $variables['node'];
97
+    // Only hide standard comments for news content
98
+    if ($variables['type'] == 'news') {
99 99
     $variables['node']->comment = 0;
100
-  }
100
+    }
101 101
   
102
-  /* Drupal 7...
102
+    /* Drupal 7...
103 103
   if ($node->comment !== 0 && $variables['view_mode'] == 'full') {
104 104
     if (isset($variables['content']['comments'])) {
105 105
       unset($variables['content']['comments']);
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
  * Implements hook_form_FORM_ID_alter() for block_admin_configure.
114 114
  */
115 115
 function node_comment_block_form_block_admin_configure_alter(&$form, &$form_state) {
116
-  if (isset($form['delta'])) {
116
+    if (isset($form['delta'])) {
117 117
     if ($form['delta']['#value'] == 'node_comments') {
118
-      $form['settings']['title']['#disabled'] = TRUE;
119
-      $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
118
+        $form['settings']['title']['#disabled'] = TRUE;
119
+        $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
120
+    }
120 121
     }
121
-  }
122 122
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@
 block discarded – undo
42 42
   if (is_array($element)) {
43 43
     show($element);
44 44
     return drupal_render($element);
45
-  }
46
-  else {
45
+  } else {
47 46
     // Safe-guard for inappropriate use of render() on flat variables: return
48 47
     // the variable as-is.
49 48
     return $element;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
       if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
18 18
         $node = node_load($nid);
19 19
         if ($node->comment !== 0) {
20
-          $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
20
+          $block['subject'] = null; // This should be NULL otherwise there will be duplicate h2 elements.
21 21
           $block['content'] = '';
22 22
           if ($node->comment) {
23 23
             $block['content'] .= comment_render($node);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
       $node = node_load($nid);
75 75
 
76 76
       if ($node->comment !== 0) {
77
-        $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
77
+        $block['subject'] = null; // This should be NULL otherwise there will be duplicate h2 elements.
78 78
         $block['content'] = '';
79 79
 
80 80
         $node = node_view($node);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 function node_comment_block_form_block_admin_configure_alter(&$form, &$form_state) {
116 116
   if (isset($form['delta'])) {
117 117
     if ($form['delta']['#value'] == 'node_comments') {
118
-      $form['settings']['title']['#disabled'] = TRUE;
118
+      $form['settings']['title']['#disabled'] = true;
119 119
       $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
120 120
     }
121 121
   }
Please login to merge, or discard this patch.
modules/boinc_solr_search/boinc_solr_comments/boinc_solr_comments.module 5 patches
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -280,12 +280,12 @@  discard block
 block discarded – undo
280 280
   }
281 281
 
282 282
   switch ($op) {
283
-    case 'delete':
284
-      // Only call delete function on certain node types
285
-      if (in_array( $node->type, $node_types)) {
286
-        boinc_solr_comments_delete($node);
287
-      }
288
-      break;
283
+  case 'delete':
284
+    // Only call delete function on certain node types
285
+    if (in_array( $node->type, $node_types)) {
286
+      boinc_solr_comments_delete($node);
287
+    }
288
+    break;
289 289
   } //switch
290 290
 }
291 291
 
@@ -335,13 +335,13 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function boinc_solr_comments_comment(&$a1, $op) {
337 337
   switch ($op) {
338
-    case 'view':
339
-    case 'update':
340
-      break;
341
-    case 'delete':
342
-      // $a1 should be a comment object
343
-      boinc_solr_comments_deletecomment($a1);
344
-      break;
338
+  case 'view':
339
+  case 'update':
340
+    break;
341
+  case 'delete':
342
+    // $a1 should be a comment object
343
+    boinc_solr_comments_deletecomment($a1);
344
+    break;
345 345
   }// switch
346 346
 }
347 347
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
131 131
         if ($comment->uid == 0 || strlen($comment->name) == 0) {
132 132
           // @see user_validate_name(). !'0' === TRUE.
133 133
           $comment_document->ss_name = '0';
134
-        }
135
-        else {
134
+        } else {
136 135
           $comment_document->ss_name = $comment->name;
137 136
           // We want the name to be searchable for keywords.
138 137
           $comment_document->tos_name = $comment->name;
@@ -318,8 +317,7 @@  discard block
 block discarded – undo
318 317
     $solr->deleteByQuery($query);
319 318
     // Log the query used for deletion.
320 319
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
321
-  }
322
-  catch (Exception $e) {
320
+  } catch (Exception $e) {
323 321
       watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
324 322
       return FALSE;
325 323
   }// try
@@ -376,8 +374,7 @@  discard block
 block discarded – undo
376 374
     $solr->deleteByQuery($query);
377 375
     // Log the query used for deletion.
378 376
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
379
-    }
380
-  catch (Exception $e) {
377
+    } catch (Exception $e) {
381 378
     watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
382 379
     return FALSE;
383 380
   }// try
Please login to merge, or discard this patch.
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@  discard block
 block discarded – undo
14 14
  * Implementation of hook_menu()
15 15
  */
16 16
 function boinc_solr_comments_menu() {
17
-  $items = array();
18
-  $base_path = 'admin/settings/apachesolr/indexcomments';
19
-  $items[$base_path] = array(
20
-      'title' => 'Index Comments',
21
-      'description' => 'Administer Indexing of Comments',
22
-      'page callback' => 'drupal_get_form',
23
-      'page arguments' => array('boinc_solr_comments_form'),
24
-      'access arguments' => array('administer search'),
25
-      'file' => 'boinc_solr_comments.admin.inc',
26
-      'weight' => '10',
27
-  );
28
-
29
-  return $items;
17
+    $items = array();
18
+    $base_path = 'admin/settings/apachesolr/indexcomments';
19
+    $items[$base_path] = array(
20
+        'title' => 'Index Comments',
21
+        'description' => 'Administer Indexing of Comments',
22
+        'page callback' => 'drupal_get_form',
23
+        'page arguments' => array('boinc_solr_comments_form'),
24
+        'access arguments' => array('administer search'),
25
+        'file' => 'boinc_solr_comments.admin.inc',
26
+        'weight' => '10',
27
+    );
28
+
29
+    return $items;
30 30
 }
31 31
 
32 32
 
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
  *   Environment ID for apache solr.
59 59
  */
60 60
 function boinc_solr_comments_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) {
61
-  $comdocs = array();
61
+    $comdocs = array();
62 62
 
63
-  // Array of node types that will have comments indexed.
64
-  $node_types = variable_get('boinc_solr_comments_nodetypes', '');
65
-  if (empty($node_types)) {
63
+    // Array of node types that will have comments indexed.
64
+    $node_types = variable_get('boinc_solr_comments_nodetypes', '');
65
+    if (empty($node_types)) {
66 66
     // If the variable has not been set, then by default index
67 67
     // comments for all known node types.
68 68
     $node_types = array(
@@ -72,28 +72,28 @@  discard block
 block discarded – undo
72 72
         'story'      => 'story',
73 73
         'team_forum' => 'team_forum',
74 74
     );
75
-  }
75
+    }
76 76
   
77
-  // Loop over all documents and alter:
78
-  foreach ($documents as $document) {
77
+    // Loop over all documents and alter:
78
+    foreach ($documents as $document) {
79 79
     //dd($document, "index documents alter - document");
80 80
 
81 81
     $to_process = ( array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle] );
82 82
     if ( $document->entity_type=='node' AND $to_process) {
83 83
       
84
-      // Remove ts_comments if present.
85
-      if (isset($document->ts_comments)) {
84
+        // Remove ts_comments if present.
85
+        if (isset($document->ts_comments)) {
86 86
         unset($document->ts_comments);
87
-      }
88
-      // Node information.
89
-      $nid = $document->entity_id;
90
-      $node = node_load($nid);
87
+        }
88
+        // Node information.
89
+        $nid = $document->entity_id;
90
+        $node = node_load($nid);
91 91
       
92
-      // Query database for comments of node. Only return comments
93
-      // with status 0 (0 is published for comments).
94
-      $sql = 'SELECT cid from {comments} WHERE nid = %d AND status = 0 ORDER by timestamp DESC';
95
-      $resource = db_query($sql, $nid);
96
-      while ($row = db_fetch_array($resource)) {
92
+        // Query database for comments of node. Only return comments
93
+        // with status 0 (0 is published for comments).
94
+        $sql = 'SELECT cid from {comments} WHERE nid = %d AND status = 0 ORDER by timestamp DESC';
95
+        $resource = db_query($sql, $nid);
96
+        while ($row = db_fetch_array($resource)) {
97 97
         // Load the comment from cid.
98 98
         $comment = _comment_load($row['cid']);
99 99
 
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
         // Comment object has no language
117 117
         $comment_document->ss_language = 'und';
118 118
         if (function_exists('drupal_get_path_alias')) {
119
-          $output = drupal_get_path_alias($comment_document->path, NULL);
120
-          if ($output && $output != $document->path) {
119
+            $output = drupal_get_path_alias($comment_document->path, NULL);
120
+            if ($output && $output != $document->path) {
121 121
             $comment_document->path_alias = $output;
122
-          }
122
+            }
123 123
         }
124 124
         
125 125
         // Code derived from apachesolr_index_node_solr_document
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 
130 130
         // Author information
131 131
         if ($comment->uid == 0 || strlen($comment->name) == 0) {
132
-          // @see user_validate_name(). !'0' === TRUE.
133
-          $comment_document->ss_name = '0';
132
+            // @see user_validate_name(). !'0' === TRUE.
133
+            $comment_document->ss_name = '0';
134 134
         }
135 135
         else {
136
-          $comment_document->ss_name = $comment->name;
137
-          // We want the name to be searchable for keywords.
138
-          $comment_document->tos_name = $comment->name;
136
+            $comment_document->ss_name = $comment->name;
137
+            // We want the name to be searchable for keywords.
138
+            $comment_document->tos_name = $comment->name;
139 139
         }
140 140
 
141 141
         // Index formatted username so it can be searched and sorted
@@ -157,59 +157,59 @@  discard block
 block discarded – undo
157 157
         // Unset the following fields (if set) that don't make sense
158 158
         // for a comment.
159 159
         if (isset($comment_document->bs_sticky)) {
160
-          unset($comment_document->bs_sticky);
160
+            unset($comment_document->bs_sticky);
161 161
         }
162 162
         if (isset($comment_document->bs_promote)) {
163
-          unset($comment_document->bs_promote);
163
+            unset($comment_document->bs_promote);
164 164
         }    
165 165
         if (isset($comment_document->is_tnid)) {
166
-          unset($comment_document->is_tnid);
166
+            unset($comment_document->is_tnid);
167 167
         }
168 168
         if (isset($comment_document->bs_translate)) {
169
-          unset($comment_document->bs_translate);
169
+            unset($comment_document->bs_translate);
170 170
         }
171 171
         if (isset($comment_document->ts_last_comment_timestamp)) {
172
-          unset($comment_document->ts_last_comment_timestamp);
172
+            unset($comment_document->ts_last_comment_timestamp);
173 173
         }
174 174
         if (isset($comment_document->ds_last_comment_or_change)) {
175
-          unset($comment_document->ds_last_comment_or_change);
175
+            unset($comment_document->ds_last_comment_or_change);
176 176
         }
177 177
         if (isset($comment_document->is_comment_count)) {
178
-          unset($comment_document->is_comment_count);
178
+            unset($comment_document->is_comment_count);
179 179
         }
180 180
 
181 181
         // Loop over fields in document and copy relevant values into
182 182
         // comment_document.
183 183
         foreach ($document as $fieldName => $fieldValue) {
184 184
 
185
-          // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1],
186
-          // [im_vid_Forums], [tm_vid_1_names]
187
-          if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) {
185
+            // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1],
186
+            // [im_vid_Forums], [tm_vid_1_names]
187
+            if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) {
188 188
             foreach ($fieldValue as $subkey => $subvalue) {
189
-              $comment_document->addField($fieldName, $subvalue);
189
+                $comment_document->addField($fieldName, $subvalue);
190 190
             }
191
-          }// if preg_match
191
+            }// if preg_match
192 192
                
193
-          // Set the access keys so this module will work with
194
-          // apachesolr_access.
195
-          if (module_exists('apachesolr_access')) {
193
+            // Set the access keys so this module will work with
194
+            // apachesolr_access.
195
+            if (module_exists('apachesolr_access')) {
196 196
             if (preg_match('/^access/', $fieldName) AND is_array($fieldValue)) {
197
-              foreach ($fieldValue as $subkey => $subvalue) {
197
+                foreach ($fieldValue as $subkey => $subvalue) {
198 198
                 $comment_document->addField($fieldName, $subvalue);
199
-              }
199
+                }
200 200
             }// if preg_match
201
-          }// if module_exist
201
+            }// if module_exist
202 202
             
203 203
         }// foreach document
204 204
         
205 205
         $comdocs[] = $comment_document;
206
-      }// while
206
+        }// while
207 207
     }// if entity_type=node
208
-  }// documents
208
+    }// documents
209 209
 
210
-  // Merge the comment documents with the input documents array. These
211
-  // documents will now be added to the Solr search index.
212
-  $documents = array_merge($documents, $comdocs);
210
+    // Merge the comment documents with the input documents array. These
211
+    // documents will now be added to the Solr search index.
212
+    $documents = array_merge($documents, $comdocs);
213 213
 }
214 214
 
215 215
 /**
@@ -225,19 +225,19 @@  discard block
 block discarded – undo
225 225
  *   The Solr query used for the search.
226 226
  */
227 227
 function boinc_solr_comments_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) {
228
-  //dpm($query->getSolrParams(), "process_results query getSolrParams");
229
-  foreach($results as $id => $result) {
228
+    //dpm($query->getSolrParams(), "process_results query getSolrParams");
229
+    foreach($results as $id => $result) {
230 230
     if ($result['entity_type']=='comment') {
231 231
         $results[$id]['type'] = 'Comment';
232 232
         $results[$id]['date'] = $result['fields']['changed'];
233 233
         if (isset($result['fields']['is_uid'])) {
234
-          $uid = $result['fields']['is_uid'];
235
-          $results[$id]['uid']  = $uid;
236
-          $results[$id]['user'] = theme('username', user_load($uid));
234
+            $uid = $result['fields']['is_uid'];
235
+            $results[$id]['uid']  = $uid;
236
+            $results[$id]['user'] = theme('username', user_load($uid));
237 237
         }
238 238
     } //if result entity_type == comment
239
-  }// foreach $result
240
-  //dpm($results, "process_results array_results");
239
+    }// foreach $result
240
+    //dpm($results, "process_results array_results");
241 241
 }
242 242
 
243 243
 /**
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
  *   The Solr query used for the search.
252 252
  */
253 253
 function boinc_solr_comments_apachesolr_query_alter($query) {
254
-  // Add custom field to query results
255
-  $query->addParam('fl','tos_content_extra');
254
+    // Add custom field to query results
255
+    $query->addParam('fl','tos_content_extra');
256 256
 }
257 257
 
258 258
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
  * 
266 266
  */
267 267
 function boinc_solr_comments_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
268
-  // Array of node types that will have comments indexed.
269
-  $node_types = variable_get('boinc_solr_comments_nodetypes', '');
270
-  if (empty($node_types)) {
268
+    // Array of node types that will have comments indexed.
269
+    $node_types = variable_get('boinc_solr_comments_nodetypes', '');
270
+    if (empty($node_types)) {
271 271
     // If the variable has not been set, then by default index
272 272
     // comments for all known node types.
273 273
     $node_types = array(
@@ -277,16 +277,16 @@  discard block
 block discarded – undo
277 277
         'story'      => 'story',
278 278
         'team_forum' => 'team_forum',
279 279
     );
280
-  }
280
+    }
281 281
 
282
-  switch ($op) {
282
+    switch ($op) {
283 283
     case 'delete':
284 284
       // Only call delete function on certain node types
285 285
       if (in_array( $node->type, $node_types)) {
286 286
         boinc_solr_comments_delete($node);
287
-      }
288
-      break;
289
-  } //switch
287
+        }
288
+        break;
289
+    } //switch
290 290
 }
291 291
 
292 292
 
@@ -303,30 +303,30 @@  discard block
 block discarded – undo
303 303
  *   Returns TRUE if the comment was deleted, otherwise return FALSE.
304 304
  */
305 305
 function boinc_solr_comments_delete($node) {
306
-  // Load the Solr environment.
307
-  $env_id = apachesolr_default_environment();
308
-  // Check to see if Solr is read-only.
309
-  if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
306
+    // Load the Solr environment.
307
+    $env_id = apachesolr_default_environment();
308
+    // Check to see if Solr is read-only.
309
+    if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
310 310
     return FALSE;
311
-  }
311
+    }
312 312
   
313
-  // Code derived from apachesolr_index_delete_entity_from_index
314
-  try {
313
+    // Code derived from apachesolr_index_delete_entity_from_index
314
+    try {
315 315
     $solr = apachesolr_get_solr($env_id);
316 316
     // Custom query to find all comments with parent nid of the node bing deleted.
317 317
     $query = "entity_type:comment AND tos_content_extra:" . $node->nid;
318 318
     $solr->deleteByQuery($query);
319 319
     // Log the query used for deletion.
320 320
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
321
-  }
322
-  catch (Exception $e) {
323
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
324
-      return FALSE;
325
-  }// try
326
-
327
-  // all deletions sucessful
328
-  apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
329
-  return TRUE;
321
+    }
322
+    catch (Exception $e) {
323
+        watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
324
+        return FALSE;
325
+    }// try
326
+
327
+    // all deletions sucessful
328
+    apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
329
+    return TRUE;
330 330
 }
331 331
 
332 332
 /**
@@ -334,15 +334,15 @@  discard block
 block discarded – undo
334 334
  *
335 335
  */
336 336
 function boinc_solr_comments_comment(&$a1, $op) {
337
-  switch ($op) {
337
+    switch ($op) {
338 338
     case 'view':
339 339
     case 'update':
340 340
       break;
341 341
     case 'delete':
342 342
       // $a1 should be a comment object
343 343
       boinc_solr_comments_deletecomment($a1);
344
-      break;
345
-  }// switch
344
+        break;
345
+    }// switch
346 346
 }
347 347
 
348 348
 /** 
@@ -358,16 +358,16 @@  discard block
 block discarded – undo
358 358
  *   Returns TRUE if the comment was deleted, otherwise return FALSE.
359 359
  */
360 360
 function boinc_solr_comments_deletecomment($comment) {
361
-  // Load the Solr environment.
362
-  $env_id = apachesolr_default_environment();
363
-  // Check to see if Solr is read-only.
364
-  if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
361
+    // Load the Solr environment.
362
+    $env_id = apachesolr_default_environment();
363
+    // Check to see if Solr is read-only.
364
+    if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
365 365
     return FALSE;
366
-  }
367
-  //dd($comment->cid, "delete - nid begin");
366
+    }
367
+    //dd($comment->cid, "delete - nid begin");
368 368
     
369
-  // Code derived from apachesolr_index_delete_entity_from_index.
370
-  try {
369
+    // Code derived from apachesolr_index_delete_entity_from_index.
370
+    try {
371 371
     $solr = apachesolr_get_solr($env_id);
372 372
     $entity_id = $comment->cid;
373 373
     $entity_type = 'comment';
@@ -377,14 +377,14 @@  discard block
 block discarded – undo
377 377
     // Log the query used for deletion.
378 378
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
379 379
     }
380
-  catch (Exception $e) {
380
+    catch (Exception $e) {
381 381
     watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
382 382
     return FALSE;
383
-  }// try
383
+    }// try
384 384
 
385
-  // deletion sucessful
386
-  apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
387
-  return TRUE;
385
+    // deletion sucessful
386
+    apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
387
+    return TRUE;
388 388
 }
389 389
 
390 390
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
  */
400 400
 
401 401
 function boinc_solr_comments_enable() {
402
-  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
402
+    drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
403 403
 }
404 404
 
405 405
 /** 
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
  *   The comment to be published (unhidden).
411 411
  */
412 412
 function boinc_solr_comments_publish($comment) {
413
-  if ( ($comment->cid) AND ($comment->nid) ) {
413
+    if ( ($comment->cid) AND ($comment->nid) ) {
414 414
     $node = node_load($comment->nid);
415 415
     // Tell Solr that the node has been updated, so the comment can be
416 416
     // indexed.
417 417
     apachesolr_entity_update($node, 'node');
418
-  }
418
+    }
419 419
 }
420 420
 
421 421
 /** 
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
  *   The comment to be unpublished (hidden). 
427 427
  */
428 428
 function boinc_solr_comments_unpublish($comment) {
429
-  if ( ($comment->cid) ) {
429
+    if ( ($comment->cid) ) {
430 430
     // Call the deletecomment function for hook comment.
431 431
     boinc_solr_comments_deletecomment($comment);
432
-  }
432
+    }
433 433
 }
434 434
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
   foreach ($documents as $document) {
79 79
     //dd($document, "index documents alter - document");
80 80
 
81
-    $to_process = ( array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle] );
82
-    if ( $document->entity_type=='node' AND $to_process) {
81
+    $to_process = (array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle]);
82
+    if ($document->entity_type == 'node' AND $to_process) {
83 83
       
84 84
       // Remove ts_comments if present.
85 85
       if (isset($document->ts_comments)) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $comment_document->bundle = 'Comment';
111 111
         $comment_document->bundle_name = 'Comment';
112 112
 
113
-        $comment_document->path = 'goto/comment/' . $comment->cid;
113
+        $comment_document->path = 'goto/comment/'.$comment->cid;
114 114
         $comment_document->url = url($comment_document->path, $url_options);
115 115
 
116 116
         // Comment object has no language
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         // Index formatted username so it can be searched and sorted
142 142
         // on.
143
-        $account = (object) array('uid' => $comment->uid, 'name' => $comment->name);
143
+        $account = (object)array('uid' => $comment->uid, 'name' => $comment->name);
144 144
         $username = check_plain($account->name);
145 145
         $comment_document->ss_name_formatted = $username;
146 146
         $comment_document->tos_name_formatted = $username;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
           // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1],
186 186
           // [im_vid_Forums], [tm_vid_1_names]
187
-          if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) {
187
+          if ((preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName)) AND is_array($fieldValue)) {
188 188
             foreach ($fieldValue as $subkey => $subvalue) {
189 189
               $comment_document->addField($fieldName, $subvalue);
190 190
             }
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
  */
227 227
 function boinc_solr_comments_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) {
228 228
   //dpm($query->getSolrParams(), "process_results query getSolrParams");
229
-  foreach($results as $id => $result) {
230
-    if ($result['entity_type']=='comment') {
229
+  foreach ($results as $id => $result) {
230
+    if ($result['entity_type'] == 'comment') {
231 231
         $results[$id]['type'] = 'Comment';
232 232
         $results[$id]['date'] = $result['fields']['changed'];
233 233
         if (isset($result['fields']['is_uid'])) {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
  */
253 253
 function boinc_solr_comments_apachesolr_query_alter($query) {
254 254
   // Add custom field to query results
255
-  $query->addParam('fl','tos_content_extra');
255
+  $query->addParam('fl', 'tos_content_extra');
256 256
 }
257 257
 
258 258
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
   switch ($op) {
283 283
     case 'delete':
284 284
       // Only call delete function on certain node types
285
-      if (in_array( $node->type, $node_types)) {
285
+      if (in_array($node->type, $node_types)) {
286 286
         boinc_solr_comments_delete($node);
287 287
       }
288 288
       break;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
   try {
315 315
     $solr = apachesolr_get_solr($env_id);
316 316
     // Custom query to find all comments with parent nid of the node bing deleted.
317
-    $query = "entity_type:comment AND tos_content_extra:" . $node->nid;
317
+    $query = "entity_type:comment AND tos_content_extra:".$node->nid;
318 318
     $solr->deleteByQuery($query);
319 319
     // Log the query used for deletion.
320 320
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
  */
400 400
 
401 401
 function boinc_solr_comments_enable() {
402
-  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
402
+  drupal_set_message(bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
403 403
 }
404 404
 
405 405
 /** 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
  *   The comment to be published (unhidden).
411 411
  */
412 412
 function boinc_solr_comments_publish($comment) {
413
-  if ( ($comment->cid) AND ($comment->nid) ) {
413
+  if (($comment->cid) AND ($comment->nid)) {
414 414
     $node = node_load($comment->nid);
415 415
     // Tell Solr that the node has been updated, so the comment can be
416 416
     // indexed.
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
  *   The comment to be unpublished (hidden). 
427 427
  */
428 428
 function boinc_solr_comments_unpublish($comment) {
429
-  if ( ($comment->cid) ) {
429
+  if (($comment->cid)) {
430 430
     // Call the deletecomment function for hook comment.
431 431
     boinc_solr_comments_deletecomment($comment);
432 432
   }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
   foreach ($documents as $document) {
79 79
     //dd($document, "index documents alter - document");
80 80
 
81
-    $to_process = ( array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle] );
82
-    if ( $document->entity_type=='node' AND $to_process) {
81
+    $to_process = ( array_key_exists($document->bundle, $node_types) and $node_types[$document->bundle] );
82
+    if ( $document->entity_type=='node' and $to_process) {
83 83
       
84 84
       // Remove ts_comments if present.
85 85
       if (isset($document->ts_comments)) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $comment = _comment_load($row['cid']);
99 99
 
100 100
         // Code derived from _apachesolr_index_process_entity_get_document
101
-        $url_options = array('absolute' => TRUE);
101
+        $url_options = array('absolute' => true);
102 102
         $comment_document = new ApacheSolrdocument();
103 103
 
104 104
         $comment_document->id = apachesolr_document_id($comment->cid, 'comment');
@@ -116,16 +116,16 @@  discard block
 block discarded – undo
116 116
         // Comment object has no language
117 117
         $comment_document->ss_language = 'und';
118 118
         if (function_exists('drupal_get_path_alias')) {
119
-          $output = drupal_get_path_alias($comment_document->path, NULL);
119
+          $output = drupal_get_path_alias($comment_document->path, null);
120 120
           if ($output && $output != $document->path) {
121 121
             $comment_document->path_alias = $output;
122 122
           }
123 123
         }
124 124
         
125 125
         // Code derived from apachesolr_index_node_solr_document
126
-        $comment_document->label = truncate_utf8(apachesolr_clean_text($comment->comment), 32, TRUE);
126
+        $comment_document->label = truncate_utf8(apachesolr_clean_text($comment->comment), 32, true);
127 127
         $comment_document->content = apachesolr_clean_text($comment->comment);
128
-        $comment_document->teaser = truncate_utf8($document->content, 300, TRUE);
128
+        $comment_document->teaser = truncate_utf8($document->content, 300, true);
129 129
 
130 130
         // Author information
131 131
         if ($comment->uid == 0 || strlen($comment->name) == 0) {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
           // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1],
186 186
           // [im_vid_Forums], [tm_vid_1_names]
187
-          if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) {
187
+          if ( ( preg_match('/tid/', $fieldName) or preg_match('/vid/', $fieldName) ) and is_array($fieldValue) ) {
188 188
             foreach ($fieldValue as $subkey => $subvalue) {
189 189
               $comment_document->addField($fieldName, $subvalue);
190 190
             }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
           // Set the access keys so this module will work with
194 194
           // apachesolr_access.
195 195
           if (module_exists('apachesolr_access')) {
196
-            if (preg_match('/^access/', $fieldName) AND is_array($fieldValue)) {
196
+            if (preg_match('/^access/', $fieldName) and is_array($fieldValue)) {
197 197
               foreach ($fieldValue as $subkey => $subvalue) {
198 198
                 $comment_document->addField($fieldName, $subvalue);
199 199
               }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
  * Implementation of hook_nodeapi()
265 265
  * 
266 266
  */
267
-function boinc_solr_comments_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
267
+function boinc_solr_comments_nodeapi(&$node, $op, $a3 = null, $a4 = null) {
268 268
   // Array of node types that will have comments indexed.
269 269
   $node_types = variable_get('boinc_solr_comments_nodetypes', '');
270 270
   if (empty($node_types)) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
   $env_id = apachesolr_default_environment();
308 308
   // Check to see if Solr is read-only.
309 309
   if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
310
-    return FALSE;
310
+    return false;
311 311
   }
312 312
   
313 313
   // Code derived from apachesolr_index_delete_entity_from_index
@@ -320,13 +320,13 @@  discard block
 block discarded – undo
320 320
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
321 321
   }
322 322
   catch (Exception $e) {
323
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
324
-      return FALSE;
323
+      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), null, WATCHDOG_ERROR);
324
+      return false;
325 325
   }// try
326 326
 
327 327
   // all deletions sucessful
328 328
   apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
329
-  return TRUE;
329
+  return true;
330 330
 }
331 331
 
332 332
 /**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
   $env_id = apachesolr_default_environment();
363 363
   // Check to see if Solr is read-only.
364 364
   if (apachesolr_environment_variable_get($env_id, 'apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_ONLY) {
365
-    return FALSE;
365
+    return false;
366 366
   }
367 367
   //dd($comment->cid, "delete - nid begin");
368 368
     
@@ -378,13 +378,13 @@  discard block
 block discarded – undo
378 378
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
379 379
     }
380 380
   catch (Exception $e) {
381
-    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
382
-    return FALSE;
381
+    watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), null, WATCHDOG_ERROR);
382
+    return false;
383 383
   }// try
384 384
 
385 385
   // deletion sucessful
386 386
   apachesolr_set_last_index_updated($env_id, APACHESOLR_REQUEST_TIME);
387
-  return TRUE;
387
+  return true;
388 388
 }
389 389
 
390 390
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
  */
400 400
 
401 401
 function boinc_solr_comments_enable() {
402
-  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
402
+  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), null, 'boinc:admin-solr-index-comments-message'), 'warning');
403 403
 }
404 404
 
405 405
 /** 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
  *   The comment to be published (unhidden).
411 411
  */
412 412
 function boinc_solr_comments_publish($comment) {
413
-  if ( ($comment->cid) AND ($comment->nid) ) {
413
+  if ( ($comment->cid) and ($comment->nid) ) {
414 414
     $node = node_load($comment->nid);
415 415
     // Tell Solr that the node has been updated, so the comment can be
416 416
     // indexed.
Please login to merge, or discard this patch.
modules/boinc_solr_search/boinc_solr_comments/boinc_solr_comments.admin.inc 4 patches
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
   foreach (content_types() as $key => $info) {
20 20
     // Exclude node types profile, team, and panel
21 21
     switch ($key) {
22
-      case 'profile':
23
-      case 'team':
24
-      case 'panel':
25
-        continue 2;
22
+    case 'profile':
23
+    case 'team':
24
+    case 'panel':
25
+      continue 2;
26 26
     }// switch key
27 27
     $options[$key] = $info['name'];
28 28
   }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     'boinc_solr_comments_nodetypes' => variable_get('boinc_solr_comments_nodetypes', ''),
34 34
   );
35 35
   if (empty($default['boinc_solr_comments_nodetypes'])) {
36
-    $default['boinc_solr_comments_nodetypes'] = array('forum','team_forum','news','page','story');
36
+    $default['boinc_solr_comments_nodetypes'] = array('forum', 'team_forum', 'news', 'page', 'story');
37 37
   }
38 38
   
39 39
   // Define the form
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,48 +7,48 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 function boinc_solr_comments_form(&$form_state) {
10
-  $form = array();
10
+    $form = array();
11 11
 
12
-  $form['config'] = array(
12
+    $form['config'] = array(
13 13
     '#type' => 'fieldset',
14 14
     '#title' => t('Configuration'),
15 15
     '#collapsible' => TRUE,
16
-  );
16
+    );
17 17
 
18
-  $options = array();
19
-  foreach (content_types() as $key => $info) {
18
+    $options = array();
19
+    foreach (content_types() as $key => $info) {
20 20
     // Exclude node types profile, team, and panel
21 21
     switch ($key) {
22
-      case 'profile':
22
+        case 'profile':
23 23
       case 'team':
24 24
       case 'panel':
25 25
         continue 2;
26 26
     }// switch key
27 27
     $options[$key] = $info['name'];
28
-  }
29
-  asort($options);
28
+    }
29
+    asort($options);
30 30
   
31
-  // Form defaults
32
-  $default = array(
31
+    // Form defaults
32
+    $default = array(
33 33
     'boinc_solr_comments_nodetypes' => variable_get('boinc_solr_comments_nodetypes', ''),
34
-  );
35
-  if (empty($default['boinc_solr_comments_nodetypes'])) {
34
+    );
35
+    if (empty($default['boinc_solr_comments_nodetypes'])) {
36 36
     $default['boinc_solr_comments_nodetypes'] = array('forum','team_forum','news','page','story');
37
-  }
37
+    }
38 38
   
39
-  // Define the form
40
-  $form['config']['nodes'] = array(
39
+    // Define the form
40
+    $form['config']['nodes'] = array(
41 41
     '#type'  => 'markup',
42 42
     '#value' => bts('Select the content types where the comments are indexed by Apace Solr. Your content must be re-indexed after changing this configuration.', array(), NULL, 'boinc:admin-solr-search-comments-option'),
43
-  );
43
+    );
44 44
       
45
-  $form['config']['boinc_solr_comments_nodetypes'] = array(
45
+    $form['config']['boinc_solr_comments_nodetypes'] = array(
46 46
     '#type'          => 'checkboxes',
47 47
     '#title'         => 'node',
48 48
     '#options'       => $options,
49 49
     '#default_value' => $default['boinc_solr_comments_nodetypes'],
50
-  );
50
+    );
51 51
 
52
-  return system_settings_form($form);
52
+    return system_settings_form($form);
53 53
 }
54 54
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
   $form['config'] = array(
13 13
     '#type' => 'fieldset',
14 14
     '#title' => t('Configuration'),
15
-    '#collapsible' => TRUE,
15
+    '#collapsible' => true,
16 16
   );
17 17
 
18 18
   $options = array();
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
   // Define the form
40 40
   $form['config']['nodes'] = array(
41 41
     '#type'  => 'markup',
42
-    '#value' => bts('Select the content types where the comments are indexed by Apace Solr. Your content must be re-indexed after changing this configuration.', array(), NULL, 'boinc:admin-solr-search-comments-option'),
42
+    '#value' => bts('Select the content types where the comments are indexed by Apace Solr. Your content must be re-indexed after changing this configuration.', array(), null, 'boinc:admin-solr-search-comments-option'),
43 43
   );
44 44
       
45 45
   $form['config']['boinc_solr_comments_nodetypes'] = array(
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pIndicator.class.php 4 patches
Indentation   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pIndicator - class to draw indicators
4 4
 
5 5
      Version     : 2.1.3
@@ -13,229 +13,229 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("INDICATOR_CAPTION_DEFAULT"	, 700001);
17
- define("INDICATOR_CAPTION_EXTENDED"	, 700002);
16
+    define("INDICATOR_CAPTION_DEFAULT"	, 700001);
17
+    define("INDICATOR_CAPTION_EXTENDED"	, 700002);
18 18
 
19
- define("INDICATOR_CAPTION_INSIDE"	, 700011);
20
- define("INDICATOR_CAPTION_BOTTOM"	, 700012);
19
+    define("INDICATOR_CAPTION_INSIDE"	, 700011);
20
+    define("INDICATOR_CAPTION_BOTTOM"	, 700012);
21 21
 
22
- define("INDICATOR_VALUE_BUBBLE"	, 700021);
23
- define("INDICATOR_VALUE_LABEL"		, 700022);
22
+    define("INDICATOR_VALUE_BUBBLE"	, 700021);
23
+    define("INDICATOR_VALUE_LABEL"		, 700022);
24 24
 
25
- /* pIndicator class definition */
26
- class pIndicator
27
-  {
28
-   var $pChartObject;
25
+    /* pIndicator class definition */
26
+    class pIndicator
27
+    {
28
+    var $pChartObject;
29 29
 
30
-   /* Class creator */
31
-   function pIndicator($pChartObject)
30
+    /* Class creator */
31
+    function pIndicator($pChartObject)
32 32
     {
33
-     $this->pChartObject = $pChartObject;
33
+        $this->pChartObject = $pChartObject;
34 34
     }
35 35
 
36
-   /* Draw an indicator */
37
-   function draw($X,$Y,$Width,$Height,$Format="")
36
+    /* Draw an indicator */
37
+    function draw($X,$Y,$Width,$Height,$Format="")
38 38
     {
39
-     $Values			= isset($Format["Values"]) ? $Format["Values"] : VOID;
40
-     $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
41
-     $ValueDisplay		= isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
42
-     $SectionsMargin		= isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
43
-     $DrawLeftHead		= isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : TRUE;
44
-     $DrawRightHead		= isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : TRUE;
45
-     $HeadSize			= isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height/4);
46
-     $TextPadding		= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
47
-     $CaptionLayout		= isset($Format["CaptionLayout"]) ? $Format["CaptionLayout"] : INDICATOR_CAPTION_EXTENDED;
48
-     $CaptionPosition		= isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
49
-     $CaptionColorFactor	= isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : NULL;
50
-     $CaptionR			= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
51
-     $CaptionG			= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
52
-     $CaptionB			= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
53
-     $CaptionAlpha		= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
54
-     $SubCaptionColorFactor	= isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : NULL;
55
-     $SubCaptionR		= isset($Format["SubCaptionR"]) ? $Format["SubCaptionR"] : 50;
56
-     $SubCaptionG		= isset($Format["SubCaptionG"]) ? $Format["SubCaptionG"] : 50;
57
-     $SubCaptionB		= isset($Format["SubCaptionB"]) ? $Format["SubCaptionB"] : 50;
58
-     $SubCaptionAlpha		= isset($Format["SubCaptionAlpha"]) ? $Format["SubCaptionAlpha"] : 100;
59
-     $ValueFontName		= isset($Format["ValueFontName"]) ? $Format["ValueFontName"] : $this->pChartObject->FontName;
60
-     $ValueFontSize		= isset($Format["ValueFontSize"]) ? $Format["ValueFontSize"] : $this->pChartObject->FontSize;
61
-     $CaptionFontName		= isset($Format["CaptionFontName"]) ? $Format["CaptionFontName"] : $this->pChartObject->FontName;
62
-     $CaptionFontSize		= isset($Format["CaptionFontSize"]) ? $Format["CaptionFontSize"] : $this->pChartObject->FontSize;
63
-     $Unit			= isset($Format["Unit"]) ? $Format["Unit"] : "";
64
-
65
-     /* Convert the Values to display to an array if needed */
66
-     if ( !is_array($Values) ) { $Value = $Values; $Values = ""; $Values[] = $Value; }
67
-
68
-     /* No section, let's die */
69
-     if ( $IndicatorSections == NULL ) { return(0); }
70
-
71
-     /* Determine indicator visual configuration */
72
-     $OverallMin = $IndicatorSections[0]["End"]; $OverallMax = $IndicatorSections[0]["Start"];
73
-     foreach ($IndicatorSections as $Key => $Settings)
74
-      {
75
-       if ( $Settings["End"] > $OverallMax )   { $OverallMax = $Settings["End"]; }
76
-       if ( $Settings["Start"] < $OverallMin ) { $OverallMin = $Settings["Start"]; }
77
-      }
78
-     $RealWidth = $Width - (count($IndicatorSections)-1)*$SectionsMargin;
79
-     $XScale    = $RealWidth / ($OverallMax-$OverallMin);
80
-
81
-     $X1 = $X; $ValuesPos = "";
82
-     foreach ($IndicatorSections as $Key => $Settings)
83
-      {
84
-       $Color      = array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"]);
85
-       $Caption    = $Settings["Caption"];
86
-       $SubCaption = $Settings["Start"]." - ".$Settings["End"];
87
-
88
-       $X2 = $X1 + ($Settings["End"] - $Settings["Start"]) * $XScale;
89
-
90
-       if ( $Key == 0 && $DrawLeftHead )
39
+        $Values			= isset($Format["Values"]) ? $Format["Values"] : VOID;
40
+        $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
41
+        $ValueDisplay		= isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
42
+        $SectionsMargin		= isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
43
+        $DrawLeftHead		= isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : TRUE;
44
+        $DrawRightHead		= isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : TRUE;
45
+        $HeadSize			= isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height/4);
46
+        $TextPadding		= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
47
+        $CaptionLayout		= isset($Format["CaptionLayout"]) ? $Format["CaptionLayout"] : INDICATOR_CAPTION_EXTENDED;
48
+        $CaptionPosition		= isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
49
+        $CaptionColorFactor	= isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : NULL;
50
+        $CaptionR			= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
51
+        $CaptionG			= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
52
+        $CaptionB			= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
53
+        $CaptionAlpha		= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
54
+        $SubCaptionColorFactor	= isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : NULL;
55
+        $SubCaptionR		= isset($Format["SubCaptionR"]) ? $Format["SubCaptionR"] : 50;
56
+        $SubCaptionG		= isset($Format["SubCaptionG"]) ? $Format["SubCaptionG"] : 50;
57
+        $SubCaptionB		= isset($Format["SubCaptionB"]) ? $Format["SubCaptionB"] : 50;
58
+        $SubCaptionAlpha		= isset($Format["SubCaptionAlpha"]) ? $Format["SubCaptionAlpha"] : 100;
59
+        $ValueFontName		= isset($Format["ValueFontName"]) ? $Format["ValueFontName"] : $this->pChartObject->FontName;
60
+        $ValueFontSize		= isset($Format["ValueFontSize"]) ? $Format["ValueFontSize"] : $this->pChartObject->FontSize;
61
+        $CaptionFontName		= isset($Format["CaptionFontName"]) ? $Format["CaptionFontName"] : $this->pChartObject->FontName;
62
+        $CaptionFontSize		= isset($Format["CaptionFontSize"]) ? $Format["CaptionFontSize"] : $this->pChartObject->FontSize;
63
+        $Unit			= isset($Format["Unit"]) ? $Format["Unit"] : "";
64
+
65
+        /* Convert the Values to display to an array if needed */
66
+        if ( !is_array($Values) ) { $Value = $Values; $Values = ""; $Values[] = $Value; }
67
+
68
+        /* No section, let's die */
69
+        if ( $IndicatorSections == NULL ) { return(0); }
70
+
71
+        /* Determine indicator visual configuration */
72
+        $OverallMin = $IndicatorSections[0]["End"]; $OverallMax = $IndicatorSections[0]["Start"];
73
+        foreach ($IndicatorSections as $Key => $Settings)
74
+        {
75
+        if ( $Settings["End"] > $OverallMax )   { $OverallMax = $Settings["End"]; }
76
+        if ( $Settings["Start"] < $OverallMin ) { $OverallMin = $Settings["Start"]; }
77
+        }
78
+        $RealWidth = $Width - (count($IndicatorSections)-1)*$SectionsMargin;
79
+        $XScale    = $RealWidth / ($OverallMax-$OverallMin);
80
+
81
+        $X1 = $X; $ValuesPos = "";
82
+        foreach ($IndicatorSections as $Key => $Settings)
83
+        {
84
+        $Color      = array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"]);
85
+        $Caption    = $Settings["Caption"];
86
+        $SubCaption = $Settings["Start"]." - ".$Settings["End"];
87
+
88
+        $X2 = $X1 + ($Settings["End"] - $Settings["Start"]) * $XScale;
89
+
90
+        if ( $Key == 0 && $DrawLeftHead )
91 91
         {
92
-         $Poly = ""; $Poly[] = $X1-1; $Poly[] = $Y; $Poly[] = $X1-1; $Poly[] = $Y+$Height; $Poly[] = $X1-1-$HeadSize; $Poly[] = $Y+($Height/2);
93
-         $this->pChartObject->drawPolygon($Poly,$Color);
94
-         $this->pChartObject->drawLine($X1-2,$Y,$X1-2-$HeadSize,$Y+($Height/2),$Color);
95
-         $this->pChartObject->drawLine($X1-2,$Y+$Height,$X1-2-$HeadSize,$Y+($Height/2),$Color);
92
+            $Poly = ""; $Poly[] = $X1-1; $Poly[] = $Y; $Poly[] = $X1-1; $Poly[] = $Y+$Height; $Poly[] = $X1-1-$HeadSize; $Poly[] = $Y+($Height/2);
93
+            $this->pChartObject->drawPolygon($Poly,$Color);
94
+            $this->pChartObject->drawLine($X1-2,$Y,$X1-2-$HeadSize,$Y+($Height/2),$Color);
95
+            $this->pChartObject->drawLine($X1-2,$Y+$Height,$X1-2-$HeadSize,$Y+($Height/2),$Color);
96 96
         }
97 97
 
98
-       /* Determine the position of the breaks */
99
-       $Break = "";
100
-       foreach($Values as $iKey => $Value)
98
+        /* Determine the position of the breaks */
99
+        $Break = "";
100
+        foreach($Values as $iKey => $Value)
101 101
         {
102
-         if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
103
-          {
104
-           $XBreak  = $X1 + ($Value - $Settings["Start"]) * $XScale;
105
-           $ValuesPos[$Value] = $XBreak;
106
-           $Break[] = floor($XBreak);
107
-          }
102
+            if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
103
+            {
104
+            $XBreak  = $X1 + ($Value - $Settings["Start"]) * $XScale;
105
+            $ValuesPos[$Value] = $XBreak;
106
+            $Break[] = floor($XBreak);
107
+            }
108 108
         }
109 109
 
110
-       if ( $ValueDisplay == INDICATOR_VALUE_LABEL )
110
+        if ( $ValueDisplay == INDICATOR_VALUE_LABEL )
111 111
         {
112
-         if ( $Break == "" )
113
-          $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
114
-         else
115
-          {
116
-           sort($Break);
117
-           $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = FALSE;
118
-           foreach($Break as $iKey => $Value)
112
+            if ( $Break == "" )
113
+            $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
114
+            else
115
+            {
116
+            sort($Break);
117
+            $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = FALSE;
118
+            foreach($Break as $iKey => $Value)
119 119
             {
120
-             if ( $Value-5 >= $X1 )
121
-              { $Poly[] = $Value-5; $Poly[] = $Y; }
122
-             elseif ($X1 - ($Value-5) > 0 )
123
-              {
124
-               $Offset = $X1 - ($Value-5);
125
-               $Poly = ""; $Poly[] = $X1; $Poly[] = $Y + $Offset;
126
-              }
127
-
128
-             $Poly[] = $Value;   $Poly[] = $Y+5;
129
-
130
-             if ( $Value+5 <= $X2 )
131
-              { $Poly[] = $Value+5; $Poly[] = $Y; }
132
-             elseif (($Value+5) > $X2 )
133
-              {
134
-               $Offset = ($Value+5) - $X2;
135
-               $Poly[] = $X2; $Poly[] = $Y + $Offset;
136
-               $LastPointWritten = TRUE;
137
-              }
120
+                if ( $Value-5 >= $X1 )
121
+                { $Poly[] = $Value-5; $Poly[] = $Y; }
122
+                elseif ($X1 - ($Value-5) > 0 )
123
+                {
124
+                $Offset = $X1 - ($Value-5);
125
+                $Poly = ""; $Poly[] = $X1; $Poly[] = $Y + $Offset;
126
+                }
127
+
128
+                $Poly[] = $Value;   $Poly[] = $Y+5;
129
+
130
+                if ( $Value+5 <= $X2 )
131
+                { $Poly[] = $Value+5; $Poly[] = $Y; }
132
+                elseif (($Value+5) > $X2 )
133
+                {
134
+                $Offset = ($Value+5) - $X2;
135
+                $Poly[] = $X2; $Poly[] = $Y + $Offset;
136
+                $LastPointWritten = TRUE;
137
+                }
138 138
 
139 139
             }
140
-           if ( !$LastPointWritten ) { $Poly[] = $X2; $Poly[] = $Y; }
141
-           $Poly[] = $X2; $Poly[] = $Y+$Height;
142
-           $Poly[] = $X1; $Poly[] = $Y+$Height;
140
+            if ( !$LastPointWritten ) { $Poly[] = $X2; $Poly[] = $Y; }
141
+            $Poly[] = $X2; $Poly[] = $Y+$Height;
142
+            $Poly[] = $X1; $Poly[] = $Y+$Height;
143 143
 
144
-           $this->pChartObject->drawPolygon($Poly,$Color);
145
-          }
144
+            $this->pChartObject->drawPolygon($Poly,$Color);
145
+            }
146 146
         }
147
-       else
147
+        else
148 148
         $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
149 149
 
150
-       if ( $Key == count($IndicatorSections)-1 && $DrawRightHead )
150
+        if ( $Key == count($IndicatorSections)-1 && $DrawRightHead )
151 151
         {
152
-         $Poly = ""; $Poly[] = $X2+1; $Poly[] = $Y; $Poly[] = $X2+1; $Poly[] = $Y+$Height; $Poly[] = $X2+1+$HeadSize; $Poly[] = $Y+($Height/2);
153
-         $this->pChartObject->drawPolygon($Poly,$Color);
154
-         $this->pChartObject->drawLine($X2+1,$Y,$X2+1+$HeadSize,$Y+($Height/2),$Color);
155
-         $this->pChartObject->drawLine($X2+1,$Y+$Height,$X2+1+$HeadSize,$Y+($Height/2),$Color);
152
+            $Poly = ""; $Poly[] = $X2+1; $Poly[] = $Y; $Poly[] = $X2+1; $Poly[] = $Y+$Height; $Poly[] = $X2+1+$HeadSize; $Poly[] = $Y+($Height/2);
153
+            $this->pChartObject->drawPolygon($Poly,$Color);
154
+            $this->pChartObject->drawLine($X2+1,$Y,$X2+1+$HeadSize,$Y+($Height/2),$Color);
155
+            $this->pChartObject->drawLine($X2+1,$Y+$Height,$X2+1+$HeadSize,$Y+($Height/2),$Color);
156 156
         }
157 157
 
158
-       if ( $CaptionPosition == INDICATOR_CAPTION_INSIDE )
158
+        if ( $CaptionPosition == INDICATOR_CAPTION_INSIDE )
159 159
         {
160
-         $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
161
-         $YOffset = ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding;
160
+            $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
161
+            $YOffset = ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding;
162 162
 
163
-         if ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
164
-          {
165
-           $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$SubCaption);
166
-           $YOffset = $YOffset + ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding*2;
167
-          }
163
+            if ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
164
+            {
165
+            $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$SubCaption);
166
+            $YOffset = $YOffset + ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding*2;
167
+            }
168 168
 
169
-         $XOffset = $TextPadding;
169
+            $XOffset = $TextPadding;
170 170
         }
171
-       else
171
+        else
172 172
         { $YOffset = 0; $XOffset = 0; }
173 173
 
174
-       if ( $CaptionColorFactor == NULL )
174
+        if ( $CaptionColorFactor == NULL )
175 175
         { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha); }
176
-       else
176
+        else
177 177
         { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$CaptionColorFactor,"G"=>$Settings["G"]+$CaptionColorFactor,"B"=>$Settings["B"]+$CaptionColorFactor); }
178 178
 
179
-       if ( $SubCaptionColorFactor == NULL )
179
+        if ( $SubCaptionColorFactor == NULL )
180 180
         $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$SubCaptionR,"G"=>$SubCaptionG,"B"=>$SubCaptionB,"Alpha"=>$SubCaptionAlpha);
181
-       else
181
+        else
182 182
         $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$SubCaptionColorFactor,"G"=>$Settings["G"]+$SubCaptionColorFactor,"B"=>$Settings["B"]+$SubCaptionColorFactor);
183 183
 
184
-       $RestoreShadow = $this->pChartObject->Shadow;
185
-       $this->pChartObject->Shadow = FALSE;
184
+        $RestoreShadow = $this->pChartObject->Shadow;
185
+        $this->pChartObject->Shadow = FALSE;
186 186
 
187
-       if ( $CaptionLayout == INDICATOR_CAPTION_DEFAULT )
187
+        if ( $CaptionLayout == INDICATOR_CAPTION_DEFAULT )
188 188
         $this->pChartObject->drawText($X1,$Y+$Height+$TextPadding,$Caption,$CaptionColor);
189
-       elseif ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
189
+        elseif ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
190 190
         {
191
-         $TxtPos        = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
192
-         $CaptionHeight = $TxtPos[0]["Y"] - $TxtPos[2]["Y"];
191
+            $TxtPos        = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
192
+            $CaptionHeight = $TxtPos[0]["Y"] - $TxtPos[2]["Y"];
193 193
 
194
-         $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$TextPadding,$Caption,$CaptionColor);
195
-         $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$CaptionHeight+$TextPadding*2,$SubCaption,$SubCaptionColor);
194
+            $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$TextPadding,$Caption,$CaptionColor);
195
+            $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$CaptionHeight+$TextPadding*2,$SubCaption,$SubCaptionColor);
196 196
         }
197 197
 
198
-       $this->pChartObject->Shadow = $RestoreShadow;
198
+        $this->pChartObject->Shadow = $RestoreShadow;
199 199
 
200
-       $X1 = $X2 + $SectionsMargin;
201
-      }
200
+        $X1 = $X2 + $SectionsMargin;
201
+        }
202 202
 
203
-     $RestoreShadow = $this->pChartObject->Shadow;
204
-     $this->pChartObject->Shadow = FALSE;
203
+        $RestoreShadow = $this->pChartObject->Shadow;
204
+        $this->pChartObject->Shadow = FALSE;
205 205
 
206
-     foreach($Values as $Key => $Value)
207
-      {
208
-       if ( $Value >= $OverallMin && $Value <= $OverallMax )
206
+        foreach($Values as $Key => $Value)
207
+        {
208
+        if ( $Value >= $OverallMin && $Value <= $OverallMax )
209 209
         {
210
-         foreach ($IndicatorSections as $Key => $Settings)
211
-          {
212
-           if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
210
+            foreach ($IndicatorSections as $Key => $Settings)
213 211
             {
214
-             $X1 = $ValuesPos[$Value]; //$X + $Key*$SectionsMargin + ($Value - $OverallMin) * $XScale;
215
-
216
-             if ( $ValueDisplay == INDICATOR_VALUE_BUBBLE )
217
-              {
218
-               $TxtPos = $this->pChartObject->getTextBox($X1,$Y,$ValueFontName,$ValueFontSize,0,$Value.$Unit);
219
-               $Radius = floor(($TxtPos[1]["X"] - $TxtPos[0]["X"] + $TextPadding*4)/2);
220
-
221
-               $this->pChartObject->drawFilledCircle($X1,$Y,$Radius+4,array("R"=>$Settings["R"]+20,"G"=>$Settings["G"]+20,"B"=>$Settings["B"]+20));
222
-               $this->pChartObject->drawFilledCircle($X1,$Y,$Radius,array("R"=>255,"G"=>255,"B"=>255));
223
-
224
-               $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontName"=>$ValueFontName,"FontSize"=>$ValueFontSize);
225
-               $this->pChartObject->drawText($X1-1,$Y-1,$Value.$Unit,$TextSettings);
226
-              }
227
-             elseif( $ValueDisplay == INDICATOR_VALUE_LABEL )
228
-              {
229
-               $Caption = "";
230
-               $Caption[] = array("Format"=>array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"],"Alpha"=>100),"Caption"=>$Value.$Unit);
231
-               $this->pChartObject->drawLabelBox(floor($X1),floor($Y)+2,"Value - ".$Settings["Caption"],$Caption);
232
-              }
212
+            if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
213
+            {
214
+                $X1 = $ValuesPos[$Value]; //$X + $Key*$SectionsMargin + ($Value - $OverallMin) * $XScale;
215
+
216
+                if ( $ValueDisplay == INDICATOR_VALUE_BUBBLE )
217
+                {
218
+                $TxtPos = $this->pChartObject->getTextBox($X1,$Y,$ValueFontName,$ValueFontSize,0,$Value.$Unit);
219
+                $Radius = floor(($TxtPos[1]["X"] - $TxtPos[0]["X"] + $TextPadding*4)/2);
220
+
221
+                $this->pChartObject->drawFilledCircle($X1,$Y,$Radius+4,array("R"=>$Settings["R"]+20,"G"=>$Settings["G"]+20,"B"=>$Settings["B"]+20));
222
+                $this->pChartObject->drawFilledCircle($X1,$Y,$Radius,array("R"=>255,"G"=>255,"B"=>255));
223
+
224
+                $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontName"=>$ValueFontName,"FontSize"=>$ValueFontSize);
225
+                $this->pChartObject->drawText($X1-1,$Y-1,$Value.$Unit,$TextSettings);
226
+                }
227
+                elseif( $ValueDisplay == INDICATOR_VALUE_LABEL )
228
+                {
229
+                $Caption = "";
230
+                $Caption[] = array("Format"=>array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"],"Alpha"=>100),"Caption"=>$Value.$Unit);
231
+                $this->pChartObject->drawLabelBox(floor($X1),floor($Y)+2,"Value - ".$Settings["Caption"],$Caption);
232
+                }
233
+            }
234
+            $X1 = $X2 + $SectionsMargin;
233 235
             }
234
-           $X1 = $X2 + $SectionsMargin;
235
-          }
236 236
         }
237
-      }
238
-     $this->pChartObject->Shadow = $RestoreShadow;
237
+        }
238
+        $this->pChartObject->Shadow = $RestoreShadow;
239
+    }
239 240
     }
240
-  }
241 241
 ?>
242 242
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("INDICATOR_CAPTION_DEFAULT"	, 700001);
17
- define("INDICATOR_CAPTION_EXTENDED"	, 700002);
16
+ define("INDICATOR_CAPTION_DEFAULT", 700001);
17
+ define("INDICATOR_CAPTION_EXTENDED", 700002);
18 18
 
19
- define("INDICATOR_CAPTION_INSIDE"	, 700011);
20
- define("INDICATOR_CAPTION_BOTTOM"	, 700012);
19
+ define("INDICATOR_CAPTION_INSIDE", 700011);
20
+ define("INDICATOR_CAPTION_BOTTOM", 700012);
21 21
 
22
- define("INDICATOR_VALUE_BUBBLE"	, 700021);
23
- define("INDICATOR_VALUE_LABEL"		, 700022);
22
+ define("INDICATOR_VALUE_BUBBLE", 700021);
23
+ define("INDICATOR_VALUE_LABEL", 700022);
24 24
 
25 25
  /* pIndicator class definition */
26 26
  class pIndicator
@@ -34,24 +34,24 @@  discard block
 block discarded – undo
34 34
     }
35 35
 
36 36
    /* Draw an indicator */
37
-   function draw($X,$Y,$Width,$Height,$Format="")
37
+   function draw($X, $Y, $Width, $Height, $Format = "")
38 38
     {
39
-     $Values			= isset($Format["Values"]) ? $Format["Values"] : VOID;
40
-     $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
39
+     $Values = isset($Format["Values"]) ? $Format["Values"] : VOID;
40
+     $IndicatorSections = isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
41 41
      $ValueDisplay		= isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
42
-     $SectionsMargin		= isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
42
+     $SectionsMargin = isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
43 43
      $DrawLeftHead		= isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : TRUE;
44 44
      $DrawRightHead		= isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : TRUE;
45
-     $HeadSize			= isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height/4);
46
-     $TextPadding		= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
45
+     $HeadSize = isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height/4);
46
+     $TextPadding = isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
47 47
      $CaptionLayout		= isset($Format["CaptionLayout"]) ? $Format["CaptionLayout"] : INDICATOR_CAPTION_EXTENDED;
48
-     $CaptionPosition		= isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
49
-     $CaptionColorFactor	= isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : NULL;
48
+     $CaptionPosition = isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
49
+     $CaptionColorFactor = isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : NULL;
50 50
      $CaptionR			= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
51 51
      $CaptionG			= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
52 52
      $CaptionB			= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
53
-     $CaptionAlpha		= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
54
-     $SubCaptionColorFactor	= isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : NULL;
53
+     $CaptionAlpha = isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
54
+     $SubCaptionColorFactor = isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : NULL;
55 55
      $SubCaptionR		= isset($Format["SubCaptionR"]) ? $Format["SubCaptionR"] : 50;
56 56
      $SubCaptionG		= isset($Format["SubCaptionG"]) ? $Format["SubCaptionG"] : 50;
57 57
      $SubCaptionB		= isset($Format["SubCaptionB"]) ? $Format["SubCaptionB"] : 50;
@@ -60,109 +60,109 @@  discard block
 block discarded – undo
60 60
      $ValueFontSize		= isset($Format["ValueFontSize"]) ? $Format["ValueFontSize"] : $this->pChartObject->FontSize;
61 61
      $CaptionFontName		= isset($Format["CaptionFontName"]) ? $Format["CaptionFontName"] : $this->pChartObject->FontName;
62 62
      $CaptionFontSize		= isset($Format["CaptionFontSize"]) ? $Format["CaptionFontSize"] : $this->pChartObject->FontSize;
63
-     $Unit			= isset($Format["Unit"]) ? $Format["Unit"] : "";
63
+     $Unit = isset($Format["Unit"]) ? $Format["Unit"] : "";
64 64
 
65 65
      /* Convert the Values to display to an array if needed */
66
-     if ( !is_array($Values) ) { $Value = $Values; $Values = ""; $Values[] = $Value; }
66
+     if (!is_array($Values)) { $Value = $Values; $Values = ""; $Values[] = $Value; }
67 67
 
68 68
      /* No section, let's die */
69
-     if ( $IndicatorSections == NULL ) { return(0); }
69
+     if ($IndicatorSections == NULL) { return(0); }
70 70
 
71 71
      /* Determine indicator visual configuration */
72 72
      $OverallMin = $IndicatorSections[0]["End"]; $OverallMax = $IndicatorSections[0]["Start"];
73 73
      foreach ($IndicatorSections as $Key => $Settings)
74 74
       {
75
-       if ( $Settings["End"] > $OverallMax )   { $OverallMax = $Settings["End"]; }
76
-       if ( $Settings["Start"] < $OverallMin ) { $OverallMin = $Settings["Start"]; }
75
+       if ($Settings["End"] > $OverallMax) { $OverallMax = $Settings["End"]; }
76
+       if ($Settings["Start"] < $OverallMin) { $OverallMin = $Settings["Start"]; }
77 77
       }
78
-     $RealWidth = $Width - (count($IndicatorSections)-1)*$SectionsMargin;
79
-     $XScale    = $RealWidth / ($OverallMax-$OverallMin);
78
+     $RealWidth = $Width - (count($IndicatorSections) - 1)*$SectionsMargin;
79
+     $XScale    = $RealWidth/($OverallMax - $OverallMin);
80 80
 
81 81
      $X1 = $X; $ValuesPos = "";
82 82
      foreach ($IndicatorSections as $Key => $Settings)
83 83
       {
84
-       $Color      = array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"]);
84
+       $Color      = array("R"=>$Settings["R"], "G"=>$Settings["G"], "B"=>$Settings["B"]);
85 85
        $Caption    = $Settings["Caption"];
86 86
        $SubCaption = $Settings["Start"]." - ".$Settings["End"];
87 87
 
88
-       $X2 = $X1 + ($Settings["End"] - $Settings["Start"]) * $XScale;
88
+       $X2 = $X1 + ($Settings["End"] - $Settings["Start"])*$XScale;
89 89
 
90
-       if ( $Key == 0 && $DrawLeftHead )
90
+       if ($Key == 0 && $DrawLeftHead)
91 91
         {
92
-         $Poly = ""; $Poly[] = $X1-1; $Poly[] = $Y; $Poly[] = $X1-1; $Poly[] = $Y+$Height; $Poly[] = $X1-1-$HeadSize; $Poly[] = $Y+($Height/2);
93
-         $this->pChartObject->drawPolygon($Poly,$Color);
94
-         $this->pChartObject->drawLine($X1-2,$Y,$X1-2-$HeadSize,$Y+($Height/2),$Color);
95
-         $this->pChartObject->drawLine($X1-2,$Y+$Height,$X1-2-$HeadSize,$Y+($Height/2),$Color);
92
+         $Poly = ""; $Poly[] = $X1 - 1; $Poly[] = $Y; $Poly[] = $X1 - 1; $Poly[] = $Y + $Height; $Poly[] = $X1 - 1 - $HeadSize; $Poly[] = $Y + ($Height/2);
93
+         $this->pChartObject->drawPolygon($Poly, $Color);
94
+         $this->pChartObject->drawLine($X1 - 2, $Y, $X1 - 2 - $HeadSize, $Y + ($Height/2), $Color);
95
+         $this->pChartObject->drawLine($X1 - 2, $Y + $Height, $X1 - 2 - $HeadSize, $Y + ($Height/2), $Color);
96 96
         }
97 97
 
98 98
        /* Determine the position of the breaks */
99 99
        $Break = "";
100
-       foreach($Values as $iKey => $Value)
100
+       foreach ($Values as $iKey => $Value)
101 101
         {
102
-         if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
102
+         if ($Value >= $Settings["Start"] && $Value <= $Settings["End"])
103 103
           {
104
-           $XBreak  = $X1 + ($Value - $Settings["Start"]) * $XScale;
104
+           $XBreak  = $X1 + ($Value - $Settings["Start"])*$XScale;
105 105
            $ValuesPos[$Value] = $XBreak;
106 106
            $Break[] = floor($XBreak);
107 107
           }
108 108
         }
109 109
 
110
-       if ( $ValueDisplay == INDICATOR_VALUE_LABEL )
110
+       if ($ValueDisplay == INDICATOR_VALUE_LABEL)
111 111
         {
112
-         if ( $Break == "" )
113
-          $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
112
+         if ($Break == "")
113
+          $this->pChartObject->drawFilledRectangle($X1, $Y, $X2, $Y + $Height, $Color);
114 114
          else
115 115
           {
116 116
            sort($Break);
117 117
            $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = FALSE;
118
-           foreach($Break as $iKey => $Value)
118
+           foreach ($Break as $iKey => $Value)
119 119
             {
120
-             if ( $Value-5 >= $X1 )
121
-              { $Poly[] = $Value-5; $Poly[] = $Y; }
122
-             elseif ($X1 - ($Value-5) > 0 )
120
+             if ($Value - 5 >= $X1)
121
+              { $Poly[] = $Value - 5; $Poly[] = $Y; }
122
+             elseif ($X1 - ($Value - 5) > 0)
123 123
               {
124
-               $Offset = $X1 - ($Value-5);
124
+               $Offset = $X1 - ($Value - 5);
125 125
                $Poly = ""; $Poly[] = $X1; $Poly[] = $Y + $Offset;
126 126
               }
127 127
 
128
-             $Poly[] = $Value;   $Poly[] = $Y+5;
128
+             $Poly[] = $Value; $Poly[] = $Y + 5;
129 129
 
130
-             if ( $Value+5 <= $X2 )
131
-              { $Poly[] = $Value+5; $Poly[] = $Y; }
132
-             elseif (($Value+5) > $X2 )
130
+             if ($Value + 5 <= $X2)
131
+              { $Poly[] = $Value + 5; $Poly[] = $Y; }
132
+             elseif (($Value + 5) > $X2)
133 133
               {
134
-               $Offset = ($Value+5) - $X2;
134
+               $Offset = ($Value + 5) - $X2;
135 135
                $Poly[] = $X2; $Poly[] = $Y + $Offset;
136 136
                $LastPointWritten = TRUE;
137 137
               }
138 138
 
139 139
             }
140
-           if ( !$LastPointWritten ) { $Poly[] = $X2; $Poly[] = $Y; }
141
-           $Poly[] = $X2; $Poly[] = $Y+$Height;
142
-           $Poly[] = $X1; $Poly[] = $Y+$Height;
140
+           if (!$LastPointWritten) { $Poly[] = $X2; $Poly[] = $Y; }
141
+           $Poly[] = $X2; $Poly[] = $Y + $Height;
142
+           $Poly[] = $X1; $Poly[] = $Y + $Height;
143 143
 
144
-           $this->pChartObject->drawPolygon($Poly,$Color);
144
+           $this->pChartObject->drawPolygon($Poly, $Color);
145 145
           }
146 146
         }
147 147
        else
148
-        $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
148
+        $this->pChartObject->drawFilledRectangle($X1, $Y, $X2, $Y + $Height, $Color);
149 149
 
150
-       if ( $Key == count($IndicatorSections)-1 && $DrawRightHead )
150
+       if ($Key == count($IndicatorSections) - 1 && $DrawRightHead)
151 151
         {
152
-         $Poly = ""; $Poly[] = $X2+1; $Poly[] = $Y; $Poly[] = $X2+1; $Poly[] = $Y+$Height; $Poly[] = $X2+1+$HeadSize; $Poly[] = $Y+($Height/2);
153
-         $this->pChartObject->drawPolygon($Poly,$Color);
154
-         $this->pChartObject->drawLine($X2+1,$Y,$X2+1+$HeadSize,$Y+($Height/2),$Color);
155
-         $this->pChartObject->drawLine($X2+1,$Y+$Height,$X2+1+$HeadSize,$Y+($Height/2),$Color);
152
+         $Poly = ""; $Poly[] = $X2 + 1; $Poly[] = $Y; $Poly[] = $X2 + 1; $Poly[] = $Y + $Height; $Poly[] = $X2 + 1 + $HeadSize; $Poly[] = $Y + ($Height/2);
153
+         $this->pChartObject->drawPolygon($Poly, $Color);
154
+         $this->pChartObject->drawLine($X2 + 1, $Y, $X2 + 1 + $HeadSize, $Y + ($Height/2), $Color);
155
+         $this->pChartObject->drawLine($X2 + 1, $Y + $Height, $X2 + 1 + $HeadSize, $Y + ($Height/2), $Color);
156 156
         }
157 157
 
158
-       if ( $CaptionPosition == INDICATOR_CAPTION_INSIDE )
158
+       if ($CaptionPosition == INDICATOR_CAPTION_INSIDE)
159 159
         {
160
-         $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
160
+         $TxtPos  = $this->pChartObject->getTextBox($X1, $Y + $Height + $TextPadding, $CaptionFontName, $CaptionFontSize, 0, $Caption);
161 161
          $YOffset = ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding;
162 162
 
163
-         if ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
163
+         if ($CaptionLayout == INDICATOR_CAPTION_EXTENDED)
164 164
           {
165
-           $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$SubCaption);
165
+           $TxtPos  = $this->pChartObject->getTextBox($X1, $Y + $Height + $TextPadding, $CaptionFontName, $CaptionFontSize, 0, $SubCaption);
166 166
            $YOffset = $YOffset + ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding*2;
167 167
           }
168 168
 
@@ -171,28 +171,28 @@  discard block
 block discarded – undo
171 171
        else
172 172
         { $YOffset = 0; $XOffset = 0; }
173 173
 
174
-       if ( $CaptionColorFactor == NULL )
175
-        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha); }
174
+       if ($CaptionColorFactor == NULL)
175
+        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT, "FontName"=>$CaptionFontName, "FontSize"=>$CaptionFontSize, "R"=>$CaptionR, "G"=>$CaptionG, "B"=>$CaptionB, "Alpha"=>$CaptionAlpha); }
176 176
        else
177
-        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$CaptionColorFactor,"G"=>$Settings["G"]+$CaptionColorFactor,"B"=>$Settings["B"]+$CaptionColorFactor); }
177
+        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT, "FontName"=>$CaptionFontName, "FontSize"=>$CaptionFontSize, "R"=>$Settings["R"] + $CaptionColorFactor, "G"=>$Settings["G"] + $CaptionColorFactor, "B"=>$Settings["B"] + $CaptionColorFactor); }
178 178
 
179
-       if ( $SubCaptionColorFactor == NULL )
180
-        $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$SubCaptionR,"G"=>$SubCaptionG,"B"=>$SubCaptionB,"Alpha"=>$SubCaptionAlpha);
179
+       if ($SubCaptionColorFactor == NULL)
180
+        $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT, "FontName"=>$CaptionFontName, "FontSize"=>$CaptionFontSize, "R"=>$SubCaptionR, "G"=>$SubCaptionG, "B"=>$SubCaptionB, "Alpha"=>$SubCaptionAlpha);
181 181
        else
182
-        $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$SubCaptionColorFactor,"G"=>$Settings["G"]+$SubCaptionColorFactor,"B"=>$Settings["B"]+$SubCaptionColorFactor);
182
+        $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT, "FontName"=>$CaptionFontName, "FontSize"=>$CaptionFontSize, "R"=>$Settings["R"] + $SubCaptionColorFactor, "G"=>$Settings["G"] + $SubCaptionColorFactor, "B"=>$Settings["B"] + $SubCaptionColorFactor);
183 183
 
184 184
        $RestoreShadow = $this->pChartObject->Shadow;
185 185
        $this->pChartObject->Shadow = FALSE;
186 186
 
187
-       if ( $CaptionLayout == INDICATOR_CAPTION_DEFAULT )
188
-        $this->pChartObject->drawText($X1,$Y+$Height+$TextPadding,$Caption,$CaptionColor);
189
-       elseif ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
187
+       if ($CaptionLayout == INDICATOR_CAPTION_DEFAULT)
188
+        $this->pChartObject->drawText($X1, $Y + $Height + $TextPadding, $Caption, $CaptionColor);
189
+       elseif ($CaptionLayout == INDICATOR_CAPTION_EXTENDED)
190 190
         {
191
-         $TxtPos        = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
191
+         $TxtPos        = $this->pChartObject->getTextBox($X1, $Y + $Height + $TextPadding, $CaptionFontName, $CaptionFontSize, 0, $Caption);
192 192
          $CaptionHeight = $TxtPos[0]["Y"] - $TxtPos[2]["Y"];
193 193
 
194
-         $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$TextPadding,$Caption,$CaptionColor);
195
-         $this->pChartObject->drawText($X1+$XOffset,$Y+$Height-$YOffset+$CaptionHeight+$TextPadding*2,$SubCaption,$SubCaptionColor);
194
+         $this->pChartObject->drawText($X1 + $XOffset, $Y + $Height - $YOffset + $TextPadding, $Caption, $CaptionColor);
195
+         $this->pChartObject->drawText($X1 + $XOffset, $Y + $Height - $YOffset + $CaptionHeight + $TextPadding*2, $SubCaption, $SubCaptionColor);
196 196
         }
197 197
 
198 198
        $this->pChartObject->Shadow = $RestoreShadow;
@@ -203,32 +203,32 @@  discard block
 block discarded – undo
203 203
      $RestoreShadow = $this->pChartObject->Shadow;
204 204
      $this->pChartObject->Shadow = FALSE;
205 205
 
206
-     foreach($Values as $Key => $Value)
206
+     foreach ($Values as $Key => $Value)
207 207
       {
208
-       if ( $Value >= $OverallMin && $Value <= $OverallMax )
208
+       if ($Value >= $OverallMin && $Value <= $OverallMax)
209 209
         {
210 210
          foreach ($IndicatorSections as $Key => $Settings)
211 211
           {
212
-           if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
212
+           if ($Value >= $Settings["Start"] && $Value <= $Settings["End"])
213 213
             {
214 214
              $X1 = $ValuesPos[$Value]; //$X + $Key*$SectionsMargin + ($Value - $OverallMin) * $XScale;
215 215
 
216
-             if ( $ValueDisplay == INDICATOR_VALUE_BUBBLE )
216
+             if ($ValueDisplay == INDICATOR_VALUE_BUBBLE)
217 217
               {
218
-               $TxtPos = $this->pChartObject->getTextBox($X1,$Y,$ValueFontName,$ValueFontSize,0,$Value.$Unit);
218
+               $TxtPos = $this->pChartObject->getTextBox($X1, $Y, $ValueFontName, $ValueFontSize, 0, $Value.$Unit);
219 219
                $Radius = floor(($TxtPos[1]["X"] - $TxtPos[0]["X"] + $TextPadding*4)/2);
220 220
 
221
-               $this->pChartObject->drawFilledCircle($X1,$Y,$Radius+4,array("R"=>$Settings["R"]+20,"G"=>$Settings["G"]+20,"B"=>$Settings["B"]+20));
222
-               $this->pChartObject->drawFilledCircle($X1,$Y,$Radius,array("R"=>255,"G"=>255,"B"=>255));
221
+               $this->pChartObject->drawFilledCircle($X1, $Y, $Radius + 4, array("R"=>$Settings["R"] + 20, "G"=>$Settings["G"] + 20, "B"=>$Settings["B"] + 20));
222
+               $this->pChartObject->drawFilledCircle($X1, $Y, $Radius, array("R"=>255, "G"=>255, "B"=>255));
223 223
 
224
-               $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontName"=>$ValueFontName,"FontSize"=>$ValueFontSize);
225
-               $this->pChartObject->drawText($X1-1,$Y-1,$Value.$Unit,$TextSettings);
224
+               $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE, "FontName"=>$ValueFontName, "FontSize"=>$ValueFontSize);
225
+               $this->pChartObject->drawText($X1 - 1, $Y - 1, $Value.$Unit, $TextSettings);
226 226
               }
227
-             elseif( $ValueDisplay == INDICATOR_VALUE_LABEL )
227
+             elseif ($ValueDisplay == INDICATOR_VALUE_LABEL)
228 228
               {
229 229
                $Caption = "";
230
-               $Caption[] = array("Format"=>array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"],"Alpha"=>100),"Caption"=>$Value.$Unit);
231
-               $this->pChartObject->drawLabelBox(floor($X1),floor($Y)+2,"Value - ".$Settings["Caption"],$Caption);
230
+               $Caption[] = array("Format"=>array("R"=>$Settings["R"], "G"=>$Settings["G"], "B"=>$Settings["B"], "Alpha"=>100), "Caption"=>$Value.$Unit);
231
+               $this->pChartObject->drawLabelBox(floor($X1), floor($Y) + 2, "Value - ".$Settings["Caption"], $Caption);
232 232
               }
233 233
             }
234 234
            $X1 = $X2 + $SectionsMargin;
Please login to merge, or discard this patch.
Braces   +26 added lines, -55 removed lines patch added patch discarded remove patch
@@ -23,19 +23,16 @@  discard block
 block discarded – undo
23 23
  define("INDICATOR_VALUE_LABEL"		, 700022);
24 24
 
25 25
  /* pIndicator class definition */
26
- class pIndicator
27
-  {
26
+ class pIndicator {
28 27
    var $pChartObject;
29 28
 
30 29
    /* Class creator */
31
-   function pIndicator($pChartObject)
32
-    {
30
+   function pIndicator($pChartObject) {
33 31
      $this->pChartObject = $pChartObject;
34 32
     }
35 33
 
36 34
    /* Draw an indicator */
37
-   function draw($X,$Y,$Width,$Height,$Format="")
38
-    {
35
+   function draw($X,$Y,$Width,$Height,$Format="") {
39 36
      $Values			= isset($Format["Values"]) ? $Format["Values"] : VOID;
40 37
      $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
41 38
      $ValueDisplay		= isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
@@ -70,8 +67,7 @@  discard block
 block discarded – undo
70 67
 
71 68
      /* Determine indicator visual configuration */
72 69
      $OverallMin = $IndicatorSections[0]["End"]; $OverallMax = $IndicatorSections[0]["Start"];
73
-     foreach ($IndicatorSections as $Key => $Settings)
74
-      {
70
+     foreach ($IndicatorSections as $Key => $Settings) {
75 71
        if ( $Settings["End"] > $OverallMax )   { $OverallMax = $Settings["End"]; }
76 72
        if ( $Settings["Start"] < $OverallMin ) { $OverallMin = $Settings["Start"]; }
77 73
       }
@@ -79,16 +75,14 @@  discard block
 block discarded – undo
79 75
      $XScale    = $RealWidth / ($OverallMax-$OverallMin);
80 76
 
81 77
      $X1 = $X; $ValuesPos = "";
82
-     foreach ($IndicatorSections as $Key => $Settings)
83
-      {
78
+     foreach ($IndicatorSections as $Key => $Settings) {
84 79
        $Color      = array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"]);
85 80
        $Caption    = $Settings["Caption"];
86 81
        $SubCaption = $Settings["Start"]." - ".$Settings["End"];
87 82
 
88 83
        $X2 = $X1 + ($Settings["End"] - $Settings["Start"]) * $XScale;
89 84
 
90
-       if ( $Key == 0 && $DrawLeftHead )
91
-        {
85
+       if ( $Key == 0 && $DrawLeftHead ) {
92 86
          $Poly = ""; $Poly[] = $X1-1; $Poly[] = $Y; $Poly[] = $X1-1; $Poly[] = $Y+$Height; $Poly[] = $X1-1-$HeadSize; $Poly[] = $Y+($Height/2);
93 87
          $this->pChartObject->drawPolygon($Poly,$Color);
94 88
          $this->pChartObject->drawLine($X1-2,$Y,$X1-2-$HeadSize,$Y+($Height/2),$Color);
@@ -97,30 +91,23 @@  discard block
 block discarded – undo
97 91
 
98 92
        /* Determine the position of the breaks */
99 93
        $Break = "";
100
-       foreach($Values as $iKey => $Value)
101
-        {
102
-         if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
103
-          {
94
+       foreach($Values as $iKey => $Value) {
95
+         if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] ) {
104 96
            $XBreak  = $X1 + ($Value - $Settings["Start"]) * $XScale;
105 97
            $ValuesPos[$Value] = $XBreak;
106 98
            $Break[] = floor($XBreak);
107 99
           }
108 100
         }
109 101
 
110
-       if ( $ValueDisplay == INDICATOR_VALUE_LABEL )
111
-        {
102
+       if ( $ValueDisplay == INDICATOR_VALUE_LABEL ) {
112 103
          if ( $Break == "" )
113 104
           $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
114
-         else
115
-          {
105
+         else {
116 106
            sort($Break);
117 107
            $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = FALSE;
118
-           foreach($Break as $iKey => $Value)
119
-            {
108
+           foreach($Break as $iKey => $Value) {
120 109
              if ( $Value-5 >= $X1 )
121
-              { $Poly[] = $Value-5; $Poly[] = $Y; }
122
-             elseif ($X1 - ($Value-5) > 0 )
123
-              {
110
+              { $Poly[] = $Value-5; $Poly[] = $Y; } elseif ($X1 - ($Value-5) > 0 ) {
124 111
                $Offset = $X1 - ($Value-5);
125 112
                $Poly = ""; $Poly[] = $X1; $Poly[] = $Y + $Offset;
126 113
               }
@@ -128,9 +115,7 @@  discard block
 block discarded – undo
128 115
              $Poly[] = $Value;   $Poly[] = $Y+5;
129 116
 
130 117
              if ( $Value+5 <= $X2 )
131
-              { $Poly[] = $Value+5; $Poly[] = $Y; }
132
-             elseif (($Value+5) > $X2 )
133
-              {
118
+              { $Poly[] = $Value+5; $Poly[] = $Y; } elseif (($Value+5) > $X2 ) {
134 119
                $Offset = ($Value+5) - $X2;
135 120
                $Poly[] = $X2; $Poly[] = $Y + $Offset;
136 121
                $LastPointWritten = TRUE;
@@ -143,37 +128,31 @@  discard block
 block discarded – undo
143 128
 
144 129
            $this->pChartObject->drawPolygon($Poly,$Color);
145 130
           }
146
-        }
147
-       else
131
+        } else
148 132
         $this->pChartObject->drawFilledRectangle($X1,$Y,$X2,$Y+$Height,$Color);
149 133
 
150
-       if ( $Key == count($IndicatorSections)-1 && $DrawRightHead )
151
-        {
134
+       if ( $Key == count($IndicatorSections)-1 && $DrawRightHead ) {
152 135
          $Poly = ""; $Poly[] = $X2+1; $Poly[] = $Y; $Poly[] = $X2+1; $Poly[] = $Y+$Height; $Poly[] = $X2+1+$HeadSize; $Poly[] = $Y+($Height/2);
153 136
          $this->pChartObject->drawPolygon($Poly,$Color);
154 137
          $this->pChartObject->drawLine($X2+1,$Y,$X2+1+$HeadSize,$Y+($Height/2),$Color);
155 138
          $this->pChartObject->drawLine($X2+1,$Y+$Height,$X2+1+$HeadSize,$Y+($Height/2),$Color);
156 139
         }
157 140
 
158
-       if ( $CaptionPosition == INDICATOR_CAPTION_INSIDE )
159
-        {
141
+       if ( $CaptionPosition == INDICATOR_CAPTION_INSIDE ) {
160 142
          $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
161 143
          $YOffset = ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding;
162 144
 
163
-         if ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
164
-          {
145
+         if ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED ) {
165 146
            $TxtPos  = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$SubCaption);
166 147
            $YOffset = $YOffset + ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding*2;
167 148
           }
168 149
 
169 150
          $XOffset = $TextPadding;
170
-        }
171
-       else
151
+        } else
172 152
         { $YOffset = 0; $XOffset = 0; }
173 153
 
174 154
        if ( $CaptionColorFactor == NULL )
175
-        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha); }
176
-       else
155
+        { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha); } else
177 156
         { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$CaptionColorFactor,"G"=>$Settings["G"]+$CaptionColorFactor,"B"=>$Settings["B"]+$CaptionColorFactor); }
178 157
 
179 158
        if ( $SubCaptionColorFactor == NULL )
@@ -186,8 +165,7 @@  discard block
 block discarded – undo
186 165
 
187 166
        if ( $CaptionLayout == INDICATOR_CAPTION_DEFAULT )
188 167
         $this->pChartObject->drawText($X1,$Y+$Height+$TextPadding,$Caption,$CaptionColor);
189
-       elseif ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED )
190
-        {
168
+       elseif ( $CaptionLayout == INDICATOR_CAPTION_EXTENDED ) {
191 169
          $TxtPos        = $this->pChartObject->getTextBox($X1,$Y+$Height+$TextPadding,$CaptionFontName,$CaptionFontSize,0,$Caption);
192 170
          $CaptionHeight = $TxtPos[0]["Y"] - $TxtPos[2]["Y"];
193 171
 
@@ -203,18 +181,13 @@  discard block
 block discarded – undo
203 181
      $RestoreShadow = $this->pChartObject->Shadow;
204 182
      $this->pChartObject->Shadow = FALSE;
205 183
 
206
-     foreach($Values as $Key => $Value)
207
-      {
208
-       if ( $Value >= $OverallMin && $Value <= $OverallMax )
209
-        {
210
-         foreach ($IndicatorSections as $Key => $Settings)
211
-          {
212
-           if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] )
213
-            {
184
+     foreach($Values as $Key => $Value) {
185
+       if ( $Value >= $OverallMin && $Value <= $OverallMax ) {
186
+         foreach ($IndicatorSections as $Key => $Settings) {
187
+           if ( $Value >= $Settings["Start"] && $Value <= $Settings["End"] ) {
214 188
              $X1 = $ValuesPos[$Value]; //$X + $Key*$SectionsMargin + ($Value - $OverallMin) * $XScale;
215 189
 
216
-             if ( $ValueDisplay == INDICATOR_VALUE_BUBBLE )
217
-              {
190
+             if ( $ValueDisplay == INDICATOR_VALUE_BUBBLE ) {
218 191
                $TxtPos = $this->pChartObject->getTextBox($X1,$Y,$ValueFontName,$ValueFontSize,0,$Value.$Unit);
219 192
                $Radius = floor(($TxtPos[1]["X"] - $TxtPos[0]["X"] + $TextPadding*4)/2);
220 193
 
@@ -223,9 +196,7 @@  discard block
 block discarded – undo
223 196
 
224 197
                $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontName"=>$ValueFontName,"FontSize"=>$ValueFontSize);
225 198
                $this->pChartObject->drawText($X1-1,$Y-1,$Value.$Unit,$TextSettings);
226
-              }
227
-             elseif( $ValueDisplay == INDICATOR_VALUE_LABEL )
228
-              {
199
+              } elseif( $ValueDisplay == INDICATOR_VALUE_LABEL ) {
229 200
                $Caption = "";
230 201
                $Caption[] = array("Format"=>array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"],"Alpha"=>100),"Caption"=>$Value.$Unit);
231 202
                $this->pChartObject->drawLabelBox(floor($X1),floor($Y)+2,"Value - ".$Settings["Caption"],$Caption);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
    function draw($X,$Y,$Width,$Height,$Format="")
38 38
     {
39 39
      $Values			= isset($Format["Values"]) ? $Format["Values"] : VOID;
40
-     $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : NULL;
40
+     $IndicatorSections		= isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : null;
41 41
      $ValueDisplay		= isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
42 42
      $SectionsMargin		= isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
43
-     $DrawLeftHead		= isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : TRUE;
44
-     $DrawRightHead		= isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : TRUE;
43
+     $DrawLeftHead		= isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : true;
44
+     $DrawRightHead		= isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : true;
45 45
      $HeadSize			= isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height/4);
46 46
      $TextPadding		= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
47 47
      $CaptionLayout		= isset($Format["CaptionLayout"]) ? $Format["CaptionLayout"] : INDICATOR_CAPTION_EXTENDED;
48 48
      $CaptionPosition		= isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
49
-     $CaptionColorFactor	= isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : NULL;
49
+     $CaptionColorFactor	= isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : null;
50 50
      $CaptionR			= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
51 51
      $CaptionG			= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
52 52
      $CaptionB			= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
53 53
      $CaptionAlpha		= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
54
-     $SubCaptionColorFactor	= isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : NULL;
54
+     $SubCaptionColorFactor	= isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : null;
55 55
      $SubCaptionR		= isset($Format["SubCaptionR"]) ? $Format["SubCaptionR"] : 50;
56 56
      $SubCaptionG		= isset($Format["SubCaptionG"]) ? $Format["SubCaptionG"] : 50;
57 57
      $SubCaptionB		= isset($Format["SubCaptionB"]) ? $Format["SubCaptionB"] : 50;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      if ( !is_array($Values) ) { $Value = $Values; $Values = ""; $Values[] = $Value; }
67 67
 
68 68
      /* No section, let's die */
69
-     if ( $IndicatorSections == NULL ) { return(0); }
69
+     if ( $IndicatorSections == null ) { return(0); }
70 70
 
71 71
      /* Determine indicator visual configuration */
72 72
      $OverallMin = $IndicatorSections[0]["End"]; $OverallMax = $IndicatorSections[0]["Start"];
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
          else
115 115
           {
116 116
            sort($Break);
117
-           $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = FALSE;
117
+           $Poly = ""; $Poly[] = $X1; $Poly[] = $Y; $LastPointWritten = false;
118 118
            foreach($Break as $iKey => $Value)
119 119
             {
120 120
              if ( $Value-5 >= $X1 )
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
               {
134 134
                $Offset = ($Value+5) - $X2;
135 135
                $Poly[] = $X2; $Poly[] = $Y + $Offset;
136
-               $LastPointWritten = TRUE;
136
+               $LastPointWritten = true;
137 137
               }
138 138
 
139 139
             }
@@ -171,18 +171,18 @@  discard block
 block discarded – undo
171 171
        else
172 172
         { $YOffset = 0; $XOffset = 0; }
173 173
 
174
-       if ( $CaptionColorFactor == NULL )
174
+       if ( $CaptionColorFactor == null )
175 175
         { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha); }
176 176
        else
177 177
         { $CaptionColor    = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$CaptionColorFactor,"G"=>$Settings["G"]+$CaptionColorFactor,"B"=>$Settings["B"]+$CaptionColorFactor); }
178 178
 
179
-       if ( $SubCaptionColorFactor == NULL )
179
+       if ( $SubCaptionColorFactor == null )
180 180
         $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$SubCaptionR,"G"=>$SubCaptionG,"B"=>$SubCaptionB,"Alpha"=>$SubCaptionAlpha);
181 181
        else
182 182
         $SubCaptionColor = array("Align"=>TEXT_ALIGN_TOPLEFT,"FontName"=>$CaptionFontName,"FontSize"=>$CaptionFontSize,"R"=>$Settings["R"]+$SubCaptionColorFactor,"G"=>$Settings["G"]+$SubCaptionColorFactor,"B"=>$Settings["B"]+$SubCaptionColorFactor);
183 183
 
184 184
        $RestoreShadow = $this->pChartObject->Shadow;
185
-       $this->pChartObject->Shadow = FALSE;
185
+       $this->pChartObject->Shadow = false;
186 186
 
187 187
        if ( $CaptionLayout == INDICATOR_CAPTION_DEFAULT )
188 188
         $this->pChartObject->drawText($X1,$Y+$Height+$TextPadding,$Caption,$CaptionColor);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
       }
202 202
 
203 203
      $RestoreShadow = $this->pChartObject->Shadow;
204
-     $this->pChartObject->Shadow = FALSE;
204
+     $this->pChartObject->Shadow = false;
205 205
 
206 206
      foreach($Values as $Key => $Value)
207 207
       {
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pBubble.class.php 4 patches
Indentation   +212 added lines, -212 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pBubble - class to draw bubble charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,314 +13,314 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("BUBBLE_SHAPE_ROUND"		, 700001);
17
- define("BUBBLE_SHAPE_SQUARE"		, 700002);
16
+    define("BUBBLE_SHAPE_ROUND"		, 700001);
17
+    define("BUBBLE_SHAPE_SQUARE"		, 700002);
18 18
 
19
- /* pBubble class definition */
20
- class pBubble
21
-  {
22
-   var $pChartObject;
23
-   var $pDataObject;
19
+    /* pBubble class definition */
20
+    class pBubble
21
+    {
22
+    var $pChartObject;
23
+    var $pDataObject;
24 24
 
25
-   /* Class creator */
26
-   function pBubble($pChartObject,$pDataObject)
25
+    /* Class creator */
26
+    function pBubble($pChartObject,$pDataObject)
27 27
     {
28
-     $this->pChartObject = $pChartObject;
29
-     $this->pDataObject  = $pDataObject;
28
+        $this->pChartObject = $pChartObject;
29
+        $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32
-   /* Prepare the scale */
33
-   function bubbleScale($DataSeries,$WeightSeries)
32
+    /* Prepare the scale */
33
+    function bubbleScale($DataSeries,$WeightSeries)
34 34
     {
35
-     if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
36
-     if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
35
+        if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
36
+        if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
37 37
 
38
-     /* Parse each data series to find the new min & max boundaries to scale */
39
-     $NewPositiveSerie = ""; $NewNegativeSerie = ""; $MaxValues = 0; $LastPositive = 0; $LastNegative = 0;
40
-     foreach($DataSeries as $Key => $SerieName)
41
-      {
42
-       $SerieWeightName = $WeightSeries[$Key];
38
+        /* Parse each data series to find the new min & max boundaries to scale */
39
+        $NewPositiveSerie = ""; $NewNegativeSerie = ""; $MaxValues = 0; $LastPositive = 0; $LastNegative = 0;
40
+        foreach($DataSeries as $Key => $SerieName)
41
+        {
42
+        $SerieWeightName = $WeightSeries[$Key];
43 43
 
44
-       $this->pDataObject->setSerieDrawable($SerieWeightName,FALSE);
44
+        $this->pDataObject->setSerieDrawable($SerieWeightName,FALSE);
45 45
 
46
-       if ( count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues ) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
46
+        if ( count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues ) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
47 47
 
48
-       foreach($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value)
48
+        foreach($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value)
49 49
         {
50
-         if ( $Value >= 0 )
51
-          {
52
-           $BubbleBounds = $Value + $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
50
+            if ( $Value >= 0 )
51
+            {
52
+            $BubbleBounds = $Value + $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
53 53
 
54
-           if ( !isset($NewPositiveSerie[$Key]) )
54
+            if ( !isset($NewPositiveSerie[$Key]) )
55 55
             { $NewPositiveSerie[$Key] = $BubbleBounds; }
56
-           elseif ( $NewPositiveSerie[$Key] < $BubbleBounds )
56
+            elseif ( $NewPositiveSerie[$Key] < $BubbleBounds )
57 57
             { $NewPositiveSerie[$Key] = $BubbleBounds; }
58 58
 
59
-           $LastPositive = $BubbleBounds;
60
-          }
61
-         else
62
-          {
63
-           $BubbleBounds = $Value - $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
59
+            $LastPositive = $BubbleBounds;
60
+            }
61
+            else
62
+            {
63
+            $BubbleBounds = $Value - $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
64 64
 
65
-           if ( !isset($NewNegativeSerie[$Key]) )
65
+            if ( !isset($NewNegativeSerie[$Key]) )
66 66
             { $NewNegativeSerie[$Key] = $BubbleBounds; }
67
-           elseif ( $NewNegativeSerie[$Key] > $BubbleBounds )
67
+            elseif ( $NewNegativeSerie[$Key] > $BubbleBounds )
68 68
             { $NewNegativeSerie[$Key] = $BubbleBounds; }
69 69
 
70
-           $LastNegative = $BubbleBounds;
71
-          }
70
+            $LastNegative = $BubbleBounds;
71
+            }
72
+        }
72 73
         }
73
-      }
74 74
 
75
-     /* Check for missing values and all the fake positive serie */
76
-     if ( $NewPositiveSerie != "" )
77
-      {
78
-       for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewPositiveSerie[$i])) { $NewPositiveSerie[$i] = $LastPositive; } }
75
+        /* Check for missing values and all the fake positive serie */
76
+        if ( $NewPositiveSerie != "" )
77
+        {
78
+        for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewPositiveSerie[$i])) { $NewPositiveSerie[$i] = $LastPositive; } }
79 79
 
80
-       $this->pDataObject->addPoints($NewPositiveSerie,"BubbleFakePositiveSerie");
81
-      }
80
+        $this->pDataObject->addPoints($NewPositiveSerie,"BubbleFakePositiveSerie");
81
+        }
82 82
 
83
-     /* Check for missing values and all the fake negative serie */
84
-     if ( $NewNegativeSerie != "" )
85
-      {
86
-       for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewNegativeSerie[$i])) { $NewNegativeSerie[$i] = $LastNegative; } }
83
+        /* Check for missing values and all the fake negative serie */
84
+        if ( $NewNegativeSerie != "" )
85
+        {
86
+        for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewNegativeSerie[$i])) { $NewNegativeSerie[$i] = $LastNegative; } }
87 87
 
88
-       $this->pDataObject->addPoints($NewNegativeSerie,"BubbleFakeNegativeSerie");
89
-      }
88
+        $this->pDataObject->addPoints($NewNegativeSerie,"BubbleFakeNegativeSerie");
89
+        }
90 90
     }
91 91
 
92
-   function resetSeriesColors()
92
+    function resetSeriesColors()
93 93
     {
94
-     $Data    = $this->pDataObject->getData();
95
-     $Palette = $this->pDataObject->getPalette();
94
+        $Data    = $this->pDataObject->getData();
95
+        $Palette = $this->pDataObject->getPalette();
96 96
 
97
-     $ID = 0;
98
-     foreach($Data["Series"] as $SerieName => $SeriesParameters)
99
-      {
100
-       if ( $SeriesParameters["isDrawable"] )
97
+        $ID = 0;
98
+        foreach($Data["Series"] as $SerieName => $SeriesParameters)
101 99
         {
102
-         $this->pDataObject->Data["Series"][$SerieName]["Color"]["R"]     = $Palette[$ID]["R"];
103
-         $this->pDataObject->Data["Series"][$SerieName]["Color"]["G"]     = $Palette[$ID]["G"];
104
-         $this->pDataObject->Data["Series"][$SerieName]["Color"]["B"]     = $Palette[$ID]["B"];
105
-         $this->pDataObject->Data["Series"][$SerieName]["Color"]["Alpha"] = $Palette[$ID]["Alpha"];
106
-         $ID++;
100
+        if ( $SeriesParameters["isDrawable"] )
101
+        {
102
+            $this->pDataObject->Data["Series"][$SerieName]["Color"]["R"]     = $Palette[$ID]["R"];
103
+            $this->pDataObject->Data["Series"][$SerieName]["Color"]["G"]     = $Palette[$ID]["G"];
104
+            $this->pDataObject->Data["Series"][$SerieName]["Color"]["B"]     = $Palette[$ID]["B"];
105
+            $this->pDataObject->Data["Series"][$SerieName]["Color"]["Alpha"] = $Palette[$ID]["Alpha"];
106
+            $ID++;
107
+        }
107 108
         }
108
-      }
109 109
     }
110 110
 
111
-   /* Prepare the scale */
112
-   function drawBubbleChart($DataSeries,$WeightSeries,$Format="")
111
+    /* Prepare the scale */
112
+    function drawBubbleChart($DataSeries,$WeightSeries,$Format="")
113 113
     {
114
-     $ForceAlpha	= isset($Format["ForceAlpha"]) ? $Format["ForceAlpha"] : VOID;
115
-     $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : TRUE;
116
-     $BorderWidth	= isset($Format["BorderWidth"]) ? $Format["BorderWidth"] : 1;
117
-     $Shape		= isset($Format["Shape"]) ? $Format["Shape"] : BUBBLE_SHAPE_ROUND;
118
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
119
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
120
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
121
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
122
-     $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
123
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
114
+        $ForceAlpha	= isset($Format["ForceAlpha"]) ? $Format["ForceAlpha"] : VOID;
115
+        $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : TRUE;
116
+        $BorderWidth	= isset($Format["BorderWidth"]) ? $Format["BorderWidth"] : 1;
117
+        $Shape		= isset($Format["Shape"]) ? $Format["Shape"] : BUBBLE_SHAPE_ROUND;
118
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
119
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
120
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
121
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
122
+        $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
123
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
124 124
 
125
-     if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
126
-     if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
125
+        if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
126
+        if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
127 127
 
128
-     $Data    = $this->pDataObject->getData();
129
-     $Palette = $this->pDataObject->getPalette();
128
+        $Data    = $this->pDataObject->getData();
129
+        $Palette = $this->pDataObject->getPalette();
130 130
 
131
-     if ( isset($Data["Series"]["BubbleFakePositiveSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie",FALSE); }
132
-     if ( isset($Data["Series"]["BubbleFakeNegativeSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie",FALSE); }
131
+        if ( isset($Data["Series"]["BubbleFakePositiveSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie",FALSE); }
132
+        if ( isset($Data["Series"]["BubbleFakeNegativeSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie",FALSE); }
133 133
 
134
-     $this->resetSeriesColors();
134
+        $this->resetSeriesColors();
135 135
 
136
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
136
+        list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
137 137
 
138
-     foreach($DataSeries as $Key => $SerieName)
139
-      {
140
-       $AxisID	= $Data["Series"][$SerieName]["Axis"];
141
-       $Mode	= $Data["Axis"][$AxisID]["Display"];
142
-       $Format	= $Data["Axis"][$AxisID]["Format"];
143
-       $Unit	= $Data["Axis"][$AxisID]["Unit"];
138
+        foreach($DataSeries as $Key => $SerieName)
139
+        {
140
+        $AxisID	= $Data["Series"][$SerieName]["Axis"];
141
+        $Mode	= $Data["Axis"][$AxisID]["Display"];
142
+        $Format	= $Data["Axis"][$AxisID]["Format"];
143
+        $Unit	= $Data["Axis"][$AxisID]["Unit"];
144 144
 
145
-       if (isset($Data["Series"][$SerieName]["Description"])) { $SerieDescription = $Data["Series"][$SerieName]["Description"]; } else { $SerieDescription = $SerieName; }
145
+        if (isset($Data["Series"][$SerieName]["Description"])) { $SerieDescription = $Data["Series"][$SerieName]["Description"]; } else { $SerieDescription = $SerieName; }
146 146
 
147
-       $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
147
+        $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
148 148
 
149
-       $X = $this->pChartObject->GraphAreaX1 + $XMargin;
150
-       $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
149
+        $X = $this->pChartObject->GraphAreaX1 + $XMargin;
150
+        $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
151 151
 
152
-       $Color = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"]);
152
+        $Color = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"]);
153 153
 
154
-       if ( $ForceAlpha != VOID ) { $Color["Alpha"]=$ForceAlpha; }
154
+        if ( $ForceAlpha != VOID ) { $Color["Alpha"]=$ForceAlpha; }
155 155
 
156
-       if ( $DrawBorder )
156
+        if ( $DrawBorder )
157 157
         {
158
-         if ( $BorderWidth != 1 )
159
-          {
160
-           if ( $Surrounding != NULL )
158
+            if ( $BorderWidth != 1 )
159
+            {
160
+            if ( $Surrounding != NULL )
161 161
             { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; }
162
-           else
162
+            else
163 163
             { $BorderR = $BorderR; $BorderG = $BorderG; $BorderB = $BorderB; }
164
-           if ( $ForceAlpha != VOID ) { $BorderAlpha = $ForceAlpha/2; }
165
-           $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
166
-          }
167
-         else
168
-          {
169
-           $Color["BorderAlpha"] = $BorderAlpha;
170
-
171
-           if ( $Surrounding != NULL )
164
+            if ( $ForceAlpha != VOID ) { $BorderAlpha = $ForceAlpha/2; }
165
+            $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
166
+            }
167
+            else
168
+            {
169
+            $Color["BorderAlpha"] = $BorderAlpha;
170
+
171
+            if ( $Surrounding != NULL )
172 172
             { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; }
173
-           else
173
+            else
174 174
             { $Color["BorderR"] = $BorderR; $Color["BorderG"] = $BorderG; $Color["BorderB"] = $BorderB; }
175
-           if ( $ForceAlpha != VOID ) { $Color["BorderAlpha"] = $ForceAlpha/2; }
176
-          }
175
+            if ( $ForceAlpha != VOID ) { $Color["BorderAlpha"] = $ForceAlpha/2; }
176
+            }
177 177
         }
178 178
 
179
-       foreach($Data["Series"][$SerieName]["Data"] as $iKey => $Point)
179
+        foreach($Data["Series"][$SerieName]["Data"] as $iKey => $Point)
180 180
         {
181
-         $Weight = $Point + $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey];
181
+            $Weight = $Point + $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey];
182 182
 
183
-         $PosArray    = $this->pChartObject->scaleComputeY($Point,array("AxisID"=>$AxisID));
184
-         $WeightArray = $this->pChartObject->scaleComputeY($Weight,array("AxisID"=>$AxisID));
183
+            $PosArray    = $this->pChartObject->scaleComputeY($Point,array("AxisID"=>$AxisID));
184
+            $WeightArray = $this->pChartObject->scaleComputeY($Weight,array("AxisID"=>$AxisID));
185 185
 
186
-         if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
187
-          {
188
-           if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
189
-           $Y = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
186
+            if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
187
+            {
188
+            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
189
+            $Y = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
190 190
 
191
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
191
+            if ( $Shape == BUBBLE_SHAPE_SQUARE )
192 192
             {
193
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
194
-
195
-             if ( $BorderWidth != 1 )
196
-              {
197
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
198
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
199
-              }
200
-             else
201
-              $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
193
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
194
+
195
+                if ( $BorderWidth != 1 )
196
+                {
197
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
198
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
199
+                }
200
+                else
201
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
202 202
             }
203
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
203
+            elseif ( $Shape == BUBBLE_SHAPE_ROUND )
204 204
             {
205
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
206
-
207
-             if ( $BorderWidth != 1 )
208
-              {
209
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
210
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
211
-              }
212
-             else
213
-              $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
205
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
206
+
207
+                if ( $BorderWidth != 1 )
208
+                {
209
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
210
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
211
+                }
212
+                else
213
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
214 214
             }
215 215
 
216
-           $X = $X + $XStep;
217
-          }
218
-         elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
219
-          {
220
-           if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
221
-           $X = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
216
+            $X = $X + $XStep;
217
+            }
218
+            elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
219
+            {
220
+            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
221
+            $X = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
222 222
 
223
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
223
+            if ( $Shape == BUBBLE_SHAPE_SQUARE )
224 224
             {
225
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
226
-
227
-             if ( $BorderWidth != 1 )
228
-              {
229
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
230
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
231
-              }
232
-             else
233
-              $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
225
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
226
+
227
+                if ( $BorderWidth != 1 )
228
+                {
229
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
230
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
231
+                }
232
+                else
233
+                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
234 234
             }
235
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
235
+            elseif ( $Shape == BUBBLE_SHAPE_ROUND )
236 236
             {
237
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
238
-
239
-             if ( $BorderWidth != 1 )
240
-              {
241
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
242
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
243
-              }
244
-             else
245
-              $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
237
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
238
+
239
+                if ( $BorderWidth != 1 )
240
+                {
241
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
242
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
243
+                }
244
+                else
245
+                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
246 246
             }
247 247
 
248
-           $Y = $Y + $XStep;
249
-          }
248
+            $Y = $Y + $XStep;
249
+            }
250
+        }
250 251
         }
251
-      }
252 252
     }
253 253
 
254
-   function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="")
254
+    function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="")
255 255
     {
256
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
257
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
256
+        $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
257
+        $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
258 258
 
259
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[] = $Point; }
259
+        if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[] = $Point; }
260 260
 
261
-     $Data    = $this->pDataObject->getData();
262
-     $Palette = $this->pDataObject->getPalette();
261
+        $Data    = $this->pDataObject->getData();
262
+        $Palette = $this->pDataObject->getPalette();
263 263
 
264
-     if ( !isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]) )
265
-      return(0);
264
+        if ( !isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]) )
265
+        return(0);
266 266
 
267
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
267
+        list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
268 268
 
269
-     $AxisID	 = $Data["Series"][$SerieName]["Axis"];
270
-     $AxisMode	 = $Data["Axis"][$AxisID]["Display"];
271
-     $AxisFormat = $Data["Axis"][$AxisID]["Format"];
272
-     $AxisUnit	 = $Data["Axis"][$AxisID]["Unit"];
273
-     $XStep	 = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
269
+        $AxisID	 = $Data["Series"][$SerieName]["Axis"];
270
+        $AxisMode	 = $Data["Axis"][$AxisID]["Display"];
271
+        $AxisFormat = $Data["Axis"][$AxisID]["Format"];
272
+        $AxisUnit	 = $Data["Axis"][$AxisID]["Unit"];
273
+        $XStep	 = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
274 274
 
275
-     $X = $this->pChartObject->GraphAreaX1 + $XMargin;
276
-     $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
275
+        $X = $this->pChartObject->GraphAreaX1 + $XMargin;
276
+        $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
277 277
 
278
-     $Color = array("R"=>$Data["Series"][$SerieName]["Color"]["R"],"G"=>$Data["Series"][$SerieName]["Color"]["G"],"B"=>$Data["Series"][$SerieName]["Color"]["B"],"Alpha"=>$Data["Series"][$SerieName]["Color"]["Alpha"]);
278
+        $Color = array("R"=>$Data["Series"][$SerieName]["Color"]["R"],"G"=>$Data["Series"][$SerieName]["Color"]["G"],"B"=>$Data["Series"][$SerieName]["Color"]["B"],"Alpha"=>$Data["Series"][$SerieName]["Color"]["Alpha"]);
279 279
 
280
-     foreach($Points as $Key => $Point)
281
-      {
282
-       $Value    = $Data["Series"][$SerieName]["Data"][$Point];
283
-       $PosArray = $this->pChartObject->scaleComputeY($Value,array("AxisID"=>$AxisID));
280
+        foreach($Points as $Key => $Point)
281
+        {
282
+        $Value    = $Data["Series"][$SerieName]["Data"][$Point];
283
+        $PosArray = $this->pChartObject->scaleComputeY($Value,array("AxisID"=>$AxisID));
284 284
 
285
-       if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]) )
285
+        if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]) )
286 286
         $Abscissa = $Data["Series"][$Data["Abscissa"]]["Data"][$Point]." : ";
287
-       else
287
+        else
288 288
         $Abscissa = "";
289 289
 
290
-       $Value   = $this->pChartObject->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit);
291
-       $Weight  = $Data["Series"][$SerieWeightName]["Data"][$Point];
292
-       $Caption = $Abscissa.$Value." / ".$Weight;
290
+        $Value   = $this->pChartObject->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit);
291
+        $Weight  = $Data["Series"][$SerieWeightName]["Data"][$Point];
292
+        $Caption = $Abscissa.$Value." / ".$Weight;
293 293
 
294
-       if ( isset($Data["Series"][$SerieName]["Description"]) )
294
+        if ( isset($Data["Series"][$SerieName]["Description"]) )
295 295
         $Description = $Data["Series"][$SerieName]["Description"];
296
-       else
296
+        else
297 297
         $Description = "No description";
298 298
 
299
-       $Series = "";
300
-       $Series[] = array("Format"=>$Color,"Caption"=>$Caption);
299
+        $Series = "";
300
+        $Series[] = array("Format"=>$Color,"Caption"=>$Caption);
301 301
 
302
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
302
+        if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
303 303
         {
304
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
304
+            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
305 305
 
306
-         $X = floor($X + $Point * $XStep);
307
-         $Y = floor($PosArray);
306
+            $X = floor($X + $Point * $XStep);
307
+            $Y = floor($PosArray);
308 308
         }
309
-       else
309
+        else
310 310
         {
311
-         if ( $XDivs == 0 ) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
311
+            if ( $XDivs == 0 ) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
312 312
 
313
-         $X = floor($PosArray);
314
-         $Y = floor($Y + $Point * $YStep);
313
+            $X = floor($PosArray);
314
+            $Y = floor($Y + $Point * $YStep);
315 315
         }
316 316
 
317
-       if ( $DrawPoint == LABEL_POINT_CIRCLE )
317
+        if ( $DrawPoint == LABEL_POINT_CIRCLE )
318 318
         $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
319
-       elseif ( $DrawPoint == LABEL_POINT_BOX )
319
+        elseif ( $DrawPoint == LABEL_POINT_BOX )
320 320
         $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
321 321
 
322
-       $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
323
-      }
322
+        $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
323
+        }
324
+    }
324 325
     }
325
-  }
326 326
 ?>
327 327
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("BUBBLE_SHAPE_ROUND"		, 700001);
17
- define("BUBBLE_SHAPE_SQUARE"		, 700002);
16
+ define("BUBBLE_SHAPE_ROUND", 700001);
17
+ define("BUBBLE_SHAPE_SQUARE", 700002);
18 18
 
19 19
  /* pBubble class definition */
20 20
  class pBubble
@@ -23,37 +23,37 @@  discard block
 block discarded – undo
23 23
    var $pDataObject;
24 24
 
25 25
    /* Class creator */
26
-   function pBubble($pChartObject,$pDataObject)
26
+   function pBubble($pChartObject, $pDataObject)
27 27
     {
28 28
      $this->pChartObject = $pChartObject;
29 29
      $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32 32
    /* Prepare the scale */
33
-   function bubbleScale($DataSeries,$WeightSeries)
33
+   function bubbleScale($DataSeries, $WeightSeries)
34 34
     {
35
-     if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
36
-     if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
35
+     if (!is_array($DataSeries)) { $DataSeries = array($DataSeries); }
36
+     if (!is_array($WeightSeries)) { $WeightSeries = array($WeightSeries); }
37 37
 
38 38
      /* Parse each data series to find the new min & max boundaries to scale */
39 39
      $NewPositiveSerie = ""; $NewNegativeSerie = ""; $MaxValues = 0; $LastPositive = 0; $LastNegative = 0;
40
-     foreach($DataSeries as $Key => $SerieName)
40
+     foreach ($DataSeries as $Key => $SerieName)
41 41
       {
42 42
        $SerieWeightName = $WeightSeries[$Key];
43 43
 
44
-       $this->pDataObject->setSerieDrawable($SerieWeightName,FALSE);
44
+       $this->pDataObject->setSerieDrawable($SerieWeightName, FALSE);
45 45
 
46
-       if ( count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues ) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
46
+       if (count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
47 47
 
48
-       foreach($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value)
48
+       foreach ($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value)
49 49
         {
50
-         if ( $Value >= 0 )
50
+         if ($Value >= 0)
51 51
           {
52 52
            $BubbleBounds = $Value + $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
53 53
 
54
-           if ( !isset($NewPositiveSerie[$Key]) )
54
+           if (!isset($NewPositiveSerie[$Key]))
55 55
             { $NewPositiveSerie[$Key] = $BubbleBounds; }
56
-           elseif ( $NewPositiveSerie[$Key] < $BubbleBounds )
56
+           elseif ($NewPositiveSerie[$Key] < $BubbleBounds)
57 57
             { $NewPositiveSerie[$Key] = $BubbleBounds; }
58 58
 
59 59
            $LastPositive = $BubbleBounds;
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
           {
63 63
            $BubbleBounds = $Value - $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
64 64
 
65
-           if ( !isset($NewNegativeSerie[$Key]) )
65
+           if (!isset($NewNegativeSerie[$Key]))
66 66
             { $NewNegativeSerie[$Key] = $BubbleBounds; }
67
-           elseif ( $NewNegativeSerie[$Key] > $BubbleBounds )
67
+           elseif ($NewNegativeSerie[$Key] > $BubbleBounds)
68 68
             { $NewNegativeSerie[$Key] = $BubbleBounds; }
69 69
 
70 70
            $LastNegative = $BubbleBounds;
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
       }
74 74
 
75 75
      /* Check for missing values and all the fake positive serie */
76
-     if ( $NewPositiveSerie != "" )
76
+     if ($NewPositiveSerie != "")
77 77
       {
78
-       for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewPositiveSerie[$i])) { $NewPositiveSerie[$i] = $LastPositive; } }
78
+       for ($i = 0; $i < $MaxValues; $i++) { if (!isset($NewPositiveSerie[$i])) { $NewPositiveSerie[$i] = $LastPositive; } }
79 79
 
80
-       $this->pDataObject->addPoints($NewPositiveSerie,"BubbleFakePositiveSerie");
80
+       $this->pDataObject->addPoints($NewPositiveSerie, "BubbleFakePositiveSerie");
81 81
       }
82 82
 
83 83
      /* Check for missing values and all the fake negative serie */
84
-     if ( $NewNegativeSerie != "" )
84
+     if ($NewNegativeSerie != "")
85 85
       {
86
-       for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewNegativeSerie[$i])) { $NewNegativeSerie[$i] = $LastNegative; } }
86
+       for ($i = 0; $i < $MaxValues; $i++) { if (!isset($NewNegativeSerie[$i])) { $NewNegativeSerie[$i] = $LastNegative; } }
87 87
 
88
-       $this->pDataObject->addPoints($NewNegativeSerie,"BubbleFakeNegativeSerie");
88
+       $this->pDataObject->addPoints($NewNegativeSerie, "BubbleFakeNegativeSerie");
89 89
       }
90 90
     }
91 91
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
      $Palette = $this->pDataObject->getPalette();
96 96
 
97 97
      $ID = 0;
98
-     foreach($Data["Series"] as $SerieName => $SeriesParameters)
98
+     foreach ($Data["Series"] as $SerieName => $SeriesParameters)
99 99
       {
100
-       if ( $SeriesParameters["isDrawable"] )
100
+       if ($SeriesParameters["isDrawable"])
101 101
         {
102 102
          $this->pDataObject->Data["Series"][$SerieName]["Color"]["R"]     = $Palette[$ID]["R"];
103 103
          $this->pDataObject->Data["Series"][$SerieName]["Color"]["G"]     = $Palette[$ID]["G"];
@@ -109,33 +109,33 @@  discard block
 block discarded – undo
109 109
     }
110 110
 
111 111
    /* Prepare the scale */
112
-   function drawBubbleChart($DataSeries,$WeightSeries,$Format="")
112
+   function drawBubbleChart($DataSeries, $WeightSeries, $Format = "")
113 113
     {
114 114
      $ForceAlpha	= isset($Format["ForceAlpha"]) ? $Format["ForceAlpha"] : VOID;
115 115
      $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : TRUE;
116 116
      $BorderWidth	= isset($Format["BorderWidth"]) ? $Format["BorderWidth"] : 1;
117
-     $Shape		= isset($Format["Shape"]) ? $Format["Shape"] : BUBBLE_SHAPE_ROUND;
117
+     $Shape = isset($Format["Shape"]) ? $Format["Shape"] : BUBBLE_SHAPE_ROUND;
118 118
      $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
119 119
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
120 120
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
121 121
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
122
-     $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
123
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
122
+     $BorderAlpha = isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
123
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
124 124
 
125
-     if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
126
-     if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
125
+     if (!is_array($DataSeries)) { $DataSeries = array($DataSeries); }
126
+     if (!is_array($WeightSeries)) { $WeightSeries = array($WeightSeries); }
127 127
 
128 128
      $Data    = $this->pDataObject->getData();
129 129
      $Palette = $this->pDataObject->getPalette();
130 130
 
131
-     if ( isset($Data["Series"]["BubbleFakePositiveSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie",FALSE); }
132
-     if ( isset($Data["Series"]["BubbleFakeNegativeSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie",FALSE); }
131
+     if (isset($Data["Series"]["BubbleFakePositiveSerie"])) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie", FALSE); }
132
+     if (isset($Data["Series"]["BubbleFakeNegativeSerie"])) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie", FALSE); }
133 133
 
134 134
      $this->resetSeriesColors();
135 135
 
136
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
136
+     list($XMargin, $XDivs) = $this->pChartObject->scaleGetXSettings();
137 137
 
138
-     foreach($DataSeries as $Key => $SerieName)
138
+     foreach ($DataSeries as $Key => $SerieName)
139 139
       {
140 140
        $AxisID	= $Data["Series"][$SerieName]["Axis"];
141 141
        $Mode	= $Data["Axis"][$AxisID]["Display"];
@@ -144,105 +144,105 @@  discard block
 block discarded – undo
144 144
 
145 145
        if (isset($Data["Series"][$SerieName]["Description"])) { $SerieDescription = $Data["Series"][$SerieName]["Description"]; } else { $SerieDescription = $SerieName; }
146 146
 
147
-       $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
147
+       $XStep = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs;
148 148
 
149 149
        $X = $this->pChartObject->GraphAreaX1 + $XMargin;
150 150
        $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
151 151
 
152
-       $Color = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"]);
152
+       $Color = array("R"=>$Palette[$Key]["R"], "G"=>$Palette[$Key]["G"], "B"=>$Palette[$Key]["B"], "Alpha"=>$Palette[$Key]["Alpha"]);
153 153
 
154
-       if ( $ForceAlpha != VOID ) { $Color["Alpha"]=$ForceAlpha; }
154
+       if ($ForceAlpha != VOID) { $Color["Alpha"] = $ForceAlpha; }
155 155
 
156
-       if ( $DrawBorder )
156
+       if ($DrawBorder)
157 157
         {
158
-         if ( $BorderWidth != 1 )
158
+         if ($BorderWidth != 1)
159 159
           {
160
-           if ( $Surrounding != NULL )
161
-            { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; }
160
+           if ($Surrounding != NULL)
161
+            { $BorderR = $Palette[$Key]["R"] + $Surrounding; $BorderG = $Palette[$Key]["G"] + $Surrounding; $BorderB = $Palette[$Key]["B"] + $Surrounding; }
162 162
            else
163 163
             { $BorderR = $BorderR; $BorderG = $BorderG; $BorderB = $BorderB; }
164
-           if ( $ForceAlpha != VOID ) { $BorderAlpha = $ForceAlpha/2; }
165
-           $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
164
+           if ($ForceAlpha != VOID) { $BorderAlpha = $ForceAlpha/2; }
165
+           $BorderColor = array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha);
166 166
           }
167 167
          else
168 168
           {
169 169
            $Color["BorderAlpha"] = $BorderAlpha;
170 170
 
171
-           if ( $Surrounding != NULL )
172
-            { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; }
171
+           if ($Surrounding != NULL)
172
+            { $Color["BorderR"] = $Palette[$Key]["R"] + $Surrounding; $Color["BorderG"] = $Palette[$Key]["G"] + $Surrounding; $Color["BorderB"] = $Palette[$Key]["B"] + $Surrounding; }
173 173
            else
174 174
             { $Color["BorderR"] = $BorderR; $Color["BorderG"] = $BorderG; $Color["BorderB"] = $BorderB; }
175
-           if ( $ForceAlpha != VOID ) { $Color["BorderAlpha"] = $ForceAlpha/2; }
175
+           if ($ForceAlpha != VOID) { $Color["BorderAlpha"] = $ForceAlpha/2; }
176 176
           }
177 177
         }
178 178
 
179
-       foreach($Data["Series"][$SerieName]["Data"] as $iKey => $Point)
179
+       foreach ($Data["Series"][$SerieName]["Data"] as $iKey => $Point)
180 180
         {
181 181
          $Weight = $Point + $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey];
182 182
 
183
-         $PosArray    = $this->pChartObject->scaleComputeY($Point,array("AxisID"=>$AxisID));
184
-         $WeightArray = $this->pChartObject->scaleComputeY($Weight,array("AxisID"=>$AxisID));
183
+         $PosArray    = $this->pChartObject->scaleComputeY($Point, array("AxisID"=>$AxisID));
184
+         $WeightArray = $this->pChartObject->scaleComputeY($Weight, array("AxisID"=>$AxisID));
185 185
 
186
-         if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
186
+         if ($Data["Orientation"] == SCALE_POS_LEFTRIGHT)
187 187
           {
188
-           if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
188
+           if ($XDivs == 0) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs; }
189 189
            $Y = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
190 190
 
191
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
191
+           if ($Shape == BUBBLE_SHAPE_SQUARE)
192 192
             {
193
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
193
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($X - $CircleRadius).",".floor($Y - $CircleRadius).",".floor($X + $CircleRadius).",".floor($Y + $CircleRadius), $this->pChartObject->toHTMLColor($Palette[$Key]["R"], $Palette[$Key]["G"], $Palette[$Key]["B"]), $SerieDescription, $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
194 194
 
195
-             if ( $BorderWidth != 1 )
195
+             if ($BorderWidth != 1)
196 196
               {
197
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
198
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
197
+               $this->pChartObject->drawFilledRectangle($X - $CircleRadius - $BorderWidth, $Y - $CircleRadius - $BorderWidth, $X + $CircleRadius + $BorderWidth, $Y + $CircleRadius + $BorderWidth, $BorderColor);
198
+               $this->pChartObject->drawFilledRectangle($X - $CircleRadius, $Y - $CircleRadius, $X + $CircleRadius, $Y + $CircleRadius, $Color);
199 199
               }
200 200
              else
201
-              $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
201
+              $this->pChartObject->drawFilledRectangle($X - $CircleRadius, $Y - $CircleRadius, $X + $CircleRadius, $Y + $CircleRadius, $Color);
202 202
             }
203
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
203
+           elseif ($Shape == BUBBLE_SHAPE_ROUND)
204 204
             {
205
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
205
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("CIRCLE", floor($X).",".floor($Y).",".floor($CircleRadius), $this->pChartObject->toHTMLColor($Palette[$Key]["R"], $Palette[$Key]["G"], $Palette[$Key]["B"]), $SerieDescription, $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
206 206
 
207
-             if ( $BorderWidth != 1 )
207
+             if ($BorderWidth != 1)
208 208
               {
209
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
210
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
209
+               $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius + $BorderWidth, $BorderColor);
210
+               $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius, $Color);
211 211
               }
212 212
              else
213
-              $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
213
+              $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius, $Color);
214 214
             }
215 215
 
216 216
            $X = $X + $XStep;
217 217
           }
218
-         elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
218
+         elseif ($Data["Orientation"] == SCALE_POS_TOPBOTTOM)
219 219
           {
220
-           if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
220
+           if ($XDivs == 0) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $XMargin*2)/$XDivs; }
221 221
            $X = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
222 222
 
223
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
223
+           if ($Shape == BUBBLE_SHAPE_SQUARE)
224 224
             {
225
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
225
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($X - $CircleRadius).",".floor($Y - $CircleRadius).",".floor($X + $CircleRadius).",".floor($Y + $CircleRadius), $this->pChartObject->toHTMLColor($Palette[$Key]["R"], $Palette[$Key]["G"], $Palette[$Key]["B"]), $SerieDescription, $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
226 226
 
227
-             if ( $BorderWidth != 1 )
227
+             if ($BorderWidth != 1)
228 228
               {
229
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
230
-               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
229
+               $this->pChartObject->drawFilledRectangle($X - $CircleRadius - $BorderWidth, $Y - $CircleRadius - $BorderWidth, $X + $CircleRadius + $BorderWidth, $Y + $CircleRadius + $BorderWidth, $BorderColor);
230
+               $this->pChartObject->drawFilledRectangle($X - $CircleRadius, $Y - $CircleRadius, $X + $CircleRadius, $Y + $CircleRadius, $Color);
231 231
               }
232 232
              else
233
-              $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
233
+              $this->pChartObject->drawFilledRectangle($X - $CircleRadius, $Y - $CircleRadius, $X + $CircleRadius, $Y + $CircleRadius, $Color);
234 234
             }
235
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
235
+           elseif ($Shape == BUBBLE_SHAPE_ROUND)
236 236
             {
237
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
237
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("CIRCLE", floor($X).",".floor($Y).",".floor($CircleRadius), $this->pChartObject->toHTMLColor($Palette[$Key]["R"], $Palette[$Key]["G"], $Palette[$Key]["B"]), $SerieDescription, $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
238 238
 
239
-             if ( $BorderWidth != 1 )
239
+             if ($BorderWidth != 1)
240 240
               {
241
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
242
-               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
241
+               $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius + $BorderWidth, $BorderColor);
242
+               $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius, $Color);
243 243
               }
244 244
              else
245
-              $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
245
+              $this->pChartObject->drawFilledCircle($X, $Y, $CircleRadius, $Color);
246 246
             }
247 247
 
248 248
            $Y = $Y + $XStep;
@@ -251,75 +251,75 @@  discard block
 block discarded – undo
251 251
       }
252 252
     }
253 253
 
254
-   function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="")
254
+   function writeBubbleLabel($SerieName, $SerieWeightName, $Points, $Format = "")
255 255
     {
256
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
257
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
256
+     $OverrideTitle = isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
257
+     $DrawPoint = isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
258 258
 
259
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[] = $Point; }
259
+     if (!is_array($Points)) { $Point = $Points; $Points = ""; $Points[] = $Point; }
260 260
 
261 261
      $Data    = $this->pDataObject->getData();
262 262
      $Palette = $this->pDataObject->getPalette();
263 263
 
264
-     if ( !isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]) )
264
+     if (!isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]))
265 265
       return(0);
266 266
 
267
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
267
+     list($XMargin, $XDivs) = $this->pChartObject->scaleGetXSettings();
268 268
 
269
-     $AxisID	 = $Data["Series"][$SerieName]["Axis"];
269
+     $AxisID = $Data["Series"][$SerieName]["Axis"];
270 270
      $AxisMode	 = $Data["Axis"][$AxisID]["Display"];
271 271
      $AxisFormat = $Data["Axis"][$AxisID]["Format"];
272 272
      $AxisUnit	 = $Data["Axis"][$AxisID]["Unit"];
273
-     $XStep	 = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
273
+     $XStep = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs;
274 274
 
275 275
      $X = $this->pChartObject->GraphAreaX1 + $XMargin;
276 276
      $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
277 277
 
278
-     $Color = array("R"=>$Data["Series"][$SerieName]["Color"]["R"],"G"=>$Data["Series"][$SerieName]["Color"]["G"],"B"=>$Data["Series"][$SerieName]["Color"]["B"],"Alpha"=>$Data["Series"][$SerieName]["Color"]["Alpha"]);
278
+     $Color = array("R"=>$Data["Series"][$SerieName]["Color"]["R"], "G"=>$Data["Series"][$SerieName]["Color"]["G"], "B"=>$Data["Series"][$SerieName]["Color"]["B"], "Alpha"=>$Data["Series"][$SerieName]["Color"]["Alpha"]);
279 279
 
280
-     foreach($Points as $Key => $Point)
280
+     foreach ($Points as $Key => $Point)
281 281
       {
282 282
        $Value    = $Data["Series"][$SerieName]["Data"][$Point];
283
-       $PosArray = $this->pChartObject->scaleComputeY($Value,array("AxisID"=>$AxisID));
283
+       $PosArray = $this->pChartObject->scaleComputeY($Value, array("AxisID"=>$AxisID));
284 284
 
285
-       if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]) )
285
+       if (isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]))
286 286
         $Abscissa = $Data["Series"][$Data["Abscissa"]]["Data"][$Point]." : ";
287 287
        else
288 288
         $Abscissa = "";
289 289
 
290
-       $Value   = $this->pChartObject->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit);
290
+       $Value   = $this->pChartObject->scaleFormat($Value, $AxisMode, $AxisFormat, $AxisUnit);
291 291
        $Weight  = $Data["Series"][$SerieWeightName]["Data"][$Point];
292 292
        $Caption = $Abscissa.$Value." / ".$Weight;
293 293
 
294
-       if ( isset($Data["Series"][$SerieName]["Description"]) )
294
+       if (isset($Data["Series"][$SerieName]["Description"]))
295 295
         $Description = $Data["Series"][$SerieName]["Description"];
296 296
        else
297 297
         $Description = "No description";
298 298
 
299 299
        $Series = "";
300
-       $Series[] = array("Format"=>$Color,"Caption"=>$Caption);
300
+       $Series[] = array("Format"=>$Color, "Caption"=>$Caption);
301 301
 
302
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
302
+       if ($Data["Orientation"] == SCALE_POS_LEFTRIGHT)
303 303
         {
304
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
304
+         if ($XDivs == 0) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs; }
305 305
 
306
-         $X = floor($X + $Point * $XStep);
306
+         $X = floor($X + $Point*$XStep);
307 307
          $Y = floor($PosArray);
308 308
         }
309 309
        else
310 310
         {
311
-         if ( $XDivs == 0 ) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
311
+         if ($XDivs == 0) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $XMargin*2)/$XDivs; }
312 312
 
313 313
          $X = floor($PosArray);
314
-         $Y = floor($Y + $Point * $YStep);
314
+         $Y = floor($Y + $Point*$YStep);
315 315
         }
316 316
 
317
-       if ( $DrawPoint == LABEL_POINT_CIRCLE )
318
-        $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
319
-       elseif ( $DrawPoint == LABEL_POINT_BOX )
320
-        $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
317
+       if ($DrawPoint == LABEL_POINT_CIRCLE)
318
+        $this->pChartObject->drawFilledCircle($X, $Y, 3, array("R"=>255, "G"=>255, "B"=>255, "BorderR"=>0, "BorderG"=>0, "BorderB"=>0));
319
+       elseif ($DrawPoint == LABEL_POINT_BOX)
320
+        $this->pChartObject->drawFilledRectangle($X - 2, $Y - 2, $X + 2, $Y + 2, array("R"=>255, "G"=>255, "B"=>255, "BorderR"=>0, "BorderG"=>0, "BorderB"=>0));
321 321
 
322
-       $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
322
+       $this->pChartObject->drawLabelBox($X, $Y - 3, $Description, $Series, $Format);
323 323
       }
324 324
     }
325 325
   }
Please login to merge, or discard this patch.
Braces   +40 added lines, -86 removed lines patch added patch discarded remove patch
@@ -17,54 +17,44 @@  discard block
 block discarded – undo
17 17
  define("BUBBLE_SHAPE_SQUARE"		, 700002);
18 18
 
19 19
  /* pBubble class definition */
20
- class pBubble
21
-  {
20
+ class pBubble {
22 21
    var $pChartObject;
23 22
    var $pDataObject;
24 23
 
25 24
    /* Class creator */
26
-   function pBubble($pChartObject,$pDataObject)
27
-    {
25
+   function pBubble($pChartObject,$pDataObject) {
28 26
      $this->pChartObject = $pChartObject;
29 27
      $this->pDataObject  = $pDataObject;
30 28
     }
31 29
 
32 30
    /* Prepare the scale */
33
-   function bubbleScale($DataSeries,$WeightSeries)
34
-    {
31
+   function bubbleScale($DataSeries,$WeightSeries) {
35 32
      if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
36 33
      if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
37 34
 
38 35
      /* Parse each data series to find the new min & max boundaries to scale */
39 36
      $NewPositiveSerie = ""; $NewNegativeSerie = ""; $MaxValues = 0; $LastPositive = 0; $LastNegative = 0;
40
-     foreach($DataSeries as $Key => $SerieName)
41
-      {
37
+     foreach($DataSeries as $Key => $SerieName) {
42 38
        $SerieWeightName = $WeightSeries[$Key];
43 39
 
44 40
        $this->pDataObject->setSerieDrawable($SerieWeightName,FALSE);
45 41
 
46 42
        if ( count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues ) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
47 43
 
48
-       foreach($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value)
49
-        {
50
-         if ( $Value >= 0 )
51
-          {
44
+       foreach($this->pDataObject->Data["Series"][$SerieName]["Data"] as $Key => $Value) {
45
+         if ( $Value >= 0 ) {
52 46
            $BubbleBounds = $Value + $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
53 47
 
54 48
            if ( !isset($NewPositiveSerie[$Key]) )
55
-            { $NewPositiveSerie[$Key] = $BubbleBounds; }
56
-           elseif ( $NewPositiveSerie[$Key] < $BubbleBounds )
49
+            { $NewPositiveSerie[$Key] = $BubbleBounds; } elseif ( $NewPositiveSerie[$Key] < $BubbleBounds )
57 50
             { $NewPositiveSerie[$Key] = $BubbleBounds; }
58 51
 
59 52
            $LastPositive = $BubbleBounds;
60
-          }
61
-         else
62
-          {
53
+          } else {
63 54
            $BubbleBounds = $Value - $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key];
64 55
 
65 56
            if ( !isset($NewNegativeSerie[$Key]) )
66
-            { $NewNegativeSerie[$Key] = $BubbleBounds; }
67
-           elseif ( $NewNegativeSerie[$Key] > $BubbleBounds )
57
+            { $NewNegativeSerie[$Key] = $BubbleBounds; } elseif ( $NewNegativeSerie[$Key] > $BubbleBounds )
68 58
             { $NewNegativeSerie[$Key] = $BubbleBounds; }
69 59
 
70 60
            $LastNegative = $BubbleBounds;
@@ -73,32 +63,27 @@  discard block
 block discarded – undo
73 63
       }
74 64
 
75 65
      /* Check for missing values and all the fake positive serie */
76
-     if ( $NewPositiveSerie != "" )
77
-      {
66
+     if ( $NewPositiveSerie != "" ) {
78 67
        for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewPositiveSerie[$i])) { $NewPositiveSerie[$i] = $LastPositive; } }
79 68
 
80 69
        $this->pDataObject->addPoints($NewPositiveSerie,"BubbleFakePositiveSerie");
81 70
       }
82 71
 
83 72
      /* Check for missing values and all the fake negative serie */
84
-     if ( $NewNegativeSerie != "" )
85
-      {
73
+     if ( $NewNegativeSerie != "" ) {
86 74
        for ($i=0; $i<$MaxValues; $i++) { if (!isset($NewNegativeSerie[$i])) { $NewNegativeSerie[$i] = $LastNegative; } }
87 75
 
88 76
        $this->pDataObject->addPoints($NewNegativeSerie,"BubbleFakeNegativeSerie");
89 77
       }
90 78
     }
91 79
 
92
-   function resetSeriesColors()
93
-    {
80
+   function resetSeriesColors() {
94 81
      $Data    = $this->pDataObject->getData();
95 82
      $Palette = $this->pDataObject->getPalette();
96 83
 
97 84
      $ID = 0;
98
-     foreach($Data["Series"] as $SerieName => $SeriesParameters)
99
-      {
100
-       if ( $SeriesParameters["isDrawable"] )
101
-        {
85
+     foreach($Data["Series"] as $SerieName => $SeriesParameters) {
86
+       if ( $SeriesParameters["isDrawable"] ) {
102 87
          $this->pDataObject->Data["Series"][$SerieName]["Color"]["R"]     = $Palette[$ID]["R"];
103 88
          $this->pDataObject->Data["Series"][$SerieName]["Color"]["G"]     = $Palette[$ID]["G"];
104 89
          $this->pDataObject->Data["Series"][$SerieName]["Color"]["B"]     = $Palette[$ID]["B"];
@@ -109,8 +94,7 @@  discard block
 block discarded – undo
109 94
     }
110 95
 
111 96
    /* Prepare the scale */
112
-   function drawBubbleChart($DataSeries,$WeightSeries,$Format="")
113
-    {
97
+   function drawBubbleChart($DataSeries,$WeightSeries,$Format="") {
114 98
      $ForceAlpha	= isset($Format["ForceAlpha"]) ? $Format["ForceAlpha"] : VOID;
115 99
      $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : TRUE;
116 100
      $BorderWidth	= isset($Format["BorderWidth"]) ? $Format["BorderWidth"] : 1;
@@ -135,8 +119,7 @@  discard block
 block discarded – undo
135 119
 
136 120
      list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
137 121
 
138
-     foreach($DataSeries as $Key => $SerieName)
139
-      {
122
+     foreach($DataSeries as $Key => $SerieName) {
140 123
        $AxisID	= $Data["Series"][$SerieName]["Axis"];
141 124
        $Mode	= $Data["Axis"][$AxisID]["Display"];
142 125
        $Format	= $Data["Axis"][$AxisID]["Format"];
@@ -153,95 +136,71 @@  discard block
 block discarded – undo
153 136
 
154 137
        if ( $ForceAlpha != VOID ) { $Color["Alpha"]=$ForceAlpha; }
155 138
 
156
-       if ( $DrawBorder )
157
-        {
158
-         if ( $BorderWidth != 1 )
159
-          {
139
+       if ( $DrawBorder ) {
140
+         if ( $BorderWidth != 1 ) {
160 141
            if ( $Surrounding != NULL )
161
-            { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; }
162
-           else
142
+            { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; } else
163 143
             { $BorderR = $BorderR; $BorderG = $BorderG; $BorderB = $BorderB; }
164 144
            if ( $ForceAlpha != VOID ) { $BorderAlpha = $ForceAlpha/2; }
165 145
            $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
166
-          }
167
-         else
168
-          {
146
+          } else {
169 147
            $Color["BorderAlpha"] = $BorderAlpha;
170 148
 
171 149
            if ( $Surrounding != NULL )
172
-            { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; }
173
-           else
150
+            { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; } else
174 151
             { $Color["BorderR"] = $BorderR; $Color["BorderG"] = $BorderG; $Color["BorderB"] = $BorderB; }
175 152
            if ( $ForceAlpha != VOID ) { $Color["BorderAlpha"] = $ForceAlpha/2; }
176 153
           }
177 154
         }
178 155
 
179
-       foreach($Data["Series"][$SerieName]["Data"] as $iKey => $Point)
180
-        {
156
+       foreach($Data["Series"][$SerieName]["Data"] as $iKey => $Point) {
181 157
          $Weight = $Point + $Data["Series"][$WeightSeries[$Key]]["Data"][$iKey];
182 158
 
183 159
          $PosArray    = $this->pChartObject->scaleComputeY($Point,array("AxisID"=>$AxisID));
184 160
          $WeightArray = $this->pChartObject->scaleComputeY($Weight,array("AxisID"=>$AxisID));
185 161
 
186
-         if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
187
-          {
162
+         if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) {
188 163
            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
189 164
            $Y = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
190 165
 
191
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
192
-            {
166
+           if ( $Shape == BUBBLE_SHAPE_SQUARE ) {
193 167
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
194 168
 
195
-             if ( $BorderWidth != 1 )
196
-              {
169
+             if ( $BorderWidth != 1 ) {
197 170
                $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
198 171
                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
199
-              }
200
-             else
172
+              } else
201 173
               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
202
-            }
203
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
204
-            {
174
+            } elseif ( $Shape == BUBBLE_SHAPE_ROUND ) {
205 175
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
206 176
 
207
-             if ( $BorderWidth != 1 )
208
-              {
177
+             if ( $BorderWidth != 1 ) {
209 178
                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
210 179
                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
211
-              }
212
-             else
180
+              } else
213 181
               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
214 182
             }
215 183
 
216 184
            $X = $X + $XStep;
217
-          }
218
-         elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
219
-          {
185
+          } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) {
220 186
            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
221 187
            $X = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2);
222 188
 
223
-           if ( $Shape == BUBBLE_SHAPE_SQUARE )
224
-            {
189
+           if ( $Shape == BUBBLE_SHAPE_SQUARE ) {
225 190
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$CircleRadius).",".floor($Y-$CircleRadius).",".floor($X+$CircleRadius).",".floor($Y+$CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
226 191
 
227
-             if ( $BorderWidth != 1 )
228
-              {
192
+             if ( $BorderWidth != 1 ) {
229 193
                $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor);
230 194
                $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
231
-              }
232
-             else
195
+              } else
233 196
               $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color);
234
-            }
235
-           elseif ( $Shape == BUBBLE_SHAPE_ROUND )
236
-            {
197
+            } elseif ( $Shape == BUBBLE_SHAPE_ROUND ) {
237 198
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); }
238 199
 
239
-             if ( $BorderWidth != 1 )
240
-              {
200
+             if ( $BorderWidth != 1 ) {
241 201
                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor);
242 202
                $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
243
-              }
244
-             else
203
+              } else
245 204
               $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color);
246 205
             }
247 206
 
@@ -251,8 +210,7 @@  discard block
 block discarded – undo
251 210
       }
252 211
     }
253 212
 
254
-   function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="")
255
-    {
213
+   function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="") {
256 214
      $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
257 215
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
258 216
 
@@ -277,8 +235,7 @@  discard block
 block discarded – undo
277 235
 
278 236
      $Color = array("R"=>$Data["Series"][$SerieName]["Color"]["R"],"G"=>$Data["Series"][$SerieName]["Color"]["G"],"B"=>$Data["Series"][$SerieName]["Color"]["B"],"Alpha"=>$Data["Series"][$SerieName]["Color"]["Alpha"]);
279 237
 
280
-     foreach($Points as $Key => $Point)
281
-      {
238
+     foreach($Points as $Key => $Point) {
282 239
        $Value    = $Data["Series"][$SerieName]["Data"][$Point];
283 240
        $PosArray = $this->pChartObject->scaleComputeY($Value,array("AxisID"=>$AxisID));
284 241
 
@@ -299,15 +256,12 @@  discard block
 block discarded – undo
299 256
        $Series = "";
300 257
        $Series[] = array("Format"=>$Color,"Caption"=>$Caption);
301 258
 
302
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
303
-        {
259
+       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) {
304 260
          if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
305 261
 
306 262
          $X = floor($X + $Point * $XStep);
307 263
          $Y = floor($PosArray);
308
-        }
309
-       else
310
-        {
264
+        } else {
311 265
          if ( $XDivs == 0 ) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
312 266
 
313 267
          $X = floor($PosArray);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
       {
42 42
        $SerieWeightName = $WeightSeries[$Key];
43 43
 
44
-       $this->pDataObject->setSerieDrawable($SerieWeightName,FALSE);
44
+       $this->pDataObject->setSerieDrawable($SerieWeightName,false);
45 45
 
46 46
        if ( count($this->pDataObject->Data["Series"][$SerieName]["Data"]) > $MaxValues ) { $MaxValues = count($this->pDataObject->Data["Series"][$SerieName]["Data"]); }
47 47
 
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
    function drawBubbleChart($DataSeries,$WeightSeries,$Format="")
113 113
     {
114 114
      $ForceAlpha	= isset($Format["ForceAlpha"]) ? $Format["ForceAlpha"] : VOID;
115
-     $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : TRUE;
115
+     $DrawBorder	= isset($Format["DrawBorder"]) ? $Format["DrawBorder"] : true;
116 116
      $BorderWidth	= isset($Format["BorderWidth"]) ? $Format["BorderWidth"] : 1;
117 117
      $Shape		= isset($Format["Shape"]) ? $Format["Shape"] : BUBBLE_SHAPE_ROUND;
118
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
118
+     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
119 119
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
120 120
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
121 121
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
122 122
      $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
123
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
123
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
124 124
 
125 125
      if ( !is_array($DataSeries) )	{ $DataSeries = array($DataSeries); }
126 126
      if ( !is_array($WeightSeries) )	{ $WeightSeries = array($WeightSeries); }
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
      $Data    = $this->pDataObject->getData();
129 129
      $Palette = $this->pDataObject->getPalette();
130 130
 
131
-     if ( isset($Data["Series"]["BubbleFakePositiveSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie",FALSE); }
132
-     if ( isset($Data["Series"]["BubbleFakeNegativeSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie",FALSE); }
131
+     if ( isset($Data["Series"]["BubbleFakePositiveSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakePositiveSerie",false); }
132
+     if ( isset($Data["Series"]["BubbleFakeNegativeSerie"] ) ) { $this->pDataObject->setSerieDrawable("BubbleFakeNegativeSerie",false); }
133 133
 
134 134
      $this->resetSeriesColors();
135 135
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         {
158 158
          if ( $BorderWidth != 1 )
159 159
           {
160
-           if ( $Surrounding != NULL )
160
+           if ( $Surrounding != null )
161 161
             { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; }
162 162
            else
163 163
             { $BorderR = $BorderR; $BorderG = $BorderG; $BorderB = $BorderB; }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
           {
169 169
            $Color["BorderAlpha"] = $BorderAlpha;
170 170
 
171
-           if ( $Surrounding != NULL )
171
+           if ( $Surrounding != null )
172 172
             { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; }
173 173
            else
174 174
             { $Color["BorderR"] = $BorderR; $Color["BorderG"] = $BorderG; $Color["BorderB"] = $BorderB; }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
    function writeBubbleLabel($SerieName,$SerieWeightName,$Points,$Format="")
255 255
     {
256
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
256
+     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : null;
257 257
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
258 258
 
259 259
      if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[] = $Point; }
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pScatter.class.php 4 patches
Indentation   +866 added lines, -866 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pScatter - class to draw scatter charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,1146 +13,1146 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("SCATTER_MISSING_X_SERIE"	, 190001);
17
- define("SCATTER_MISSING_Y_SERIE"	, 190002);
16
+    define("SCATTER_MISSING_X_SERIE"	, 190001);
17
+    define("SCATTER_MISSING_Y_SERIE"	, 190002);
18 18
 
19
- /* pScatter class definition */
20
- class pScatter
21
-  {
22
-   var $pChartObject;
23
-   var $pDataObject;
19
+    /* pScatter class definition */
20
+    class pScatter
21
+    {
22
+    var $pChartObject;
23
+    var $pDataObject;
24 24
 
25
-   /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
25
+    /* Class creator */
26
+    function pScatter($pChartObject,$pDataObject)
27 27
     {
28
-     $this->pChartObject = $pChartObject;
29
-     $this->pDataObject  = $pDataObject;
28
+        $this->pChartObject = $pChartObject;
29
+        $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32
-   /* Prepare the scale */
33
-   function drawScatterScale($Format="")
32
+    /* Prepare the scale */
33
+    function drawScatterScale($Format="")
34 34
     {
35
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
-     $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
-     $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
-     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
-     $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
41
-     $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42
-     $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
-     $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44
-     $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45
-     $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46
-     $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
47
-     $DrawYLines	= isset($Format["DrawYLines"]) ? $Format["DrawYLines"] : ALL;
48
-     $GridTicks		= isset($Format["GridTicks"]) ? $Format["GridTicks"] : 4;
49
-     $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50
-     $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51
-     $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
-     $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53
-     $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54
-     $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55
-     $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
-     $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57
-     $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58
-     $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59
-     $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
-     $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62
-     $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63
-     $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64
-     $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65
-     $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66
-     $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
-     $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68
-     $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
-     $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
-     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72
-     $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73
-     $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74
-     $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
-     $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76
-     $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77
-     $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78
-     $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
-     $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80
-
81
-     /* Check if we have at least both one X and Y axis */
82
-     $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
-      {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87
-      }
88
-     if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
-     if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
90
-
91
-     /* Skip a NOTICE event in case of an empty array */
92
-     if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
93
-
94
-     $Data = $this->pDataObject->getData();
95
-
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
-      {
98
-       if ( $AxisSettings["Identity"] == AXIS_X)
35
+        $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
+        $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
+        $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
+        $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
+        $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
+        $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
41
+        $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42
+        $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
+        $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44
+        $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45
+        $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46
+        $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
47
+        $DrawYLines	= isset($Format["DrawYLines"]) ? $Format["DrawYLines"] : ALL;
48
+        $GridTicks		= isset($Format["GridTicks"]) ? $Format["GridTicks"] : 4;
49
+        $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50
+        $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51
+        $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
+        $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53
+        $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54
+        $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55
+        $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
+        $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57
+        $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58
+        $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59
+        $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
+        $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
+        $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62
+        $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63
+        $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64
+        $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65
+        $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66
+        $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
+        $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68
+        $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
+        $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
+        $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
+        $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72
+        $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73
+        $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74
+        $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
+        $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76
+        $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77
+        $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78
+        $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
+        $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80
+
81
+        /* Check if we have at least both one X and Y axis */
82
+        $GotXAxis = FALSE; $GotYAxis = FALSE;
83
+        foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
+        {
85
+        if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
+        if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87
+        }
88
+        if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
+        if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
90
+
91
+        /* Skip a NOTICE event in case of an empty array */
92
+        if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
93
+
94
+        $Data = $this->pDataObject->getData();
95
+
96
+        foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
+        {
98
+        if ( $AxisSettings["Identity"] == AXIS_X)
99 99
         { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100
-       else
100
+        else
101 101
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 102
 
103
-       $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
103
+        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
+        if ( $Mode == SCALE_MODE_FLOATING )
105 105
         {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
107
-          {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
106
+            foreach($Data["Series"] as $SerieID => $SerieParameter)
109 107
             {
110
-             $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
-             $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
108
+            if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
109
+            {
110
+                $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
+                $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
112
+            }
112 113
             }
113
-          }
114
-         $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
114
+            $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
115 115
 
116
-         $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
116
+            $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
117 117
         }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
118
+        elseif ( $Mode == SCALE_MODE_MANUAL )
119 119
         {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
-          {
122
-           $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123
-           $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
-          }
125
-         else
126
-          { echo "Manual scale boundaries not set."; exit(); }
120
+            if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
+            {
122
+            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123
+            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
+            }
125
+            else
126
+            { echo "Manual scale boundaries not set."; exit(); }
127 127
         }
128 128
 
129
-       /* Full manual scale */
130
-       if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
129
+        /* Full manual scale */
130
+        if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
131 131
         $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]);
132
-       else
132
+        else
133 133
         {
134
-         $MaxDivs = floor($Width/$MinDivHeight);
135
-         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
134
+            $MaxDivs = floor($Width/$MinDivHeight);
135
+            $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
136 136
         }
137 137
 
138
-       $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
139
-       $Data["Axis"][$AxisID]["ScaleMin"]  = $Scale["XMin"];
140
-       $Data["Axis"][$AxisID]["ScaleMax"]  = $Scale["XMax"];
141
-       $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142
-       $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
138
+        $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
139
+        $Data["Axis"][$AxisID]["ScaleMin"]  = $Scale["XMin"];
140
+        $Data["Axis"][$AxisID]["ScaleMax"]  = $Scale["XMax"];
141
+        $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142
+        $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
143 143
 
144
-       if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
144
+        if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149
-      }
146
+        if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
+        if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
+        if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149
+        }
150 150
 
151
-     /* Get the default font color */
152
-     $FontColorRo = $this->pChartObject->FontColorR; $FontColorGo = $this->pChartObject->FontColorG; $FontColorBo = $this->pChartObject->FontColorB;
151
+        /* Get the default font color */
152
+        $FontColorRo = $this->pChartObject->FontColorR; $FontColorGo = $this->pChartObject->FontColorG; $FontColorBo = $this->pChartObject->FontColorB;
153 153
 
154
-     /* Set the original boundaries */
155
-     $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
154
+        /* Set the original boundaries */
155
+        $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 156
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
-      {
159
-       if ( isset($AxisSettings["Color"]) )
157
+        foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
+        {
159
+        if ( isset($AxisSettings["Color"]) )
160 160
         {
161
-         $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162
-         $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
-         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
161
+            $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162
+            $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
+            $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
164 164
         }
165
-       else
165
+        else
166 166
         {
167
-         $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168
-         $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
-         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
167
+            $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168
+            $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
+            $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
170 170
         }
171 171
 
172
-       $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
172
+        $LastValue = "w00t"; $ID = 1;
173
+        if ( $AxisSettings["Identity"] == AXIS_X )
174 174
         {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
-          {
177
-           if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
-           if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
-           if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181
-
182
-           if ( $Floating )
175
+            if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
+            {
177
+            if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
+            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
+            if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
+            if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181
+
182
+            if ( $Floating )
183 183
             { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
184
-           else
184
+            else
185 185
             { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["B"],$this->pChartObject->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
186 186
 
187
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
187
+            if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
188 188
 
189
-           $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
-           $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
189
+            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
+            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
+            $LastX  = NULL;
192
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
193 193
             {
194
-             $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195
-             $YPos  = $AxisPos["B"];
196
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
194
+                $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195
+                $YPos  = $AxisPos["B"];
196
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
197 197
 
198
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
198
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
+                if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
200 200
 
201
-             if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
202
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
203
-              $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$InnerSubTickWidth,$XPos+$SubTicksSize,$YPos+$OuterSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
201
+                if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
202
+                if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
203
+                $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$InnerSubTickWidth,$XPos+$SubTicksSize,$YPos+$OuterSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
204 204
 
205
-             $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
-             $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
-             $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
-             $MaxBottom = max($MaxBottom,$TxtBottom);
205
+                $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
+                $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
+                $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
+                $MaxBottom = max($MaxBottom,$TxtBottom);
209 209
 
210
-             $LastX = $XPos;
210
+                $LastX = $XPos;
211 211
             }
212 212
 
213
-           if ( isset($AxisSettings["Name"]) )
213
+            if ( isset($AxisSettings["Name"]) )
214 214
             {
215
-             $YPos   = $MaxBottom+2;
216
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218
-             $MaxBottom = $Bounds[0]["Y"];
215
+                $YPos   = $MaxBottom+2;
216
+                $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218
+                $MaxBottom = $Bounds[0]["Y"];
219 219
 
220
-             $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
220
+                $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
221 221
             }
222 222
 
223
-           $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
-          }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
-          {
227
-           if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
-           if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
-           if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
223
+            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
+            }
225
+            elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
+            {
227
+            if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
+            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
+            if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
+            if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 231
 
232
-           if ( $Floating )
232
+            if ( $Floating )
233 233
             { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
234
-           else
234
+            else
235 235
             { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["T"],$this->pChartObject->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
236 236
 
237
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
237
+            if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
238 238
 
239
-           $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
-           $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
239
+            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
+            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
+            $LastX  = NULL;
242
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
243 243
             {
244
-             $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245
-             $YPos  = $AxisPos["T"];
246
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
244
+                $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245
+                $YPos  = $AxisPos["T"];
246
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
247 247
 
248
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
248
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
+                if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
250 250
 
251
-             if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
251
+                if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
252 252
 
253
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
254
-              $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
253
+                if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
254
+                $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
255 255
 
256
-             $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
-             $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
-             $MinTop = min($MinTop,$TxtBox);
256
+                $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
+                $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
+                $MinTop = min($MinTop,$TxtBox);
260 260
 
261
-             $LastX = $XPos;
261
+                $LastX = $XPos;
262 262
             }
263 263
 
264
-           if ( isset($AxisSettings["Name"]) )
264
+            if ( isset($AxisSettings["Name"]) )
265 265
             {
266
-             $YPos   = $MinTop-2;
267
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269
-             $MinTop = $Bounds[2]["Y"];
266
+                $YPos   = $MinTop-2;
267
+                $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269
+                $MinTop = $Bounds[2]["Y"];
270 270
 
271
-             $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
271
+                $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
272 272
             }
273 273
 
274
-           $AxisPos["T"] = $MinTop - $ScaleSpacing;
275
-          }
274
+            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275
+            }
276 276
         }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
277
+        elseif ( $AxisSettings["Identity"] == AXIS_Y )
278 278
         {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
-          {
279
+            if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
+            {
281 281
 
282
-           if ( $Floating )
282
+            if ( $Floating )
283 283
             { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
284
-           else
284
+            else
285 285
             { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1,$AxisPos["L"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
286 286
 
287
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
287
+            if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
288 288
 
289
-           $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
-           $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
289
+            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
+            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
+            $LastY  = NULL;
292
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
293 293
             {
294
-             $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295
-             $XPos  = $AxisPos["L"];
296
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
294
+                $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295
+                $XPos  = $AxisPos["L"];
296
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
297 297
 
298
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
298
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
+                if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
300 300
 
301
-             if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
301
+                if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
302 302
 
303
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
304
-              $this->pChartObject->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
303
+                if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
304
+                $this->pChartObject->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
305 305
 
306
-             $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
-             $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
-             $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
-             $MinLeft = min($MinLeft,$TxtLeft);
306
+                $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
+                $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
+                $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
+                $MinLeft = min($MinLeft,$TxtLeft);
310 310
 
311
-             $LastY = $YPos;
311
+                $LastY = $YPos;
312 312
             }
313 313
 
314
-           if ( isset($AxisSettings["Name"]) )
314
+            if ( isset($AxisSettings["Name"]) )
315 315
             {
316
-             $XPos    = $MinLeft-2;
317
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
319
-             $MinLeft = $Bounds[2]["X"];
316
+                $XPos    = $MinLeft-2;
317
+                $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
+                $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
319
+                $MinLeft = $Bounds[2]["X"];
320 320
 
321
-             $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
321
+                $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
322 322
             }
323 323
 
324
-           $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
-          }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
-          {
324
+            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
+            }
326
+            elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
+            {
328 328
 
329
-           if ( $Floating )
329
+            if ( $Floating )
330 330
             { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
331
-           else
331
+            else
332 332
             { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1,$AxisPos["R"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
333 333
 
334
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
334
+            if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
335 335
 
336
-           $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
-           $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
336
+            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
+            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
+            $LastY  = NULL;
339
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
340 340
             {
341
-             $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342
-             $XPos  = $AxisPos["R"];
343
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
341
+                $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342
+                $XPos  = $AxisPos["R"];
343
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
344 344
 
345
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
345
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
+                if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
347 347
 
348
-             if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines)) ) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
348
+                if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines)) ) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
349 349
 
350
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
351
-              $this->pChartObject->drawLine($XPos-$InnerSubTickWidth,$YPos-$SubTicksSize,$XPos+$OuterSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
350
+                if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
351
+                $this->pChartObject->drawLine($XPos-$InnerSubTickWidth,$YPos-$SubTicksSize,$XPos+$OuterSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
352 352
 
353
-             $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
-             $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
-             $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
-             $MaxLeft = max($MaxLeft,$TxtLeft);
353
+                $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
+                $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
+                $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
+                $MaxLeft = max($MaxLeft,$TxtLeft);
357 357
 
358
-             $LastY = $YPos;
358
+                $LastY = $YPos;
359 359
             }
360 360
 
361
-           if ( isset($AxisSettings["Name"]) )
361
+            if ( isset($AxisSettings["Name"]) )
362 362
             {
363
-             $XPos    = $MaxLeft+6;
364
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
366
-             $MaxLeft = $Bounds[2]["X"];
363
+                $XPos    = $MaxLeft+6;
364
+                $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
+                $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
366
+                $MaxLeft = $Bounds[2]["X"];
367 367
 
368
-             $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
368
+                $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
369 369
             }
370 370
 
371
-           $AxisPos["R"] = $MaxLeft + $ScaleSpacing;
372
-          }
371
+            $AxisPos["R"] = $MaxLeft + $ScaleSpacing;
372
+            }
373
+        }
373 374
         }
374
-      }
375 375
 
376
-     $this->pDataObject->saveAxisConfig($Data["Axis"]);
376
+        $this->pDataObject->saveAxisConfig($Data["Axis"]);
377 377
     }
378 378
 
379
-   /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
379
+    /* Draw a scatter plot chart */
380
+    function drawScatterPlotChart($Format=NULL)
381 381
     {
382
-     $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387
-     $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
-     $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393
-
394
-     $Data    = $this->pDataObject->getData();
395
-     $Palette = $this->pDataObject->getPalette();
396
-
397
-     $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398
-
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
400
-      {
401
-       if ( $Series["isDrawable"] == TRUE )
382
+        $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
+        $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387
+        $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
+        $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393
+
394
+        $Data    = $this->pDataObject->getData();
395
+        $Palette = $this->pDataObject->getPalette();
396
+
397
+        $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398
+
399
+        foreach($Data["ScatterSeries"] as $Key => $Series)
402 400
         {
403
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
401
+        if ( $Series["isDrawable"] == TRUE )
402
+        {
403
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408
-         if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
-         else
411
-          { $Picture = NULL; }
408
+            if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
+            { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
+            else
411
+            { $Picture = NULL; }
412 412
 
413
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
413
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
417 417
 
418
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
418
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
419 419
 
420
-         foreach($PosArrayX as $Key => $Value)
421
-          {
422
-           $X = $Value; $Y = $PosArrayY[$Key];
420
+            foreach($PosArrayX as $Key => $Value)
421
+            {
422
+            $X = $Value; $Y = $PosArrayY[$Key];
423 423
 
424
-           if ( $X != VOID && $Y != VOID )
424
+            if ( $X != VOID && $Y != VOID )
425 425
             {
426
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($PlotSize+$BorderSize),$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
428
-
429
-             if( isset($Series["Shape"]) )
430
-              { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); }
431
-             elseif ( $Picture == NULL )
432
-              {
433
-               if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
-               $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
-              }
436
-             else
437
-              { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
426
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($PlotSize+$BorderSize),$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
428
+
429
+                if( isset($Series["Shape"]) )
430
+                { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); }
431
+                elseif ( $Picture == NULL )
432
+                {
433
+                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
+                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
+                }
436
+                else
437
+                { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
438
+            }
438 439
             }
439
-          }
440 440
         }
441
-      }
441
+        }
442 442
     }
443 443
 
444
-   /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
444
+    /* Draw a scatter line chart */
445
+    function drawScatterLineChart($Format=NULL)
446 446
     {
447
-     $Data		= $this->pDataObject->getData();
448
-     $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453
-
454
-     /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
456
-      {
457
-       if ( $Series["isDrawable"] == TRUE )
447
+        $Data		= $this->pDataObject->getData();
448
+        $Palette		= $this->pDataObject->getPalette();
449
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
+        $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453
+
454
+        /* Parse all the series to draw */
455
+        foreach($Data["ScatterSeries"] as $Key => $Series)
456
+        {
457
+        if ( $Series["isDrawable"] == TRUE )
458 458
         {
459
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461
-         $Ticks  = $Series["Ticks"];
462
-         $Weight = $Series["Weight"];
459
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461
+            $Ticks  = $Series["Ticks"];
462
+            $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
466
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
470 470
 
471
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
-         if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
-         if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
471
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
+            if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
+            if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
474 474
 
475
-         $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
477
-          {
478
-           $X = $Value; $Y = $PosArrayY[$Key];
475
+            $LastX = VOID; $LastY = VOID;
476
+            foreach($PosArrayX as $Key => $Value)
477
+            {
478
+            $X = $Value; $Y = $PosArrayY[$Key];
479 479
 
480
-           if ( $X != VOID && $Y != VOID )
480
+            if ( $X != VOID && $Y != VOID )
481 481
             {
482
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
482
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
484 484
             }
485 485
 
486
-           if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
486
+            if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487 487
             $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color);
488 488
 
489
-           $LastX = $X; $LastY = $Y;
490
-          }
489
+            $LastX = $X; $LastY = $Y;
490
+            }
491
+        }
491 492
         }
492
-      }
493 493
     }
494 494
 
495
-   /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
495
+    /* Draw a scatter spline chart */
496
+    function drawScatterSplineChart($Format=NULL)
497 497
     {
498
-     $Data		= $this->pDataObject->getData();
499
-     $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504
-
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
506
-      {
507
-       if ( $Series["isDrawable"] == TRUE )
498
+        $Data		= $this->pDataObject->getData();
499
+        $Palette		= $this->pDataObject->getPalette();
500
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
+        $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504
+
505
+        foreach($Data["ScatterSeries"] as $Key => $Series)
506
+        {
507
+        if ( $Series["isDrawable"] == TRUE )
508 508
         {
509
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511
-         $Ticks  = $Series["Ticks"];
512
-         $Weight = $Series["Weight"];
509
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511
+            $Ticks  = $Series["Ticks"];
512
+            $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
516
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
520 520
 
521
-         $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
-         if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
-         if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
521
+            $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
+            if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
+            if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
524 524
 
525
-         $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
527
-          {
528
-           $X = $Value; $Y = $PosArrayY[$Key];
529
-           $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
525
+            $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
+            foreach($PosArrayX as $Key => $Value)
527
+            {
528
+            $X = $Value; $Y = $PosArrayY[$Key];
529
+            $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
530 530
 
531
-           if ( $X != VOID && $Y != VOID )
531
+            if ( $X != VOID && $Y != VOID )
532 532
             {
533
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
533
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
+                if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
535 535
             }
536 536
 
537
-           if ( $X != VOID && $Y != VOID )
537
+            if ( $X != VOID && $Y != VOID )
538 538
             { $WayPoints[] = array($X,$Y); $Forces[] = $Force; }
539 539
 
540
-           if ( $Y == VOID || $X == VOID )
540
+            if ( $Y == VOID || $X == VOID )
541 541
             { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints,$SplineSettings); $WayPoints = ""; $Forces = "";}
542 542
 
543
-           $LastX = $X; $LastY = $Y;
544
-          }
545
-         $SplineSettings["Forces"] = $Forces; 
546
-         $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
543
+            $LastX = $X; $LastY = $Y;
544
+            }
545
+            $SplineSettings["Forces"] = $Forces; 
546
+            $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
547
+        }
547 548
         }
548
-      }
549 549
     }
550 550
 
551
-   /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
551
+    /* Return the scaled plot position */
552
+    function getPosArray($Values,$AxisID)
553 553
     {
554
-     $Data = $this->pDataObject->getData();
554
+        $Data = $this->pDataObject->getData();
555 555
 
556
-     if ( !is_array($Values) ) { $Values = array($Values); }
556
+        if ( !is_array($Values) ) { $Values = array($Values); }
557 557
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
-      {
560
-       $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561
-       $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
-       $Step        = $Height / $ScaleHeight;
558
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
+        {
560
+        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561
+        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
+        $Step        = $Height / $ScaleHeight;
563 563
 
564
-       $Result = "";
565
-       foreach($Values as $Key => $Value)
564
+        $Result = "";
565
+        foreach($Values as $Key => $Value)
566 566
         {
567
-         if ( $Value == VOID ) 
568
-          $Result[] = VOID;
569
-         else
570
-          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
567
+            if ( $Value == VOID ) 
568
+            $Result[] = VOID;
569
+            else
570
+            $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
571 571
         }
572 572
 
573
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
-      }
575
-     else
576
-      {
577
-       $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578
-       $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
-       $Step        = $Height / $ScaleHeight;
573
+        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
+        }
575
+        else
576
+        {
577
+        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578
+        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
+        $Step        = $Height / $ScaleHeight;
580 580
 
581
-       $Result = "";
582
-       foreach($Values as $Key => $Value)
581
+        $Result = "";
582
+        foreach($Values as $Key => $Value)
583 583
         {
584
-         if ( $Value == VOID ) 
585
-          $Result[] = VOID;
586
-         else
587
-          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
584
+            if ( $Value == VOID ) 
585
+            $Result[] = VOID;
586
+            else
587
+            $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
588 588
         }
589 589
 
590
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
591
-      }
590
+        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
591
+        }
592 592
     }
593 593
 
594
-   /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
594
+    /* Draw the legend of the active series */
595
+    function drawScatterLegend($X,$Y,$Format="")
596 596
     {
597
-     $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598
-     $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599
-     $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600
-     $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601
-     $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602
-     $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
-     $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
-     $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
-     $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
-     $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
-     $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
609
-     $R			= isset($Format["R"]) ? $Format["R"] : 200;
610
-     $G			= isset($Format["G"]) ? $Format["G"] : 200;
611
-     $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
-     $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619
-
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621
-
622
-     $Data = $this->pDataObject->getData();
623
-
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
625
-      {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
597
+        $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598
+        $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599
+        $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600
+        $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601
+        $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602
+        $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
+        $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
+        $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
+        $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
+        $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
+        $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
+        $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
609
+        $R			= isset($Format["R"]) ? $Format["R"] : 200;
610
+        $G			= isset($Format["G"]) ? $Format["G"] : 200;
611
+        $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
+        $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
+        $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619
+
620
+        if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621
+
622
+        $Data = $this->pDataObject->getData();
623
+
624
+        foreach($Data["ScatterSeries"] as $Key => $Series)
627 625
         {
628
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
626
+        if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627
+        {
628
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
+            if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
+            if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
631
+        }
631 632
         }
632
-      }
633 633
 
634
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
635
-     $XStep = $IconAreaWidth + 5;
636
-     $XStep = $XSpacing;
634
+        $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
635
+        $XStep = $IconAreaWidth + 5;
636
+        $XStep = $XSpacing;
637 637
 
638
-     $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
640
-      {
641
-       if ( $Series["isDrawable"] == TRUE )
638
+        $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
+        foreach($Data["ScatterSeries"] as $Key => $Series)
642 640
         {
643
-         if ( $Mode == LEGEND_VERTICAL )
644
-          {
645
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
646
-
647
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
650
-
651
-           $Lines = preg_split("/\n/",$Series["Description"]);
652
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
653
-          }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
655
-          {
656
-           $Lines = preg_split("/\n/",$Series["Description"]);
657
-           $Width = "";
658
-           foreach($Lines as $Key => $Value)
641
+        if ( $Series["isDrawable"] == TRUE )
642
+        {
643
+            if ( $Mode == LEGEND_VERTICAL )
659 644
             {
660
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
645
+            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
661 646
 
662
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
647
+            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
+            if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
+            if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
665 650
 
666
-             $Width[] = $BoxArray[1]["X"];
651
+            $Lines = preg_split("/\n/",$Series["Description"]);
652
+            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
667 653
             }
654
+            elseif ( $Mode == LEGEND_HORIZONTAL )
655
+            {
656
+            $Lines = preg_split("/\n/",$Series["Description"]);
657
+            $Width = "";
658
+            foreach($Lines as $Key => $Value)
659
+            {
660
+                $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
661
+
662
+                if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
+                if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
+                if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
668 665
 
669
-           $vX=max($Width)+$XStep;
670
-          }
666
+                $Width[] = $BoxArray[1]["X"];
667
+            }
668
+
669
+            $vX=max($Width)+$XStep;
670
+            }
671
+        }
671 672
         }
672
-      }
673
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
673
+        $vY=$vY-$YStep; $vX=$vX-$XStep;
674 674
 
675
-     $TopOffset  = $Y - $Boundaries["T"];
676
-     if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
675
+        $TopOffset  = $Y - $Boundaries["T"];
676
+        if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
677 677
 
678
-     if ( $Style == LEGEND_ROUND )
679
-      $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
680
-     elseif ( $Style == LEGEND_BOX )
681
-      $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
678
+        if ( $Style == LEGEND_ROUND )
679
+        $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
680
+        elseif ( $Style == LEGEND_BOX )
681
+        $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
682 682
 
683
-     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
685
-      {
686
-       if ( $Series["isDrawable"] == TRUE )
683
+        $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
+        foreach($Data["ScatterSeries"] as $Key => $Series)
687 685
         {
688
-         $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689
-         $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690
-
691
-         if ( isset($Series["Picture"]) )
692
-          {
693
-           $Picture = $Series["Picture"];
694
-           list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
-           $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
696
-
697
-           $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
698
-          }
699
-         else
700
-          {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
686
+        if ( $Series["isDrawable"] == TRUE )
687
+        {
688
+            $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689
+            $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690
+
691
+            if ( isset($Series["Picture"]) )
702 692
             {
703
-             if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
-             if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
693
+            $Picture = $Series["Picture"];
694
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
+            $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
705 696
 
706
-             $this->pChartObject->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
707
-             $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
697
+            $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
708 698
             }
709
-           elseif ( $Family == LEGEND_FAMILY_CIRCLE )
699
+            else
700
+            {
701
+            if ( $Family == LEGEND_FAMILY_BOX )
710 702
             {
711
-             $this->pChartObject->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
712
-             $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
703
+                if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
+                if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
705
+
706
+                $this->pChartObject->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
707
+                $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
708
+            }
709
+            elseif ( $Family == LEGEND_FAMILY_CIRCLE )
710
+            {
711
+                $this->pChartObject->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
712
+                $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
713 713
             }
714
-           elseif ( $Family == LEGEND_FAMILY_LINE )
714
+            elseif ( $Family == LEGEND_FAMILY_LINE )
715 715
             {
716
-             $this->pChartObject->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight));
717
-             $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
716
+                $this->pChartObject->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight));
717
+                $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
718
+            }
718 719
             }
719
-          }
720 720
 
721
-         if ( $Mode == LEGEND_VERTICAL )
722
-          {
723
-           $Lines = preg_split("/\n/",$Series["Description"]);
724
-           foreach($Lines as $Key => $Value)
721
+            if ( $Mode == LEGEND_VERTICAL )
722
+            {
723
+            $Lines = preg_split("/\n/",$Series["Description"]);
724
+            foreach($Lines as $Key => $Value)
725 725
             $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
726 726
 
727
-           $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
-          }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
730
-          {
731
-           $Lines = preg_split("/\n/",$Series["Description"]);
732
-           $Width = "";
733
-           foreach($Lines as $Key => $Value)
727
+            $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
+            }
729
+            elseif ( $Mode == LEGEND_HORIZONTAL )
730
+            {
731
+            $Lines = preg_split("/\n/",$Series["Description"]);
732
+            $Width = "";
733
+            foreach($Lines as $Key => $Value)
734 734
             {
735
-             $BoxArray = $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
736
-             $Width[] = $BoxArray[1]["X"];
735
+                $BoxArray = $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
736
+                $Width[] = $BoxArray[1]["X"];
737 737
             }
738
-           $X=max($Width)+2+$XStep;
739
-          }
738
+            $X=max($Width)+2+$XStep;
739
+            }
740
+        }
740 741
         }
741
-      }
742 742
 
743
-     $this->Shadow = $RestoreShadow;
743
+        $this->Shadow = $RestoreShadow;
744 744
     }
745 745
 
746
-   /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
746
+    /* Get the legend box size */
747
+    function getScatterLegendSize($Format="")
748 748
     {
749
-     $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750
-     $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
-     $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
-     $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
753
-     $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
-     $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
749
+        $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750
+        $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
+        $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
+        $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
753
+        $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
+        $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
755 755
 
756
-     $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
757
-     $XStep = $BoxSize + 5;
756
+        $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
757
+        $XStep = $BoxSize + 5;
758 758
 
759
-     $X=100; $Y=100;
759
+        $X=100; $Y=100;
760 760
 
761
-     $Data = $this->pDataObject->getData();
761
+        $Data = $this->pDataObject->getData();
762 762
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
764
-      {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
763
+        foreach($Data["ScatterSeries"] as $Key => $Series)
764
+        {
765
+        if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766 766
         {
767
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
767
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
+            if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
+            if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
770
+        }
770 771
         }
771
-      }
772 772
 
773
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
774
-     $XStep = $IconAreaWidth + 5;
775
-     $XStep = $XSpacing;
773
+        $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
774
+        $XStep = $IconAreaWidth + 5;
775
+        $XStep = $XSpacing;
776 776
 
777
-     $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
779
-      {
780
-       if ( $Series["isDrawable"] == TRUE )
777
+        $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
+        foreach($Data["ScatterSeries"] as $Key => $Series)
779
+        {
780
+        if ( $Series["isDrawable"] == TRUE )
781 781
         {
782
-         if ( $Mode == LEGEND_VERTICAL )
783
-          {
784
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785
-
786
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
789
-
790
-           $Lines = preg_split("/\n/",$Series["Description"]);
791
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
-          }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
794
-          {
795
-           $Lines = preg_split("/\n/",$Series["Description"]);
796
-           $Width = "";
797
-           foreach($Lines as $Key => $Value)
782
+            if ( $Mode == LEGEND_VERTICAL )
783
+            {
784
+            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785
+
786
+            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
+            if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
+            if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
789
+
790
+            $Lines = preg_split("/\n/",$Series["Description"]);
791
+            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
+            }
793
+            elseif ( $Mode == LEGEND_HORIZONTAL )
794
+            {
795
+            $Lines = preg_split("/\n/",$Series["Description"]);
796
+            $Width = "";
797
+            foreach($Lines as $Key => $Value)
798 798
             {
799
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
799
+                $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
800 800
 
801
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
801
+                if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
+                if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
+                if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
804 804
 
805
-             $Width[] = $BoxArray[1]["X"];
805
+                $Width[] = $BoxArray[1]["X"];
806 806
             }
807 807
 
808
-           $vX=max($Width)+$XStep;
809
-          }
808
+            $vX=max($Width)+$XStep;
809
+            }
810
+        }
810 811
         }
811
-      }
812
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
812
+        $vY=$vY-$YStep; $vX=$vX-$XStep;
813 813
 
814
-     $TopOffset  = $Y - $Boundaries["T"];
815
-     if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
814
+        $TopOffset  = $Y - $Boundaries["T"];
815
+        if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
816 816
 
817
-     $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
-     $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
817
+        $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
+        $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
819 819
 
820
-     return(array("Width"=>$Width,"Height"=>$Height));
820
+        return(array("Width"=>$Width,"Height"=>$Height));
821 821
     }
822 822
 
823
-   /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
823
+    /* Draw the line of best fit */
824
+    function drawScatterBestFit($Format="")
825 825
     {
826
-     $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
826
+        $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 827
 
828
-     $Data    = $this->pDataObject->getData();
828
+        $Data    = $this->pDataObject->getData();
829 829
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
831
-      {
832
-       if ( $Series["isDrawable"] == TRUE )
830
+        foreach($Data["ScatterSeries"] as $Key => $Series)
831
+        {
832
+        if ( $Series["isDrawable"] == TRUE )
833 833
         {
834
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836
-
837
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
838
-         $Color["Ticks"] = $Ticks;
839
-
840
-         $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841
-         $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842
-
843
-         $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
845
-          {
846
-           $X = $Value; $Y = $PosArrayY[$Key];
847
-
848
-           $Sxy = $Sxy + $X*$Y;
849
-           $Sx  = $Sx + $X;
850
-           $Sy  = $Sy + $Y;
851
-           $Sxx = $Sxx + $X*$X;
852
-          }
853
-
854
-         $n = count($PosArrayX);
855
-
856
-         if ((($n*$Sxx) == ($Sx*$Sx)))
857
-          {
858
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859
-           $X2 = $X1;
860
-           $Y1 = $this->pChartObject->GraphAreaY1;
861
-           $Y2 = $this->pChartObject->GraphAreaY2;
862
-          }
863
-         else
864
-          {
865
-           $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
-           $B = (($Sy)-($M*$Sx))/($n);
867
-
868
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
-           $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
-           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
-           $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
872
-
873
-           $RealM = -($Y2-$Y1)/($X2-$X1);
874
-
875
-           if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
-           if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
-           if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
-           if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879
-          }
880
-
881
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
834
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836
+
837
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
838
+            $Color["Ticks"] = $Ticks;
839
+
840
+            $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841
+            $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842
+
843
+            $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
+            foreach($PosArrayX as $Key => $Value)
845
+            {
846
+            $X = $Value; $Y = $PosArrayY[$Key];
847
+
848
+            $Sxy = $Sxy + $X*$Y;
849
+            $Sx  = $Sx + $X;
850
+            $Sy  = $Sy + $Y;
851
+            $Sxx = $Sxx + $X*$X;
852
+            }
853
+
854
+            $n = count($PosArrayX);
855
+
856
+            if ((($n*$Sxx) == ($Sx*$Sx)))
857
+            {
858
+            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859
+            $X2 = $X1;
860
+            $Y1 = $this->pChartObject->GraphAreaY1;
861
+            $Y2 = $this->pChartObject->GraphAreaY2;
862
+            }
863
+            else
864
+            {
865
+            $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
+            $B = (($Sy)-($M*$Sx))/($n);
867
+
868
+            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
+            $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
+            $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
+            $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
872
+
873
+            $RealM = -($Y2-$Y1)/($X2-$X1);
874
+
875
+            if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
+            if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
+            if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
+            if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879
+            }
880
+
881
+            $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
882
+        }
882 883
         }
883
-      }
884 884
     }
885 885
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
886
+    function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
888
+        $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
+        $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
+        $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
891 891
 
892
-     $Data    = $this->pDataObject->getData();
893
-     $Palette = $this->pDataObject->getPalette();
892
+        $Data    = $this->pDataObject->getData();
893
+        $Palette = $this->pDataObject->getPalette();
894 894
 
895
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
895
+        if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
896 896
 
897
-     if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
898
-      return(0);
897
+        if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
898
+        return(0);
899 899
 
900
-     $Series = $Data["ScatterSeries"][$ScatterSerieID];
901
-     $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902
-     $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
900
+        $Series = $Data["ScatterSeries"][$ScatterSerieID];
901
+        $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902
+        $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
903 903
 
904
-     $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
-     if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
-     $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
-     if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
904
+        $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
+        if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
+        $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
+        if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 908
 
909
-     foreach($Points as $Key => $Point)
910
-      {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
909
+        foreach($Points as $Key => $Point)
910
+        {
911
+        if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
912 912
         {
913
-         $X = floor($PosArrayX[$Point]);
914
-         $Y = floor($PosArrayY[$Point]);
915
-
916
-         if ( $DrawPoint == LABEL_POINT_CIRCLE )
917
-          $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
918
-         elseif ( $DrawPoint == LABEL_POINT_BOX )
919
-          $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
920
-
921
-         $Serie = "";
922
-         $Serie["R"] = $Series["Color"]["R"];
923
-         $Serie["G"] = $Series["Color"]["G"];
924
-         $Serie["B"] = $Series["Color"]["B"];
925
-         $Serie["Alpha"] = $Series["Color"]["Alpha"];
926
-
927
-         $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928
-         $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929
-         $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
-         $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932
-
933
-         $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934
-         $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935
-         $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
-         $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938
-
939
-         $Caption = $XValue." / ".$YValue;
940
-
941
-         if ( isset($Series["Description"]) )
942
-          $Description = $Series["Description"];
943
-         else
944
-          $Description = "No description";
945
-
946
-         $Series = "";
947
-         $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
948
-
949
-         $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
913
+            $X = floor($PosArrayX[$Point]);
914
+            $Y = floor($PosArrayY[$Point]);
915
+
916
+            if ( $DrawPoint == LABEL_POINT_CIRCLE )
917
+            $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
918
+            elseif ( $DrawPoint == LABEL_POINT_BOX )
919
+            $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
920
+
921
+            $Serie = "";
922
+            $Serie["R"] = $Series["Color"]["R"];
923
+            $Serie["G"] = $Series["Color"]["G"];
924
+            $Serie["B"] = $Series["Color"]["B"];
925
+            $Serie["Alpha"] = $Series["Color"]["Alpha"];
926
+
927
+            $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928
+            $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929
+            $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
+            if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
+            $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932
+
933
+            $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934
+            $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935
+            $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
+            if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
+            $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938
+
939
+            $Caption = $XValue." / ".$YValue;
940
+
941
+            if ( isset($Series["Description"]) )
942
+            $Description = $Series["Description"];
943
+            else
944
+            $Description = "No description";
945
+
946
+            $Series = "";
947
+            $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
948
+
949
+            $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
950
+        }
950 951
         }
951
-      }
952 952
     }
953 953
 
954
-   /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
954
+    /* Draw a Scatter threshold */
955
+    function drawScatterThreshold($Value,$Format="")
956 956
     {
957
-     $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958
-     $R			= isset($Format["R"]) ? $Format["R"] : 255;
959
-     $G			= isset($Format["G"]) ? $Format["G"] : 0;
960
-     $B			= isset($Format["B"]) ? $Format["B"] : 0;
961
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963
-     $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
-     $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
-     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968
-     $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
-     $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970
-     $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971
-     $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972
-     $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973
-     $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
-     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976
-     $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978
-     $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979
-     $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980
-     $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981
-     $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
-     $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
-     $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984
-     $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985
-     $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986
-     $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
-     $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988
-
989
-     $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
-                              "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
-                              "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
-                              "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993
-
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
995
-
996
-     $Data = $this->pDataObject->getData();
997
-
998
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
957
+        $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958
+        $R			= isset($Format["R"]) ? $Format["R"] : 255;
959
+        $G			= isset($Format["G"]) ? $Format["G"] : 0;
960
+        $B			= isset($Format["B"]) ? $Format["B"] : 0;
961
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
+        $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963
+        $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
+        $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
+        $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
+        $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
+        $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968
+        $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
+        $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970
+        $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971
+        $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972
+        $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973
+        $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
+        $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
+        $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976
+        $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
+        $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978
+        $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979
+        $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980
+        $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981
+        $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
+        $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
+        $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984
+        $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985
+        $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986
+        $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
+        $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988
+
989
+        $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
+                                "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
+                                "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
+                                "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993
+
994
+        if ( $Caption == NULL ) { $Caption = $Value; }
995
+
996
+        $Data = $this->pDataObject->getData();
997
+
998
+        if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
999 999
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
-      {
1002
-       $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003
-       $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
-       $Y  = $this->getPosArray($Value,$AxisID);
1000
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
+        {
1002
+        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003
+        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
+        $Y  = $this->getPosArray($Value,$AxisID);
1005 1005
 
1006
-       $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1006
+        $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1007 1007
 
1008
-       if ( $Wide )
1008
+        if ( $Wide )
1009 1009
         {
1010
-         $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
-         $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1010
+            $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
+            $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1012 1012
         }
1013 1013
 
1014
-       if ( $WriteCaption )
1014
+        if ( $WriteCaption )
1015 1015
         {
1016
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
-          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
-         else 
1019
-          { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1016
+            if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
+            { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
+            else 
1019
+            { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 1020
 
1021
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1021
+            $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1022 1022
         }
1023 1023
 
1024
-       return(array("Y"=>$Y));
1025
-      }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
-      {
1028
-       $X  = $this->getPosArray($Value,$AxisID);
1029
-       $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030
-       $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1024
+        return(array("Y"=>$Y));
1025
+        }
1026
+        elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
+        {
1028
+        $X  = $this->getPosArray($Value,$AxisID);
1029
+        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030
+        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 1031
 
1032
-       $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1032
+        $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1033 1033
 
1034
-       if ( $Wide )
1034
+        if ( $Wide )
1035 1035
         {
1036
-         $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
-         $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1036
+            $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
+            $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1038 1038
         }
1039 1039
 
1040
-       if ( $WriteCaption )
1040
+        if ( $WriteCaption )
1041 1041
         {
1042
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
-          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
-         else 
1045
-          { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1042
+            if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
+            { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
+            else 
1045
+            { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 1046
 
1047
-         $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1047
+            $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
+            $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1049 1049
         }
1050 1050
 
1051
-       return(array("X"=>$X));
1052
-      }
1051
+        return(array("X"=>$X));
1052
+        }
1053 1053
     }
1054 1054
 
1055
-   /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1055
+    /* Draw a Scatter threshold area */
1056
+    function drawScatterThresholdArea($Value1,$Value2,$Format="")
1057 1057
     {
1058
-     $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059
-     $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060
-     $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061
-     $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
-     $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
-     $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064
-     $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065
-     $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066
-     $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
1067
-     $BorderAlpha = isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : $Alpha + 20;
1068
-     $BorderTicks = isset($Format["BorderTicks"]) ? $Format["BorderTicks"] : 2;
1069
-     $AreaName 	= isset($Format["AreaName"]) ? $Format["AreaName"] : "La ouate de phoque"; //NULL;
1070
-     $NameAngle	= isset($Format["NameAngle"]) ? $Format["NameAngle"] : ZONE_NAME_ANGLE_AUTO;
1071
-     $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072
-     $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073
-     $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
-     $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
-     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076
-
1077
-     if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078
-
1079
-     $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1081
-
1082
-     if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083
-
1084
-     $Data = $this->pDataObject->getData();
1085
-
1086
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1058
+        $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059
+        $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060
+        $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061
+        $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
+        $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
+        $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064
+        $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065
+        $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066
+        $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
1067
+        $BorderAlpha = isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : $Alpha + 20;
1068
+        $BorderTicks = isset($Format["BorderTicks"]) ? $Format["BorderTicks"] : 2;
1069
+        $AreaName 	= isset($Format["AreaName"]) ? $Format["AreaName"] : "La ouate de phoque"; //NULL;
1070
+        $NameAngle	= isset($Format["NameAngle"]) ? $Format["NameAngle"] : ZONE_NAME_ANGLE_AUTO;
1071
+        $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072
+        $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073
+        $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
+        $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
+        $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076
+
1077
+        if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078
+
1079
+        $RestoreShadow = $this->pChartObject->Shadow;
1080
+        if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1081
+
1082
+        if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083
+
1084
+        $Data = $this->pDataObject->getData();
1085
+
1086
+        if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1087 1087
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
-      {
1090
-       $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091
-       $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
-       $X1  = $this->getPosArray($Value1,$AxisID);
1093
-       $X2  = $this->getPosArray($Value2,$AxisID);
1088
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
+        {
1090
+        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091
+        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
+        $X1  = $this->getPosArray($Value1,$AxisID);
1093
+        $X2  = $this->getPosArray($Value2,$AxisID);
1094 1094
 
1095
-       if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
-       if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1095
+        if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
+        if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1097 1097
 
1098
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1098
+        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1099 1099
 
1100
-       if ( $Border )
1100
+        if ( $Border )
1101 1101
         {
1102
-         $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
-         $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1102
+            $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
+            $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+        if ( $AreaName != NULL )
1107 1107
         {
1108
-         $XPos = ($X2-$X1)/2 + $X1;
1109
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1110
-
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
-          {
1113
-           $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114
-           $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
-           if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1116
-          }
1117
-         $this->pChartObject->Shadow = $RestoreShadow;
1118
-         $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1108
+            $XPos = ($X2-$X1)/2 + $X1;
1109
+            $YPos = ($Y2-$Y1)/2 + $Y1;
1110
+
1111
+            if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
+            {
1113
+            $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114
+            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
+            if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1116
+            }
1117
+            $this->pChartObject->Shadow = $RestoreShadow;
1118
+            $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
+            if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1120 1120
         }
1121 1121
 
1122
-       $this->pChartObject->Shadow = $RestoreShadow;
1123
-       return(array("X1"=>$X1,"X2"=>$X2));
1124
-      }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
-      {
1127
-       $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128
-       $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
-       $Y1 = $this->getPosArray($Value1,$AxisID);
1130
-       $Y2 = $this->getPosArray($Value2,$AxisID);
1122
+        $this->pChartObject->Shadow = $RestoreShadow;
1123
+        return(array("X1"=>$X1,"X2"=>$X2));
1124
+        }
1125
+        elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
+        {
1127
+        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128
+        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
+        $Y1 = $this->getPosArray($Value1,$AxisID);
1130
+        $Y2 = $this->getPosArray($Value2,$AxisID);
1131 1131
 
1132
-       if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
-       if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1132
+        if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
+        if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1134 1134
 
1135
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1135
+        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1136 1136
 
1137
-       if ( $Border )
1137
+        if ( $Border )
1138 1138
         {
1139
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
-         $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1139
+            $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
+            $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+        if ( $AreaName != NULL )
1144 1144
         {
1145
-         $XPos = ($X2-$X1)/2 + $X1;
1146
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1145
+            $XPos = ($X2-$X1)/2 + $X1;
1146
+            $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1147
 
1148
-         $this->pChartObject->Shadow = $RestoreShadow;
1149
-         $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1148
+            $this->pChartObject->Shadow = $RestoreShadow;
1149
+            $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
+            if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1151 1151
         }
1152 1152
 
1153
-       $this->pChartObject->Shadow = $RestoreShadow;
1154
-       return(array("Y1"=>$Y1,"Y2"=>$Y2));
1155
-      }
1153
+        $this->pChartObject->Shadow = $RestoreShadow;
1154
+        return(array("Y1"=>$Y1,"Y2"=>$Y2));
1155
+        }
1156
+    }
1156 1157
     }
1157
-  }
1158 1158
 ?>
1159 1159
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +454 added lines, -454 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("SCATTER_MISSING_X_SERIE"	, 190001);
17
- define("SCATTER_MISSING_Y_SERIE"	, 190002);
16
+ define("SCATTER_MISSING_X_SERIE", 190001);
17
+ define("SCATTER_MISSING_Y_SERIE", 190002);
18 18
 
19 19
  /* pScatter class definition */
20 20
  class pScatter
@@ -23,24 +23,24 @@  discard block
 block discarded – undo
23 23
    var $pDataObject;
24 24
 
25 25
    /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
26
+   function pScatter($pChartObject, $pDataObject)
27 27
     {
28 28
      $this->pChartObject = $pChartObject;
29 29
      $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32 32
    /* Prepare the scale */
33
-   function drawScatterScale($Format="")
33
+   function drawScatterScale($Format = "")
34 34
     {
35
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
-     $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
-     $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
-     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
-     $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
35
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
+     $Floating = isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
+     $XLabelsRotation = isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
+     $MinDivHeight = isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
+     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1, 2, 5);
40
+     $ManualScale = isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100, "Max"=>100));
41 41
      $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42 42
      $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
-     $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
43
+     $ScaleSpacing = isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44 44
      $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45 45
      $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46 46
      $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
@@ -49,75 +49,75 @@  discard block
 block discarded – undo
49 49
      $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50 50
      $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51 51
      $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
-     $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
52
+     $GridAlpha = isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53 53
      $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54 54
      $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55 55
      $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
-     $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
56
+     $AxisAlpha = isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57 57
      $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58 58
      $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59 59
      $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
-     $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
60
+     $TickAlpha = isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
+     $DrawSubTicks = isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62 62
      $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63 63
      $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64 64
      $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65 65
      $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66 66
      $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
-     $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
67
+     $SubTickAlpha = isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68 68
      $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
-     $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
69
+     $DrawArrows = isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
+     $ArrowSize = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71 71
      $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72 72
      $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73 73
      $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74 74
      $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
-     $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
75
+     $BackgroundAlpha1 = isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76 76
      $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77 77
      $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78 78
      $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
-     $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
79
+     $BackgroundAlpha2 = isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80 80
 
81 81
      /* Check if we have at least both one X and Y axis */
82 82
      $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
83
+     foreach ($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84 84
       {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
85
+       if ($AxisSettings["Identity"] == AXIS_X) { $GotXAxis = TRUE; }
86
+       if ($AxisSettings["Identity"] == AXIS_Y) { $GotYAxis = TRUE; }
87 87
       }
88
-     if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
-     if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
88
+     if (!$GotXAxis) { return(SCATTER_MISSING_X_SERIE); }
89
+     if (!$GotYAxis) { return(SCATTER_MISSING_Y_SERIE); }
90 90
 
91 91
      /* Skip a NOTICE event in case of an empty array */
92
-     if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
92
+     if ($DrawYLines == NONE) { $DrawYLines = array("zarma"=>"31"); }
93 93
 
94 94
      $Data = $this->pDataObject->getData();
95 95
 
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
96
+     foreach ($Data["Axis"] as $AxisID => $AxisSettings)
97 97
       {
98
-       if ( $AxisSettings["Identity"] == AXIS_X)
98
+       if ($AxisSettings["Identity"] == AXIS_X)
99 99
         { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100 100
        else
101 101
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 102
 
103 103
        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
104
+       if ($Mode == SCALE_MODE_FLOATING)
105 105
         {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
106
+         foreach ($Data["Series"] as $SerieID => $SerieParameter)
107 107
           {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
108
+           if ($SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"])
109 109
             {
110
-             $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
-             $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
110
+             $AxisMax = max($AxisMax, $Data["Series"][$SerieID]["Max"]);
111
+             $AxisMin = min($AxisMin, $Data["Series"][$SerieID]["Min"]);
112 112
             }
113 113
           }
114
-         $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
114
+         $AutoMargin = (($AxisMax - $AxisMin)/100)*$XReleasePercent;
115 115
 
116
-         $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
116
+         $Data["Axis"][$AxisID]["Min"] = $AxisMin - $AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax + $AutoMargin;
117 117
         }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
118
+       elseif ($Mode == SCALE_MODE_MANUAL)
119 119
         {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
120
+         if (isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]))
121 121
           {
122 122
            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123 123
            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
         }
128 128
 
129 129
        /* Full manual scale */
130
-       if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
131
-        $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]);
130
+       if (isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]))
131
+        $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"], "RowHeight"=>$ManualScale[$AxisID]["RowHeight"], "XMin"=>$ManualScale[$AxisID]["Min"], "XMax"=>$ManualScale[$AxisID]["Max"]);
132 132
        else
133 133
         {
134 134
          $MaxDivs = floor($Width/$MinDivHeight);
135
-         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
135
+         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"], $Data["Axis"][$AxisID]["Max"], $MaxDivs, $Factors, $AxisID);
136 136
         }
137 137
 
138 138
        $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
        $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142 142
        $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
143 143
 
144
-       if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
144
+       if (isset($Scale["Format"])) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
146
+       if (!isset($Data["Axis"][$AxisID]["Display"])) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
+       if (!isset($Data["Axis"][$AxisID]["Format"])) { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
+       if (!isset($Data["Axis"][$AxisID]["Unit"])) { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149 149
       }
150 150
 
151 151
      /* Get the default font color */
@@ -154,67 +154,67 @@  discard block
 block discarded – undo
154 154
      /* Set the original boundaries */
155 155
      $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 156
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
157
+     foreach ($Data["Axis"] as $AxisID => $AxisSettings)
158 158
       {
159
-       if ( isset($AxisSettings["Color"]) )
159
+       if (isset($AxisSettings["Color"]))
160 160
         {
161 161
          $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162 162
          $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
-         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
163
+         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"], "G"=>$AxisSettings["Color"]["G"], "B"=>$AxisSettings["Color"]["B"]));
164 164
         }
165 165
        else
166 166
         {
167 167
          $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168 168
          $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
-         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
169
+         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo, "G"=>$FontColorGo, "B"=>$FontColorBo));
170 170
         }
171 171
 
172 172
        $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
173
+       if ($AxisSettings["Identity"] == AXIS_X)
174 174
         {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
175
+         if ($AxisSettings["Position"] == AXIS_POSITION_BOTTOM)
176 176
           {
177
-           if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
-           if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
-           if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
177
+           if ($XLabelsRotation == 0) { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
+           if ($XLabelsRotation > 0 && $XLabelsRotation < 190) { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
+           if ($XLabelsRotation == 180) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
+           if ($XLabelsRotation > 180 && $XLabelsRotation < 360) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181 181
 
182
-           if ( $Floating )
183
-            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
182
+           if ($Floating)
183
+            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"], $AxisPos["B"], $this->pChartObject->GraphAreaX2 - $AxisSettings["Margin"], $AxisPos["B"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
184 184
            else
185
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["B"],$this->pChartObject->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
185
+            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1, $AxisPos["B"], $this->pChartObject->GraphAreaX2, $AxisPos["B"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
186 186
 
187
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
187
+           if ($DrawArrows) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2 - $AxisSettings["Margin"], $AxisPos["B"], $this->pChartObject->GraphAreaX2 + ($ArrowSize*2), $AxisPos["B"], array("FillR"=>$AxisR, "FillG"=>$AxisG, "FillB"=>$AxisB, "Size"=>$ArrowSize)); }
188 188
 
189 189
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
190
+           $Step   = $Width/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MaxBottom = $AxisPos["B"];
191 191
            $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
192
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
193 193
             {
194 194
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195 195
              $YPos  = $AxisPos["B"];
196
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
196
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
197 197
 
198
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
198
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
199
+             if ($LastX != NULL && $CycleBackground && ($DrawXLines == ALL || in_array($AxisID, $DrawXLines))) { $this->pChartObject->drawFilledRectangle($LastX, $this->pChartObject->GraphAreaY1 + $FloatingOffset, $XPos, $this->pChartObject->GraphAreaY2 - $FloatingOffset, $BGColor); }
200 200
 
201
-             if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
202
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
203
-              $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$InnerSubTickWidth,$XPos+$SubTicksSize,$YPos+$OuterSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
201
+             if ($DrawXLines == ALL || in_array($AxisID, $DrawXLines)) { $this->pChartObject->drawLine($XPos, $this->pChartObject->GraphAreaY1 + $FloatingOffset, $XPos, $this->pChartObject->GraphAreaY2 - $FloatingOffset, array("R"=>$GridR, "G"=>$GridG, "B"=>$GridB, "Alpha"=>$GridAlpha, "Ticks"=>$GridTicks)); }
202
+             if ($DrawSubTicks && $i != $AxisSettings["Rows"])
203
+              $this->pChartObject->drawLine($XPos + $SubTicksSize, $YPos - $InnerSubTickWidth, $XPos + $SubTicksSize, $YPos + $OuterSubTickWidth, array("R"=>$SubTickR, "G"=>$SubTickG, "B"=>$SubTickB, "Alpha"=>$SubTickAlpha));
204 204
 
205
-             $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
-             $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
-             $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
-             $MaxBottom = max($MaxBottom,$TxtBottom);
205
+             $this->pChartObject->drawLine($XPos, $YPos - $InnerTickWidth, $XPos, $YPos + $OuterTickWidth, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
206
+             $Bounds    = $this->pChartObject->drawText($XPos, $YPos + $OuterTickWidth + $LabelOffset, $Value, array("Angle"=>$XLabelsRotation, "Align"=>$LabelAlign));
207
+             $TxtBottom = $YPos + 2 + $OuterTickWidth + 2 + ($Bounds[0]["Y"] - $Bounds[2]["Y"]);
208
+             $MaxBottom = max($MaxBottom, $TxtBottom);
209 209
 
210 210
              $LastX = $XPos;
211 211
             }
212 212
 
213
-           if ( isset($AxisSettings["Name"]) )
213
+           if (isset($AxisSettings["Name"]))
214 214
             {
215
-             $YPos   = $MaxBottom+2;
216
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
215
+             $YPos   = $MaxBottom + 2;
216
+             $XPos   = $this->pChartObject->GraphAreaX1 + ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/2;
217
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218 218
              $MaxBottom = $Bounds[0]["Y"];
219 219
 
220 220
              $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
@@ -222,50 +222,50 @@  discard block
 block discarded – undo
222 222
 
223 223
            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224 224
           }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
225
+         elseif ($AxisSettings["Position"] == AXIS_POSITION_TOP)
226 226
           {
227
-           if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
-           if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
-           if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
227
+           if ($XLabelsRotation == 0) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
+           if ($XLabelsRotation > 0 && $XLabelsRotation < 190) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
+           if ($XLabelsRotation == 180) { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
+           if ($XLabelsRotation > 180 && $SLabelxRotation < 360) { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 231
 
232
-           if ( $Floating )
233
-            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
232
+           if ($Floating)
233
+            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"], $AxisPos["T"], $this->pChartObject->GraphAreaX2 - $AxisSettings["Margin"], $AxisPos["T"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
234 234
            else
235
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["T"],$this->pChartObject->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
235
+            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1, $AxisPos["T"], $this->pChartObject->GraphAreaX2, $AxisPos["T"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
236 236
 
237
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
237
+           if ($DrawArrows) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2 - $AxisSettings["Margin"], $AxisPos["T"], $this->pChartObject->GraphAreaX2 + ($ArrowSize*2), $AxisPos["T"], array("FillR"=>$AxisR, "FillG"=>$AxisG, "FillB"=>$AxisB, "Size"=>$ArrowSize)); }
238 238
 
239 239
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
240
+           $Step   = $Width/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MinTop = $AxisPos["T"];
241 241
            $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
242
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
243 243
             {
244 244
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245 245
              $YPos  = $AxisPos["T"];
246
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
246
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
247 247
 
248
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
248
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
249
+             if ($LastX != NULL && $CycleBackground && ($DrawXLines == ALL || in_array($AxisID, $DrawXLines))) { $this->pChartObject->drawFilledRectangle($LastX, $this->pChartObject->GraphAreaY1 + $FloatingOffset, $XPos, $this->pChartObject->GraphAreaY2 - $FloatingOffset, $BGColor); }
250 250
 
251
-             if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
251
+             if ($DrawXLines == ALL || in_array($AxisID, $DrawXLines)) { $this->pChartObject->drawLine($XPos, $this->pChartObject->GraphAreaY1 + $FloatingOffset, $XPos, $this->pChartObject->GraphAreaY2 - $FloatingOffset, array("R"=>$GridR, "G"=>$GridG, "B"=>$GridB, "Alpha"=>$GridAlpha, "Ticks"=>$GridTicks)); }
252 252
 
253
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
254
-              $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
253
+             if ($DrawSubTicks && $i != $AxisSettings["Rows"])
254
+              $this->pChartObject->drawLine($XPos + $SubTicksSize, $YPos - $OuterSubTickWidth, $XPos + $SubTicksSize, $YPos + $InnerSubTickWidth, array("R"=>$SubTickR, "G"=>$SubTickG, "B"=>$SubTickB, "Alpha"=>$SubTickAlpha));
255 255
 
256
-             $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
-             $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
-             $MinTop = min($MinTop,$TxtBox);
256
+             $this->pChartObject->drawLine($XPos, $YPos - $OuterTickWidth, $XPos, $YPos + $InnerTickWidth, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
257
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos - $OuterTickWidth - $LabelOffset, $Value, array("Angle"=>$XLabelsRotation, "Align"=>$LabelAlign));
258
+             $TxtBox = $YPos - $OuterTickWidth - 4 - ($Bounds[0]["Y"] - $Bounds[2]["Y"]);
259
+             $MinTop = min($MinTop, $TxtBox);
260 260
 
261 261
              $LastX = $XPos;
262 262
             }
263 263
 
264
-           if ( isset($AxisSettings["Name"]) )
264
+           if (isset($AxisSettings["Name"]))
265 265
             {
266
-             $YPos   = $MinTop-2;
267
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
266
+             $YPos   = $MinTop - 2;
267
+             $XPos   = $this->pChartObject->GraphAreaX1 + ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/2;
268
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269 269
              $MinTop = $Bounds[2]["Y"];
270 270
 
271 271
              $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
@@ -274,48 +274,48 @@  discard block
 block discarded – undo
274 274
            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275 275
           }
276 276
         }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
277
+       elseif ($AxisSettings["Identity"] == AXIS_Y)
278 278
         {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
279
+         if ($AxisSettings["Position"] == AXIS_POSITION_LEFT)
280 280
           {
281 281
 
282
-           if ( $Floating )
283
-            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
282
+           if ($Floating)
283
+            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"], $this->pChartObject->GraphAreaY1 + $AxisSettings["Margin"], $AxisPos["L"], $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
284 284
            else
285
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1,$AxisPos["L"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
285
+            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"], $this->pChartObject->GraphAreaY1, $AxisPos["L"], $this->pChartObject->GraphAreaY2, array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
286 286
 
287
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
287
+           if ($DrawArrows) { $this->pChartObject->drawArrow($AxisPos["L"], $this->pChartObject->GraphAreaY1 + $AxisSettings["Margin"], $AxisPos["L"], $this->pChartObject->GraphAreaY1 - ($ArrowSize*2), array("FillR"=>$AxisR, "FillG"=>$AxisG, "FillB"=>$AxisB, "Size"=>$ArrowSize)); }
288 288
 
289 289
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
290
+           $Step   = $Height/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MinLeft = $AxisPos["L"];
291 291
            $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
292
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
293 293
             {
294 294
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295 295
              $XPos  = $AxisPos["L"];
296
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
296
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
297 297
 
298
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
298
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
299
+             if ($LastY != NULL && $CycleBackground && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1 + $FloatingOffset, $LastY, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, $BGColor); }
300 300
 
301
-             if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
301
+             if (($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1 + $FloatingOffset, $YPos, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, array("R"=>$GridR, "G"=>$GridG, "B"=>$GridB, "Alpha"=>$GridAlpha, "Ticks"=>$GridTicks)); }
302 302
 
303
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
304
-              $this->pChartObject->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
303
+             if ($DrawSubTicks && $i != $AxisSettings["Rows"])
304
+              $this->pChartObject->drawLine($XPos - $OuterSubTickWidth, $YPos - $SubTicksSize, $XPos + $InnerSubTickWidth, $YPos - $SubTicksSize, array("R"=>$SubTickR, "G"=>$SubTickG, "B"=>$SubTickB, "Alpha"=>$SubTickAlpha));
305 305
 
306
-             $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
-             $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
-             $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
-             $MinLeft = min($MinLeft,$TxtLeft);
306
+             $this->pChartObject->drawLine($XPos - $OuterTickWidth, $YPos, $XPos + $InnerTickWidth, $YPos, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
307
+             $Bounds  = $this->pChartObject->drawText($XPos - $OuterTickWidth - 2, $YPos, $Value, array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
+             $TxtLeft = $XPos - $OuterTickWidth - 2 - ($Bounds[1]["X"] - $Bounds[0]["X"]);
309
+             $MinLeft = min($MinLeft, $TxtLeft);
310 310
 
311 311
              $LastY = $YPos;
312 312
             }
313 313
 
314
-           if ( isset($AxisSettings["Name"]) )
314
+           if (isset($AxisSettings["Name"]))
315 315
             {
316
-             $XPos    = $MinLeft-2;
317
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
316
+             $XPos    = $MinLeft - 2;
317
+             $YPos    = $this->pChartObject->GraphAreaY1 + ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/2;
318
+             $Bounds  = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE, "Angle"=>90));
319 319
              $MinLeft = $Bounds[2]["X"];
320 320
 
321 321
              $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
@@ -323,46 +323,46 @@  discard block
 block discarded – undo
323 323
 
324 324
            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325 325
           }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
326
+         elseif ($AxisSettings["Position"] == AXIS_POSITION_RIGHT)
327 327
           {
328 328
 
329
-           if ( $Floating )
330
-            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
329
+           if ($Floating)
330
+            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"], $this->pChartObject->GraphAreaY1 + $AxisSettings["Margin"], $AxisPos["R"], $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"], array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
331 331
            else
332
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1,$AxisPos["R"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
332
+            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"], $this->pChartObject->GraphAreaY1, $AxisPos["R"], $this->pChartObject->GraphAreaY2, array("R"=>$AxisR, "G"=>$AxisG, "B"=>$AxisB, "Alpha"=>$AxisAlpha)); }
333 333
 
334
-           if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
334
+           if ($DrawArrows) { $this->pChartObject->drawArrow($AxisPos["R"], $this->pChartObject->GraphAreaY1 + $AxisSettings["Margin"], $AxisPos["R"], $this->pChartObject->GraphAreaY1 - ($ArrowSize*2), array("FillR"=>$AxisR, "FillG"=>$AxisG, "FillB"=>$AxisB, "Size"=>$ArrowSize)); }
335 335
 
336 336
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
337
+           $Step   = $Height/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MaxLeft = $AxisPos["R"];
338 338
            $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
339
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
340 340
             {
341 341
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342 342
              $XPos  = $AxisPos["R"];
343
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
343
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
344 344
 
345
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
345
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
346
+             if ($LastY != NULL && $CycleBackground && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1 + $FloatingOffset, $LastY, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, $BGColor); }
347 347
 
348
-             if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines)) ) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
348
+             if (($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1 + $FloatingOffset, $YPos, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, array("R"=>$GridR, "G"=>$GridG, "B"=>$GridB, "Alpha"=>$GridAlpha, "Ticks"=>$GridTicks)); }
349 349
 
350
-             if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
351
-              $this->pChartObject->drawLine($XPos-$InnerSubTickWidth,$YPos-$SubTicksSize,$XPos+$OuterSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha));
350
+             if ($DrawSubTicks && $i != $AxisSettings["Rows"])
351
+              $this->pChartObject->drawLine($XPos - $InnerSubTickWidth, $YPos - $SubTicksSize, $XPos + $OuterSubTickWidth, $YPos - $SubTicksSize, array("R"=>$SubTickR, "G"=>$SubTickG, "B"=>$SubTickB, "Alpha"=>$SubTickAlpha));
352 352
 
353
-             $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
-             $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
-             $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
-             $MaxLeft = max($MaxLeft,$TxtLeft);
353
+             $this->pChartObject->drawLine($XPos - $InnerTickWidth, $YPos, $XPos + $OuterTickWidth, $YPos, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
354
+             $Bounds  = $this->pChartObject->drawText($XPos + $OuterTickWidth + 2, $YPos, $Value, array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
+             $TxtLeft = $XPos + $OuterTickWidth + 2 + ($Bounds[1]["X"] - $Bounds[0]["X"]);
356
+             $MaxLeft = max($MaxLeft, $TxtLeft);
357 357
 
358 358
              $LastY = $YPos;
359 359
             }
360 360
 
361
-           if ( isset($AxisSettings["Name"]) )
361
+           if (isset($AxisSettings["Name"]))
362 362
             {
363
-             $XPos    = $MaxLeft+6;
364
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
363
+             $XPos    = $MaxLeft + 6;
364
+             $YPos    = $this->pChartObject->GraphAreaY1 + ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/2;
365
+             $Bounds  = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE, "Angle"=>270));
366 366
              $MaxLeft = $Bounds[2]["X"];
367 367
 
368 368
              $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
@@ -377,64 +377,64 @@  discard block
 block discarded – undo
377 377
     }
378 378
 
379 379
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
380
+   function drawScatterPlotChart($Format = NULL)
381 381
     {
382
-     $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
382
+     $PlotSize = isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
+     $PlotBorder = isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384 384
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385 385
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386 386
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387 387
      $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
-     $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
388
+     $BorderSize = isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389 389
      $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
390
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392 392
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393 393
 
394 394
      $Data    = $this->pDataObject->getData();
395 395
      $Palette = $this->pDataObject->getPalette();
396 396
 
397
-     $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
397
+     $BorderColor = array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha);
398 398
 
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
399
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
400 400
       {
401
-       if ( $Series["isDrawable"] == TRUE )
401
+       if ($Series["isDrawable"] == TRUE)
402 402
         {
403 403
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 404
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408
-         if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
408
+         if (isset($Series["Picture"]) && $Series["Picture"] != "")
409
+          { $Picture = $Series["Picture"]; list($PicWidth, $PicHeight, $PicType) = $this->pChartObject->getPicInfo($Picture); }
410 410
          else
411 411
           { $Picture = NULL; }
412 412
 
413
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
413
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
414
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
416
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
417 417
 
418
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
418
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
419 419
 
420
-         foreach($PosArrayX as $Key => $Value)
420
+         foreach ($PosArrayX as $Key => $Value)
421 421
           {
422 422
            $X = $Value; $Y = $PosArrayY[$Key];
423 423
 
424
-           if ( $X != VOID && $Y != VOID )
424
+           if ($X != VOID && $Y != VOID)
425 425
             {
426
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($PlotSize+$BorderSize),$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
426
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
427
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("CIRCLE", floor($X).",".floor($Y).",".floor($PlotSize + $BorderSize), $this->pChartObject->toHTMLColor($Series["Color"]["R"], $Series["Color"]["G"], $Series["Color"]["B"]), $Description, $RealValue); }
428 428
 
429
-             if( isset($Series["Shape"]) )
430
-              { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); }
431
-             elseif ( $Picture == NULL )
429
+             if (isset($Series["Shape"]))
430
+              { $this->pChartObject->drawShape($X, $Y, $Series["Shape"], $PlotSize, $PlotBorder, $BorderSize, $Series["Color"]["R"], $Series["Color"]["G"], $Series["Color"]["B"], $Series["Color"]["Alpha"], $BorderR, $BorderG, $BorderB, $BorderAlpha); }
431
+             elseif ($Picture == NULL)
432 432
               {
433
-               if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
-               $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
433
+               if ($PlotBorder) { $this->pChartObject->drawFilledCircle($X, $Y, $PlotSize + $BorderSize, $BorderColor); }
434
+               $this->pChartObject->drawFilledCircle($X, $Y, $PlotSize, $Color);
435 435
               }
436 436
              else
437
-              { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
437
+              { $this->pChartObject->drawFromPicture($PicType, $Picture, $X - $PicWidth/2, $Y - $PicHeight/2); }
438 438
             }
439 439
           }
440 440
         }
@@ -442,49 +442,49 @@  discard block
 block discarded – undo
442 442
     }
443 443
 
444 444
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
445
+   function drawScatterLineChart($Format = NULL)
446 446
     {
447
-     $Data		= $this->pDataObject->getData();
448
-     $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
447
+     $Data = $this->pDataObject->getData();
448
+     $Palette = $this->pDataObject->getPalette();
449
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
+     $ImageMapPlotSize = isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452 452
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 453
 
454 454
      /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
455
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
456 456
       {
457
-       if ( $Series["isDrawable"] == TRUE )
457
+       if ($Series["isDrawable"] == TRUE)
458 458
         {
459 459
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 460
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 461
          $Ticks  = $Series["Ticks"];
462 462
          $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
466
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
467
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
469
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
470 470
 
471
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
-         if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
-         if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
471
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
472
+         if ($Ticks != 0) { $Color["Ticks"]  = $Ticks; }
473
+         if ($Weight != 0) { $Color["Weight"] = $Weight; }
474 474
 
475 475
          $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
476
+         foreach ($PosArrayX as $Key => $Value)
477 477
           {
478 478
            $X = $Value; $Y = $PosArrayY[$Key];
479 479
 
480
-           if ( $X != VOID && $Y != VOID )
480
+           if ($X != VOID && $Y != VOID)
481 481
             {
482
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
482
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
483
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("CIRCLE", floor($X).",".floor($Y).",".$ImageMapPlotSize, $this->pChartObject->toHTMLColor($Series["Color"]["R"], $Series["Color"]["G"], $Series["Color"]["B"]), $Description, $RealValue); }
484 484
             }
485 485
 
486
-           if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487
-            $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color);
486
+           if ($X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487
+            $this->pChartObject->drawLine($LastX, $LastY, $X, $Y, $Color);
488 488
 
489 489
            $LastX = $X; $LastY = $Y;
490 490
           }
@@ -493,249 +493,249 @@  discard block
 block discarded – undo
493 493
     }
494 494
 
495 495
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
496
+   function drawScatterSplineChart($Format = NULL)
497 497
     {
498
-     $Data		= $this->pDataObject->getData();
499
-     $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
498
+     $Data = $this->pDataObject->getData();
499
+     $Palette = $this->pDataObject->getPalette();
500
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
+     $ImageMapPlotSize = isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 503
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 504
 
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
505
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
506 506
       {
507
-       if ( $Series["isDrawable"] == TRUE )
507
+       if ($Series["isDrawable"] == TRUE)
508 508
         {
509 509
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 510
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 511
          $Ticks  = $Series["Ticks"];
512 512
          $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
516
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
517
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
519
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
520 520
 
521
-         $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
-         if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
-         if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
521
+         $SplineSettings = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
522
+         if ($Ticks != 0) { $SplineSettings["Ticks"]  = $Ticks; }
523
+         if ($Weight != 0) { $SplineSettings["Weight"] = $Weight; }
524 524
 
525 525
          $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
526
+         foreach ($PosArrayX as $Key => $Value)
527 527
           {
528 528
            $X = $Value; $Y = $PosArrayY[$Key];
529
-           $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
529
+           $Force = $this->pChartObject->getLength($LastX, $LastY, $X, $Y)/5;
530 530
 
531
-           if ( $X != VOID && $Y != VOID )
531
+           if ($X != VOID && $Y != VOID)
532 532
             {
533
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
-             if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
533
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
534
+             if ($RecordImageMap) { $this->pChartObject->addToImageMap("CIRCLE", floor($X).",".floor($Y).",".$ImageMapPlotSize, $this->pChartObject->toHTMLColor($Series["Color"]["R"], $Series["Color"]["G"], $Series["Color"]["B"]), $Description, $RealValue); }
535 535
             }
536 536
 
537
-           if ( $X != VOID && $Y != VOID )
538
-            { $WayPoints[] = array($X,$Y); $Forces[] = $Force; }
537
+           if ($X != VOID && $Y != VOID)
538
+            { $WayPoints[] = array($X, $Y); $Forces[] = $Force; }
539 539
 
540
-           if ( $Y == VOID || $X == VOID )
541
-            { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints,$SplineSettings); $WayPoints = ""; $Forces = "";}
540
+           if ($Y == VOID || $X == VOID)
541
+            { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints, $SplineSettings); $WayPoints = ""; $Forces = ""; }
542 542
 
543 543
            $LastX = $X; $LastY = $Y;
544 544
           }
545 545
          $SplineSettings["Forces"] = $Forces; 
546
-         $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
546
+         $this->pChartObject->drawSpline($WayPoints, $SplineSettings);
547 547
         }
548 548
       }
549 549
     }
550 550
 
551 551
    /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
552
+   function getPosArray($Values, $AxisID)
553 553
     {
554 554
      $Data = $this->pDataObject->getData();
555 555
 
556
-     if ( !is_array($Values) ) { $Values = array($Values); }
556
+     if (!is_array($Values)) { $Values = array($Values); }
557 557
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
558
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
559 559
       {
560 560
        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561 561
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
-       $Step        = $Height / $ScaleHeight;
562
+       $Step        = $Height/$ScaleHeight;
563 563
 
564 564
        $Result = "";
565
-       foreach($Values as $Key => $Value)
565
+       foreach ($Values as $Key => $Value)
566 566
         {
567
-         if ( $Value == VOID ) 
567
+         if ($Value == VOID) 
568 568
           $Result[] = VOID;
569 569
          else
570
-          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
570
+          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step*($Value - $Data["Axis"][$AxisID]["ScaleMin"]));
571 571
         }
572 572
 
573
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
573
+       if (count($Result) == 1) { return($Result[0]); } else { return($Result); }
574 574
       }
575 575
      else
576 576
       {
577 577
        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578 578
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
-       $Step        = $Height / $ScaleHeight;
579
+       $Step        = $Height/$ScaleHeight;
580 580
 
581 581
        $Result = "";
582
-       foreach($Values as $Key => $Value)
582
+       foreach ($Values as $Key => $Value)
583 583
         {
584
-         if ( $Value == VOID ) 
584
+         if ($Value == VOID) 
585 585
           $Result[] = VOID;
586 586
          else
587
-          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
587
+          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step*($Value - $Data["Axis"][$AxisID]["ScaleMin"]));
588 588
         }
589 589
 
590
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
590
+       if (count($Result) == 1) { return($Result[0]); } else { return($Result); }
591 591
       }
592 592
     }
593 593
 
594 594
    /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
595
+   function drawScatterLegend($X, $Y, $Format = "")
596 596
     {
597
-     $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
597
+     $Family = isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598 598
      $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599 599
      $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600 600
      $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601 601
      $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602 602
      $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
-     $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
-     $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
-     $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
-     $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
-     $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
603
+     $BoxWidth = isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
+     $BoxHeight = isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
+     $IconAreaWidth = isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
+     $IconAreaHeight = isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
+     $XSpacing = isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
+     $Margin = isset($Format["Margin"]) ? $Format["Margin"] : 5;
609 609
      $R			= isset($Format["R"]) ? $Format["R"] : 200;
610 610
      $G			= isset($Format["G"]) ? $Format["G"] : 200;
611 611
      $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
612
+     $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613 613
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614 614
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615 615
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
-     $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
616
+     $Surrounding = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
+     $Style = isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619 619
 
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
620
+     if ($Surrounding != NULL) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621 621
 
622 622
      $Data = $this->pDataObject->getData();
623 623
 
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
624
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
625 625
       {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
626
+       if ($Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627 627
         {
628
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
628
+         list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
+         if ($IconAreaWidth < $PicWidth) { $IconAreaWidth = $PicWidth; }
630
+         if ($IconAreaHeight < $PicHeight) { $IconAreaHeight = $PicHeight; }
631 631
         }
632 632
       }
633 633
 
634
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
634
+     $YStep = max($this->pChartObject->FontSize, $IconAreaHeight) + 5;
635 635
      $XStep = $IconAreaWidth + 5;
636 636
      $XStep = $XSpacing;
637 637
 
638 638
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
639
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
640 640
       {
641
-       if ( $Series["isDrawable"] == TRUE )
641
+       if ($Series["isDrawable"] == TRUE)
642 642
         {
643
-         if ( $Mode == LEGEND_VERTICAL )
643
+         if ($Mode == LEGEND_VERTICAL)
644 644
           {
645
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
645
+           $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 4, $vY + $IconAreaHeight/2, $FontName, $FontSize, 0, $Series["Description"]);
646 646
 
647
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
647
+           if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
648
+           if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
649
+           if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
650 650
 
651
-           $Lines = preg_split("/\n/",$Series["Description"]);
652
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
651
+           $Lines = preg_split("/\n/", $Series["Description"]);
652
+           $vY = $vY + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
653 653
           }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
654
+         elseif ($Mode == LEGEND_HORIZONTAL)
655 655
           {
656
-           $Lines = preg_split("/\n/",$Series["Description"]);
656
+           $Lines = preg_split("/\n/", $Series["Description"]);
657 657
            $Width = "";
658
-           foreach($Lines as $Key => $Value)
658
+           foreach ($Lines as $Key => $Value)
659 659
             {
660
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
660
+             $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 6, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $FontName, $FontSize, 0, $Value);
661 661
 
662
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
662
+             if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
663
+             if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
664
+             if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
665 665
 
666 666
              $Width[] = $BoxArray[1]["X"];
667 667
             }
668 668
 
669
-           $vX=max($Width)+$XStep;
669
+           $vX = max($Width) + $XStep;
670 670
           }
671 671
         }
672 672
       }
673
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
673
+     $vY = $vY - $YStep; $vX = $vX - $XStep;
674 674
 
675
-     $TopOffset  = $Y - $Boundaries["T"];
676
-     if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
675
+     $TopOffset = $Y - $Boundaries["T"];
676
+     if ($Boundaries["B"] - ($vY + $IconAreaHeight) < $TopOffset) { $Boundaries["B"] = $vY + $IconAreaHeight + $TopOffset; }
677 677
 
678
-     if ( $Style == LEGEND_ROUND )
679
-      $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
680
-     elseif ( $Style == LEGEND_BOX )
681
-      $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
678
+     if ($Style == LEGEND_ROUND)
679
+      $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"] - $Margin, $Boundaries["T"] - $Margin, $Boundaries["R"] + $Margin, $Boundaries["B"] + $Margin, $Margin, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "BorderR"=>$BorderR, "BorderG"=>$BorderG, "BorderB"=>$BorderB));
680
+     elseif ($Style == LEGEND_BOX)
681
+      $this->pChartObject->drawFilledRectangle($Boundaries["L"] - $Margin, $Boundaries["T"] - $Margin, $Boundaries["R"] + $Margin, $Boundaries["B"] + $Margin, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "BorderR"=>$BorderR, "BorderG"=>$BorderG, "BorderB"=>$BorderB));
682 682
 
683 683
      $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
684
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
685 685
       {
686
-       if ( $Series["isDrawable"] == TRUE )
686
+       if ($Series["isDrawable"] == TRUE)
687 687
         {
688 688
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 689
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690 690
 
691
-         if ( isset($Series["Picture"]) )
691
+         if (isset($Series["Picture"]))
692 692
           {
693 693
            $Picture = $Series["Picture"];
694
-           list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
-           $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
694
+           list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
+           $PicX = $X + $IconAreaWidth/2; $PicY = $Y + $IconAreaHeight/2; 
696 696
 
697
-           $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
697
+           $this->pChartObject->drawFromPNG($PicX - $PicWidth/2, $PicY - $PicHeight/2, $Picture);
698 698
           }
699 699
          else
700 700
           {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
701
+           if ($Family == LEGEND_FAMILY_BOX)
702 702
             {
703
-             if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
-             if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
703
+             if ($BoxWidth != $IconAreaWidth) { $XOffset = floor(($IconAreaWidth - $BoxWidth)/2); } else { $XOffset = 0; }
704
+             if ($BoxHeight != $IconAreaHeight) { $YOffset = floor(($IconAreaHeight - $BoxHeight)/2); } else { $YOffset = 0; }
705 705
 
706
-             $this->pChartObject->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
707
-             $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
706
+             $this->pChartObject->drawFilledRectangle($X + 1 + $XOffset, $Y + 1 + $YOffset, $X + $BoxWidth + $XOffset + 1, $Y + $BoxHeight + 1 + $YOffset, array("R"=>0, "G"=>0, "B"=>0, "Alpha"=>20));
707
+             $this->pChartObject->drawFilledRectangle($X + $XOffset, $Y + $YOffset, $X + $BoxWidth + $XOffset, $Y + $BoxHeight + $YOffset, array("R"=>$R, "G"=>$G, "B"=>$B, "Surrounding"=>20));
708 708
             }
709
-           elseif ( $Family == LEGEND_FAMILY_CIRCLE )
709
+           elseif ($Family == LEGEND_FAMILY_CIRCLE)
710 710
             {
711
-             $this->pChartObject->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
712
-             $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
711
+             $this->pChartObject->drawFilledCircle($X + 1 + $IconAreaWidth/2, $Y + 1 + $IconAreaHeight/2, min($IconAreaHeight/2, $IconAreaWidth/2), array("R"=>0, "G"=>0, "B"=>0, "Alpha"=>20));
712
+             $this->pChartObject->drawFilledCircle($X + $IconAreaWidth/2, $Y + $IconAreaHeight/2, min($IconAreaHeight/2, $IconAreaWidth/2), array("R"=>$R, "G"=>$G, "B"=>$B, "Surrounding"=>20));
713 713
             }
714
-           elseif ( $Family == LEGEND_FAMILY_LINE )
714
+           elseif ($Family == LEGEND_FAMILY_LINE)
715 715
             {
716
-             $this->pChartObject->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight));
717
-             $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
716
+             $this->pChartObject->drawLine($X + 1, $Y + 1 + $IconAreaHeight/2, $X + 1 + $IconAreaWidth, $Y + 1 + $IconAreaHeight/2, array("R"=>0, "G"=>0, "B"=>0, "Alpha"=>20, "Ticks"=>$Ticks, "Weight"=>$Weight));
717
+             $this->pChartObject->drawLine($X, $Y + $IconAreaHeight/2, $X + $IconAreaWidth, $Y + $IconAreaHeight/2, array("R"=>$R, "G"=>$G, "B"=>$B, "Ticks"=>$Ticks, "Weight"=>$Weight));
718 718
             }
719 719
           }
720 720
 
721
-         if ( $Mode == LEGEND_VERTICAL )
721
+         if ($Mode == LEGEND_VERTICAL)
722 722
           {
723
-           $Lines = preg_split("/\n/",$Series["Description"]);
724
-           foreach($Lines as $Key => $Value)
725
-            $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
723
+           $Lines = preg_split("/\n/", $Series["Description"]);
724
+           foreach ($Lines as $Key => $Value)
725
+            $this->pChartObject->drawText($X + $IconAreaWidth + 4, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $Value, array("R"=>$FontR, "G"=>$FontG, "B"=>$FontB, "Align"=>TEXT_ALIGN_MIDDLELEFT));
726 726
 
727
-           $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
727
+           $Y = $Y + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
728 728
           }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
729
+         elseif ($Mode == LEGEND_HORIZONTAL)
730 730
           {
731
-           $Lines = preg_split("/\n/",$Series["Description"]);
731
+           $Lines = preg_split("/\n/", $Series["Description"]);
732 732
            $Width = "";
733
-           foreach($Lines as $Key => $Value)
733
+           foreach ($Lines as $Key => $Value)
734 734
             {
735
-             $BoxArray = $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
735
+             $BoxArray = $this->pChartObject->drawText($X + $IconAreaWidth + 4, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $Value, array("R"=>$FontR, "G"=>$FontG, "B"=>$FontB, "Align"=>TEXT_ALIGN_MIDDLELEFT));
736 736
              $Width[] = $BoxArray[1]["X"];
737 737
             }
738
-           $X=max($Width)+2+$XStep;
738
+           $X = max($Width) + 2 + $XStep;
739 739
           }
740 740
         }
741 741
       }
@@ -744,104 +744,104 @@  discard block
 block discarded – undo
744 744
     }
745 745
 
746 746
    /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
747
+   function getScatterLegendSize($Format = "")
748 748
     {
749 749
      $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750 750
      $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
-     $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
-     $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
751
+     $BoxSize = isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
+     $Margin = isset($Format["Margin"]) ? $Format["Margin"] : 5;
753 753
      $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
-     $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
754
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
755 755
 
756
-     $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
756
+     $YStep = max($this->pChartObject->FontSize, $BoxSize) + 5;
757 757
      $XStep = $BoxSize + 5;
758 758
 
759
-     $X=100; $Y=100;
759
+     $X = 100; $Y = 100;
760 760
 
761 761
      $Data = $this->pDataObject->getData();
762 762
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
763
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
764 764
       {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
765
+       if ($Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766 766
         {
767
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
767
+         list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
+         if ($IconAreaWidth < $PicWidth) { $IconAreaWidth = $PicWidth; }
769
+         if ($IconAreaHeight < $PicHeight) { $IconAreaHeight = $PicHeight; }
770 770
         }
771 771
       }
772 772
 
773
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
773
+     $YStep = max($this->pChartObject->FontSize, $IconAreaHeight) + 5;
774 774
      $XStep = $IconAreaWidth + 5;
775 775
      $XStep = $XSpacing;
776 776
 
777 777
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
778
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
779 779
       {
780
-       if ( $Series["isDrawable"] == TRUE )
780
+       if ($Series["isDrawable"] == TRUE)
781 781
         {
782
-         if ( $Mode == LEGEND_VERTICAL )
782
+         if ($Mode == LEGEND_VERTICAL)
783 783
           {
784
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
784
+           $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 4, $vY + $IconAreaHeight/2, $FontName, $FontSize, 0, $Series["Description"]);
785 785
 
786
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
786
+           if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
787
+           if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
788
+           if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
789 789
 
790
-           $Lines = preg_split("/\n/",$Series["Description"]);
791
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
790
+           $Lines = preg_split("/\n/", $Series["Description"]);
791
+           $vY = $vY + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
792 792
           }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
793
+         elseif ($Mode == LEGEND_HORIZONTAL)
794 794
           {
795
-           $Lines = preg_split("/\n/",$Series["Description"]);
795
+           $Lines = preg_split("/\n/", $Series["Description"]);
796 796
            $Width = "";
797
-           foreach($Lines as $Key => $Value)
797
+           foreach ($Lines as $Key => $Value)
798 798
             {
799
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
799
+             $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 6, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $FontName, $FontSize, 0, $Value);
800 800
 
801
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
801
+             if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
802
+             if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
803
+             if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
804 804
 
805 805
              $Width[] = $BoxArray[1]["X"];
806 806
             }
807 807
 
808
-           $vX=max($Width)+$XStep;
808
+           $vX = max($Width) + $XStep;
809 809
           }
810 810
         }
811 811
       }
812
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
812
+     $vY = $vY - $YStep; $vX = $vX - $XStep;
813 813
 
814
-     $TopOffset  = $Y - $Boundaries["T"];
815
-     if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
814
+     $TopOffset = $Y - $Boundaries["T"];
815
+     if ($Boundaries["B"] - ($vY + $BoxSize) < $TopOffset) { $Boundaries["B"] = $vY + $BoxSize + $TopOffset; }
816 816
 
817
-     $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
-     $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
817
+     $Width  = ($Boundaries["R"] + $Margin) - ($Boundaries["L"] - $Margin);
818
+     $Height = ($Boundaries["B"] + $Margin) - ($Boundaries["T"] - $Margin);
819 819
 
820
-     return(array("Width"=>$Width,"Height"=>$Height));
820
+     return(array("Width"=>$Width, "Height"=>$Height));
821 821
     }
822 822
 
823 823
    /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
824
+   function drawScatterBestFit($Format = "")
825 825
     {
826
-     $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
826
+     $Ticks = isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 827
 
828
-     $Data    = $this->pDataObject->getData();
828
+     $Data = $this->pDataObject->getData();
829 829
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
830
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
831 831
       {
832
-       if ( $Series["isDrawable"] == TRUE )
832
+       if ($Series["isDrawable"] == TRUE)
833 833
         {
834 834
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 835
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836 836
 
837
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
837
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
838 838
          $Color["Ticks"] = $Ticks;
839 839
 
840 840
          $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841 841
          $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842 842
 
843 843
          $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
844
+         foreach ($PosArrayX as $Key => $Value)
845 845
           {
846 846
            $X = $Value; $Y = $PosArrayY[$Key];
847 847
 
@@ -855,68 +855,68 @@  discard block
 block discarded – undo
855 855
 
856 856
          if ((($n*$Sxx) == ($Sx*$Sx)))
857 857
           {
858
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
858
+           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"], $SerieXAxis);
859 859
            $X2 = $X1;
860 860
            $Y1 = $this->pChartObject->GraphAreaY1;
861 861
            $Y2 = $this->pChartObject->GraphAreaY2;
862 862
           }
863 863
          else
864 864
           {
865
-           $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
-           $B = (($Sy)-($M*$Sx))/($n);
865
+           $M = (($n*$Sxy) - ($Sx*$Sy))/(($n*$Sxx) - ($Sx*$Sx));
866
+           $B = (($Sy) - ($M*$Sx))/($n);
867 867
 
868
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
-           $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
-           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
-           $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
868
+           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"], $SerieXAxis);
869
+           $Y1 = $this->getPosArray($M*$Data["Axis"][$SerieXAxis]["ScaleMin"] + $B, $SerieYAxis);
870
+           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"], $SerieXAxis);
871
+           $Y2 = $this->getPosArray($M*$Data["Axis"][$SerieXAxis]["ScaleMax"] + $B, $SerieYAxis);
872 872
 
873
-           $RealM = -($Y2-$Y1)/($X2-$X1);
873
+           $RealM = -($Y2 - $Y1)/($X2 - $X1);
874 874
 
875
-           if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
-           if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
-           if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
-           if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
875
+           if ($Y1 < $this->pChartObject->GraphAreaY1) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1 - $Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
+           if ($Y1 > $this->pChartObject->GraphAreaY2) { $X1 = $X1 + ($Y1 - $this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
+           if ($Y2 < $this->pChartObject->GraphAreaY1) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1 - $Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
+           if ($Y2 > $this->pChartObject->GraphAreaY2) { $X2 = $X2 - ($Y2 - $this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879 879
           }
880 880
 
881
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
881
+         $this->pChartObject->drawLine($X1, $Y1, $X2, $Y2, $Color);
882 882
         }
883 883
       }
884 884
     }
885 885
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
886
+   function writeScatterLabel($ScatterSerieID, $Points, $Format = "")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
888
+     $OverrideTitle = isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
+     $DrawPoint = isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
+     $Decimals = isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
891 891
 
892 892
      $Data    = $this->pDataObject->getData();
893 893
      $Palette = $this->pDataObject->getPalette();
894 894
 
895
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
895
+     if (!is_array($Points)) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
896 896
 
897
-     if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
897
+     if (!isset($Data["ScatterSeries"][$ScatterSerieID])) 
898 898
       return(0);
899 899
 
900 900
      $Series = $Data["ScatterSeries"][$ScatterSerieID];
901 901
      $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902 902
      $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
903 903
 
904
-     $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
-     if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
-     $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
-     if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
904
+     $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
905
+     if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
+     $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
907
+     if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 908
 
909
-     foreach($Points as $Key => $Point)
909
+     foreach ($Points as $Key => $Point)
910 910
       {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
911
+       if (isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]))
912 912
         {
913 913
          $X = floor($PosArrayX[$Point]);
914 914
          $Y = floor($PosArrayY[$Point]);
915 915
 
916
-         if ( $DrawPoint == LABEL_POINT_CIRCLE )
917
-          $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
918
-         elseif ( $DrawPoint == LABEL_POINT_BOX )
919
-          $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0));
916
+         if ($DrawPoint == LABEL_POINT_CIRCLE)
917
+          $this->pChartObject->drawFilledCircle($X, $Y, 3, array("R"=>255, "G"=>255, "B"=>255, "BorderR"=>0, "BorderG"=>0, "BorderB"=>0));
918
+         elseif ($DrawPoint == LABEL_POINT_BOX)
919
+          $this->pChartObject->drawFilledRectangle($X - 2, $Y - 2, $X + 2, $Y + 2, array("R"=>255, "G"=>255, "B"=>255, "BorderR"=>0, "BorderG"=>0, "BorderB"=>0));
920 920
 
921 921
          $Serie = "";
922 922
          $Serie["R"] = $Series["Color"]["R"];
@@ -927,125 +927,125 @@  discard block
 block discarded – undo
927 927
          $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928 928
          $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929 929
          $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
-         $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
930
+         if ($Decimals == NULL) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point], $Decimals); }
931
+         $XValue      = $this->pChartObject->scaleFormat($XValue, $XAxisMode, $XAxisFormat, $XAxisUnit);
932 932
 
933 933
          $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934 934
          $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935 935
          $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
-         $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
936
+         if ($Decimals == NULL) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point], $Decimals); }
937
+         $YValue      = $this->pChartObject->scaleFormat($YValue, $YAxisMode, $YAxisFormat, $YAxisUnit);
938 938
 
939 939
          $Caption = $XValue." / ".$YValue;
940 940
 
941
-         if ( isset($Series["Description"]) )
941
+         if (isset($Series["Description"]))
942 942
           $Description = $Series["Description"];
943 943
          else
944 944
           $Description = "No description";
945 945
 
946 946
          $Series = "";
947
-         $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
947
+         $Series[] = array("Format"=>$Serie, "Caption"=>$Caption);
948 948
 
949
-         $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
949
+         $this->pChartObject->drawLabelBox($X, $Y - 3, $Description, $Series, $Format);
950 950
         }
951 951
       }
952 952
     }
953 953
 
954 954
    /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
955
+   function drawScatterThreshold($Value, $Format = "")
956 956
     {
957
-     $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
957
+     $AxisID = isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958 958
      $R			= isset($Format["R"]) ? $Format["R"] : 255;
959 959
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
960 960
      $B			= isset($Format["B"]) ? $Format["B"] : 0;
961 961
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
962
+     $Weight = isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963 963
      $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
-     $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
964
+     $Wide = isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
+     $WideFactor = isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966 966
      $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
967
+     $Caption = isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968 968
      $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
-     $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
969
+     $CaptionOffset = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970 970
      $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971 971
      $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972 972
      $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973 973
      $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
974
+     $DrawBox = isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975 975
      $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976 976
      $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
977
+     $BoxRounded = isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978 978
      $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979 979
      $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980 980
      $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981 981
      $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
-     $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
-     $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
982
+     $BoxAlpha = isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
+     $BoxSurrounding = isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984 984
      $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985 985
      $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986 986
      $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
-     $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
987
+     $BoxBorderAlpha = isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988 988
 
989
-     $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
-                              "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
-                              "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
-                              "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
989
+     $CaptionSettings = array("DrawBox"=>$DrawBox, "DrawBoxBorder"=>$DrawBoxBorder, "BorderOffset"=>$BorderOffset, "BoxRounded"=>$BoxRounded, "RoundedRadius"=>$RoundedRadius,
990
+                              "BoxR"=>$BoxR, "BoxG"=>$BoxG, "BoxB"=>$BoxB, "BoxAlpha"=>$BoxAlpha, "BoxSurrounding"=>$BoxSurrounding,
991
+                              "BoxBorderR"=>$BoxBorderR, "BoxBorderG"=>$BoxBorderG, "BoxBorderB"=>$BoxBorderB, "BoxBorderAlpha"=>$BoxBorderAlpha,
992
+                              "R"=>$CaptionR, "G"=>$CaptionG, "B"=>$CaptionB, "Alpha"=>$CaptionAlpha);
993 993
 
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
994
+     if ($Caption == NULL) { $Caption = $Value; }
995 995
 
996 996
      $Data = $this->pDataObject->getData();
997 997
 
998
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
998
+     if (!isset($Data["Axis"][$AxisID])) { return(-1); }
999 999
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1000
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_Y)
1001 1001
       {
1002 1002
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003 1003
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
-       $Y  = $this->getPosArray($Value,$AxisID);
1004
+       $Y  = $this->getPosArray($Value, $AxisID);
1005 1005
 
1006
-       $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1006
+       $this->pChartObject->drawLine($X1, $Y, $X2, $Y, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "Ticks"=>$Ticks, "Weight"=>$Weight));
1007 1007
 
1008
-       if ( $Wide )
1008
+       if ($Wide)
1009 1009
         {
1010
-         $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
-         $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1010
+         $this->pChartObject->drawLine($X1, $Y - 1, $X2, $Y - 1, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1011
+         $this->pChartObject->drawLine($X1, $Y + 1, $X2, $Y + 1, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1012 1012
         }
1013 1013
 
1014
-       if ( $WriteCaption )
1014
+       if ($WriteCaption)
1015 1015
         {
1016
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1016
+         if ($CaptionAlign == CAPTION_LEFT_TOP)
1017 1017
           { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018 1018
          else 
1019 1019
           { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 1020
 
1021
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1021
+         $this->pChartObject->drawText($X, $Y, $Caption, $CaptionSettings);
1022 1022
         }
1023 1023
 
1024 1024
        return(array("Y"=>$Y));
1025 1025
       }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1026
+     elseif ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
1027 1027
       {
1028
-       $X  = $this->getPosArray($Value,$AxisID);
1028
+       $X  = $this->getPosArray($Value, $AxisID);
1029 1029
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030 1030
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 1031
 
1032
-       $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1032
+       $this->pChartObject->drawLine($X, $Y1, $X, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "Ticks"=>$Ticks, "Weight"=>$Weight));
1033 1033
 
1034
-       if ( $Wide )
1034
+       if ($Wide)
1035 1035
         {
1036
-         $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
-         $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1036
+         $this->pChartObject->drawLine($X - 1, $Y1, $X - 1, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1037
+         $this->pChartObject->drawLine($X + 1, $Y1, $X + 1, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1038 1038
         }
1039 1039
 
1040
-       if ( $WriteCaption )
1040
+       if ($WriteCaption)
1041 1041
         {
1042
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1042
+         if ($CaptionAlign == CAPTION_LEFT_TOP)
1043 1043
           { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044 1044
          else 
1045 1045
           { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 1046
 
1047 1047
          $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1048
+         $this->pChartObject->drawText($X, $Y, $Caption, $CaptionSettings);
1049 1049
         }
1050 1050
 
1051 1051
        return(array("X"=>$X));
@@ -1053,13 +1053,13 @@  discard block
 block discarded – undo
1053 1053
     }
1054 1054
 
1055 1055
    /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1056
+   function drawScatterThresholdArea($Value1, $Value2, $Format = "")
1057 1057
     {
1058
-     $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1058
+     $AxisID = isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059 1059
      $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060 1060
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061 1061
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
-     $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1062
+     $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063 1063
      $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064 1064
      $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065 1065
      $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
@@ -1071,87 +1071,87 @@  discard block
 block discarded – undo
1071 1071
      $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072 1072
      $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073 1073
      $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
-     $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1074
+     $NameAlpha = isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075 1075
      $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076 1076
 
1077 1077
      if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078 1078
 
1079 1079
      $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1080
+     if ($DisableShadowOnArea && $this->pChartObject->Shadow) { $this->pChartObject->Shadow = FALSE; }
1081 1081
 
1082
-     if ($BorderAlpha >100) { $BorderAlpha = 100;}
1082
+     if ($BorderAlpha > 100) { $BorderAlpha = 100; }
1083 1083
 
1084 1084
      $Data = $this->pDataObject->getData();
1085 1085
 
1086
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1086
+     if (!isset($Data["Axis"][$AxisID])) { return(-1); }
1087 1087
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1088
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
1089 1089
       {
1090 1090
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091 1091
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
-       $X1  = $this->getPosArray($Value1,$AxisID);
1093
-       $X2  = $this->getPosArray($Value2,$AxisID);
1092
+       $X1  = $this->getPosArray($Value1, $AxisID);
1093
+       $X2  = $this->getPosArray($Value2, $AxisID);
1094 1094
 
1095
-       if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
-       if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1095
+       if ($X1 <= $this->pChartObject->GraphAreaX1) { $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"]; }
1096
+       if ($X2 >= $this->pChartObject->GraphAreaX2) { $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"]; }
1097 1097
 
1098
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1098
+       $this->pChartObject->drawFilledRectangle($X1, $Y1, $X2, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha));
1099 1099
 
1100
-       if ( $Border )
1100
+       if ($Border)
1101 1101
         {
1102
-         $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
-         $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1102
+         $this->pChartObject->drawLine($X1, $Y1, $X1, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1103
+         $this->pChartObject->drawLine($X2, $Y1, $X2, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+       if ($AreaName != NULL)
1107 1107
         {
1108
-         $XPos = ($X2-$X1)/2 + $X1;
1109
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1108
+         $XPos = ($X2 - $X1)/2 + $X1;
1109
+         $YPos = ($Y2 - $Y1)/2 + $Y1;
1110 1110
 
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1111
+         if ($NameAngle == ZONE_NAME_ANGLE_AUTO)
1112 1112
           {
1113
-           $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1113
+           $TxtPos   = $this->pChartObject->getTextBox($XPos, $YPos, $this->pChartObject->FontName, $this->pChartObject->FontSize, 0, $AreaName);
1114 1114
            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
-           if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1115
+           if (abs($X2 - $X1) > $TxtWidth) { $NameAngle = 0; } else { $NameAngle = 90; }
1116 1116
           }
1117 1117
          $this->pChartObject->Shadow = $RestoreShadow;
1118
-         $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1118
+         $this->pChartObject->drawText($XPos, $YPos, $AreaName, array("R"=>$NameR, "G"=>$NameG, "B"=>$NameB, "Alpha"=>$NameAlpha, "Angle"=>$NameAngle, "Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
+         if ($DisableShadowOnArea) { $this->pChartObject->Shadow = FALSE; }
1120 1120
         }
1121 1121
 
1122 1122
        $this->pChartObject->Shadow = $RestoreShadow;
1123
-       return(array("X1"=>$X1,"X2"=>$X2));
1123
+       return(array("X1"=>$X1, "X2"=>$X2));
1124 1124
       }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1125
+     elseif ($Data["Axis"][$AxisID]["Identity"] == AXIS_Y)
1126 1126
       {
1127 1127
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128 1128
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
-       $Y1 = $this->getPosArray($Value1,$AxisID);
1130
-       $Y2 = $this->getPosArray($Value2,$AxisID);
1129
+       $Y1 = $this->getPosArray($Value1, $AxisID);
1130
+       $Y2 = $this->getPosArray($Value2, $AxisID);
1131 1131
 
1132
-       if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
-       if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1132
+       if ($Y1 >= $this->pChartObject->GraphAreaY2) { $Y1 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"]; }
1133
+       if ($Y2 <= $this->pChartObject->GraphAreaY1) { $Y2 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"]; }
1134 1134
 
1135
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1135
+       $this->pChartObject->drawFilledRectangle($X1, $Y1, $X2, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha));
1136 1136
 
1137
-       if ( $Border )
1137
+       if ($Border)
1138 1138
         {
1139
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
-         $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1139
+         $this->pChartObject->drawLine($X1, $Y1, $X2, $Y1, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1140
+         $this->pChartObject->drawLine($X1, $Y2, $X2, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+       if ($AreaName != NULL)
1144 1144
         {
1145
-         $XPos = ($X2-$X1)/2 + $X1;
1146
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1145
+         $XPos = ($X2 - $X1)/2 + $X1;
1146
+         $YPos = ($Y2 - $Y1)/2 + $Y1;
1147 1147
 
1148 1148
          $this->pChartObject->Shadow = $RestoreShadow;
1149
-         $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1149
+         $this->pChartObject->drawText($YPos, $XPos, $AreaName, array("R"=>$NameR, "G"=>$NameG, "B"=>$NameB, "Alpha"=>$NameAlpha, "Angle"=>0, "Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
+         if ($DisableShadowOnArea) { $this->Shadow = FALSE; }
1151 1151
         }
1152 1152
 
1153 1153
        $this->pChartObject->Shadow = $RestoreShadow;
1154
-       return(array("Y1"=>$Y1,"Y2"=>$Y2));
1154
+       return(array("Y1"=>$Y1, "Y2"=>$Y2));
1155 1155
       }
1156 1156
     }
1157 1157
   }
Please login to merge, or discard this patch.
Braces   +112 added lines, -236 removed lines patch added patch discarded remove patch
@@ -17,21 +17,18 @@  discard block
 block discarded – undo
17 17
  define("SCATTER_MISSING_Y_SERIE"	, 190002);
18 18
 
19 19
  /* pScatter class definition */
20
- class pScatter
21
-  {
20
+ class pScatter {
22 21
    var $pChartObject;
23 22
    var $pDataObject;
24 23
 
25 24
    /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
27
-    {
25
+   function pScatter($pChartObject,$pDataObject) {
28 26
      $this->pChartObject = $pChartObject;
29 27
      $this->pDataObject  = $pDataObject;
30 28
     }
31 29
 
32 30
    /* Prepare the scale */
33
-   function drawScatterScale($Format="")
34
-    {
31
+   function drawScatterScale($Format="") {
35 32
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36 33
      $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37 34
      $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
@@ -80,8 +77,7 @@  discard block
 block discarded – undo
80 77
 
81 78
      /* Check if we have at least both one X and Y axis */
82 79
      $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
-      {
80
+     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings) {
85 81
        if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86 82
        if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87 83
       }
@@ -93,20 +89,15 @@  discard block
 block discarded – undo
93 89
 
94 90
      $Data = $this->pDataObject->getData();
95 91
 
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
-      {
92
+     foreach($Data["Axis"] as $AxisID => $AxisSettings) {
98 93
        if ( $AxisSettings["Identity"] == AXIS_X)
99
-        { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100
-       else
94
+        { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; } else
101 95
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 96
 
103 97
        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
105
-        {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
107
-          {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
109
-            {
98
+       if ( $Mode == SCALE_MODE_FLOATING ) {
99
+         foreach($Data["Series"] as $SerieID => $SerieParameter) {
100
+           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] ) {
110 101
              $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111 102
              $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
112 103
             }
@@ -114,23 +105,18 @@  discard block
 block discarded – undo
114 105
          $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
115 106
 
116 107
          $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
117
-        }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
119
-        {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
-          {
108
+        } elseif ( $Mode == SCALE_MODE_MANUAL ) {
109
+         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) ) {
122 110
            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123 111
            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
-          }
125
-         else
112
+          } else
126 113
           { echo "Manual scale boundaries not set."; exit(); }
127 114
         }
128 115
 
129 116
        /* Full manual scale */
130 117
        if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
131 118
         $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]);
132
-       else
133
-        {
119
+       else {
134 120
          $MaxDivs = floor($Width/$MinDivHeight);
135 121
          $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
136 122
         }
@@ -154,34 +140,27 @@  discard block
 block discarded – undo
154 140
      /* Set the original boundaries */
155 141
      $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 142
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
-      {
159
-       if ( isset($AxisSettings["Color"]) )
160
-        {
143
+     foreach($Data["Axis"] as $AxisID => $AxisSettings) {
144
+       if ( isset($AxisSettings["Color"]) ) {
161 145
          $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162 146
          $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163 147
          $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
164
-        }
165
-       else
166
-        {
148
+        } else {
167 149
          $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168 150
          $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169 151
          $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
170 152
         }
171 153
 
172 154
        $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
174
-        {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
-          {
155
+       if ( $AxisSettings["Identity"] == AXIS_X ) {
156
+         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM ) {
177 157
            if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178 158
            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179 159
            if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180 160
            if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181 161
 
182 162
            if ( $Floating )
183
-            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
184
-           else
163
+            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else
185 164
             { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["B"],$this->pChartObject->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
186 165
 
187 166
            if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
@@ -189,8 +168,7 @@  discard block
 block discarded – undo
189 168
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190 169
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191 170
            $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
193
-            {
171
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
194 172
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195 173
              $YPos  = $AxisPos["B"];
196 174
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -210,8 +188,7 @@  discard block
 block discarded – undo
210 188
              $LastX = $XPos;
211 189
             }
212 190
 
213
-           if ( isset($AxisSettings["Name"]) )
214
-            {
191
+           if ( isset($AxisSettings["Name"]) ) {
215 192
              $YPos   = $MaxBottom+2;
216 193
              $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217 194
              $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
@@ -221,17 +198,14 @@  discard block
 block discarded – undo
221 198
             }
222 199
 
223 200
            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
-          }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
-          {
201
+          } elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP ) {
227 202
            if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228 203
            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229 204
            if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230 205
            if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 206
 
232 207
            if ( $Floating )
233
-            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
234
-           else
208
+            { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else
235 209
             { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["T"],$this->pChartObject->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
236 210
 
237 211
            if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
@@ -239,8 +213,7 @@  discard block
 block discarded – undo
239 213
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240 214
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241 215
            $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
243
-            {
216
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
244 217
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245 218
              $YPos  = $AxisPos["T"];
246 219
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -261,8 +234,7 @@  discard block
 block discarded – undo
261 234
              $LastX = $XPos;
262 235
             }
263 236
 
264
-           if ( isset($AxisSettings["Name"]) )
265
-            {
237
+           if ( isset($AxisSettings["Name"]) ) {
266 238
              $YPos   = $MinTop-2;
267 239
              $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268 240
              $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
@@ -273,15 +245,11 @@  discard block
 block discarded – undo
273 245
 
274 246
            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275 247
           }
276
-        }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
278
-        {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
-          {
248
+        } elseif ( $AxisSettings["Identity"] == AXIS_Y ) {
249
+         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT ) {
281 250
 
282 251
            if ( $Floating )
283
-            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
284
-           else
252
+            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else
285 253
             { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1,$AxisPos["L"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
286 254
 
287 255
            if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
@@ -289,8 +257,7 @@  discard block
 block discarded – undo
289 257
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290 258
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291 259
            $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
293
-            {
260
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
294 261
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295 262
              $XPos  = $AxisPos["L"];
296 263
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -311,8 +278,7 @@  discard block
 block discarded – undo
311 278
              $LastY = $YPos;
312 279
             }
313 280
 
314
-           if ( isset($AxisSettings["Name"]) )
315
-            {
281
+           if ( isset($AxisSettings["Name"]) ) {
316 282
              $XPos    = $MinLeft-2;
317 283
              $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318 284
              $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
@@ -322,13 +288,10 @@  discard block
 block discarded – undo
322 288
             }
323 289
 
324 290
            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
-          }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
-          {
291
+          } elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT ) {
328 292
 
329 293
            if ( $Floating )
330
-            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
331
-           else
294
+            { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else
332 295
             { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1,$AxisPos["R"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
333 296
 
334 297
            if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); }
@@ -336,8 +299,7 @@  discard block
 block discarded – undo
336 299
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337 300
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338 301
            $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
340
-            {
302
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
341 303
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342 304
              $XPos  = $AxisPos["R"];
343 305
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -358,8 +320,7 @@  discard block
 block discarded – undo
358 320
              $LastY = $YPos;
359 321
             }
360 322
 
361
-           if ( isset($AxisSettings["Name"]) )
362
-            {
323
+           if ( isset($AxisSettings["Name"]) ) {
363 324
              $XPos    = $MaxLeft+6;
364 325
              $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365 326
              $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
@@ -377,8 +338,7 @@  discard block
 block discarded – undo
377 338
     }
378 339
 
379 340
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
381
-    {
341
+   function drawScatterPlotChart($Format=NULL) {
382 342
      $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383 343
      $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384 344
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
@@ -396,18 +356,15 @@  discard block
 block discarded – undo
396 356
 
397 357
      $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398 358
 
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
400
-      {
401
-       if ( $Series["isDrawable"] == TRUE )
402
-        {
359
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
360
+       if ( $Series["isDrawable"] == TRUE ) {
403 361
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 362
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 363
 
406 364
          if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 365
          
408 366
          if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
-         else
367
+          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); } else
411 368
           { $Picture = NULL; }
412 369
 
413 370
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
@@ -417,23 +374,18 @@  discard block
 block discarded – undo
417 374
 
418 375
          $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
419 376
 
420
-         foreach($PosArrayX as $Key => $Value)
421
-          {
377
+         foreach($PosArrayX as $Key => $Value) {
422 378
            $X = $Value; $Y = $PosArrayY[$Key];
423 379
 
424
-           if ( $X != VOID && $Y != VOID )
425
-            {
380
+           if ( $X != VOID && $Y != VOID ) {
426 381
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427 382
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($PlotSize+$BorderSize),$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
428 383
 
429 384
              if( isset($Series["Shape"]) )
430
-              { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); }
431
-             elseif ( $Picture == NULL )
432
-              {
385
+              { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); } elseif ( $Picture == NULL ) {
433 386
                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434 387
                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
-              }
436
-             else
388
+              } else
437 389
               { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
438 390
             }
439 391
           }
@@ -442,8 +394,7 @@  discard block
 block discarded – undo
442 394
     }
443 395
 
444 396
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
446
-    {
397
+   function drawScatterLineChart($Format=NULL) {
447 398
      $Data		= $this->pDataObject->getData();
448 399
      $Palette		= $this->pDataObject->getPalette();
449 400
      $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
@@ -452,10 +403,8 @@  discard block
 block discarded – undo
452 403
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 404
 
454 405
      /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
456
-      {
457
-       if ( $Series["isDrawable"] == TRUE )
458
-        {
406
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
407
+       if ( $Series["isDrawable"] == TRUE ) {
459 408
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 409
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 410
          $Ticks  = $Series["Ticks"];
@@ -473,12 +422,10 @@  discard block
 block discarded – undo
473 422
          if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
474 423
 
475 424
          $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
477
-          {
425
+         foreach($PosArrayX as $Key => $Value) {
478 426
            $X = $Value; $Y = $PosArrayY[$Key];
479 427
 
480
-           if ( $X != VOID && $Y != VOID )
481
-            {
428
+           if ( $X != VOID && $Y != VOID ) {
482 429
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483 430
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
484 431
             }
@@ -493,8 +440,7 @@  discard block
 block discarded – undo
493 440
     }
494 441
 
495 442
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
497
-    {
443
+   function drawScatterSplineChart($Format=NULL) {
498 444
      $Data		= $this->pDataObject->getData();
499 445
      $Palette		= $this->pDataObject->getPalette();
500 446
      $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
@@ -502,10 +448,8 @@  discard block
 block discarded – undo
502 448
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 449
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 450
 
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
506
-      {
507
-       if ( $Series["isDrawable"] == TRUE )
508
-        {
451
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
452
+       if ( $Series["isDrawable"] == TRUE ) {
509 453
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 454
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 455
          $Ticks  = $Series["Ticks"];
@@ -523,13 +467,11 @@  discard block
 block discarded – undo
523 467
          if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
524 468
 
525 469
          $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
527
-          {
470
+         foreach($PosArrayX as $Key => $Value) {
528 471
            $X = $Value; $Y = $PosArrayY[$Key];
529 472
            $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
530 473
 
531
-           if ( $X != VOID && $Y != VOID )
532
-            {
474
+           if ( $X != VOID && $Y != VOID ) {
533 475
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534 476
              if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); }
535 477
             }
@@ -549,21 +491,18 @@  discard block
 block discarded – undo
549 491
     }
550 492
 
551 493
    /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
553
-    {
494
+   function getPosArray($Values,$AxisID) {
554 495
      $Data = $this->pDataObject->getData();
555 496
 
556 497
      if ( !is_array($Values) ) { $Values = array($Values); }
557 498
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
-      {
499
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
560 500
        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561 501
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562 502
        $Step        = $Height / $ScaleHeight;
563 503
 
564 504
        $Result = "";
565
-       foreach($Values as $Key => $Value)
566
-        {
505
+       foreach($Values as $Key => $Value) {
567 506
          if ( $Value == VOID ) 
568 507
           $Result[] = VOID;
569 508
          else
@@ -571,16 +510,13 @@  discard block
 block discarded – undo
571 510
         }
572 511
 
573 512
        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
-      }
575
-     else
576
-      {
513
+      } else {
577 514
        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578 515
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579 516
        $Step        = $Height / $ScaleHeight;
580 517
 
581 518
        $Result = "";
582
-       foreach($Values as $Key => $Value)
583
-        {
519
+       foreach($Values as $Key => $Value) {
584 520
          if ( $Value == VOID ) 
585 521
           $Result[] = VOID;
586 522
          else
@@ -592,8 +528,7 @@  discard block
 block discarded – undo
592 528
     }
593 529
 
594 530
    /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
596
-    {
531
+   function drawScatterLegend($X,$Y,$Format="") {
597 532
      $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598 533
      $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599 534
      $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
@@ -621,10 +556,8 @@  discard block
 block discarded – undo
621 556
 
622 557
      $Data = $this->pDataObject->getData();
623 558
 
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
625
-      {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627
-        {
559
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
560
+       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"])) {
628 561
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629 562
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630 563
          if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
@@ -636,12 +569,9 @@  discard block
 block discarded – undo
636 569
      $XStep = $XSpacing;
637 570
 
638 571
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
640
-      {
641
-       if ( $Series["isDrawable"] == TRUE )
642
-        {
643
-         if ( $Mode == LEGEND_VERTICAL )
644
-          {
572
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
573
+       if ( $Series["isDrawable"] == TRUE ) {
574
+         if ( $Mode == LEGEND_VERTICAL ) {
645 575
            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
646 576
 
647 577
            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -650,13 +580,10 @@  discard block
 block discarded – undo
650 580
 
651 581
            $Lines = preg_split("/\n/",$Series["Description"]);
652 582
            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
653
-          }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
655
-          {
583
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
656 584
            $Lines = preg_split("/\n/",$Series["Description"]);
657 585
            $Width = "";
658
-           foreach($Lines as $Key => $Value)
659
-            {
586
+           foreach($Lines as $Key => $Value) {
660 587
              $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
661 588
 
662 589
              if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -681,57 +608,44 @@  discard block
 block discarded – undo
681 608
       $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
682 609
 
683 610
      $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
685
-      {
686
-       if ( $Series["isDrawable"] == TRUE )
687
-        {
611
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
612
+       if ( $Series["isDrawable"] == TRUE ) {
688 613
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 614
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690 615
 
691
-         if ( isset($Series["Picture"]) )
692
-          {
616
+         if ( isset($Series["Picture"]) ) {
693 617
            $Picture = $Series["Picture"];
694 618
            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695 619
            $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
696 620
 
697 621
            $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
698
-          }
699
-         else
700
-          {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
702
-            {
622
+          } else {
623
+           if ( $Family == LEGEND_FAMILY_BOX ) {
703 624
              if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704 625
              if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
705 626
 
706 627
              $this->pChartObject->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
707 628
              $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
708
-            }
709
-           elseif ( $Family == LEGEND_FAMILY_CIRCLE )
710
-            {
629
+            } elseif ( $Family == LEGEND_FAMILY_CIRCLE ) {
711 630
              $this->pChartObject->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
712 631
              $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
713
-            }
714
-           elseif ( $Family == LEGEND_FAMILY_LINE )
715
-            {
632
+            } elseif ( $Family == LEGEND_FAMILY_LINE ) {
716 633
              $this->pChartObject->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight));
717 634
              $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
718 635
             }
719 636
           }
720 637
 
721
-         if ( $Mode == LEGEND_VERTICAL )
722
-          {
638
+         if ( $Mode == LEGEND_VERTICAL ) {
723 639
            $Lines = preg_split("/\n/",$Series["Description"]);
724
-           foreach($Lines as $Key => $Value)
725
-            $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
640
+           foreach($Lines as $Key => $Value) {
641
+                       $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
642
+           }
726 643
 
727 644
            $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
-          }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
730
-          {
645
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
731 646
            $Lines = preg_split("/\n/",$Series["Description"]);
732 647
            $Width = "";
733
-           foreach($Lines as $Key => $Value)
734
-            {
648
+           foreach($Lines as $Key => $Value) {
735 649
              $BoxArray = $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT));
736 650
              $Width[] = $BoxArray[1]["X"];
737 651
             }
@@ -744,8 +658,7 @@  discard block
 block discarded – undo
744 658
     }
745 659
 
746 660
    /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
748
-    {
661
+   function getScatterLegendSize($Format="") {
749 662
      $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750 663
      $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751 664
      $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
@@ -760,10 +673,8 @@  discard block
 block discarded – undo
760 673
 
761 674
      $Data = $this->pDataObject->getData();
762 675
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
764
-      {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766
-        {
676
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
677
+       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"])) {
767 678
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768 679
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769 680
          if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
@@ -775,12 +686,9 @@  discard block
 block discarded – undo
775 686
      $XStep = $XSpacing;
776 687
 
777 688
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
779
-      {
780
-       if ( $Series["isDrawable"] == TRUE )
781
-        {
782
-         if ( $Mode == LEGEND_VERTICAL )
783
-          {
689
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
690
+       if ( $Series["isDrawable"] == TRUE ) {
691
+         if ( $Mode == LEGEND_VERTICAL ) {
784 692
            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785 693
 
786 694
            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -789,13 +697,10 @@  discard block
 block discarded – undo
789 697
 
790 698
            $Lines = preg_split("/\n/",$Series["Description"]);
791 699
            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
-          }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
794
-          {
700
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
795 701
            $Lines = preg_split("/\n/",$Series["Description"]);
796 702
            $Width = "";
797
-           foreach($Lines as $Key => $Value)
798
-            {
703
+           foreach($Lines as $Key => $Value) {
799 704
              $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
800 705
 
801 706
              if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -821,16 +726,13 @@  discard block
 block discarded – undo
821 726
     }
822 727
 
823 728
    /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
825
-    {
729
+   function drawScatterBestFit($Format="") {
826 730
      $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 731
 
828 732
      $Data    = $this->pDataObject->getData();
829 733
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
831
-      {
832
-       if ( $Series["isDrawable"] == TRUE )
833
-        {
734
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
735
+       if ( $Series["isDrawable"] == TRUE ) {
834 736
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 737
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836 738
 
@@ -841,8 +743,7 @@  discard block
 block discarded – undo
841 743
          $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842 744
 
843 745
          $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
845
-          {
746
+         foreach($PosArrayX as $Key => $Value) {
846 747
            $X = $Value; $Y = $PosArrayY[$Key];
847 748
 
848 749
            $Sxy = $Sxy + $X*$Y;
@@ -853,15 +754,12 @@  discard block
 block discarded – undo
853 754
 
854 755
          $n = count($PosArrayX);
855 756
 
856
-         if ((($n*$Sxx) == ($Sx*$Sx)))
857
-          {
757
+         if ((($n*$Sxx) == ($Sx*$Sx))) {
858 758
            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859 759
            $X2 = $X1;
860 760
            $Y1 = $this->pChartObject->GraphAreaY1;
861 761
            $Y2 = $this->pChartObject->GraphAreaY2;
862
-          }
863
-         else
864
-          {
762
+          } else {
865 763
            $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866 764
            $B = (($Sy)-($M*$Sx))/($n);
867 765
 
@@ -883,8 +781,7 @@  discard block
 block discarded – undo
883 781
       }
884 782
     }
885 783
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887
-    {
784
+   function writeScatterLabel($ScatterSerieID,$Points,$Format="") {
888 785
      $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889 786
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890 787
      $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
@@ -906,10 +803,8 @@  discard block
 block discarded – undo
906 803
      $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907 804
      if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 805
 
909
-     foreach($Points as $Key => $Point)
910
-      {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
912
-        {
806
+     foreach($Points as $Key => $Point) {
807
+       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) ) {
913 808
          $X = floor($PosArrayX[$Point]);
914 809
          $Y = floor($PosArrayY[$Point]);
915 810
 
@@ -952,8 +847,7 @@  discard block
 block discarded – undo
952 847
     }
953 848
 
954 849
    /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
956
-    {
850
+   function drawScatterThreshold($Value,$Format="") {
957 851
      $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958 852
      $R			= isset($Format["R"]) ? $Format["R"] : 255;
959 853
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
@@ -997,51 +891,42 @@  discard block
 block discarded – undo
997 891
 
998 892
      if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
999 893
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
-      {
894
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) {
1002 895
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003 896
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004 897
        $Y  = $this->getPosArray($Value,$AxisID);
1005 898
 
1006 899
        $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1007 900
 
1008
-       if ( $Wide )
1009
-        {
901
+       if ( $Wide ) {
1010 902
          $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011 903
          $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1012 904
         }
1013 905
 
1014
-       if ( $WriteCaption )
1015
-        {
906
+       if ( $WriteCaption ) {
1016 907
          if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
-          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
-         else 
908
+          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else 
1019 909
           { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 910
 
1021 911
          $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1022 912
         }
1023 913
 
1024 914
        return(array("Y"=>$Y));
1025
-      }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
-      {
915
+      } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
1028 916
        $X  = $this->getPosArray($Value,$AxisID);
1029 917
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030 918
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 919
 
1032 920
        $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1033 921
 
1034
-       if ( $Wide )
1035
-        {
922
+       if ( $Wide ) {
1036 923
          $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037 924
          $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1038 925
         }
1039 926
 
1040
-       if ( $WriteCaption )
1041
-        {
927
+       if ( $WriteCaption ) {
1042 928
          if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
-          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
-         else 
929
+          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } else 
1045 930
           { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 931
 
1047 932
          $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
@@ -1053,8 +938,7 @@  discard block
 block discarded – undo
1053 938
     }
1054 939
 
1055 940
    /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1057
-    {
941
+   function drawScatterThresholdArea($Value1,$Value2,$Format="") {
1058 942
      $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059 943
      $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060 944
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
@@ -1085,8 +969,7 @@  discard block
 block discarded – undo
1085 969
 
1086 970
      if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1087 971
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
-      {
972
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
1090 973
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091 974
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092 975
        $X1  = $this->getPosArray($Value1,$AxisID);
@@ -1097,19 +980,16 @@  discard block
 block discarded – undo
1097 980
 
1098 981
        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1099 982
 
1100
-       if ( $Border )
1101
-        {
983
+       if ( $Border ) {
1102 984
          $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103 985
          $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 986
         }
1105 987
 
1106
-       if ( $AreaName != NULL )
1107
-        {
988
+       if ( $AreaName != NULL ) {
1108 989
          $XPos = ($X2-$X1)/2 + $X1;
1109 990
          $YPos = ($Y2-$Y1)/2 + $Y1;
1110 991
 
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
-          {
992
+         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO ) {
1113 993
            $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114 994
            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115 995
            if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
@@ -1121,9 +1001,7 @@  discard block
 block discarded – undo
1121 1001
 
1122 1002
        $this->pChartObject->Shadow = $RestoreShadow;
1123 1003
        return(array("X1"=>$X1,"X2"=>$X2));
1124
-      }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
-      {
1004
+      } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) {
1127 1005
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128 1006
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129 1007
        $Y1 = $this->getPosArray($Value1,$AxisID);
@@ -1134,14 +1012,12 @@  discard block
 block discarded – undo
1134 1012
 
1135 1013
        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1136 1014
 
1137
-       if ( $Border )
1138
-        {
1015
+       if ( $Border ) {
1139 1016
          $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140 1017
          $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1018
         }
1142 1019
 
1143
-       if ( $AreaName != NULL )
1144
-        {
1020
+       if ( $AreaName != NULL ) {
1145 1021
          $XPos = ($X2-$X1)/2 + $X1;
1146 1022
          $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1023
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
    function drawScatterScale($Format="")
34 34
     {
35 35
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
36
+     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : false;
37 37
      $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38 38
      $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39 39
      $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59 59
      $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60 60
      $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
61
+     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : false;
62 62
      $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63 63
      $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64 64
      $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
      $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67 67
      $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68 68
      $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
69
+     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : false;
70 70
      $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
-     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
71
+     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : false;
72 72
      $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73 73
      $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74 74
      $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
      $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80 80
 
81 81
      /* Check if we have at least both one X and Y axis */
82
-     $GotXAxis = FALSE; $GotYAxis = FALSE;
82
+     $GotXAxis = false; $GotYAxis = false;
83 83
      foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84 84
       {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
85
+       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = true; }
86
+       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = true; }
87 87
       }
88 88
      if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89 89
      if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 
144 144
        if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
146
+       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = null; }
147
+       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = null; }
148
+       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = null; }
149 149
       }
150 150
 
151 151
      /* Get the default font color */
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190 190
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
-           $LastX  = NULL;
191
+           $LastX  = null;
192 192
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
193 193
             {
194 194
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
197 197
 
198 198
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
199
+             if ( $LastX != null && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
200 200
 
201 201
              if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
202 202
              if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240 240
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
-           $LastX  = NULL;
241
+           $LastX  = null;
242 242
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
243 243
             {
244 244
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
247 247
 
248 248
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
249
+             if ( $LastX != null && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
250 250
 
251 251
              if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
252 252
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290 290
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
-           $LastY  = NULL;
291
+           $LastY  = null;
292 292
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
293 293
             {
294 294
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
297 297
 
298 298
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
299
+             if ( $LastY != null && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
300 300
 
301 301
              if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
302 302
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337 337
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
-           $LastY  = NULL;
338
+           $LastY  = null;
339 339
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
340 340
             {
341 341
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
344 344
 
345 345
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
346
+             if ( $LastY != null && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
347 347
 
348 348
              if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines)) ) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); }
349 349
 
@@ -377,18 +377,18 @@  discard block
 block discarded – undo
377 377
     }
378 378
 
379 379
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
380
+   function drawScatterPlotChart($Format=null)
381 381
     {
382 382
      $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
383
+     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : false;
384 384
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385 385
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386 386
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387 387
      $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388 388
      $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
389
+     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
390
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
391
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
392 392
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393 393
 
394 394
      $Data    = $this->pDataObject->getData();
@@ -398,17 +398,17 @@  discard block
 block discarded – undo
398 398
 
399 399
      foreach($Data["ScatterSeries"] as $Key => $Series)
400 400
       {
401
-       if ( $Series["isDrawable"] == TRUE )
401
+       if ( $Series["isDrawable"] == true )
402 402
         {
403 403
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 404
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408 408
          if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409 409
           { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410 410
          else
411
-          { $Picture = NULL; }
411
+          { $Picture = null; }
412 412
 
413 413
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414 414
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
              if( isset($Series["Shape"]) )
430 430
               { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); }
431
-             elseif ( $Picture == NULL )
431
+             elseif ( $Picture == null )
432 432
               {
433 433
                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434 434
                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
@@ -442,26 +442,26 @@  discard block
 block discarded – undo
442 442
     }
443 443
 
444 444
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
445
+   function drawScatterLineChart($Format=null)
446 446
     {
447 447
      $Data		= $this->pDataObject->getData();
448 448
      $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
449
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
450
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
451 451
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452 452
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 453
 
454 454
      /* Parse all the series to draw */
455 455
      foreach($Data["ScatterSeries"] as $Key => $Series)
456 456
       {
457
-       if ( $Series["isDrawable"] == TRUE )
457
+       if ( $Series["isDrawable"] == true )
458 458
         {
459 459
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 460
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 461
          $Ticks  = $Series["Ticks"];
462 462
          $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466 466
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467 467
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
     }
494 494
 
495 495
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
496
+   function drawScatterSplineChart($Format=null)
497 497
     {
498 498
      $Data		= $this->pDataObject->getData();
499 499
      $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
500
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
501
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
502 502
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 503
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 504
 
505 505
      foreach($Data["ScatterSeries"] as $Key => $Series)
506 506
       {
507
-       if ( $Series["isDrawable"] == TRUE )
507
+       if ( $Series["isDrawable"] == true )
508 508
         {
509 509
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 510
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 511
          $Ticks  = $Series["Ticks"];
512 512
          $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516 516
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517 517
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -613,17 +613,17 @@  discard block
 block discarded – undo
613 613
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614 614
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615 615
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
616
+     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
617 617
      $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618 618
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619 619
 
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
620
+     if ( $Surrounding != null ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621 621
 
622 622
      $Data = $this->pDataObject->getData();
623 623
 
624 624
      foreach($Data["ScatterSeries"] as $Key => $Series)
625 625
       {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
626
+       if ( $Series["isDrawable"] == true && isset($Series["Picture"]))
627 627
         {
628 628
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629 629
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639 639
      foreach($Data["ScatterSeries"] as $Key => $Series)
640 640
       {
641
-       if ( $Series["isDrawable"] == TRUE )
641
+       if ( $Series["isDrawable"] == true )
642 642
         {
643 643
          if ( $Mode == LEGEND_VERTICAL )
644 644
           {
@@ -680,10 +680,10 @@  discard block
 block discarded – undo
680 680
      elseif ( $Style == LEGEND_BOX )
681 681
       $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB));
682 682
 
683
-     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
683
+     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = false;
684 684
      foreach($Data["ScatterSeries"] as $Key => $Series)
685 685
       {
686
-       if ( $Series["isDrawable"] == TRUE )
686
+       if ( $Series["isDrawable"] == true )
687 687
         {
688 688
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 689
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 
763 763
      foreach($Data["ScatterSeries"] as $Key => $Series)
764 764
       {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
765
+       if ( $Series["isDrawable"] == true && isset($Series["Picture"]))
766 766
         {
767 767
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768 768
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778 778
      foreach($Data["ScatterSeries"] as $Key => $Series)
779 779
       {
780
-       if ( $Series["isDrawable"] == TRUE )
780
+       if ( $Series["isDrawable"] == true )
781 781
         {
782 782
          if ( $Mode == LEGEND_VERTICAL )
783 783
           {
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
      foreach($Data["ScatterSeries"] as $Key => $Series)
831 831
       {
832
-       if ( $Series["isDrawable"] == TRUE )
832
+       if ( $Series["isDrawable"] == true )
833 833
         {
834 834
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 835
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
 
886 886
    function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
888
+     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : null;
889 889
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
890
+     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : null;
891 891
 
892 892
      $Data    = $this->pDataObject->getData();
893 893
      $Palette = $this->pDataObject->getPalette();
@@ -927,13 +927,13 @@  discard block
 block discarded – undo
927 927
          $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928 928
          $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929 929
          $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
930
+         if ( $Decimals == null ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931 931
          $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932 932
 
933 933
          $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934 934
          $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935 935
          $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
936
+         if ( $Decimals == null ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937 937
          $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938 938
 
939 939
          $Caption = $XValue." / ".$YValue;
@@ -959,22 +959,22 @@  discard block
 block discarded – undo
959 959
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
960 960
      $B			= isset($Format["B"]) ? $Format["B"] : 0;
961 961
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
962
+     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : null;
963 963
      $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
964
+     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : false;
965 965
      $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
-     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
966
+     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : false;
967
+     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : null;
968 968
      $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969 969
      $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970 970
      $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971 971
      $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972 972
      $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973 973
      $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
-     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
974
+     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : true;
975
+     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : false;
976 976
      $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
977
+     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : true;
978 978
      $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979 979
      $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980 980
      $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
                               "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992 992
                               "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993 993
 
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
994
+     if ( $Caption == null ) { $Caption = $Value; }
995 995
 
996 996
      $Data = $this->pDataObject->getData();
997 997
 
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061 1061
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062 1062
      $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
-     $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1063
+     $Border    = isset($Format["Border"]) ? $Format["Border"] : true;
1064 1064
      $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065 1065
      $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066 1066
      $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
@@ -1072,12 +1072,12 @@  discard block
 block discarded – undo
1072 1072
      $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073 1073
      $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074 1074
      $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
-     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1075
+     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : true;
1076 1076
 
1077 1077
      if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078 1078
 
1079 1079
      $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1080
+     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = false; }
1081 1081
 
1082 1082
      if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083 1083
 
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
          $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+       if ( $AreaName != null )
1107 1107
         {
1108 1108
          $XPos = ($X2-$X1)/2 + $X1;
1109 1109
          $YPos = ($Y2-$Y1)/2 + $Y1;
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
           }
1117 1117
          $this->pChartObject->Shadow = $RestoreShadow;
1118 1118
          $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1119
+         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = false; }
1120 1120
         }
1121 1121
 
1122 1122
        $this->pChartObject->Shadow = $RestoreShadow;
@@ -1140,14 +1140,14 @@  discard block
 block discarded – undo
1140 1140
          $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+       if ( $AreaName != null )
1144 1144
         {
1145 1145
          $XPos = ($X2-$X1)/2 + $X1;
1146 1146
          $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1147
 
1148 1148
          $this->pChartObject->Shadow = $RestoreShadow;
1149 1149
          $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1150
+         if ( $DisableShadowOnArea ) { $this->Shadow = false; }
1151 1151
         }
1152 1152
 
1153 1153
        $this->pChartObject->Shadow = $RestoreShadow;
Please login to merge, or discard this patch.