Class with static back-end methods used by the file type tool.  
 More...
|  | 
| static | get_file_icons () | 
|  | Gets unique file type icons from pix/f folder. 
 | 
|  | 
| static | get_icons_from_path ($path) | 
|  | Gets all unique file type icons from a specific path, not including sub-directories. 
 | 
|  | 
| static | is_defaulticon_allowed ($mimetype, $oldextension='') | 
|  | Checks if we are allowed to turn on the 'default icon' option. 
 | 
|  | 
| static | is_extension_invalid ($extension, $oldextension='') | 
|  | Checks if the given file type extension is invalid. 
 | 
|  | 
Class with static back-end methods used by the file type tool. 
- Copyright
- 2014 The Open University 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ get_file_icons()
  
  | 
        
          | static tool_filetypes\utils::get_file_icons | ( |  | ) |  |  | static | 
 
Gets unique file type icons from pix/f folder. 
- Return values
- 
  
    | array | An array of unique file type icons e.g. 'pdf' => 'pdf' |  
 
 
 
◆ get_icons_from_path()
  
  | 
        
          | static tool_filetypes\utils::get_icons_from_path | ( |  | $path | ) |  |  | static | 
 
Gets all unique file type icons from a specific path, not including sub-directories. 
Icon files such as pdf.png, pdf-24.png and pdf-36.png etc. are counted as the same icon type.
The resultant array has both key and value set to the icon name prefix, such as 'pdf' => 'pdf'.
- Parameters
- 
  
    | string | $path | The path of the icon path |  
 
- Return values
- 
  
    | array | An array of unique file icons within the given path |  
 
 
 
◆ is_defaulticon_allowed()
  
  | 
        
          | static tool_filetypes\utils::is_defaulticon_allowed | ( |  | $mimetype, |  
          |  |  |  | $oldextension = '' ) |  | static | 
 
Checks if we are allowed to turn on the 'default icon' option. 
You can only have one of these for a given MIME type.
- Parameters
- 
  
    | string | $mimetype | MIME type |  | string | $oldextension | File extension name (before any change) |  
 
 
 
◆ is_extension_invalid()
  
  | 
        
          | static tool_filetypes\utils::is_extension_invalid | ( |  | $extension, |  
          |  |  |  | $oldextension = '' ) |  | static | 
 
Checks if the given file type extension is invalid. 
The added file type extension must be unique and must not begin with a dot.
- Parameters
- 
  
    | string | $extension | Extension of the file type to add |  | string | $oldextension | Extension prior to update (empty string if adding new type) |  
 
- Return values
- 
  
    | bool | True if it the file type trying to add already exists |  
 
 
 
The documentation for this class was generated from the following file: