| @@ 245-256 (lines=12) @@ | ||
| 242 | * @param bool $suggestion Whether to show a suggestion or not |
|
| 243 | * @return string |
|
| 244 | */ |
|
| 245 | function check_writable($folder, $suggestion = false) |
|
| 246 | { |
|
| 247 | if (is_writable($folder)) { |
|
| 248 | return Display::label(get_lang('Writable'), 'success'); |
|
| 249 | } else { |
|
| 250 | if ($suggestion) { |
|
| 251 | return Display::label(get_lang('NotWritable'), 'info'); |
|
| 252 | } else { |
|
| 253 | return Display::label(get_lang('NotWritable'), 'important'); |
|
| 254 | } |
|
| 255 | } |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * This function checks if the given folder is readable |
|
| @@ 265-276 (lines=12) @@ | ||
| 262 | * |
|
| 263 | * @return string |
|
| 264 | */ |
|
| 265 | function checkReadable($folder, $suggestion = false) |
|
| 266 | { |
|
| 267 | if (is_readable($folder)) { |
|
| 268 | return Display::label(get_lang('Readable'), 'success'); |
|
| 269 | } else { |
|
| 270 | if ($suggestion) { |
|
| 271 | return Display::label(get_lang('NotReadable'), 'info'); |
|
| 272 | } else { |
|
| 273 | return Display::label(get_lang('NotReadable'), 'important'); |
|
| 274 | } |
|
| 275 | } |
|
| 276 | } |
|
| 277 | ||
| 278 | /** |
|
| 279 | * This function is similar to the core file() function, except that it |
|