Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Utility class for browsing of user files.

Copyright: 2008 Petr Skoda (http://skodak.org)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 306 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

file_info_context_user:: (11 methods):
  __construct()
  get_file_info()
  get_area_user_private()
  get_area_user_profile()
  get_area_user_draft()
  get_area_user_backup()
  get_visible_name()
  is_writable()
  is_directory()
  get_children()
  get_parent()


Class: file_info_context_user  - X-Ref

Represents a user context in the tree navigated by {@link file_browser}.

__construct($browser, $context, $user)   X-Ref
Constructor

param: file_browser $browser
param: stdClass $context
param: stdClass $user

get_file_info($component, $filearea, $itemid, $filepath, $filename)   X-Ref
Return information about this specific context level

param: string $component componet
param: string $filearea file area
param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info|null

get_area_user_private($itemid, $filepath, $filename)   X-Ref
Get a file from user private area

param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info|null

get_area_user_profile($itemid, $filepath, $filename)   X-Ref
Get a file from user profile area

param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info|null

get_area_user_draft($itemid, $filepath, $filename)   X-Ref
Get a file from user draft area

param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info|null

get_area_user_backup($itemid, $filepath, $filename)   X-Ref
Get a file from user backup area

param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info|null

get_visible_name()   X-Ref
Returns localised visible name.

return: string

is_writable()   X-Ref
Whether or not new files or directories can be added

return: bool

is_directory()   X-Ref
Whether or not this is a directory

return: bool

get_children()   X-Ref
Returns list of children.

return: array of file_info instances

get_parent()   X-Ref
Returns parent file_info instance

return: file_info|null file_info instance or null for root