@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | - * This function is for editing profile info from profile_id. |
|
37 | - * @param int $profileId |
|
38 | - * @param string $name |
|
39 | - * @param string $description |
|
40 | - */ |
|
36 | + * This function is for editing profile info from profile_id. |
|
37 | + * @param int $profileId |
|
38 | + * @param string $name |
|
39 | + * @param string $description |
|
40 | + */ |
|
41 | 41 | public function updateProfileInfo($profileId, $name, $description) |
42 | 42 | { |
43 | 43 | $profileId = intval($profileId); |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * This function is for getting profile info from profile_id. |
|
132 | - * @param int $profileId |
|
133 | - */ |
|
131 | + * This function is for getting profile info from profile_id. |
|
132 | + * @param int $profileId |
|
133 | + */ |
|
134 | 134 | |
135 | 135 | public function getProfileInfo($profileId) |
136 | 136 | { |
@@ -150,7 +150,7 @@ |
||
150 | 150 | $data = substr($png,$ipos,$chunk['size']); |
151 | 151 | $sections = explode("\0", $data); |
152 | 152 | if ($sections[0] == $key) { |
153 | - return $sections; |
|
153 | + return $sections; |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | // Extract the data and the CRC |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | class DateRangePicker extends HTML_QuickForm_text |
8 | 8 | { |
9 | 9 | /** |
10 | - * Constructor |
|
11 | - */ |
|
10 | + * Constructor |
|
11 | + */ |
|
12 | 12 | public function __construct($elementName = null, $elementLabel = null, $attributes = null) |
13 | 13 | { |
14 | 14 | if (!isset($attributes['id'])) { |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * @param array $dates result of parseDateRange() |
|
148 | - * |
|
149 | - * @return bool |
|
150 | - */ |
|
147 | + * @param array $dates result of parseDateRange() |
|
148 | + * |
|
149 | + * @return bool |
|
150 | + */ |
|
151 | 151 | public function validateDates($dates, $format = null) |
152 | 152 | { |
153 | 153 | if (empty($dates['start']) || empty($dates['end'])) { |
@@ -74,9 +74,9 @@ |
||
74 | 74 | $styleCss = $this->editor->getConfigAttribute('style'); |
75 | 75 | |
76 | 76 | if ($styleCss) { |
77 | - $style = true; |
|
77 | + $style = true; |
|
78 | 78 | } else { |
79 | - $style = false; |
|
79 | + $style = false; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return $this->buildEditor($style); |
@@ -7,16 +7,16 @@ |
||
7 | 7 | */ |
8 | 8 | class HTML_QuickForm_Rule_Date extends HTML_QuickForm_Rule |
9 | 9 | { |
10 | - /** |
|
11 | - * Check a date |
|
12 | - * @see HTML_QuickForm_Rule |
|
13 | - * @param string $date example 2014-04-30 |
|
10 | + /** |
|
11 | + * Check a date |
|
12 | + * @see HTML_QuickForm_Rule |
|
13 | + * @param string $date example 2014-04-30 |
|
14 | 14 | * @param array $options |
15 | 15 | * |
16 | - * @return boolean True if date is valid |
|
17 | - */ |
|
18 | - public function validate($date, $options) |
|
19 | - { |
|
16 | + * @return boolean True if date is valid |
|
17 | + */ |
|
18 | + public function validate($date, $options) |
|
19 | + { |
|
20 | 20 | return api_is_valid_date($date, 'Y-m-d'); |
21 | - } |
|
21 | + } |
|
22 | 22 | } |
@@ -6,24 +6,24 @@ |
||
6 | 6 | */ |
7 | 7 | class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule |
8 | 8 | { |
9 | - /** |
|
10 | - * Function to check if a username is available |
|
11 | - * @see HTML_QuickForm_Rule |
|
12 | - * @param string $username Wanted username |
|
13 | - * @param string $current_username |
|
14 | - * @return boolean True if username is available |
|
15 | - */ |
|
16 | - function validate($username, $current_username = null) { |
|
17 | - $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
9 | + /** |
|
10 | + * Function to check if a username is available |
|
11 | + * @see HTML_QuickForm_Rule |
|
12 | + * @param string $username Wanted username |
|
13 | + * @param string $current_username |
|
14 | + * @return boolean True if username is available |
|
15 | + */ |
|
16 | + function validate($username, $current_username = null) { |
|
17 | + $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
18 | 18 | $username = Database::escape_string($username); |
19 | 19 | $current_username = Database::escape_string($current_username); |
20 | 20 | |
21 | - $sql = "SELECT * FROM $user_table WHERE username = '$username'"; |
|
22 | - if (!is_null($current_username)) { |
|
23 | - $sql .= " AND username != '$current_username'"; |
|
24 | - } |
|
25 | - $res = Database::query($sql); |
|
26 | - $number = Database::num_rows($res); |
|
27 | - return $number == 0; |
|
28 | - } |
|
21 | + $sql = "SELECT * FROM $user_table WHERE username = '$username'"; |
|
22 | + if (!is_null($current_username)) { |
|
23 | + $sql .= " AND username != '$current_username'"; |
|
24 | + } |
|
25 | + $res = Database::query($sql); |
|
26 | + $number = Database::num_rows($res); |
|
27 | + return $number == 0; |
|
28 | + } |
|
29 | 29 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @return boolean True if the 2 given dates match the operator |
13 | 13 | */ |
14 | 14 | function validate($values, $operator = null) { |
15 | - $datetime1 = api_strtotime($values[0]); |
|
15 | + $datetime1 = api_strtotime($values[0]); |
|
16 | 16 | $datetime2 = api_strtotime($values[1]); |
17 | 17 | |
18 | 18 | if (strpos($operator, 'allow_empty') !== false) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | return true; |
22 | 22 | } |
23 | 23 | } |
24 | - $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
24 | + $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
25 | 25 | return $result; |
26 | 26 | } |
27 | 27 | } |
@@ -27,10 +27,10 @@ |
||
27 | 27 | */ |
28 | 28 | function validate($value, $options = null) |
29 | 29 | { |
30 | - if(is_array($value)) |
|
31 | - { |
|
32 | - $value = implode(null,$value); |
|
33 | - } |
|
30 | + if(is_array($value)) |
|
31 | + { |
|
32 | + $value = implode(null,$value); |
|
33 | + } |
|
34 | 34 | if ((string)$value == '') { |
35 | 35 | return false; |
36 | 36 | } |
@@ -9,18 +9,18 @@ |
||
9 | 9 | class HTML_QuickForm_Rule_FileName extends HTML_QuickForm_Rule |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * @param $value array Uploaded file info (from $_FILES) |
|
14 | - * @param null $options |
|
15 | - * @return bool |
|
16 | - */ |
|
17 | - public function validate($value, $options = null) |
|
18 | - { |
|
19 | - if ((isset($elementValue['error']) && $elementValue['error'] == 0) || |
|
20 | - (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) { |
|
21 | - return is_uploaded_file($elementValue['tmp_name']); |
|
22 | - } else { |
|
23 | - return false; |
|
24 | - } |
|
25 | - } |
|
12 | + /** |
|
13 | + * @param $value array Uploaded file info (from $_FILES) |
|
14 | + * @param null $options |
|
15 | + * @return bool |
|
16 | + */ |
|
17 | + public function validate($value, $options = null) |
|
18 | + { |
|
19 | + if ((isset($elementValue['error']) && $elementValue['error'] == 0) || |
|
20 | + (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) { |
|
21 | + return is_uploaded_file($elementValue['tmp_name']); |
|
22 | + } else { |
|
23 | + return false; |
|
24 | + } |
|
25 | + } |
|
26 | 26 | } |