@@ -774,10 +774,12 @@ discard block |
||
774 | 774 | public static function update_openid($user_id, $openid) |
775 | 775 | { |
776 | 776 | $table_user = Database :: get_main_table(TABLE_MAIN_USER); |
777 | - if ($user_id != strval(intval($user_id))) |
|
778 | - return false; |
|
779 | - if ($user_id === false) |
|
780 | - return false; |
|
777 | + if ($user_id != strval(intval($user_id))) { |
|
778 | + return false; |
|
779 | + } |
|
780 | + if ($user_id === false) { |
|
781 | + return false; |
|
782 | + } |
|
781 | 783 | $sql = "UPDATE $table_user SET |
782 | 784 | openid='".Database::escape_string($openid)."'"; |
783 | 785 | $sql .= " WHERE id= $user_id"; |
@@ -2069,8 +2071,9 @@ discard block |
||
2069 | 2071 | if (empty($user_id)) { |
2070 | 2072 | $user_id = 0; |
2071 | 2073 | } else { |
2072 | - if ($user_id != strval(intval($user_id))) |
|
2073 | - return array(); |
|
2074 | + if ($user_id != strval(intval($user_id))) { |
|
2075 | + return array(); |
|
2076 | + } |
|
2074 | 2077 | } |
2075 | 2078 | $extra_data = array(); |
2076 | 2079 | $t_uf = Database::get_main_table(TABLE_EXTRA_FIELD); |
@@ -2162,8 +2165,9 @@ discard block |
||
2162 | 2165 | if (empty($user_id)) { |
2163 | 2166 | $user_id = 0; |
2164 | 2167 | } else { |
2165 | - if ($user_id != strval(intval($user_id))) |
|
2166 | - return array(); |
|
2168 | + if ($user_id != strval(intval($user_id))) { |
|
2169 | + return array(); |
|
2170 | + } |
|
2167 | 2171 | } |
2168 | 2172 | $extra_data = array(); |
2169 | 2173 | $t_uf = Database::get_main_table(TABLE_EXTRA_FIELD); |
@@ -2880,13 +2884,15 @@ discard block |
||
2880 | 2884 | */ |
2881 | 2885 | public static function get_api_keys($user_id = null, $api_service = 'dokeos') |
2882 | 2886 | { |
2883 | - if ($user_id != strval(intval($user_id))) |
|
2884 | - return false; |
|
2887 | + if ($user_id != strval(intval($user_id))) { |
|
2888 | + return false; |
|
2889 | + } |
|
2885 | 2890 | if (empty($user_id)) { |
2886 | 2891 | $user_id = api_get_user_id(); |
2887 | 2892 | } |
2888 | - if ($user_id === false) |
|
2889 | - return false; |
|
2893 | + if ($user_id === false) { |
|
2894 | + return false; |
|
2895 | + } |
|
2890 | 2896 | $service_name = Database::escape_string($api_service); |
2891 | 2897 | if (is_string($service_name) === false) { |
2892 | 2898 | return false; |
@@ -2894,11 +2900,14 @@ discard block |
||
2894 | 2900 | $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY); |
2895 | 2901 | $sql = "SELECT * FROM $t_api WHERE user_id = $user_id AND api_service='$api_service';"; |
2896 | 2902 | $res = Database::query($sql); |
2897 | - if ($res === false) |
|
2898 | - return false; //error during query |
|
2903 | + if ($res === false) { |
|
2904 | + return false; |
|
2905 | + } |
|
2906 | + //error during query |
|
2899 | 2907 | $num = Database::num_rows($res); |
2900 | - if ($num == 0) |
|
2901 | - return false; |
|
2908 | + if ($num == 0) { |
|
2909 | + return false; |
|
2910 | + } |
|
2902 | 2911 | $list = array(); |
2903 | 2912 | while ($row = Database::fetch_array($res)) { |
2904 | 2913 | $list[$row['id']] = $row['api_key']; |
@@ -2913,13 +2922,15 @@ discard block |
||
2913 | 2922 | */ |
2914 | 2923 | public static function add_api_key($user_id = null, $api_service = 'dokeos') |
2915 | 2924 | { |
2916 | - if ($user_id != strval(intval($user_id))) |
|
2917 | - return false; |
|
2925 | + if ($user_id != strval(intval($user_id))) { |
|
2926 | + return false; |
|
2927 | + } |
|
2918 | 2928 | if (empty($user_id)) { |
2919 | 2929 | $user_id = api_get_user_id(); |
2920 | 2930 | } |
2921 | - if ($user_id === false) |
|
2922 | - return false; |
|
2931 | + if ($user_id === false) { |
|
2932 | + return false; |
|
2933 | + } |
|
2923 | 2934 | $service_name = Database::escape_string($api_service); |
2924 | 2935 | if (is_string($service_name) === false) { |
2925 | 2936 | return false; |
@@ -2928,8 +2939,10 @@ discard block |
||
2928 | 2939 | $md5 = md5((time() + ($user_id * 5)) - rand(10000, 10000)); //generate some kind of random key |
2929 | 2940 | $sql = "INSERT INTO $t_api (user_id, api_key,api_service) VALUES ($user_id,'$md5','$service_name')"; |
2930 | 2941 | $res = Database::query($sql); |
2931 | - if ($res === false) |
|
2932 | - return false; //error during query |
|
2942 | + if ($res === false) { |
|
2943 | + return false; |
|
2944 | + } |
|
2945 | + //error during query |
|
2933 | 2946 | $num = Database::insert_id(); |
2934 | 2947 | return ($num == 0) ? false : $num; |
2935 | 2948 | } |
@@ -2941,22 +2954,29 @@ discard block |
||
2941 | 2954 | */ |
2942 | 2955 | public static function delete_api_key($key_id) |
2943 | 2956 | { |
2944 | - if ($key_id != strval(intval($key_id))) |
|
2945 | - return false; |
|
2946 | - if ($key_id === false) |
|
2947 | - return false; |
|
2957 | + if ($key_id != strval(intval($key_id))) { |
|
2958 | + return false; |
|
2959 | + } |
|
2960 | + if ($key_id === false) { |
|
2961 | + return false; |
|
2962 | + } |
|
2948 | 2963 | $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY); |
2949 | 2964 | $sql = "SELECT * FROM $t_api WHERE id = ".$key_id; |
2950 | 2965 | $res = Database::query($sql); |
2951 | - if ($res === false) |
|
2952 | - return false; //error during query |
|
2966 | + if ($res === false) { |
|
2967 | + return false; |
|
2968 | + } |
|
2969 | + //error during query |
|
2953 | 2970 | $num = Database::num_rows($res); |
2954 | - if ($num !== 1) |
|
2955 | - return false; |
|
2971 | + if ($num !== 1) { |
|
2972 | + return false; |
|
2973 | + } |
|
2956 | 2974 | $sql = "DELETE FROM $t_api WHERE id = ".$key_id; |
2957 | 2975 | $res = Database::query($sql); |
2958 | - if ($res === false) |
|
2959 | - return false; //error during query |
|
2976 | + if ($res === false) { |
|
2977 | + return false; |
|
2978 | + } |
|
2979 | + //error during query |
|
2960 | 2980 | return true; |
2961 | 2981 | } |
2962 | 2982 | |
@@ -2968,10 +2988,12 @@ discard block |
||
2968 | 2988 | */ |
2969 | 2989 | public static function update_api_key($user_id, $api_service) |
2970 | 2990 | { |
2971 | - if ($user_id != strval(intval($user_id))) |
|
2972 | - return false; |
|
2973 | - if ($user_id === false) |
|
2974 | - return false; |
|
2991 | + if ($user_id != strval(intval($user_id))) { |
|
2992 | + return false; |
|
2993 | + } |
|
2994 | + if ($user_id === false) { |
|
2995 | + return false; |
|
2996 | + } |
|
2975 | 2997 | $service_name = Database::escape_string($api_service); |
2976 | 2998 | if (is_string($service_name) === false) { |
2977 | 2999 | return false; |
@@ -2997,12 +3019,15 @@ discard block |
||
2997 | 3019 | */ |
2998 | 3020 | public static function get_api_key_id($user_id, $api_service) |
2999 | 3021 | { |
3000 | - if ($user_id != strval(intval($user_id))) |
|
3001 | - return false; |
|
3002 | - if ($user_id === false) |
|
3003 | - return false; |
|
3004 | - if (empty($api_service)) |
|
3005 | - return false; |
|
3022 | + if ($user_id != strval(intval($user_id))) { |
|
3023 | + return false; |
|
3024 | + } |
|
3025 | + if ($user_id === false) { |
|
3026 | + return false; |
|
3027 | + } |
|
3028 | + if (empty($api_service)) { |
|
3029 | + return false; |
|
3030 | + } |
|
3006 | 3031 | $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY); |
3007 | 3032 | $api_service = Database::escape_string($api_service); |
3008 | 3033 | $sql = "SELECT id FROM $t_api WHERE user_id=".$user_id." AND api_service='".$api_service."'"; |
@@ -4473,8 +4498,9 @@ discard block |
||
4473 | 4498 | $form->applyFilter('extra_'.$field_details[1], 'stripslashes'); |
4474 | 4499 | $form->applyFilter('extra_'.$field_details[1], 'trim'); |
4475 | 4500 | if (!$admin_permissions) { |
4476 | - if ($field_details[7] == 0) |
|
4477 | - $form->freeze('extra_'.$field_details[1]); |
|
4501 | + if ($field_details[7] == 0) { |
|
4502 | + $form->freeze('extra_'.$field_details[1]); |
|
4503 | + } |
|
4478 | 4504 | } |
4479 | 4505 | break; |
4480 | 4506 | case ExtraField::FIELD_TYPE_RADIO: |
@@ -4491,8 +4517,9 @@ discard block |
||
4491 | 4517 | } |
4492 | 4518 | $form->addGroup($group, 'extra_'.$field_details[1], $field_details[3], ''); |
4493 | 4519 | if (!$admin_permissions) { |
4494 | - if ($field_details[7] == 0) |
|
4495 | - $form->freeze('extra_'.$field_details[1]); |
|
4520 | + if ($field_details[7] == 0) { |
|
4521 | + $form->freeze('extra_'.$field_details[1]); |
|
4522 | + } |
|
4496 | 4523 | } |
4497 | 4524 | break; |
4498 | 4525 | case ExtraField::FIELD_TYPE_SELECT: |
@@ -4530,8 +4557,9 @@ discard block |
||
4530 | 4557 | ); |
4531 | 4558 | |
4532 | 4559 | if (!$admin_permissions) { |
4533 | - if ($field_details[7] == 0) |
|
4534 | - $form->freeze('extra_'.$field_details[1]); |
|
4560 | + if ($field_details[7] == 0) { |
|
4561 | + $form->freeze('extra_'.$field_details[1]); |
|
4562 | + } |
|
4535 | 4563 | } |
4536 | 4564 | break; |
4537 | 4565 | case ExtraField::FIELD_TYPE_SELECT_MULTIPLE: |
@@ -4547,8 +4575,9 @@ discard block |
||
4547 | 4575 | array('multiple' => 'multiple') |
4548 | 4576 | ); |
4549 | 4577 | if (!$admin_permissions) { |
4550 | - if ($field_details[7] == 0) |
|
4551 | - $form->freeze('extra_'.$field_details[1]); |
|
4578 | + if ($field_details[7] == 0) { |
|
4579 | + $form->freeze('extra_'.$field_details[1]); |
|
4580 | + } |
|
4552 | 4581 | } |
4553 | 4582 | break; |
4554 | 4583 | case ExtraField::FIELD_TYPE_DATE: |
@@ -4556,8 +4585,9 @@ discard block |
||
4556 | 4585 | $defaults['extra_'.$field_details[1]] = date('Y-m-d 12:00:00'); |
4557 | 4586 | $form->setDefaults($defaults); |
4558 | 4587 | if (!$admin_permissions) { |
4559 | - if ($field_details[7] == 0) |
|
4560 | - $form->freeze('extra_'.$field_details[1]); |
|
4588 | + if ($field_details[7] == 0) { |
|
4589 | + $form->freeze('extra_'.$field_details[1]); |
|
4590 | + } |
|
4561 | 4591 | } |
4562 | 4592 | $form->applyFilter('theme', 'trim'); |
4563 | 4593 | break; |
@@ -4566,8 +4596,9 @@ discard block |
||
4566 | 4596 | $defaults['extra_'.$field_details[1]] = date('Y-m-d 12:00:00'); |
4567 | 4597 | $form->setDefaults($defaults); |
4568 | 4598 | if (!$admin_permissions) { |
4569 | - if ($field_details[7] == 0) |
|
4570 | - $form->freeze('extra_'.$field_details[1]); |
|
4599 | + if ($field_details[7] == 0) { |
|
4600 | + $form->freeze('extra_'.$field_details[1]); |
|
4601 | + } |
|
4571 | 4602 | } |
4572 | 4603 | $form->applyFilter('theme', 'trim'); |
4573 | 4604 | break; |
@@ -4586,8 +4617,9 @@ discard block |
||
4586 | 4617 | $form->addGroup($group, 'extra_'.$field_details[1], $field_details[3], ' '); |
4587 | 4618 | |
4588 | 4619 | if (!$admin_permissions) { |
4589 | - if ($field_details[7] == 0) |
|
4590 | - $form->freeze('extra_'.$field_details[1]); |
|
4620 | + if ($field_details[7] == 0) { |
|
4621 | + $form->freeze('extra_'.$field_details[1]); |
|
4622 | + } |
|
4591 | 4623 | } |
4592 | 4624 | |
4593 | 4625 | /* Recoding the selected values for double : if the user has |
@@ -4647,8 +4679,9 @@ discard block |
||
4647 | 4679 | break; |
4648 | 4680 | case ExtraField::FIELD_TYPE_TIMEZONE: |
4649 | 4681 | $form->addElement('select', 'extra_'.$field_details[1], $field_details[3], api_get_timezones(), ''); |
4650 | - if ($field_details[7] == 0) |
|
4651 | - $form->freeze('extra_'.$field_details[1]); |
|
4682 | + if ($field_details[7] == 0) { |
|
4683 | + $form->freeze('extra_'.$field_details[1]); |
|
4684 | + } |
|
4652 | 4685 | break; |
4653 | 4686 | case ExtraField::FIELD_TYPE_SOCIAL_PROFILE: |
4654 | 4687 | // get the social network's favicon |
@@ -4673,8 +4706,9 @@ discard block |
||
4673 | 4706 | ); |
4674 | 4707 | $form->applyFilter('extra_'.$field_details[1], 'stripslashes'); |
4675 | 4708 | $form->applyFilter('extra_'.$field_details[1], 'trim'); |
4676 | - if ($field_details[7] == 0) |
|
4677 | - $form->freeze('extra_'.$field_details[1]); |
|
4709 | + if ($field_details[7] == 0) { |
|
4710 | + $form->freeze('extra_'.$field_details[1]); |
|
4711 | + } |
|
4678 | 4712 | break; |
4679 | 4713 | case ExtraField::FIELD_TYPE_FILE: |
4680 | 4714 | $extra_field = 'extra_'.$field_details[1]; |
@@ -4991,8 +5025,9 @@ discard block |
||
4991 | 5025 | $url .= "?s=$s&d=$d&r=$r"; |
4992 | 5026 | if ( $img ) { |
4993 | 5027 | $url = '<img src="' . $url . '"'; |
4994 | - foreach ( $atts as $key => $val ) |
|
4995 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
5028 | + foreach ( $atts as $key => $val ) { |
|
5029 | + $url .= ' ' . $key . '="' . $val . '"'; |
|
5030 | + } |
|
4996 | 5031 | $url .= ' />'; |
4997 | 5032 | } |
4998 | 5033 | return $url; |
@@ -29,8 +29,9 @@ |
||
29 | 29 | while (($file = readdir($dh)) !== false) { |
30 | 30 | if ($file[0] <> '.' && substr($file, -4, strlen($file)) == '.php') { |
31 | 31 | if ($only_main_name) { |
32 | - if ($file != '' && strpos($file, '.inc.php')) |
|
33 | - $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
32 | + if ($file != '' && strpos($file, '.inc.php')) { |
|
33 | + $content_dir[] = substr($file, 0, strpos($file, '.inc.php')); |
|
34 | + } |
|
34 | 35 | } else { |
35 | 36 | $content_dir[] = $file; |
36 | 37 | } |
@@ -594,7 +594,7 @@ |
||
594 | 594 | if (!empty($limit_array)) { |
595 | 595 | if (count($limit_array) > 1) { |
596 | 596 | $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]); |
597 | - } else { |
|
597 | + } else { |
|
598 | 598 | $return_value .= ' LIMIT '.intval($limit_array[0]); |
599 | 599 | } |
600 | 600 | } |
@@ -65,8 +65,7 @@ |
||
65 | 65 | if (strpos($filename, "svg")){ |
66 | 66 | $new_sizes['width'] = 60; |
67 | 67 | $new_sizes['height'] = 60; |
68 | - } |
|
69 | - else { |
|
68 | + } else { |
|
70 | 69 | $new_sizes = api_resize_image($image, 60, 60); |
71 | 70 | } |
72 | 71 |
@@ -158,8 +158,9 @@ discard block |
||
158 | 158 | $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo')); |
159 | 159 | |
160 | 160 | $setting = ini_get('default_charset'); |
161 | - if ($setting == '') |
|
162 | - $setting = null; |
|
161 | + if ($setting == '') { |
|
162 | + $setting = null; |
|
163 | + } |
|
163 | 164 | $req_setting = null; |
164 | 165 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR; |
165 | 166 | $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo')); |
@@ -177,22 +178,25 @@ discard block |
||
177 | 178 | $setting = ini_get('memory_limit'); |
178 | 179 | $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M'; |
179 | 180 | $status = self :: STATUS_ERROR; |
180 | - if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) |
|
181 | - $status = self :: STATUS_OK; |
|
181 | + if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) { |
|
182 | + $status = self :: STATUS_OK; |
|
183 | + } |
|
182 | 184 | $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo')); |
183 | 185 | |
184 | 186 | $setting = ini_get('post_max_size'); |
185 | 187 | $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M'; |
186 | 188 | $status = self :: STATUS_ERROR; |
187 | - if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) |
|
188 | - $status = self :: STATUS_OK; |
|
189 | + if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) { |
|
190 | + $status = self :: STATUS_OK; |
|
191 | + } |
|
189 | 192 | $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo')); |
190 | 193 | |
191 | 194 | $setting = ini_get('upload_max_filesize'); |
192 | 195 | $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M'; |
193 | 196 | $status = self :: STATUS_ERROR; |
194 | - if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) |
|
195 | - $status = self :: STATUS_OK; |
|
197 | + if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) { |
|
198 | + $status = self :: STATUS_OK; |
|
199 | + } |
|
196 | 200 | $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo')); |
197 | 201 | |
198 | 202 | $setting = ini_get('variables_order'); |
@@ -205,7 +209,7 @@ discard block |
||
205 | 209 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING; |
206 | 210 | $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo')); |
207 | 211 | |
208 | - if (api_check_browscap()){$setting = true;}else{$setting=false;} |
|
212 | + if (api_check_browscap()){$setting = true;} else{$setting=false;} |
|
209 | 213 | $req_setting = true; |
210 | 214 | $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING; |
211 | 215 | $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo')); |
@@ -143,8 +143,9 @@ |
||
143 | 143 | |
144 | 144 | // SMTP server can take longer to respond, give longer timeout for first read |
145 | 145 | // Windows does not have support for this timeout function |
146 | - if(substr(PHP_OS, 0, 3) != "WIN") |
|
147 | - socket_set_timeout($this->smtp_conn, $tval, 0); |
|
146 | + if(substr(PHP_OS, 0, 3) != "WIN") { |
|
147 | + socket_set_timeout($this->smtp_conn, $tval, 0); |
|
148 | + } |
|
148 | 149 | |
149 | 150 | // get any announcement |
150 | 151 | $announce = $this->get_lines(); |
@@ -38,7 +38,9 @@ discard block |
||
38 | 38 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License |
39 | 39 | */ |
40 | 40 | |
41 | -if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n"); |
|
41 | +if (version_compare(PHP_VERSION, '5.0.0', '<') ) { |
|
42 | + exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n"); |
|
43 | +} |
|
42 | 44 | |
43 | 45 | class PHPMailer { |
44 | 46 | |
@@ -1502,8 +1504,9 @@ discard block |
||
1502 | 1504 | case '8bit': |
1503 | 1505 | $encoded = $this->FixEOL($str); |
1504 | 1506 | //Make sure it ends with a line break |
1505 | - if (substr($encoded, -(strlen($this->LE))) != $this->LE) |
|
1506 | - $encoded .= $this->LE; |
|
1507 | + if (substr($encoded, -(strlen($this->LE))) != $this->LE) { |
|
1508 | + $encoded .= $this->LE; |
|
1509 | + } |
|
1507 | 1510 | break; |
1508 | 1511 | case 'binary': |
1509 | 1512 | $encoded = $str; |
@@ -2264,7 +2267,9 @@ discard block |
||
2264 | 2267 | * @param string $body Message Body |
2265 | 2268 | */ |
2266 | 2269 | public function DKIM_BodyC($body) { |
2267 | - if ($body == '') return "\r\n"; |
|
2270 | + if ($body == '') { |
|
2271 | + return "\r\n"; |
|
2272 | + } |
|
2268 | 2273 | // stabilize line endings |
2269 | 2274 | $body=str_replace("\r\n","\n",$body); |
2270 | 2275 | $body=str_replace("\n","\r\n",$body); |
@@ -219,10 +219,10 @@ |
||
219 | 219 | // action links |
220 | 220 | echo '<div class="actions">'; |
221 | 221 | if (!api_is_anonymous()) { |
222 | - if (api_get_session_id() == 0) |
|
223 | - echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
222 | + if (api_get_session_id() == 0) { |
|
223 | + echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
|
224 | 224 | Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
225 | - elseif (api_is_allowed_to_session_edit(false, true)) { |
|
225 | + } elseif (api_is_allowed_to_session_edit(false, true)) { |
|
226 | 226 | echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . |
227 | 227 | Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; |
228 | 228 | } |
@@ -666,9 +666,10 @@ |
||
666 | 666 | $result = ''; |
667 | 667 | for ($i = $min; $i <= $max; $i ++) { |
668 | 668 | $result .= '<option value="'.$i.'"'; |
669 | - if (is_int($selected_num)) |
|
670 | - if ($selected_num == $i) { |
|
669 | + if (is_int($selected_num)) { |
|
670 | + if ($selected_num == $i) { |
|
671 | 671 | $result .= ' selected="selected"'; |
672 | + } |
|
672 | 673 | } |
673 | 674 | $result .= '>'.$i.'</option>'; |
674 | 675 | } |