Moodle  2.2.1
http://www.collinsharper.com
file_info_stored Class Reference
Inheritance diagram for file_info_stored:
Collaboration diagram for file_info_stored:

Public Member Functions

 __construct (file_browser $browser, $context, $storedfile, $urlbase, $topvisiblename, $itemidused, $readaccess, $writeaccess, $areaonly)
 get_params ()
 get_visible_name ()
 get_url ($forcedownload=false, $https=false)
 is_readable ()
 is_writable ()
 is_empty_area ()
 get_filesize ()
 get_mimetype ()
 get_timecreated ()
 get_timemodified ()
 is_directory ()
 get_license ()
 get_author ()
 get_source ()
 get_sortorder ()
 get_children ()
 get_parent ()
 create_directory ($newdirname, $userid=NULL)
 create_file_from_string ($newfilename, $content, $userid=NULL)
 create_file_from_pathname ($newfilename, $pathname, $userid=NULL)
 create_file_from_storedfile ($newfilename, $fid, $userid=NULL)
 delete ()
 copy_to_storage ($contextid, $component, $filearea, $itemid, $filepath, $filename)
 copy_to_pathname ($pathname)

Protected Attributes

 $lf
 $urlbase
 $topvisiblename
 $itemidused
 $readaccess
 $writeaccess
 $areaonly

Detailed Description

Definition at line 39 of file file_info_stored.php.


Constructor & Destructor Documentation

__construct ( file_browser browser,
context,
storedfile,
urlbase,
topvisiblename,
itemidused,
readaccess,
writeaccess,
areaonly 
)

Constructor

Parameters:
file_browser$browser
stdClass$context
stored_file | virtual_root_file$storedfile
string$urlbasethe serving script - usually the $CFG->wwwroot/.'pluginfile.php'
string$topvisiblenamethe human readable name of this area
int | bool$itemidusedfalse if itemid always 0 and not included in URL
bool$readaccessallow file reading
bool$writeaccessallow file write, delete
string$areaonlydo not show links to parent context/area

Definition at line 61 of file file_info_stored.php.


Member Function Documentation

copy_to_pathname ( pathname)

Copy content of this file to local storage, overriding current file if needed.

Parameters:
string$pathnamereal local full file name
Returns:
boolean success

Reimplemented from file_info.

Definition at line 514 of file file_info_stored.php.

Here is the call graph for this function:

copy_to_storage ( contextid,
component,
filearea,
itemid,
filepath,
filename 
)

Copy content of this file to local storage, overriding current file if needed.

Parameters:
int$contextid
string$filearea
int$itemid
string$filepath
string$filename
Returns:
boolean success

Reimplemented from file_info.

Definition at line 494 of file file_info_stored.php.

Here is the call graph for this function:

create_directory ( newdirname,
userid = NULL 
)

Create new directory, may throw exception - make sure params are valid.

Parameters:
string$newdirnamename of new directory
intid of author, default $USER->id
Returns:
file_info new directory

Reimplemented from file_info.

Definition at line 303 of file file_info_stored.php.

Here is the call graph for this function:

create_file_from_pathname ( newfilename,
pathname,
userid = NULL 
)

Create new file from pathname - make sure params are valid.

Parameters:
string$newfilenamename of new file
string$pathnamelocation of file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented from file_info.

Definition at line 378 of file file_info_stored.php.

Here is the call graph for this function:

create_file_from_storedfile ( newfilename,
fid,
userid = NULL 
)

Create new file from stored file - make sure params are valid.

Parameters:
string$newfilenamename of new file
mixedfile id or stored_file of file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented from file_info.

Definition at line 424 of file file_info_stored.php.

Here is the call graph for this function:

create_file_from_string ( newfilename,
content,
userid = NULL 
)

Create new file from string - make sure params are valid.

Parameters:
string$newfilenamename of new file
string$contentof file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented from file_info.

Definition at line 332 of file file_info_stored.php.

Here is the call graph for this function:

delete ( )

Delete file, make sure file is deletable first.

Returns:
bool success

Reimplemented from file_info.

Definition at line 466 of file file_info_stored.php.

Here is the call graph for this function:

Returns the author name of the file

Returns:
string author name or null

Reimplemented from file_info.

Definition at line 225 of file file_info_stored.php.

Returns list of children.

Returns:
array of file_info instances

Reimplemented from file_info.

Reimplemented in file_info_area_course_legacy.

Definition at line 249 of file file_info_stored.php.

Here is the call graph for this function:

Returns file size in bytes, null for directories

Returns:
int bytes or null if not known

Reimplemented from file_info.

Definition at line 177 of file file_info_stored.php.

Returns the license type of the file

Returns:
string license short name or null

Reimplemented from file_info.

Definition at line 217 of file file_info_stored.php.

Returns mimetype

Returns:
string mimetype or null if not known

Reimplemented from file_info.

Definition at line 185 of file file_info_stored.php.

Returns list of standard virtual file/directory identification. The difference from stored_file parameters is that null values are allowed in all fields

Returns:
array with keys contextid, component, filearea, itemid, filepath and filename

Reimplemented from file_info.

Definition at line 79 of file file_info_stored.php.

Returns parent file_info instance

Returns:
file_info or null for root

Reimplemented from file_info.

Reimplemented in resource_content_file_info, scorm_package_file_info, page_content_file_info, and folder_content_file_info.

Definition at line 271 of file file_info_stored.php.

Returns the sort order of the file

Returns:
int

Reimplemented from file_info.

Definition at line 241 of file file_info_stored.php.

Returns the source of the file

Returns:
string a source url or null

Reimplemented from file_info.

Definition at line 233 of file file_info_stored.php.

Returns time created unix timestamp if known

Returns:
int timestamp or null

Reimplemented from file_info.

Definition at line 193 of file file_info_stored.php.

Returns time modified unix timestamp if known

Returns:
int timestamp or null

Reimplemented from file_info.

Definition at line 201 of file file_info_stored.php.

get_url ( forcedownload = false,
https = false 
)

Returns file download url

Parameters:
bool$forcedownload
bool$httsforce https
Returns:
string url

Reimplemented from file_info.

Reimplemented in file_info_area_course_legacy.

Definition at line 117 of file file_info_stored.php.

Here is the call graph for this function:

Returns localised visible name.

Returns:
string

Reimplemented from file_info.

Reimplemented in resource_content_file_info, scorm_package_file_info, page_content_file_info, and folder_content_file_info.

Definition at line 92 of file file_info_stored.php.

Is directory?

Returns:
bool

Reimplemented from file_info.

Definition at line 209 of file file_info_stored.php.

Here is the caller graph for this function:

Is this top of empty area?

Returns:
bool

Reimplemented from file_info.

Definition at line 163 of file file_info_stored.php.

Here is the call graph for this function:

Can I read content of this file or enter directory?

Returns:
bool

Reimplemented from file_info.

Definition at line 146 of file file_info_stored.php.

Here is the caller graph for this function:

Can I add new files or directories?

Returns:
bool

Reimplemented from file_info.

Definition at line 154 of file file_info_stored.php.

Here is the caller graph for this function:


Field Documentation

$areaonly [protected]

Definition at line 46 of file file_info_stored.php.

$itemidused [protected]

Definition at line 43 of file file_info_stored.php.

$lf [protected]

Definition at line 40 of file file_info_stored.php.

$readaccess [protected]

Definition at line 44 of file file_info_stored.php.

$topvisiblename [protected]

Definition at line 42 of file file_info_stored.php.

$urlbase [protected]

Definition at line 41 of file file_info_stored.php.

$writeaccess [protected]

Definition at line 45 of file file_info_stored.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations