Template extends OC_Template
This class provides the template system for owncloud. You can use it to load specific templates, add data and generate the html code
Tags
Table of Contents
- html_select_options() : string
- Generate html code for an options block.
- human_file_size() : string
- Make OC_Helper::humanFileSize available as a simple function Example: 2048 to 2 kB.
- image_path() : string
- Make OC_Helper::imagePath available as a simple function
- mimetype_icon() : string
- Make OC_Helper::mimetypeIcon available as a simple function
- preview_icon() : string
- Make preview_icon available as a simple function
- publicPreview_icon() : string
- Make publicpreview_icon available as a simple function Returns the path to the preview of the image.
- relative_modified_date() : string
- Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
Methods
html_select_options()
Generate html code for an options block.
public
static html_select_options(array $options, mixed $selected[, array $params = [] ]) : string
Parameters
- $options : array
-
the options
- $selected : mixed
-
which one is selected?
- $params : array = []
-
the parameters
Tags
Return values
string —html options
human_file_size()
Make OC_Helper::humanFileSize available as a simple function Example: 2048 to 2 kB.
public
static human_file_size(int $bytes) : string
Parameters
- $bytes : int
-
in bytes
Tags
Return values
string —size as string
image_path()
Make OC_Helper::imagePath available as a simple function
public
static image_path(string $app, string $image) : string
Parameters
- $app : string
- $image : string
Tags
Return values
string —to the image
mimetype_icon()
Make OC_Helper::mimetypeIcon available as a simple function
public
static mimetype_icon(string $mimetype) : string
Parameters
- $mimetype : string
Tags
Return values
string —to the image of this file type.
preview_icon()
Make preview_icon available as a simple function
public
static preview_icon(string $path) : string
Parameters
- $path : string
-
path to file
Tags
Return values
string —to the preview of the image
publicPreview_icon()
Make publicpreview_icon available as a simple function Returns the path to the preview of the image.
public
static publicPreview_icon(string $path, string $token) : string
Parameters
- $path : string
-
of file
- $token : string
Tags
Return values
string —link to the preview
relative_modified_date()
Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
public
static relative_modified_date(int $timestamp[, bool $dateOnly = false ]) : string
Parameters
- $timestamp : int
-
unix timestamp
- $dateOnly : bool = false
Tags
Return values
string —human readable interpretation of the timestamp