Skip to content

Commit a322b72

Browse files
authored
Merge pull request #439 from chris18890/dev
Spacing/Syntax fixes
2 parents d2305c5 + 16e212a commit a322b72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+929
-1442
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Seltzer CRM 0.5.7 - An open source CRM for hackerspaces
1+
Seltzer CRM 0.5.8 - An open source CRM for hackerspaces
22
Copyright 2009-2020 Edward L. Platt <ed@elplatt.com>
33
Distributed under GPLv3 (see COPYING for more info)
44

crm/include/form.inc.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222

2323
/**
2424
* Return the form structure for a delete confirmation form.
25-
*
2625
* @param $type The type of element to delete.
2726
* @param $id The id of the element to delete.
2827
* @return The form structure.
29-
*/
28+
*/
3029
function delete_form ($type, $id) {
3130
$function = $type . '_delete_form';
3231
if (function_exists($function)) {
@@ -37,23 +36,20 @@ function delete_form ($type, $id) {
3736

3837
/**
3938
* Return the form structure for a filtering form.
40-
*
4139
* @param $filters Array of filter keys and labels.
4240
* @param $default The default filter.
4341
* @param $action URL to submit to.
4442
* @param $get HTTP GET params to pass.
4543
* @return The form structure.
46-
*/
44+
*/
4745
function filter_form ($filters, $selected, $action, $get) {
48-
4946
// Construct hidden fields to pass GET params
5047
$hidden = array();
5148
foreach ($get as $key => $val) {
5249
if ($key != 'filter') {
5350
$hidden[$key] = $val;
5451
}
5552
}
56-
5753
$form = array(
5854
'type' => 'form'
5955
, 'method' => 'get'
@@ -78,8 +74,5 @@ function filter_form ($filters, $selected, $action, $get) {
7874
)
7975
)
8076
);
81-
8277
return $form;
8378
}
84-
85-
?>

crm/include/page.inc.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ function core_page_list () {
4646

4747
/**
4848
* Page hook. Adds member module content to a page before it is rendered.
49-
*
5049
* @param &$page_data Reference to data about the page being rendered.
5150
* @param $page_name The name of the page being rendered.
5251
* @param $options The array of options passed to theme('page').
53-
*/
52+
*/
5453
function core_page (&$page_data, $page_name, $options) {
5554

5655
$latestNews = '<p>Welcome to ' . title() . ' version ' . crm_version() . '!</p>';
@@ -102,5 +101,5 @@ function core_page (&$page_data, $page_name, $options) {
102101
$content .= theme('form', crm_get_form('module_upgrade'));
103102
page_add_content_top($page_data, $content);
104103
}
105-
}
104+
}
106105
}

crm/include/sys/command.inc.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@
2626
* @return The url to redirect to.
2727
*/
2828
function command ($command) {
29-
3029
// Initialize url and parameters
3130
$url = '';
3231
$params = array();
33-
3432
// Call legacy handler if it exists
3533
$handler = "command_$command";
3634
if (function_exists($handler)) {
3735
$res = call_user_func($handler);
38-
3936
// Split result into file and params
4037
$parts = explode('?', $res);
4138
$url = $parts[0];
@@ -49,21 +46,18 @@ function command ($command) {
4946
}
5047
}
5148
}
52-
5349
// Call the handler for each module if it exists
5450
foreach (module_list() as $module) {
5551
$handler = "{$module}_command";
5652
if (function_exists($handler)) {
5753
$handler($command, $url, $params);
5854
}
5955
}
60-
6156
// Error if the url is still empty
6257
if (empty($url)) {
6358
error_register('No such command: ' . $command);
6459
$url = crm_url();
6560
}
66-
6761
$url .= '?';
6862
$parts = array();
6963
foreach ($params as $key => $value) {

crm/include/sys/csv.inc.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,22 @@ function remove_utf8_bom($text) {
4343
* Converts csv data into a data structure. The returned value is an array
4444
* with each element representing a row of the csv. Each element is an array
4545
* with column names as keys and fields as values.
46-
*
4746
* @param $csv_data The data.
4847
* @param $row_terminate The character represening a new row.
4948
* @param $field_terminate The character representing the end of a field.
5049
* @param $field_quote The character used to quote fields.
5150
* @param $field_escape The character used to escape special characters in the field content.
52-
*
5351
* @return The data structure corresponding to the csv data.
5452
*/
5553
function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $field_quote = '"', $field_escape = "\\") {
56-
5754
$content = trim(csv_normalize($content)) . "\n";
58-
5955
$result = array();
6056
$header = array();
6157
$row = array();
62-
6358
$field = '';
6459
$is_quoted = false;
65-
6660
$in_body = false;
67-
6861
$field_index = 0;
69-
7062
$index = 0;
7163
$length = strlen($content);
7264
while ($index < $length) {
@@ -112,10 +104,7 @@ function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $fi
112104
$field = '';
113105
$is_quoted = false;
114106
$field_index++;
115-
} else if (
116-
($char == $row_terminate && !$is_quoted)
117-
|| $index === $length - 1)
118-
{
107+
} else if (($char == $row_terminate && !$is_quoted) || $index === $length - 1) {
119108
// End field or header
120109
if ($in_body) {
121110
// Body
@@ -126,7 +115,6 @@ function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $fi
126115
}
127116
$field = '';
128117
$is_quoted = false;
129-
130118
// End row
131119
$field_index = 0;
132120
if ($in_body) {
@@ -143,6 +131,5 @@ function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $fi
143131
}
144132
$index++;
145133
}
146-
147134
return $result;
148-
}
135+
}

crm/include/sys/data.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ function crm_map ($data, $key) {
8787
$map[$row[$key]] = $row;
8888
}
8989
return $map;
90-
}
90+
}

crm/include/sys/error.inc.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,24 @@
2222

2323
/**
2424
* Register an error.
25-
*
2625
* @param $error The error.
27-
*/
26+
*/
2827
function error_register ($error) {
2928
$_SESSION['errorList'][] = $error;
3029
}
3130

3231
/**
3332
* Register a message.
34-
*
3533
* @param $message The message.
36-
*/
34+
*/
3735
function message_register ($message) {
3836
$_SESSION['messageList'][] = $message;
3937
}
4038

4139
/**
4240
* Return all registered errors and clear the list.
43-
*
4441
* @return An array of error strings.
45-
*/
42+
*/
4643
function error_list () {
4744
$errors = $_SESSION['errorList'];
4845
$_SESSION['errorList'] = array();
@@ -51,9 +48,8 @@ function error_list () {
5148

5249
/**
5350
* Return all registered messages and clear the list.
54-
*
5551
* @return An array of message strings.
56-
*/
52+
*/
5753
function message_list () {
5854
$errors = $_SESSION['messageList'];
5955
$_SESSION['messageList'] = array();
@@ -62,44 +58,36 @@ function message_list () {
6258

6359
/**
6460
* @return The themed html string for any errors currently registered.
65-
*/
61+
*/
6662
function theme_errors () {
67-
6863
// Pop and check errors
6964
$errors = error_list();
7065
if (empty($errors)) {
7166
return '';
7267
}
73-
7468
$output = '<fieldset><ul>';
75-
7669
// Loop through errors
7770
foreach ($errors as $error) {
7871
$output .= '<li>' . $error . '</li>';
7972
}
80-
8173
$output .= '</ul></fieldset>';
8274
return $output;
8375
}
8476

8577
/**
8678
* @return The themed html string for any registered messages.
87-
*/
79+
*/
8880
function theme_messages () {
89-
9081
// Pop and check messages
9182
$messages = message_list();
9283
if (empty($messages)) {
9384
return '';
9485
}
95-
9686
$output = '<fieldset><ul>';
97-
9887
// Loop through errors
9988
foreach ($messages as $message) {
10089
$output .= '<li>' . $message . '</li>';
10190
}
102-
10391
$output .= '</ul></fieldset>';
10492
return $output;
10593
}

0 commit comments

Comments
 (0)